Skip to content

Commit

Permalink
list/hostgroups: Ensure dashboard compliance
Browse files Browse the repository at this point in the history
refs #7876
  • Loading branch information
Johannes Meyer committed Apr 17, 2015
1 parent 7ae7bf3 commit faa29e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
5 changes: 5 additions & 0 deletions modules/monitoring/application/controllers/ListController.php
Expand Up @@ -569,8 +569,10 @@ public function hostgroupsAction()
if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url);
}

$this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12);

$query = $this->backend->select()->from('groupsummary', array(
'hostgroup_name',
'hostgroup_alias',
Expand Down Expand Up @@ -602,6 +604,9 @@ public function hostgroupsAction()
// service groups. We should separate them.
$this->filterQuery($query);
$this->view->hostgroups = $query->paginate();

$this->setupLimitControl();
$this->setupPaginationControl($this->view->hostgroups);
$this->setupSortControl(array(
'services_severity' => $this->translate('Severity'),
'hostgroup_alias' => $this->translate('Host Group Name'),
Expand Down
32 changes: 14 additions & 18 deletions modules/monitoring/application/views/scripts/list/hostgroups.phtml
@@ -1,24 +1,20 @@
<?php if ($this->compact): ?>
<div class="content">
<?php else: ?>
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint">
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="content">
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<?php
if (count($hostgroups) === 0) {
echo $this->translate('No host groups matching the filter');
echo '</div>';
return;
}
?>
<div class="content">
<?php

if (count($hostgroups) === 0) {
echo $this->translate('No hostgroups found matching the filter') . '</div>';
return;
}
?>
<table class="groupview" data-base-target="_next">
<thead>
<th><?= $this->translate('Last Problem'); ?></th>
Expand Down

0 comments on commit faa29e3

Please sign in to comment.