add day graph and total bandwidth to admin panel
This commit is contained in:
@@ -117,13 +117,22 @@ function loadGraph(minutes, interval, live){
|
|||||||
window.graph.data.datasets[0].data = resp.downloads;
|
window.graph.data.datasets[0].data = resp.downloads;
|
||||||
window.graph.data.datasets[1].data = resp.views;
|
window.graph.data.datasets[1].data = resp.views;
|
||||||
window.graph.update();
|
window.graph.update();
|
||||||
|
|
||||||
|
document.getElementById("time_start").innerText = resp.labels[0];
|
||||||
|
document.getElementById("time_end").innerText = resp.labels.slice(-1)[0];
|
||||||
|
let total = 0
|
||||||
|
resp.downloads.forEach(e => { total += e; });
|
||||||
|
document.getElementById("total_bandwidth").innerText = formatDataVolume(total, 3);
|
||||||
|
total = 0
|
||||||
|
resp.views.forEach(e => { total += e; });
|
||||||
|
document.getElementById("total_views").innerText = formatThousands(total);
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
alert("Error requesting time series: "+e);
|
alert("Error requesting time series: "+e);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
loadGraph(60, 1, true);
|
loadGraph(1440, 10, true);
|
||||||
|
|
||||||
// Load performance statistics
|
// Load performance statistics
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ function Viewer(type, viewToken, data) {
|
|||||||
|
|
||||||
// On small screens the toolbar takes too much space, so it collapses
|
// On small screens the toolbar takes too much space, so it collapses
|
||||||
// automatically
|
// automatically
|
||||||
if (this.divFilepreview.clientWidth > 600 && !this.toolbar.visible) {
|
if (this.divFilepreview.clientWidth > 800 && !this.toolbar.visible) {
|
||||||
this.toolbar.toggle()
|
this.toolbar.toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
margin: -0.25em;
|
margin: -0.25em;
|
||||||
margin-right: 0.2em;
|
margin-right: 0.2em;
|
||||||
}
|
}
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 600px) {
|
||||||
.file_viewer > .file_viewer_headerbar > .button_home::after {
|
.file_viewer > .file_viewer_headerbar > .button_home::after {
|
||||||
content: "pd";
|
content: "pd";
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,8 @@
|
|||||||
{{if $isAdmin}}
|
{{if $isAdmin}}
|
||||||
<h3>Bandwidth and views</h3>
|
<h3>Bandwidth and views</h3>
|
||||||
<div class="highlight_dark">
|
<div class="highlight_dark">
|
||||||
<button onclick="loadGraph(60, 1, true);">Live</button>
|
<button onclick="loadGraph(360, 1, true);">Live</button>
|
||||||
|
<button onclick="loadGraph(1440, 10, true);">Day</button>
|
||||||
<button onclick="loadGraph(10080, 60, false);">Week</button>
|
<button onclick="loadGraph(10080, 60, false);">Week</button>
|
||||||
<button onclick="loadGraph(20160, 60, false);">Two Weeks</button>
|
<button onclick="loadGraph(20160, 60, false);">Two Weeks</button>
|
||||||
<button onclick="loadGraph(43200, 1440, false);">Month</button>
|
<button onclick="loadGraph(43200, 1440, false);">Month</button>
|
||||||
@@ -23,8 +24,12 @@
|
|||||||
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 300px;">
|
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 300px;">
|
||||||
<canvas id="bandwidth_chart"></canvas>
|
<canvas id="bandwidth_chart"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<div class="highlight_dark">
|
||||||
|
Total usage from <span id="time_start"></span> to <span id="time_end"></span><br/>
|
||||||
|
<span id="total_bandwidth"></span> bandwidth and <span id="total_views"></span> views
|
||||||
|
</div>
|
||||||
<div class="limit_width">
|
<div class="limit_width">
|
||||||
|
<br/>
|
||||||
<a href="/admin/globals">Update global settings</a>
|
<a href="/admin/globals">Update global settings</a>
|
||||||
<h3>Database connection statistics</h3>
|
<h3>Database connection statistics</h3>
|
||||||
<table>
|
<table>
|
||||||
|
Reference in New Issue
Block a user