summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/pages
diff options
context:
space:
mode:
authorSimon Rettberg2022-10-27 16:16:36 +0200
committerSimon Rettberg2022-10-27 16:16:36 +0200
commit6e183c043091cf4a6c261b57fbfd9595cf76e93e (patch)
treebdd60e215324fbbbad3c64d2a9b889ec39f219f6 /modules-available/statistics/pages
parent[statistics] Don't wrap partition name column in machine view (diff)
downloadslx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.tar.gz
slx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.tar.xz
slx-admin-6e183c043091cf4a6c261b57fbfd9595cf76e93e.zip
[statistics] Add machine state icon to hints tables
Diffstat (limited to 'modules-available/statistics/pages')
-rw-r--r--modules-available/statistics/pages/hints.inc.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php
index 9b4fe568..dc789e9f 100644
--- a/modules-available/statistics/pages/hints.inc.php
+++ b/modules-available/statistics/pages/hints.inc.php
@@ -48,6 +48,7 @@ class SubPage
$q->addGlobalColumn('Memory Maximum Capacity');
$q->addMachineColumn('clientip');
$q->addMachineColumn('hostname');
+ $q->addMachineColumn('state');
$q->addLocalColumn('Memory Installed Capacity')->addCondition('<', 8 * 1024 * 1024 * 1024);
$list = [];
foreach ($q->query() as $row) {
@@ -60,6 +61,7 @@ class SubPage
if ($row['Memory Slot Occupied'] >= $row['Memory Slot Count']) {
$row['count_class'] = 'warning';
}
+ $row['icon'] = StatisticsStyling::machineStateToIcon($row['state']);
$list[] = $row;
}
if (empty($list))
@@ -87,6 +89,7 @@ class SubPage
$q->addLocalColumn('Serial Number');
$q->addMachineColumn('clientip');
$q->addMachineColumn('hostname');
+ $q->addMachineColumn('state');
$col = $q->addGlobalColumn('Speed');
$col->addCondition('>', $q->addLocalColumn('Configured Memory Speed'));
$list = [];
@@ -95,6 +98,7 @@ class SubPage
// Cast as these have a MT/s suffic, triggering a PHP notice about malformed numbers
if ((int)$row['Configured Memory Speed'] + 33 >= (int)$row['Speed'])
continue;
+ $row['icon'] = StatisticsStyling::machineStateToIcon($row['state']);
$list[] = $row;
}
if (empty($list))
@@ -119,9 +123,11 @@ class SubPage
$q->addMachineColumn('hostname');
$q->addLocalColumn('unused')->addCondition('>', 2000000000); // 2 GB
$q->addMachineWhere('id44mb', '<', 20000); // 20 GB
+ $q->addMachineColumn('state');
foreach ($q->query() as $row) {
$row['unused_s'] = Util::readableFileSize($row['unused']);
$row['id44mb_s'] = Util::readableFileSize($row['id44mb'], -1, 2);
+ $row['icon'] = StatisticsStyling::machineStateToIcon($row['state']);
$id44[] = $row;
}
// ID45
@@ -134,12 +140,14 @@ class SubPage
$q->addLocalColumn('unused')->addCondition('>', 50000000000); // 50 GB
$q->addMachineWhere('id44mb', '>', 20000); // 20 GB
$q->addMachineWhere('id45mb', '<', 20000); // 20 GB
+ $q->addMachineColumn('state');
// Only suggest SSD based systems, caching on spinning rust is usually slower than GBit
$q->addGlobalColumn('rotation_rate')->addCondition('=', 0);
foreach ($q->query() as $row) {
$row['unused_s'] = Util::readableFileSize($row['unused']);
$row['id44mb_s'] = Util::readableFileSize($row['id44mb'], -1, 2);
$row['id45mb_s'] = Util::readableFileSize($row['id45mb'], -1, 2);
+ $row['icon'] = StatisticsStyling::machineStateToIcon($row['state']);
$id45[] = $row;
}
if (empty($id44) && empty($id45))
@@ -161,12 +169,14 @@ class SubPage
}
$q->addMachineColumn('clientip');
$q->addMachineColumn('hostname');
+ $q->addMachineColumn('state');
$q->addLocalColumn('nic-speed')->addCondition('<', 1000);
$q->addLocalColumn('nic-duplex');
foreach ($q->query() as $row) {
if ($row['nic-speed'] == 0) {
$row['nic-speed'] = '???';
}
+ $row['icon'] = StatisticsStyling::machineStateToIcon($row['state']);
$list[] = $row;
}
if (empty($list))