live updating admin graph

This commit is contained in:
2020-06-08 16:17:25 +02:00
parent 522ac9d345
commit 4a7a60f5d2
2 changed files with 19 additions and 11 deletions

View File

@@ -12,14 +12,15 @@
{{if $isAdmin}}
<h3>Bandwidth and views</h3>
<div class="highlight_dark">
<button onclick="setData(7, 60);">Week</button>
<button onclick="setData(14, 60);">Two Weeks</button>
<button onclick="setData(21, 60);">Three Weeks</button>
<button onclick="setData(30, 1440);">Month</button>
<button onclick="setData(60, 1440);">Two Months</button>
<button onclick="setData(91, 1440);">Quarter</button>
<button onclick="setData(182, 1440);">Half-year</button>
<button onclick="setData(356, 1440);">Year</button>
<button onclick="loadGraph(60, 1, true);">Live</button>
<button onclick="loadGraph(420, 60, false);">Week</button>
<button onclick="loadGraph(840, 60, false);">Two Weeks</button>
<button onclick="loadGraph(1260, 60, false);">Three Weeks</button>
<button onclick="loadGraph(1800, 1440, false);">Month</button>
<button onclick="loadGraph(3600, 1440, false);">Two Months</button>
<button onclick="loadGraph(5460, 1440, false);">Quarter</button>
<button onclick="loadGraph(10920, 1440, false);">Half-year</button>
<button onclick="loadGraph(21900, 1440, false);">Year</button>
</div>
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 400px;">
<canvas id="bandwidth_chart"></canvas>