add day graph and total bandwidth to admin panel

This commit is contained in:
2020-07-19 11:29:39 +02:00
parent d8001d1176
commit 6a516299b5
4 changed files with 19 additions and 5 deletions

View File

@@ -117,13 +117,22 @@ function loadGraph(minutes, interval, live){
window.graph.data.datasets[0].data = resp.downloads;
window.graph.data.datasets[1].data = resp.views;
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 => {
alert("Error requesting time series: "+e);
})
}
loadGraph(60, 1, true);
loadGraph(1440, 10, true);
// Load performance statistics

View File

@@ -21,7 +21,7 @@ function Viewer(type, viewToken, data) {
// On small screens the toolbar takes too much space, so it collapses
// automatically
if (this.divFilepreview.clientWidth > 600 && !this.toolbar.visible) {
if (this.divFilepreview.clientWidth > 800 && !this.toolbar.visible) {
this.toolbar.toggle()
}

View File

@@ -53,7 +53,7 @@
margin: -0.25em;
margin-right: 0.2em;
}
@media (max-width: 500px) {
@media (max-width: 600px) {
.file_viewer > .file_viewer_headerbar > .button_home::after {
content: "pd";
}