From a26e67618c3fd9a6e64059c0bbfdf2e6397f8492 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 20 Jul 2022 14:16:29 +0200 Subject: [statistics] hints: Sort all tables by hostname --- modules-available/statistics/pages/hints.inc.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules-available/statistics/pages') diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php index cc44caa9..dc51b6ea 100644 --- a/modules-available/statistics/pages/hints.inc.php +++ b/modules-available/statistics/pages/hints.inc.php @@ -56,16 +56,15 @@ class SubPage 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; } + if ($row['Memory Slot Occupied'] >= $row['Memory Slot Count']) { + $row['count_class'] = 'warning'; + } + $list[] = $row; } if (empty($list)) return; + ArrayUtil::sortByColumn($list, 'hostname'); Render::addTemplate('hints-ram-upgrade', ['list' => $list]); } @@ -99,6 +98,7 @@ class SubPage } if (empty($list)) return; + ArrayUtil::sortByColumn($list, 'hostname'); Render::addTemplate('hints-ram-underclocked', ['list' => $list]); } @@ -143,6 +143,8 @@ class SubPage } if (empty($id44) && empty($id45)) return; + ArrayUtil::sortByColumn($id44, 'hostname'); + ArrayUtil::sortByColumn($id45, 'hostname'); Render::addTemplate('hints-hdd-grow', [ 'id44' => $id44, 'id45' => $id45, @@ -168,7 +170,7 @@ class SubPage } if (empty($list)) return; - ArrayUtil::sortByColumn($list, 'nic-speed', SORT_ASC | SORT_NUMERIC); + ArrayUtil::sortByColumn($list, 'hostname'); Render::addTemplate('hints-nic-speed', ['list' => $list]); } -- cgit v1.2.3-55-g7522