list/downtimes: Ensure dashboard compliance

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-17 16:13:22 +02:00
parent 29648191e4
commit 5f19ec1b2e
2 changed files with 18 additions and 22 deletions

View File

@ -250,8 +250,10 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url);
}
$this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes'));
$this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id',
'objecttype' => 'downtime_objecttype',
@ -273,9 +275,11 @@ class Monitoring_ListController extends Controller
'host_display_name',
'service_display_name'
));
$this->filterQuery($query);
$this->view->downtimes = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->downtimes);
$this->setupSortControl(array(
'downtime_is_in_effect' => $this->translate('Is In Effect'),
'host_display_name' => $this->translate('Host'),
@ -289,8 +293,6 @@ class Monitoring_ListController extends Controller
'downtime_duration' => $this->translate('Duration')
));
$this->view->downtimes = $query->paginate();
if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) {
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
}

View File

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