show/history: Ensure dashboard compliance

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-17 16:10:21 +02:00
parent 5f4a61f36e
commit 9388944283
2 changed files with 20 additions and 13 deletions

View File

@ -73,6 +73,9 @@ class Monitoring_ShowController extends Controller
$this->view->history = $this->view->object->eventhistory->getQuery()->paginate($this->params->get('limit', 50));
$this->handleFormatRequest($this->view->object->eventhistory);
$this->fetchHostStats();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->history);
}
public function servicesAction()

View File

@ -1,29 +1,33 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$self = $this;
$hostContext = $object->getType() === 'host';
?>
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?php if ($hostContext): ?>
<?= $this->render('partials/host/object-header.phtml'); ?>
<?php else: ?>
<?= $this->render('partials/service/object-header.phtml'); ?>
<?php endif ?>
<h1><?= $this->translate('This Object\'s Event History'); ?></h1>
<?= $this->widget('limiter', array('url' => $url, 'max' => $history->count())); ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<?php if (count($history) === 0): ?>
<?= $this->translate('No history available for this object'); ?>
</div>
<?php return; endif ?>
<?php
if (count($history) === 0) {
echo $this->translate('No history available for this object') . '</div>';
return;
}
?>
<?php
function contactsLink($match, $view) {