From 53a4f10253806d7e78a9899d4141a8843468459e Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 23 Jan 2015 15:46:51 +0100 Subject: [PATCH] monitoring: Sort host groups and service groups by their alias refs #7843 --- .../controllers/ListController.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 9a0cd42a7..a9ccb7ee8 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -523,18 +523,20 @@ class Monitoring_ListController extends Controller 'services_critical_last_state_change_unhandled', 'services_unknown_last_state_change_unhandled', 'services_total' - )); + ))->order('services_severity')->order('servicegroup_alias'); + // TODO(el): Can't default to the sort rules of the data view because it's meant for both host groups and + // service groups. We should separate them. $this->filterQuery($query); $this->view->servicegroups = $query->paginate(); $this->setupSortControl(array( - 'services_severity' => $this->translate('Severity'), - 'servicegroup' => $this->translate('Service Group Name'), - 'services_total' => $this->translate('Total Services'), - 'services_ok' => $this->translate('Services OK'), - 'services_unknown' => $this->translate('Services UNKNOWN'), - 'services_critical' => $this->translate('Services CRITICAL'), - 'services_warning' => $this->translate('Services WARNING'), - 'services_pending' => $this->translate('Services PENDING') + 'services_severity' => $this->translate('Severity'), + 'servicegroup_alias' => $this->translate('Service Group Name'), + 'services_total' => $this->translate('Total Services'), + 'services_ok' => $this->translate('Services OK'), + 'services_unknown' => $this->translate('Services UNKNOWN'), + 'services_critical' => $this->translate('Services CRITICAL'), + 'services_warning' => $this->translate('Services WARNING'), + 'services_pending' => $this->translate('Services PENDING') )); } @@ -571,12 +573,14 @@ class Monitoring_ListController extends Controller 'services_critical_last_state_change_unhandled', 'services_unknown_last_state_change_unhandled', 'services_total' - )); + ))->order('services_severity')->order('hostgroup_alias'); + // TODO(el): Can't default to the sort rules of the data view because it's meant for both host groups and + // service groups. We should separate them. $this->filterQuery($query); $this->view->hostgroups = $query->paginate(); $this->setupSortControl(array( 'services_severity' => $this->translate('Severity'), - 'hostgroup' => $this->translate('Host Group Name'), + 'hostgroup_alias' => $this->translate('Host Group Name'), 'services_total' => $this->translate('Total Services'), 'services_ok' => $this->translate('Services OK'), 'services_unknown' => $this->translate('Services UNKNOWN'),