From 0c43e4a36b9ebbebee883e74aab4aaef42a4a384 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 19 Aug 2015 12:41:58 +0200 Subject: [PATCH] monitoring: Sort by display_names in the service grid refs #9538 --- .../application/controllers/ListController.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index d26cc0c52..113efdcf4 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -581,29 +581,31 @@ class Monitoring_ListController extends Controller { $this->addTitleTab('servicegrid', $this->translate('Service Grid'), $this->translate('Show the Service Grid')); $this->setAutorefreshInterval(15); - $problems = (bool) $this->params->shift('problems', 0); $query = $this->backend->select()->from('servicestatus', array( + 'host_display_name', 'host_name', 'service_description', - 'service_state', + 'service_display_name', + 'service_handled', 'service_output', - 'service_handled' + 'service_state' )); $this->filterQuery($query); $this->applyRestriction('monitoring/filter/objects', $query); $this->setupSortControl(array( - 'host_name' => $this->translate('Hostname'), - 'service_description' => $this->translate('Service description') + 'host_display_name' => $this->translate('Hostname'), + 'service_display_name' => $this->translate('Service Name') ), $query); + $filter = (bool) $this->params->shift('problems', false) ? Filter::where('service_problem', 1) : null; $pivot = $query->pivot( 'service_description', 'host_name', - $problems ? Filter::where('service_problem', 1) : null, - $problems ? Filter::where('service_problem', 1) : null + $filter, + $filter ? clone $filter : null ); $this->view->pivot = $pivot; $this->view->horizontalPaginator = $pivot->paginateXAxis(); - $this->view->verticalPaginator = $pivot->paginateYAxis(); + $this->view->verticalPaginator = $pivot->paginateYAxis(); } /**