list/hostgroups: Ensure dashboard compliance

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-17 16:14:59 +02:00
parent 7ae7bf38c4
commit faa29e3dee
2 changed files with 19 additions and 18 deletions

View File

@ -569,8 +569,10 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'hostgroup_name', 'hostgroup_name',
'hostgroup_alias', 'hostgroup_alias',
@ -602,6 +604,9 @@ class Monitoring_ListController extends Controller
// service groups. We should separate them. // service groups. We should separate them.
$this->filterQuery($query); $this->filterQuery($query);
$this->view->hostgroups = $query->paginate(); $this->view->hostgroups = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->hostgroups);
$this->setupSortControl(array( $this->setupSortControl(array(
'services_severity' => $this->translate('Severity'), 'services_severity' => $this->translate('Severity'),
'hostgroup_alias' => $this->translate('Host Group Name'), 'hostgroup_alias' => $this->translate('Host Group Name'),

View File

@ -1,24 +1,20 @@
<?php if ($this->compact): ?> <?php if (! $this->compact): ?>
<div class="content">
<?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="content">
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div>
<?php endif ?> <?php endif ?>
<?php <div class="content">
if (count($hostgroups) === 0) { <?php
echo $this->translate('No host groups matching the filter');
echo '</div>'; if (count($hostgroups) === 0) {
return; echo $this->translate('No hostgroups found matching the filter') . '</div>';
} return;
?> }
?>
<table class="groupview" data-base-target="_next"> <table class="groupview" data-base-target="_next">
<thead> <thead>
<th><?= $this->translate('Last Problem'); ?></th> <th><?= $this->translate('Last Problem'); ?></th>