Merge branch 'bugfix/sort-hosts-and-services-by-last-state-change-9957'

fixes #9957
This commit is contained in:
Eric Lippmann 2015-12-21 10:34:20 +01:00
commit c5804eebb7
3 changed files with 20 additions and 15 deletions

View File

@ -90,11 +90,12 @@ class ListController extends Controller
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->hosts); $this->setupPaginationControl($this->view->hosts);
$this->setupSortControl(array( $this->setupSortControl(array(
'host_severity' => $this->translate('Severity'), 'host_severity' => $this->translate('Severity'),
'host_state' => $this->translate('Current State'), 'host_state' => $this->translate('Current State'),
'host_display_name' => $this->translate('Hostname'), 'host_display_name' => $this->translate('Hostname'),
'host_address' => $this->translate('Address'), 'host_address' => $this->translate('Address'),
'host_last_check' => $this->translate('Last Check') 'host_last_check' => $this->translate('Last Check'),
'host_last_state_change' => $this->translate('Last State Change')
), $query); ), $query);
$summary = $query->getQuery()->queryServiceProblemSummary(); $summary = $query->getQuery()->queryServiceProblemSummary();
@ -155,15 +156,16 @@ class ListController extends Controller
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->services); $this->setupPaginationControl($this->view->services);
$this->setupSortControl(array( $this->setupSortControl(array(
'service_severity' => $this->translate('Service Severity'), 'service_severity' => $this->translate('Service Severity'),
'service_state' => $this->translate('Current Service State'), 'service_state' => $this->translate('Current Service State'),
'service_display_name' => $this->translate('Service Name'), 'service_display_name' => $this->translate('Service Name'),
'service_last_check' => $this->translate('Last Service Check'), 'service_last_check' => $this->translate('Last Service Check'),
'host_severity' => $this->translate('Host Severity'), 'service_last_state_change' => $this->translate('Last State Change'),
'host_state' => $this->translate('Current Host State'), 'host_severity' => $this->translate('Host Severity'),
'host_display_name' => $this->translate('Hostname'), 'host_state' => $this->translate('Current Host State'),
'host_address' => $this->translate('Host Address'), 'host_display_name' => $this->translate('Hostname'),
'host_last_check' => $this->translate('Last Host Check') 'host_address' => $this->translate('Host Address'),
'host_last_check' => $this->translate('Last Host Check')
), $query); ), $query);
$stats = $this->backend->select()->from('servicestatussummary', array( $stats = $this->backend->select()->from('servicestatussummary', array(

View File

@ -117,7 +117,7 @@ class HostStatus extends DataView
'order' => self::SORT_ASC 'order' => self::SORT_ASC
), ),
'host_last_state_change' => array( 'host_last_state_change' => array(
'order' => self::SORT_ASC 'order' => self::SORT_DESC
) )
); );
} }

View File

@ -123,6 +123,9 @@ class ServiceStatus extends DataView
), ),
'order' => self::SORT_DESC 'order' => self::SORT_DESC
), ),
'service_last_state_change' => array(
'order' => self::SORT_DESC
),
'host_severity' => array( 'host_severity' => array(
'columns' => array( 'columns' => array(
'host_severity', 'host_severity',