list/notifications: Ensure dashboard compliance

refs 
This commit is contained in:
Johannes Meyer 2015-04-17 16:13:36 +02:00
parent 5f19ec1b2e
commit a09e41e3b8
2 changed files with 17 additions and 14 deletions
modules/monitoring/application
controllers
views/scripts/list

@ -306,12 +306,14 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url);
}
$this->addTitleTab(
'notifications',
$this->translate('Notifications'),
$this->translate('List notifications')
);
$this->setAutorefreshInterval(15);
$query = $this->backend->select()->from('notification', array(
'host_name',
'service_description',
@ -324,6 +326,9 @@ class Monitoring_ListController extends Controller
));
$this->filterQuery($query);
$this->view->notifications = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
$this->setupSortControl(array(
'notification_start_time' => $this->translate('Notification Start')
));

@ -1,26 +1,24 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
?>
<?php if (! $this->compact): ?>
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div class="dontprint" style="margin: 1em;">
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div>
<?= $this->widget('limiter') ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<?php if (count($notifications) === 0): ?>
<?= $this->translate('No notifications matching the filter') ?>
<?php return; endif ?>
<?php
if (count($notifications) === 0) {
echo $this->translate('No notifications found matching the filter') . '</div>';
return;
}
?>
<table data-base-target="_next" class="action">
<tbody>
<?php foreach ($notifications as $notification):