summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/pages
diff options
context:
space:
mode:
authorSimon Rettberg2022-06-17 14:51:27 +0200
committerSimon Rettberg2022-06-17 14:51:27 +0200
commit7123ae1ac665a8cde5428631093399d7a4a20002 (patch)
tree93007ee496b0a5b03bd8ed783897398edb47aaea /modules-available/statistics/pages
parent[statistics] Show clients with < gigabit ethernet in hints (diff)
downloadslx-admin-7123ae1ac665a8cde5428631093399d7a4a20002.tar.gz
slx-admin-7123ae1ac665a8cde5428631093399d7a4a20002.tar.xz
slx-admin-7123ae1ac665a8cde5428631093399d7a4a20002.zip
[statistics] Hide clients with isclient==false from low RAM list
Diffstat (limited to 'modules-available/statistics/pages')
-rw-r--r--modules-available/statistics/pages/hints.inc.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php
index 5092157c..935315d6 100644
--- a/modules-available/statistics/pages/hints.inc.php
+++ b/modules-available/statistics/pages/hints.inc.php
@@ -20,6 +20,19 @@ class SubPage
self::showMemorySlow($locs);
}
+ private static function isNonClientRunmode(string $machineUuid)
+ {
+ static $cache = null;
+ if ($cache === null) {
+ if (!Module::isAvailable('runmode')) {
+ $cache = [];
+ } else {
+ $cache = RunMode::getAllClients(false, false);
+ }
+ }
+ return isset($cache[$machineUuid]);
+ }
+
/**
* Machines that have less than 8GB of RAM. Highlight those
* that still have free memory slots.
@@ -38,6 +51,8 @@ class SubPage
$q->addLocalColumn('Memory Installed Capacity')->addCondition('<', 8 * 1024 * 1024 * 1024);
$list = [];
foreach ($q->query() as $row) {
+ if (self::isNonClientRunmode($row['machineuuid']))
+ continue;
if (HardwareParser::convertSize($row['Memory Installed Capacity'], 'M', false)
>= HardwareParser::convertSize($row['Memory Maximum Capacity'], 'M', false)) {
$row['size_class'] = 'danger';