diff options
Diffstat (limited to 'modules-available/statistics/pages/hints.inc.php')
-rw-r--r-- | modules-available/statistics/pages/hints.inc.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php new file mode 100644 index 00000000..d5e7487b --- /dev/null +++ b/modules-available/statistics/pages/hints.inc.php @@ -0,0 +1,36 @@ +<?php + +class SubPage +{ + + public static function doPreprocess() + { + + } + + public static function doRender() + { + $q = new HardwareQuery(HardwareInfo::MAINBOARD); + $q->addLocalColumn('Memory Slot Occupied'); + $q->addGlobalColumn('Memory Slot Count'); + $q->addGlobalColumn('Memory Maximum Capacity'); + $q->addMachineColumn('clientip'); + $q->addMachineColumn('hostname'); + $q->addWhere(false, 'Memory Installed Capacity', '<', 8 * 1024 * 1024 * 1024); + $list = []; + foreach ($q->query() as $row) { + if (HardwareParser::convertSize($row['Memory Installed Capacity'], 'M', false) + >= HardwareParser::convertSize($row['Memory Maximum Capacity'], 'M', false)) { + $row['size_class'] = 'danger'; + $list[] = $row; + } elseif ($row['Memory Slot Occupied'] < $row['Memory Slot Count']) { + $row['count_class'] = 'success'; + array_unshift($list, $row); + } else { + $list[] = $row; + } + } + Render::addTemplate('hints-ram-upgrade', ['list' => $list]); + } + +}
\ No newline at end of file |