parent
ab0720fe95
commit
9114a34223
|
@ -2,6 +2,8 @@
|
||||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\Controller;
|
use Icinga\Module\Monitoring\Controller;
|
||||||
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
|
use Icinga\Module\Monitoring\Object\Host;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
|
@ -76,6 +78,10 @@ class Monitoring_DowntimeController extends Controller
|
||||||
{
|
{
|
||||||
$this->view->downtime = $this->downtime;
|
$this->view->downtime = $this->downtime;
|
||||||
$this->view->isService = $this->isService;
|
$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->delDowntimeForm = $this->createDelDowntimeForm();
|
||||||
$this->view->listAllLink = Url::fromPath('monitoring/list/downtimes');
|
$this->view->listAllLink = Url::fromPath('monitoring/list/downtimes');
|
||||||
$this->view->showHostLink = Url::fromPath('monitoring/host/show')
|
$this->view->showHostLink = Url::fromPath('monitoring/host/show')
|
||||||
|
|
|
@ -2,35 +2,24 @@
|
||||||
<?php if (! $this->compact): ?>
|
<?php if (! $this->compact): ?>
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<h1 data-base-target="_next">
|
|
||||||
<?php if ($this->isService): ?>
|
|
||||||
<?php
|
|
||||||
$link = $this->link()->service(
|
|
||||||
$downtime->service_description,
|
|
||||||
$downtime->service_display_name,
|
|
||||||
$downtime->host_name,
|
|
||||||
$downtime->host_display_name
|
|
||||||
);
|
|
||||||
$icon = $this->icon('service', $this->translate('Service'));
|
|
||||||
?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php
|
|
||||||
$icon = $this->icon('host', $this->translate('Host'));
|
|
||||||
$link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
|
|
||||||
?>
|
|
||||||
<?php endif ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$this->translate(
|
|
||||||
'Downtime on %s',
|
|
||||||
'Downtime for host or service.'
|
|
||||||
),
|
|
||||||
$link
|
|
||||||
); ?>
|
|
||||||
<?= $icon ?>
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content">
|
<table class="action">
|
||||||
|
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
||||||
|
<td class="state">
|
||||||
|
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||||
|
<br>
|
||||||
|
<?=
|
||||||
|
$this->dateTimeRenderer(
|
||||||
|
($downtime->is_in_effect ? $downtime->end : $downtime->start),
|
||||||
|
true
|
||||||
|
)->render(
|
||||||
|
$this->translate('on %s', 'datetime'),
|
||||||
|
$this->translate('at %s', 'time'),
|
||||||
|
$this->translate('in %s', 'timespan')
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
<small>
|
<small>
|
||||||
<?php if ($downtime->is_flexible): ?>
|
<?php if ($downtime->is_flexible): ?>
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
<?php if ($downtime->is_in_effect): ?>
|
||||||
|
@ -78,10 +67,40 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</small>
|
</small>
|
||||||
<br>
|
</td>
|
||||||
<br>
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<table class="avp newsection">
|
<h1 data-base-target="_next">
|
||||||
|
<?php if ($this->isService): ?>
|
||||||
|
<?php
|
||||||
|
$link = $this->link()->service(
|
||||||
|
$downtime->service_description,
|
||||||
|
$downtime->service_display_name,
|
||||||
|
$downtime->host_name,
|
||||||
|
$downtime->host_display_name
|
||||||
|
);
|
||||||
|
$icon = $this->icon('service', $this->translate('Service'));
|
||||||
|
?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php
|
||||||
|
$icon = $this->icon('host', $this->translate('Host'));
|
||||||
|
$link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
|
||||||
|
?>
|
||||||
|
<?php endif ?>
|
||||||
|
<?= sprintf(
|
||||||
|
$this->translate(
|
||||||
|
'Downtime on %s',
|
||||||
|
'Downtime for host or service.'
|
||||||
|
),
|
||||||
|
$link
|
||||||
|
); ?>
|
||||||
|
<?= $icon ?>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<table class="avp">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
|
<tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
|
||||||
<th><?= $this->translate('Author') ?></th>
|
<th><?= $this->translate('Author') ?></th>
|
||||||
|
|
Loading…
Reference in New Issue