diff options
author | Simon Rettberg | 2022-07-04 18:25:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-07-04 18:25:06 +0200 |
commit | 9ca5c9bca40fa7e962b932364228731a6b9714a8 (patch) | |
tree | aae9463091b88826b6a931013ae6eab1935d6df6 /modules-available/statistics/templates/memory.html | |
parent | [statistics] Add a few more RAM/HDD size groups, future is catching up.. (diff) | |
download | slx-admin-9ca5c9bca40fa7e962b932364228731a6b9714a8.tar.gz slx-admin-9ca5c9bca40fa7e962b932364228731a6b9714a8.tar.xz slx-admin-9ca5c9bca40fa7e962b932364228731a6b9714a8.zip |
[js_chart] Update to Chart.js 3.0.8
Diffstat (limited to 'modules-available/statistics/templates/memory.html')
-rw-r--r-- | modules-available/statistics/templates/memory.html | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/modules-available/statistics/templates/memory.html b/modules-available/statistics/templates/memory.html index 185c1a34..0ccbca98 100644 --- a/modules-available/statistics/templates/memory.html +++ b/modules-available/statistics/templates/memory.html @@ -15,7 +15,7 @@ </thead> <tbody> {{#rows}} - <tr id="ramid{{gb}}" class="{{class}} {{collapse}}"> + <tr id="ram-{{idx}}" class="{{class}} {{collapse}}"> <td class="text-left text-nowrap" data-sort-value="{{gb}}"> <a class="filter-val" data-filter-val="{{gb}}" data-filter-op="~" href="#">{{gb}} GiB</a> </td> @@ -34,28 +34,7 @@ </tbody> </table> </div> - <div class="col-sm-6"> - <canvas id="ramsizechart" style="width:100%;height:250px"></canvas> - <script type="text/javascript"> - document.addEventListener("DOMContentLoaded", function() { - var data = {{{json}}}; - var sel = false; - new Chart(document.getElementById('ramsizechart').getContext('2d')).Pie(data, { - animation: false, - tooltipTemplate: "<%if (label){%><%=label%><%}%>", - customTooltips: function(tooltip) { - if (sel !== false) sel.removeClass('slx-bold'); - if (!tooltip) { - sel = false; - return; - } - sel = $('#ramid' + tooltip.text); - sel.addClass('slx-bold'); - } - }); - }, false); - </script> - </div> + <div class="col-sm-6 auto-chart" data-chart="{{json}}" data-chart-dest="#ram-"></div> </div> </div> </div> |