Skip to content

Commit

Permalink
Show better error message for unknown downtimes
Browse files Browse the repository at this point in the history
refs #8902
  • Loading branch information
majentsch committed May 7, 2015
1 parent 9114a34 commit 20b25e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Expand Up @@ -76,12 +76,14 @@ public function init()

public function showAction()
{
if (false === $this->downtime) {
return;
}
$this->view->downtime = $this->downtime;
$this->view->isService = $this->isService;
$this->view->stateName = isset($this->downtime->service_description) ?
Service::getStateText($this->downtime->service_state) :
Host::getStateText($this->downtime->host_state);

$this->view->delDowntimeForm = $this->createDelDowntimeForm();
$this->view->listAllLink = Url::fromPath('monitoring/list/downtimes');
$this->view->showHostLink = Url::fromPath('monitoring/host/show')
Expand Down
@@ -1,4 +1,10 @@
<div class="controls">
<?php if (! isset($downtime)): ?>
<?= $this->translate('No scheduled downtime matching the filter.') ?>
</div>
<?php return; ?>
<?php endif; ?>

<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
Expand Down
Expand Up @@ -15,7 +15,8 @@ if (! $this->compact): ?>
<?php

if (count($downtimes) === 0) {
echo $this->translate('No downtimes found matching the filter') . '</div>';
echo $this->translate('No downtimes found matching the filter,'
. ' maybe the downtime already expired.') . '</div>';
return;
}
?>
Expand Down

0 comments on commit 20b25e6

Please sign in to comment.