Skip to content

Commit

Permalink
show/history: 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 5f4a61f commit 9388944
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
3 changes: 3 additions & 0 deletions modules/monitoring/application/controllers/ShowController.php
Expand Up @@ -73,6 +73,9 @@ public function historyAction()
$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()
Expand Down
30 changes: 17 additions & 13 deletions modules/monitoring/application/views/scripts/show/history.phtml
@@ -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">
<?php if ($hostContext): ?>
<?= $this->tabs; ?>
<?php if ($hostContext): ?>
<?= $this->render('partials/host/object-header.phtml'); ?>
<?php else: ?>
<?php else: ?>
<?= $this->render('partials/service/object-header.phtml'); ?>
<?php endif ?>
<?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) {
Expand Down

0 comments on commit 9388944

Please sign in to comment.