Servicegroup Summary: Add sort control

refs #4185
This commit is contained in:
Eric Lippmann 2013-10-15 14:55:01 +02:00
parent 1f571589de
commit 2291e73c4c
4 changed files with 9 additions and 5 deletions

View File

@ -330,8 +330,11 @@ class Monitoring_ListController extends MonitoringController
'cnt_services_pending' 'cnt_services_pending'
) )
)->getQuery(); )->getQuery();
$this->view->servicegroups = $query->paginate();
$this->handleFormatRequest($query); $this->handleFormatRequest($query);
$this->view->servicegroups = $query->paginate();
$this->setupSortControl(array(
'servicegroup_name' => 'Servicegroup Name'
));
} }
/** /**

View File

@ -1,6 +1,7 @@
<div data-icinga-component="app/mainDetailGrid"> <div data-icinga-component="app/mainDetailGrid">
<?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
<table class="table table-condensed"> <table>
<tbody> <tbody>
<?php foreach($servicegroups as $servicegroup): ?> <?php foreach($servicegroups as $servicegroup): ?>
<tr> <tr>

View File

@ -43,7 +43,7 @@ class ServicestatusQuery extends AbstractQuery
), ),
'servicegroups' => array( 'servicegroups' => array(
'servicegroups' => 'sgo.name1', 'servicegroups' => 'sgo.name1',
), )
); );
protected function getDefaultColumns() protected function getDefaultColumns()

View File

@ -37,10 +37,10 @@ class Groupsummary extends DataView
{ {
return array( return array(
'servicegroup_name' => array( 'servicegroup_name' => array(
'order' => self::SORT_DESC 'order' => self::SORT_ASC
), ),
'hostgroup_name' => array( 'hostgroup_name' => array(
'order' => self::SORT_DESC 'order' => self::SORT_ASC
) )
); );
} }