list/notifications: Ensure dashboard compliance

refs #7876
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

View File

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

View File

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