diff options
author | Simon Rettberg | 2022-11-11 15:41:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-11-11 15:41:44 +0100 |
commit | aaa81e0a26085f58e5cd3290950c44f7b0f6c02f (patch) | |
tree | 25da4d09edf9de04db025928797bda011fdec343 /modules-available/statistics | |
parent | [statistics] Client list: Add option to hide columns (diff) | |
download | slx-admin-aaa81e0a26085f58e5cd3290950c44f7b0f6c02f.tar.gz slx-admin-aaa81e0a26085f58e5cd3290950c44f7b0f6c02f.tar.xz slx-admin-aaa81e0a26085f58e5cd3290950c44f7b0f6c02f.zip |
[statistics] Add ID45 column to client list
Diffstat (limited to 'modules-available/statistics')
-rw-r--r-- | modules-available/statistics/pages/list.inc.php | 3 | ||||
-rw-r--r-- | modules-available/statistics/templates/clientlist.html | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/modules-available/statistics/pages/list.inc.php b/modules-available/statistics/pages/list.inc.php index 1b6879e2..ce686d56 100644 --- a/modules-available/statistics/pages/list.inc.php +++ b/modules-available/statistics/pages/list.inc.php @@ -38,7 +38,7 @@ class SubPage } $allRows = Database::queryAll("SELECT m.machineuuid, m.locationid, m.macaddr, m.clientip, m.lastseen, m.logintime, m.state, m.currentuser, m.currentrunmode, m.realcores, m.mbram, m.kvmstate, m.cpumodel, m.id44mb, - m.hostname, m.notes IS NOT NULL AS hasnotes, + m.id45mb, m.hostname, m.notes IS NOT NULL AS hasnotes, m.badsectors, Count(s.machineuuid) AS confvars $xtra FROM machine m LEFT JOIN setting_machine s ON (m.machineuuid = s.machineuuid) $join WHERE $where GROUP BY m.machineuuid", $args); @@ -78,6 +78,7 @@ class SubPage //$row['lastboot'] = Util::prettyTime($row['lastboot']); $row['gbram'] = round(ceil($row['mbram'] / 512) / 2, 1); // Trial and error until we got "expected" rounding.. $row['gbtmp'] = round($row['id44mb'] / 1024); + $row['gbpersist'] = round($row['id45mb'] / 1024); $octets = explode('.', $row['clientip']); if (count($octets) === 4) { $row['subnet'] = "$octets[0].$octets[1].$octets[2]"; diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 721617a9..b33eafa3 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -32,6 +32,7 @@ <span class="glyphicon glyphicon-filter"></span> </button> </td> + <td></td> <td> <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('realcores')"> <span class="glyphicon glyphicon-filter"></span> @@ -56,6 +57,7 @@ <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" class="text-right">{{lang_persistentPart}}</th> <th data-sort="int">{{lang_cpuModel}}</th> <th data-sort="string">{{lang_location}}</th> </tr> @@ -144,6 +146,9 @@ </span> </div>{{/hddcount}} </td> + <td data-sort-value="{{gbpersist}}" 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> </tr> @@ -361,7 +366,7 @@ document.addEventListener("DOMContentLoaded", function () { idx++; var $th = $(this); $cs.append($('<div class="checkbox">') - .append($('<input id="shc-' + idx + '" type="checkbox" onclick="toggleColumn(' + idx + ')" checked="checked">')) + .append($('<input id="shc-' + idx + '" type="checkbox" onclick="toggleColumn(this, ' + idx + ')" checked="checked">')) .append($('<label for="shc-' + idx + '">').text($th.text()))); }); // Load previous visibility settings @@ -381,9 +386,9 @@ document.addEventListener("DOMContentLoaded", function () { } }); -function toggleColumn(idx) +function toggleColumn(e, idx) { - var $el = $(this); + var $el = $(e); $('#client-list tr > td:nth-child(' + idx + '), #client-list tr > th:nth-child(' + idx + ')') .css('display', $el.is(':checked') ? '' : 'none'); var data = {}; |