diff options
Diffstat (limited to 'modules-available/statistics/templates')
15 files changed, 627 insertions, 271 deletions
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 3d49a770..fcb98774 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -1,46 +1,23 @@ +<div class="slx-right"> + {{{roomsvg}}} + {{#sidebar}} + <div class="infobox">{{.}}</div> + {{/sidebar}} +</div> + <h2>{{lang_clientList}} ({{rowCount}})</h2> +<button class="btn btn-default" type="button" data-toggle="modal" + data-target="#column-selector">{{lang_selectColumns}}</button> + +<div class="clearfix"></div> <form method="post" action="?do=statistics" id="list-form"> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="redirect" value="?{{redirect}}"> -<table class="stupidtable table table-condensed table-striped"> +<table id="client-list" class="stupidtable table table-condensed table-striped"> <thead> - <tr> - <td></td> - <td></td> - <td class="text-right"> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('lastseen')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - <td> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - <td class="text-right"> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('gbram')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - <td class="text-right"> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('hddgb')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - <td> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('realcores')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - <td> - <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('location')"> - <span class="glyphicon glyphicon-filter"></span> - </button> - </td> - </tr> - <tr> + <tr id="thead"> <th data-sort="string"> <div class="checkbox checkbox-inline"> <input type="checkbox" id="toggle-all"> @@ -48,13 +25,15 @@ </div> {{lang_machine}} </th> - <th data-sort="ipv4">{{lang_address}}</th> - <th data-sort="int" class="text-right">{{lang_lastSeen}}</th> - <th data-sort="string">{{lang_kvmSupport}}</th> - <th data-sort="int" class="text-right">{{lang_gbRam}}</th> - <th data-sort="int" class="text-right">{{lang_tmpGb}}</th> - <th data-sort="int">{{lang_cpuModel}}</th> - <th data-sort="string">{{lang_location}}</th> + <th data-sort="ipv4" data-column="clientip">{{lang_address}}</th> + <th data-sort="int" data-column="nicspeed" class="text-right">{{lang_nicSpeed}}</th> + <th data-sort="int" data-column="lastseen" class="text-right">{{lang_lastSeen}}</th> + <th data-sort="string" data-column="kvmstate">{{lang_kvmSupport}}</th> + <th data-sort="int" data-column="gbram" class="text-right">{{lang_gbRam}}</th> + <th data-sort="int" data-column="hddgb" class="text-right">{{lang_tmpGb}}</th> + <th data-sort="int" data-column="persistentgb" class="text-right">{{lang_persistentPart}}</th> + <th data-sort="int" data-column="realcores">{{lang_cpuModel}}</th> + <th data-sort="string" data-column="location">{{lang_location}}</th> </tr> </thead> <tbody> @@ -98,10 +77,18 @@ {{/link_details}} <div class="small uuid">{{machineuuid}}</div> {{#rmmodule}} - <div class="small">{{lang_runMode}}: + <div class="small">{{lang_configuredRunMode}}: <a class="slx-bold" href="?do=runmode&module={{rmmodule}}">{{moduleName}}</a> / {{modeName}} </div> {{/rmmodule}} + {{#wrongRunMode}} + <div class="small text-danger"> + {{lang_clientInDifferentRunmode}}: {{currentrunmode}} + {{^currentrunmode}} + {{lang_bootedWithoutAnyRunmode}} + {{/currentrunmode}} + </div> + {{/wrongRunMode}} {{#currentuser}} <div class="small"> {{lang_user}}: @@ -110,22 +97,34 @@ {{/currentuser}} </td> <td data-sort-value="{{clientip}}"> - <b><a href="?do=Statistics&show=list&filters=clientip={{subnet}}/24">{{subnet}}.</a>{{lastoctet}}</b> + <b><a href="?do=statistics&show=list&filters=clientip={{subnet}}/24">{{subnet}}.</a>{{lastoctet}}</b> <div class="mac text-nowrap">{{macaddr}}</div> <div class="hidden ip">{{clientip}}</div> </td> + <td data-sort-value="{{nic-speed}}" class="text-right"> + {{nic-speed_s}} MBit/s + </td> <td data-sort-value="{{lastseen_int}}" class="text-right text-nowrap">{{lastseen}}</td> <td class="{{kvmclass}}">{{kvmstate}}</td> - <td data-sort-value="{{gbram}}" class="text-right {{ramclass}}">{{gbram}} GiB</td> - <td data-sort-value="{{gbtmp}}" class="text-right {{hddclass}}"> + <td data-sort-value="{{mbram}}" class="text-right {{ramclass}}">{{gbram}} GiB</td> + <td data-sort-value="{{id44mb}}" class="text-right {{hddclass}}"> {{gbtmp}} GiB {{#badsectors}}<div><span data-toggle="tooltip" title="{{lang_reallocatedSectors}}" data-placement="left"> <span class="glyphicon glyphicon-exclamation-sign"></span> {{badsectors}} </span></div>{{/badsectors}} - {{#nohdd}}<div> + {{^hddcount}}<div> <span class="glyphicon glyphicon-hdd red"></span> - </div>{{/nohdd}} + </div>{{/hddcount}} + {{#hddcount}}<div> + <span class="badge"> + <span class="glyphicon glyphicon-hdd"></span> + {{hddcount}} + </span> + </div>{{/hddcount}} + </td> + <td data-sort-value="{{id45mb}}" class="text-right"> + {{gbpersist}} GiB </td> <td data-sort-value="{{realcores}}">{{lang_realCores}}: {{realcores}}<div class="small">{{cpumodel}}</div></td> <td data-sort-value="{{location.sort}}">{{location.name}}</td> @@ -138,8 +137,9 @@ <span class="glyphicon glyphicon-refresh"></span> {{lang_reset}} </button> - <div class="dropdown" style="display:inline"> - <button class="btn btn-default dropdown-toggle btn-machine-action" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"> + <div class="btn-group dropup"> + <button class="btn btn-default dropdown-toggle btn-machine-action" type="button" id="dropdownMenu1" + data-toggle="dropdown" aria-haspopup="true"> <span class="glyphicon glyphicon-list"></span> {{lang_listDropdown}} <span class="caret"></span> @@ -161,10 +161,15 @@ data-target="#mac-list"> {{lang_uuid}} </a></li> + <hr style="margin: 0px"> + <li><a href="#" class="list-btn" data-what="hostname ip mac uuid" data-toggle="modal" + data-target="#mac-list"> + {{lang_fullInfo}} + </a></li> </ul> </div> {{#rebootcontrol}} - <div class="dropdown" style="display:inline"> + <div class="btn-group dropup"> <button class="btn btn-default dropdown-toggle btn-machine-action" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true"> <span class="glyphicon glyphicon-list"></span> @@ -199,16 +204,38 @@ {{lang_remoteExec}} </button> {{/canExec}} + {{#canBenchmark}} + <button type="submit" name="action" value="benchmark" class="btn btn-primary btn-machine-action"> + <span class="glyphicon glyphicon-dashboard"></span> + {{lang_remoteSpeedcheck}} + </button> + {{/canBenchmark}} </div> </div> </div> {{/rebootcontrol}} {{#canDelete}} + <div class="btn-group dropup"> <button type="submit" name="action" value="delmachines" class="btn btn-danger btn-machine-action" data-confirm="{{lang_sureDeletePermanent}}"> <span class="glyphicon glyphicon-trash"></span> {{lang_delete}} </button> + <button type="button" class="btn btn-danger btn-machine-action dropdown-toggle" + data-toggle="dropdown" aria-haspopup="true"> + <span class="caret"></span> + <span class="sr-only">Toggle Dropdown</span> + </button> + <div class="dropdown-menu" style="padding:0"> + <div class="btn-group-vertical"> + <button type="submit" name="action" value="clear-machines" class="btn btn-danger btn-machine-action" + data-confirm="{{lang_sureClearIp}}"> + <span class="glyphicon glyphicon-refresh"></span> + {{lang_resetClearIp}} + </button> + </div> + </div> + </div> {{/canDelete}} </div> <div class="hidden" id="confirm-reboot"> @@ -235,8 +262,25 @@ </div> </div> +<div class="modal" id="column-selector" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + </div> + <div class="modal-body"></div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" + data-dismiss="modal">{{lang_close}}</button> + </div> + </div> + </div> +</div> + <script type="application/javascript"><!-- +var lookupTable = {}; + document.addEventListener("DOMContentLoaded", function () { var $buttons = $('.btn-machine-action'); var $fn = function () { @@ -244,6 +288,23 @@ document.addEventListener("DOMContentLoaded", function () { }; var $boxes = $('.machine-checkbox'); $boxes.change($fn); + + // Shift click selection for the checkboxes + var lastChecked = null; + $boxes.click(function(e) { + if (!lastChecked) { + lastChecked = this; + return; + } + if (e.shiftKey) { + $boxes = $('.machine-checkbox'); + const start = $boxes.index(this); + const end = $boxes.index(lastChecked); + $boxes.slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', lastChecked.checked); + } + lastChecked = this; + }); + $("button[type=reset]").click(function() { setTimeout($fn, 1); }); if (window && window.opera && window.opera.version && Number(window.opera.version()) < 13) { $(document).ready(function () { @@ -260,17 +321,76 @@ document.addEventListener("DOMContentLoaded", function () { $fn(); }); $('.list-btn').click(function() { - var what = $(this).data('what'); + var what = $(this).data('what').split(" "); var $el = $('#mac-list-content'); $el.empty(); var result = ''; - var num = $('.machine').has('input[type=checkbox]:checked').find('.' + what).each(function() { - var text = this.innerText; - if (what === 'mac') text = text.replace(/-/g, ':'); - result += text + "\n"; + var num = $('.machine').has('input[type=checkbox]:checked').each(function(index, element) { + what.forEach(function (w) { + $(element).find('.' + w).each(function() { + var text = this.innerText; + if (w === 'mac') text = text.replace(/-/g, ':'); + result += text + "\t"; + }); + }); + result += "\n"; }).length; $el.text(result).prop('rows', Math.min(24, Math.max(5, num))); }); + // Generate list for column selection + var $cs = $('#column-selector .modal-body'); + var $filters = $('<tr>'); + $('#client-list > thead').prepend($filters); + var idx = 0; + $cs.empty(); + $('#client-list > thead > tr#thead > th').each(function() { + idx++; + var $th = $(this); + var $td = $('<td>'); + $filters.append($td); + var column = $th.data('column'); + if (!column) + return; + $cs.append($('<div class="checkbox">') + .append($('<input id="shc-' + column + '" type="checkbox" onclick="toggleColumn(this, \'' + column + '\')" checked="checked">')) + .append($('<label for="shc-' + column + '">').text($th.text()))); + $td.append($('<button type="button" class="btn btn-default btn-xs" onclick="popupFilter(\'' + column + '\')">' + + '<span class="glyphicon glyphicon-filter"></span></button>')); + lookupTable[column] = idx; + }); + // Load previous visibility settings + var colConf; + if (window.localStorage && (colConf = window.localStorage.getItem('cl-col-conf'))) { + colConf = JSON.parse(colConf); + if (colConf) { + for (var k in colConf) { + if (k.substring(0, 4) === 'shc-' && colConf[k]) { + var $cb = $('#' + k); + if ($cb.prop('checked')) { + $cb.click(); + } + } + } + } + } }); +function toggleColumn(e, column) +{ + var $el = $(e); + if (!(column in lookupTable)) + return; + var idx = lookupTable[column]; + $('#client-list tr > td:nth-child(' + idx + '), #client-list tr > th:nth-child(' + idx + ')') + .css('display', $el.is(':checked') ? '' : 'none'); + var data = {}; + $('#column-selector .modal-body .checkbox input').each(function() { + var $el = $(this); + if (!$el.is(':checked')) { + data[$el[0].id] = 1; + } + }); + window.localStorage.setItem('cl-col-conf', JSON.stringify(data)); +} + //--></script> diff --git a/modules-available/statistics/templates/cpumodels.html b/modules-available/statistics/templates/cpumodels.html index 91464031..e133bec6 100644 --- a/modules-available/statistics/templates/cpumodels.html +++ b/modules-available/statistics/templates/cpumodels.html @@ -16,7 +16,7 @@ </thead> <tbody> {{#rows}} - <tr id="{{id}}" class="{{collapse}}"> + <tr id="sysmdl-{{idx}}" class="{{collapse}}"> <td data-sort-value="{{systemmodel}}" class="text-left text-nowrap filter-col" data-filter-col="systemmodel"> <table class="slx-ellipsis"><tr><td> <a class="filter-val" data-filter-val="{{systemmodel}}" href="#">{{systemmodel}}</a> @@ -40,28 +40,7 @@ </tbody> </table> </div> - <div class="col-md-4"> - <canvas id="cpumodelchart" style="width:100%;height:380px"></canvas> - <script type="text/javascript"> - document.addEventListener("DOMContentLoaded", function() { - var data = {{{json}}}; - var sel = false; - new Chart(document.getElementById('cpumodelchart').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 = $('#' + tooltip.text); - sel.addClass('slx-bold'); - } - }); - }, false); - </script> - </div> + <div class="col-md-4 auto-chart" data-chart="{{json}}" data-chart-dest="#sysmdl-"></div> </div> </div> </div> diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index e7c1cd9b..f62c4d7c 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -106,47 +106,23 @@ document.addEventListener("DOMContentLoaded", function () { e.find('.filter-val').each(function(idx, elem) { var e = $(elem); var val = e.data('filter-val'); + var op = e.data('filter-op'); + if (!op) op = '='; if (val === null || val === undefined) return; e.click(function(ev) { ev.preventDefault(); - addFilter(col, '=', val); + addFilter(col, op, val); refresh(); }); }); }); + $('.auto-chart').each(function() { + makePieChart($(this)); + }); + }, false); -function popupFilter(field) { - var $row = addFilter(field, null, null); - if ($row !== null) { - $row.find('.arg').focus(); - $row.removeClass('slx-focus') - setTimeout(function() { $row.addClass('slx-focus'); }, 10); - } -} - -function addFilter(field, op, argument) { - if (field === null) - return null; - var $row = $('#filter-' + field); - if ($row.length === 0) - return null; - if (argument !== null) { - $row.find('.op').val(op); - $row.find('.arg').val(argument); - } - // Enable checkbox only if we got a predefined value, or if argument is in a select, as the user might want the preselected item and doesn't notice the checkbox is unchecked - if (argument !== null || $row.find('select.arg').length !== 0) { - $row.find('.filter-enable').prop('checked', true); - } - $row.show(); - return $row; -} - -function refresh() { - $('#query-form').submit(); -} // --></script> diff --git a/modules-available/statistics/templates/hints-cpu-legacy.html b/modules-available/statistics/templates/hints-cpu-legacy.html new file mode 100644 index 00000000..44a5b166 --- /dev/null +++ b/modules-available/statistics/templates/hints-cpu-legacy.html @@ -0,0 +1,28 @@ +<h2>{{lang_legacyCpuVmx}}</h2> + +<p>{{lang_legacyCpuVmxText}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_cpuModel}}</th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td class="text-nowrap"> + {{cpumodel}} + </td> + </tr> + {{/list}} + </tbody> +</table>
\ No newline at end of file diff --git a/modules-available/statistics/templates/hints-hdd-grow.html b/modules-available/statistics/templates/hints-hdd-grow.html new file mode 100644 index 00000000..b7c5bff4 --- /dev/null +++ b/modules-available/statistics/templates/hints-hdd-grow.html @@ -0,0 +1,67 @@ +<h2>{{lang_hddUnused}}</h2> + +<p>{{lang_hddUnusedId44}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_unused}}</th> + <th>{{lang_id44size}}</th> + </tr> + </thead> + <tbody> + {{#id44}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td> + {{unused_s}} + </td> + <td> + {{id44mb_s}} + </td> + </tr> + {{/id44}} + </tbody> +</table> + +<p>{{lang_hddUnusedId45}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_unused}}</th> + <th>{{lang_id45size}}</th> + <th>{{lang_id44size}}</th> + </tr> + </thead> + <tbody> + {{#id45}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td> + {{unused_s}} + </td> + <td> + {{id45mb_s}} + </td> + <td> + {{id44mb_s}} + </td> + </tr> + {{/id45}} + </tbody> +</table> diff --git a/modules-available/statistics/templates/hints-nic-speed.html b/modules-available/statistics/templates/hints-nic-speed.html new file mode 100644 index 00000000..963213cd --- /dev/null +++ b/modules-available/statistics/templates/hints-nic-speed.html @@ -0,0 +1,32 @@ +<h2>{{lang_nicSlowSpeed}}</h2> + +<p>{{lang_nicSlowSpeedText}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_nicSpeed}}</th> + <th>{{lang_nicDuplex}}</th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td class="text-nowrap"> + {{nic-speed}} {{lang_MbitPerSecond}} + </td> + <td> + {{nic-duplex}} + </td> + </tr> + {{/list}} + </tbody> +</table>
\ No newline at end of file diff --git a/modules-available/statistics/templates/hints-ram-underclocked.html b/modules-available/statistics/templates/hints-ram-underclocked.html new file mode 100644 index 00000000..35bdd857 --- /dev/null +++ b/modules-available/statistics/templates/hints-ram-underclocked.html @@ -0,0 +1,49 @@ +<h2>{{lang_ramUnderclocked}}</h2> + +<p>{{lang_ramUnderclockedText}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_type}}</th> + <th>{{lang_speedCurrent}}</th> + <th>{{lang_speedDesign}}</th> + <th>{{lang_manufacturer}}</th> + <th>{{lang_serialNo}}</th> + <th></th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td class="text-nowrap"> + {{Type}} {{Form Factor}} + <div>{{Size}}</div> + </td> + <td class="text-nowrap"> + {{Configured Memory Speed}} + </td> + <td class="text-nowrap"> + {{Speed}} + </td> + <td class="text-nowrap"> + {{Manufacturer}} + </td> + <td> + {{Serial Number}} + </td> + <td class="text-right"> + <span class="badge">{{group_count}}</span> + </td> + </tr> + {{/list}} + </tbody> +</table> diff --git a/modules-available/statistics/templates/hints-ram-upgrade.html b/modules-available/statistics/templates/hints-ram-upgrade.html new file mode 100644 index 00000000..7b60d419 --- /dev/null +++ b/modules-available/statistics/templates/hints-ram-upgrade.html @@ -0,0 +1,32 @@ +<h2>{{lang_ramUpgrade}}</h2> + +<p>{{lang_ramUpgradeText}}</p> + +<table class="table"> + <thead> + <tr> + <th>{{lang_machine}}</th> + <th>{{lang_installedCountMax}}</th> + <th>{{lang_ramSizeCurrentMax}}</th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td> + <span class="glyphicon {{icon}}"></span> + <a class="slx-bold" href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + </a> + <div class="small">{{machineuuid}}</div> + </td> + <td class="{{count_class}}"> + {{Memory Slot Occupied}} / {{Memory Slot Count}} + </td> + <td class="{{size_class}}"> + {{Memory Installed Capacity}} / {{Memory Maximum Capacity}} + </td> + </tr> + {{/list}} + </tbody> +</table>
\ No newline at end of file diff --git a/modules-available/statistics/templates/id44.html b/modules-available/statistics/templates/id44.html index ec0dac09..7851ba87 100644 --- a/modules-available/statistics/templates/id44.html +++ b/modules-available/statistics/templates/id44.html @@ -15,9 +15,9 @@ </thead> <tbody> {{#rows}} - <tr id="tmpid{{gb}}" class="{{class}} {{collapse}}"> + <tr id="id44-{{idx}}" class="{{class}} {{collapse}}"> <td data-sort-value="{{gb}}" class="text-left text-nowrap"> - <a class="filter-val" data-filter-val="{{gb}}" href="#">{{gb}} GiB</a> + <a class="filter-val" data-filter-val="{{gb}}" data-filter-op="~" href="#">{{gb}} GiB</a> </td> <td class="text-right">{{count}}</td> </tr> @@ -34,28 +34,7 @@ </tbody> </table> </div> - <div class="col-sm-6"> - <canvas id="temppartchart" style="width:100%;height:250px"></canvas> - <script type="text/javascript"> - document.addEventListener("DOMContentLoaded", function() { - var data = {{{json}}}; - var sel = false; - new Chart(document.getElementById('temppartchart').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 = $('#tmpid' + String(tooltip.text)); - sel.addClass('slx-bold'); - } - }); - }, false); - </script> - </div> + <div class="col-sm-6 auto-chart" data-chart="{{json}}" data-chart-dest="#id44-"></div> </div> </div> </div> diff --git a/modules-available/statistics/templates/js-pciquery.html b/modules-available/statistics/templates/js-pciquery.html new file mode 100644 index 00000000..5d4df867 --- /dev/null +++ b/modules-available/statistics/templates/js-pciquery.html @@ -0,0 +1,24 @@ +<script> + document.addEventListener('DOMContentLoaded', function() { + var missing = {{{missing_ids}}}; + var doQuery = function() { + if (missing && missing.length > 0) { + $.ajax({ + url: '?do=statistics', dataType: "json", method: "POST", data: { + token: TOKEN, + action: 'json-lookup', + list: missing.splice(0, 10) // Query 10 at a time max + } + }).done(function (data) { + if (!data) + return; + for (var k in data) { + $('.query-' + k.replace(':', '-')).text(data[k]); + } + doQuery(); + }); + } + } + doQuery(); + }); +</script>
\ No newline at end of file diff --git a/modules-available/statistics/templates/kvmstate.html b/modules-available/statistics/templates/kvmstate.html index 4f8994d1..b3c65733 100644 --- a/modules-available/statistics/templates/kvmstate.html +++ b/modules-available/statistics/templates/kvmstate.html @@ -15,7 +15,7 @@ </thead> <tbody> {{#rows}} - <tr id="kvm{{kvmstate}}"> + <tr id="kvm-{{idx}}"> <td data-sort-value="{{kvmstate}}" class="text-left text-nowrap"> <a class="filter-val" data-filter-val="{{kvmstate}}" href="#">{{kvmstate}}</a> </td> @@ -25,28 +25,7 @@ </tbody> </table> </div> - <div class="col-sm-6"> - <canvas id="kvmchart" style="width:100%;height:250px"></canvas> - <script type="text/javascript"> - document.addEventListener("DOMContentLoaded", function() { - var data = {{{json}}}; - var sel = false; - new Chart(document.getElementById('kvmchart').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 = $('#kvm' + tooltip.text); - sel.addClass('slx-bold'); - } - }); - }, false); - </script> - </div> + <div class="col-sm-6 auto-chart" data-chart="{{json}}" data-chart-dest="#kvm-"></div> </div> </div> </div> diff --git a/modules-available/statistics/templates/machine-hdds.html b/modules-available/statistics/templates/machine-hdds.html index 4d0409f9..57786510 100644 --- a/modules-available/statistics/templates/machine-hdds.html +++ b/modules-available/statistics/templates/machine-hdds.html @@ -4,24 +4,27 @@ <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> - <b>{{s_ModelFamily}}</b> {{dev}} + <b>{{model_family}}{{^model_family}}{{model}}{{/model_family}}</b> {{dev}} </div> <div class="panel-body"> - {{#s_DeviceModel}} - <div>{{lang_modelNo}}: {{s_DeviceModel}}, {{lang_serialNo}}: {{s_SerialNumber}}</div> - {{/s_DeviceModel}} - {{#s_ReallocatedSectorCt}} - <div class="red">{{lang_reallocatedSectors}}: {{s_ReallocatedSectorCt}}</div> - {{/s_ReallocatedSectorCt}} - {{#s_CurrentPendingSector}} - <div class="red">{{lang_pendingSectors}}: {{s_CurrentPendingSector}}</div> - {{/s_CurrentPendingSector}} - {{#s_PowerOnHours}} - <div>{{lang_powerOnTime}}: {{s_PowerOnHours}} {{lang_hours}} ({{PowerOnTime}})</div> - {{/s_PowerOnHours}} - {{#s_MediaandDataIntegrityErrors}} - <div class="red">{{lang_mediaIntegrityErrors}}: {{s_MediaandDataIntegrityErrors}}</div> - {{/s_MediaandDataIntegrityErrors}} + {{#model}} + <div>{{lang_modelNo}}: {{model}}, {{lang_serialNo}}: {{serial_number}}</div> + {{/model}} + {{#smart_status_failed}} + <div class="red">{{lang_smartSelfTestFailed}}</div> + {{/smart_status_failed}} + {{#attr_5.raw}} + <div class="red">{{lang_reallocatedSectors}}: {{attr_5.raw}}</div> + {{/attr_5.raw}} + {{#attr_197.raw}} + <div class="red">{{lang_pendingSectors}}: {{attr_197.raw}}</div> + {{/attr_197.raw}} + {{#PowerOnTime}} + <div>{{lang_powerOnTime}}: {{PowerOnTime}}</div> + {{/PowerOnTime}} + {{#media_errors}} + <div class="red">{{lang_mediaIntegrityErrors}}: {{media_errors}}</div> + {{/media_errors}} <div class="row"> <div class="col-sm-7"> <table class="table table-condensed table-striped table-responsive"> @@ -31,40 +34,32 @@ <th>{{lang_partType}}</th> </tr> {{#partitions}} - <tr id="{{id}}"> - <td>{{name}}</td> - <td class="text-right text-nowrap">{{size}} GiB</td> - <td>{{type}}</td> + <tr id="part-{{hddidx}}-{{idx}}"> + <td>{{index}}</td> + <td class="text-right text-nowrap">{{size_s}}</td> + <td class="text-nowrap"> + <table class="slx-ellipsis"><tr><td>{{name}}</td></tr></table> + </td> </tr> {{/partitions}} </table> - <div class="slx-bold">{{lang_total}}: {{size}} GiB</div> + <div class="slx-bold">{{lang_total}}: {{size_s}}</div> + {{#unused_s}} + <div class="slx-bold">{{lang_unused}}: {{unused_s}}</div> + {{/unused_s}} </div> - <div class="col-sm-5"> - <canvas id="{{devid}}-chart" style="width:100%;height:250px"></canvas> - <script type="text/javascript"> - document.addEventListener("DOMContentLoaded", function() { - var data = {{{json}}}; - var sel = false; - new Chart(document.getElementById('{{devid}}-chart').getContext('2d')).Pie(data, { - animation: false, - tooltipTemplate: "<%if (label){%><%=label%><%}%>", - customTooltips: function(tooltip) { - if (sel !== false) sel.removeClass('info'); - if (!tooltip) { - sel = false; - return; - } - sel = $('#' + tooltip.text); - sel.addClass('info'); - } - }); - }, false); - </script> + <div class="col-sm-5 auto-chart" data-chart="{{json}}" data-chart-dest="#part-{{hddidx}}-"> </div> </div> </div> </div> </div> {{/hdds}} + <script type="text/javascript"> + document.addEventListener("DOMContentLoaded", function() { + $('.auto-chart').each(function() { + makePieChart($(this)); + }); + }); + </script> </div>
\ No newline at end of file diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html index 3eabf65c..be32f9c7 100644 --- a/modules-available/statistics/templates/machine-main.html +++ b/modules-available/statistics/templates/machine-main.html @@ -29,6 +29,12 @@ <td class="text-nowrap">{{lang_ip}}</td> <td>{{clientip}}</td> </tr> + {{#nic-speed}} + <tr> + <td class="text-nowrap">{{lang_nicSpeed}}</td> + <td>{{nic-speed}} MBit/s, {{lang_duplex}}: {{nic-duplex}}</td> + </tr> + {{/nic-speed}} {{#hostname}} <tr> <td class="text-nowrap">{{lang_hostname}}</td> @@ -41,7 +47,17 @@ </tr> <tr> <td class="text-nowrap">{{lang_lastBoot}}</td> - <td>{{lastboot_s}}</td> + <td> + {{lastboot_s}} + {{#minilinux}} + <div> + {{lang_baseSystem}}: {{minilinux}} + {{#boottime_s}} + (<span title="{{lang_boottimeTooltip}}">{{boottime_s}}</span>) + {{/boottime_s}} + </div> + {{/minilinux}} + </td> </tr> <tr> <td class="text-nowrap">{{lang_lastSeen}}</td> @@ -88,19 +104,22 @@ </td> </tr> {{/modeid}} - {{#hasroomplan}} + {{#roomsvg}} <tr> <td class="text-nowrap"> {{lang_roomplan}} </td> <td> + <div> + {{{roomsvg}}} + </div> <a href="?do=roomplanner&locationid={{locationid}}" target="_blank" - onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false"> - <img src="api.php?do=roomplanner&show=svg&locationid={{locationid}}&machineuuid={{machineuuid}}&fallback=1"/> + onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false"> + {{lang_edit}} </a> </td> </tr> - {{/hasroomplan}} + {{/roomsvg}} {{#rebootcontrol}} <tr> <td class="text-nowrap"> @@ -219,12 +238,14 @@ <tr> <td class="text-nowrap">{{lang_cpuModel}}</td> <td> - {{cpumodel}} - {{#Sockets}} + <a href="?do=statistics&show=list&filter[cpumodel]=1&op[cpumodel]=%3D&arg[cpumodel]={{cpumodel}}"> + {{cpumodel}} + </a> + {{#cpu-sockets}} <div class="small"> - {{lang_sockets}}: {{Sockets}}, {{lang_cores}}: {{Realcores}}, {{lang_virtualCores}}: {{Virtualcores}} + {{lang_sockets}}: {{cpu-sockets}}, {{lang_cores}}: {{cpu-cores}}, {{lang_virtualCores}}: {{cpu-threads}} </div> - {{/Sockets}} + {{/cpu-sockets}} {{#live_cpuload_s}} <div class="meter"> <div class="text left">{{lang_cpuload}}</div> @@ -243,13 +264,18 @@ </tr> <tr> <td class="text-nowrap">{{lang_pcmodel}}</td> - <td>{{pcmodel}} ({{pcmanufacturer}})</td> + <td> + {{#system.Product Name}} + <a href="?do=statistics&show=list&filter[systemmodel]=1&op[systemmodel]=%3D&arg[systemmodel]={{system.Product Name}}+({{system.Manufacturer}})"> + {{system.Product Name}} ({{system.Manufacturer}}) + </a> + {{/system.Product Name}} + </td> </tr> <tr> <td class="text-nowrap">{{lang_mobomodel}}</td> - <td>{{mobomodel}} ({{mobomanufacturer}})</td> + <td>{{mainboard.Product Name}} ({{mainboard.Manufacturer}})</td> </tr> - {{#biosdate}} <tr> <td class="text-nowrap"> <div>{{lang_biosVersion}}</div> @@ -257,19 +283,23 @@ </td> <td class="text-nowrap"> <div id="bios-panel" class="pull-right"style="max-width:30%">{{{bioshtml}}}</div> - <div>{{biosversion}} (<b>{{biosrevision}}</b>)</div> - <div>{{biosdate}}</div> + <div>{{bios.Version}} (<b>{{bios.BIOS Revision}}</b>)</div> + <div>{{bios.Release Date}}</div> </td> </tr> - {{/biosdate}} <tr class="{{ramclass}}"> <td class="text-nowrap">{{lang_ram}}</td> <td> <div> {{gbram}} GiB - {{#maxram}}({{lang_maximumAbbrev}} {{maxram}}){{/maxram}} - {{ramtype}} + {{#Memory Maximum Capacity}} + / {{lang_maximumAbbrev}} {{Memory Maximum Capacity}} + {{/Memory Maximum Capacity}} + {{#Memory Slot Count}} + ({{Memory Slot Count}} {{lang_slots}}) + {{/Memory Slot Count}} </div> + <div>{{ramtype}}</div> {{#live_memsize}} <div class="meter"> <div class="text left">{{lang_ram}}</div> @@ -286,31 +316,72 @@ {{/live_swapsize}} </td> </tr> - {{#extram}} <tr> - <td class="text-nowrap">{{lang_ramSlots}}</td> - <td> - {{ramslotcount}}: - {{#ramslot}} - [ <span title="{{manuf}}">{{size}}</span> ] - {{/ramslot}} + <td colspan="2"> + <table class="table-responsive slx-table text-nowrap"> + <thead> + <tr class="small"> + <td>{{lang_slot}}</td> + <td></td> + <td>{{lang_speed}}</td> + <td>{{lang_manufacturer}}</td> + <td>{{lang_serialNo}}</td> + </tr> + </thead> + {{#ram}} + {{#Speed}} + <tr> + <td> + {{Locator}}, + {{Bank Locator}} + {{^Bank Locator}}{{#Set}}Set {{Set}}{{/Set}}{{/Bank Locator}} + </td> + <td class="slx-bold">{{Size}}</td> + <td>{{#Configured Memory Speed}}{{Configured Memory Speed}} / {{/Configured Memory Speed}}{{Speed}}</td> + <td>{{Manufacturer}}</td> + <td>{{Serial Number}}</td> + </tr> + {{/Speed}} + {{/ram}} + </table> </td> </tr> - {{/extram}} <tr class="{{hddclass}}"> - <td class="text-nowrap">{{lang_tempPart}}</td> + <td class="text-nowrap">{{lang_tempPartID}} + <div class="text-muted"> + {{lang_tempPart}} + </div> + </td> <td> <div> {{gbtmp}} GiB </div> {{#live_tmpsize}} - <div class="meter"> - <div class="text right">{{live_tmpfree_s}} {{lang_free}}</div> - <div class="bar" style="width:{{live_tmppercent}}%"></div> - </div> + <div class="meter"> + <div class="text right">{{live_tmpfree_s}} {{lang_free}}</div> + <div class="bar" style="width:{{live_tmppercent}}%"></div> + </div> {{/live_tmpsize}} </td> </tr> + <tr> + <td class="text-nowrap">{{lang_persistentPartID}} + <div class="text-muted"> + {{lang_persistentPart}} + </div> + </td> + <td> + <div> + {{gbid45}} GiB + </div> + {{#live_id45size}} + <div class="meter"> + <div class="text right">{{live_id45free_s}} {{lang_free}}</div> + <div class="bar" style="width:{{live_id45percent}}%"></div> + </div> + {{/live_id45size}} + </td> + </tr> <tr class="{{kvmclass}}"> <td class="text-nowrap">{{lang_64bitSupport}}</td> <td>{{kvmstate}}</td> @@ -356,16 +427,28 @@ </table> <h4>{{lang_devices}}</h4> {{#lspci1}} - <div><span class="{{lookupClass}}">{{class}}</span></div> + <div><span>{{class_s}}</span></div> {{#entries}} - <div class="small"> └ <span class="{{lookupVen}}">{{ven}}</span> <span class="{{lookupDev}}">{{dev}}</span></div> + <div class="small"> +  └ + <span class="badge">{{pt}}</span> + <span{{^vendor_s}} class="query-{{vendor}}"{{/vendor_s}}>{{vendor_s}}</span> + <span{{^device_s}} class="query-{{vendor}}-{{device}}"{{/device_s}}>{{device_s}}</span> + <a href="?do=passthrough&show=hwlist#{{vendor}}-{{device}}">[{{vendor}}:{{device}}]</a> + </div> {{/entries}} {{/lspci1}} <div id="lspci" class="collapse"> {{#lspci2}} - <div><span class="{{lookupClass}}">{{class}}</span></div> + <div><span>{{class_s}}</span></div> {{#entries}} - <div class="small"> └ <span class="{{lookupVen}}">{{ven}}</span> <span class="{{lookupDev}}">{{dev}}</span></div> + <div class="small"> +  └ + <span class="badge">{{pt}}</span> + <span{{^vendor_s}} class="query-{{vendor}}"{{/vendor_s}}>{{vendor_s}}</span> + <span{{^device_s}} class="query-{{vendor}}-{{device}}"{{/device_s}}>{{device_s}}</span> + <a href="?do=passthrough&show=hwlist#{{vendor}}-{{device}}">[{{vendor}}:{{device}}]</a> + </div> {{/entries}} {{/lspci2}} </div> @@ -374,13 +457,3 @@ </div> </div> </div> -<script type="application/javascript"><!-- -document.addEventListener("DOMContentLoaded", function () { - $('span.do-lookup').each(function () { - $(this).load('?do=statistics&lookup=' + $(this).text()); - }); - {{#biosurl}} - $('#bios-panel').load('{{{biosurl}}}'); - {{/biosurl}} -}, false); -// --></script> diff --git a/modules-available/statistics/templates/memory.html b/modules-available/statistics/templates/memory.html index f6f4c446..0ccbca98 100644 --- a/modules-available/statistics/templates/memory.html +++ b/modules-available/statistics/templates/memory.html @@ -15,9 +15,9 @@ </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}}" href="#">{{gb}} GiB</a> + <a class="filter-val" data-filter-val="{{gb}}" data-filter-op="~" href="#">{{gb}} GiB</a> </td> <td class="text-right">{{count}}</td> </tr> @@ -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> diff --git a/modules-available/statistics/templates/summary.html b/modules-available/statistics/templates/summary.html index 3ede7bc5..751a9bed 100644 --- a/modules-available/statistics/templates/summary.html +++ b/modules-available/statistics/templates/summary.html @@ -23,17 +23,61 @@ </div> </div> <div> + {{#json}} <canvas id="usagehist" style="width:100%;height:150px"></canvas> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function() { + + var markings = {{{markings}}}; + var markMax = Math.max(...markings) * 3; + var showLegend = markMax > 0; + if (markMax < 8) markMax = 8; + + var oldDraw = Chart.prototype._drawDatasets; + + Chart.prototype._drawDatasets = function () { + if (this.chartArea) { + var ctx = this.ctx; + var chartArea = this.chartArea; + + var meta = this.getDatasetMeta(0); + + ctx.save(); + var end = Math.min(meta.data.length, markings.length) - 1; + for (var i = 0; i < end; ++i) { + var start = meta.data[i].x; + var stop = meta.data[i+1].x; + ctx.fillStyle = 'rgba(16, 64, 255, ' + (!!markings[i] * .05 + markings[i] / markMax) + ')'; + ctx.fillRect(start, chartArea.top, stop - start, chartArea.bottom - chartArea.top); + } + ctx.restore(); + } + + // Perform regular chart draw + oldDraw.call(this); + }; + var data = {{{json}}}; var sel = false; - new Chart(document.getElementById('usagehist').getContext('2d')).Line(data, { + new Chart(document.getElementById('usagehist').getContext('2d'), {type: 'line', data: data, options: { + responsive: true, animation: false, - pointHitDetectionRadius: 5 - }); + pointRadius: 0, + pointHitRadius: 6, + interaction: { mode: 'index' }, + plugins: { + subtitle: { + display: showLegend, + text: '{{lang_graphLectureTitle}}', + position: 'bottom', + }, + legend: {position: 'left' }, + } + }}); + }, false); </script> + {{/json}} </div> </div> |