parent
02a3f56481
commit
417c6bb1ea
|
@ -101,6 +101,6 @@ class DowntimesController extends Controller
|
||||||
));
|
));
|
||||||
$delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
|
$delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
|
||||||
$delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest();
|
$delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest();
|
||||||
$this->view->delDowntimeForm = $delDowntimeForm;
|
$this->view->delAllDowntimeForm = $delDowntimeForm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ class DeleteDowntimeCommandForm extends CommandForm
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'escape' => false,
|
'escape' => false,
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
'class' => 'link-like spinner',
|
'class' => 'action-link link',
|
||||||
'label' => $this->getView()->icon('trash'),
|
'label' => $this->getView()->icon('trash'),
|
||||||
'title' => $this->translate('Delete this downtime'),
|
'title' => $this->translate('Delete this downtime'),
|
||||||
'decorators' => array('ViewHelper')
|
'decorators' => array('ViewHelper')
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
|
<table>
|
||||||
|
<tr> <?= $this->render('partials/downtime/downtime-header.phtml') ?> </tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="content object-command">
|
<div class="content object-command">
|
||||||
<?= $delDowntimeForm; ?>
|
<?= $delDowntimeForm; ?>
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
|
<table>
|
||||||
|
<tr> <?= $this->render('partials/downtime/downtime-header.phtml'); ?> </tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content"><h2><?= $this->translate('Details') ?></h2>
|
||||||
<h3><?= $this->translate('Downtime detail information') ?></h3>
|
<table class="name-value-table">
|
||||||
<table class="avp">
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
@ -37,28 +38,79 @@
|
||||||
<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>
|
||||||
<td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td>
|
<td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td>
|
||||||
</tr>
|
|
||||||
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
|
|
||||||
<th><?= $this->translate('Comment') ?></th>
|
|
||||||
<td><?= $this->icon('comment', $this->translate('Comment')) ?> <?= $this->escape($this->downtime->comment) ?></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
|
<tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
|
||||||
<th><?= $this->translate('Entry Time') ?></th>
|
<th><?= $this->translate('Entry Time') ?></th>
|
||||||
<td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
|
<td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
|
||||||
|
<th><?= $this->translate('Comment') ?></th>
|
||||||
|
<td class="comment-text"><?= $this->escape($this->downtime->comment) ?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2> <?= $this->translate('Duration') ?> </h2>
|
||||||
|
|
||||||
|
<table class="name-value-table">
|
||||||
|
<tbody>
|
||||||
<tr class="newsection">
|
<tr class="newsection">
|
||||||
<th><?= $this->escape(
|
<th><?= $this->escape(
|
||||||
$this->downtime->is_flexible ?
|
$this->downtime->is_flexible ?
|
||||||
$this->translate('Flexible') : $this->translate('Fixed')
|
$this->translate('Flexible') : $this->translate('Fixed')
|
||||||
); ?></th>
|
); ?>
|
||||||
<td>
|
<?= $this->icon('info-circled', $this->downtime->is_flexible ?
|
||||||
<?= $this->escape(
|
|
||||||
$this->downtime->is_flexible ?
|
|
||||||
$this->translate('Flexible downtimes have a hard start and end time,'
|
$this->translate('Flexible downtimes have a hard start and end time,'
|
||||||
. ' but also an additional restriction on the duration in which '
|
. ' but also an additional restriction on the duration in which '
|
||||||
. ' the host or service may actually be down.') :
|
. ' the host or service may actually be down.') :
|
||||||
$this->translate('Fixed downtimes have a static start and end time.')
|
$this->translate('Fixed downtimes have a static start and end time.')) ?>
|
||||||
); ?>
|
</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($downtime->is_flexible): ?>
|
||||||
|
<?php if ($downtime->is_in_effect): ?>
|
||||||
|
<?= sprintf(
|
||||||
|
$isService
|
||||||
|
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
|
||||||
|
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
|
||||||
|
$this->formatDate($downtime->start),
|
||||||
|
$this->formatTime($downtime->start),
|
||||||
|
$this->formatDuration($downtime->duration),
|
||||||
|
$this->formatDate($downtime->end),
|
||||||
|
$this->formatTime($downtime->end)
|
||||||
|
) ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= sprintf(
|
||||||
|
$isService
|
||||||
|
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
|
||||||
|
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
|
||||||
|
$this->formatDateTime($downtime->scheduled_start),
|
||||||
|
$this->formatDateTime($downtime->scheduled_end),
|
||||||
|
$this->formatDuration($downtime->duration)
|
||||||
|
) ?>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php if ($downtime->is_in_effect): ?>
|
||||||
|
<?= sprintf(
|
||||||
|
$isService
|
||||||
|
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
|
||||||
|
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
|
||||||
|
$this->formatDate($downtime->start),
|
||||||
|
$this->formatTime($downtime->start),
|
||||||
|
$this->formatDate($downtime->end),
|
||||||
|
$this->formatTime($downtime->end)
|
||||||
|
) ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= sprintf(
|
||||||
|
$isService
|
||||||
|
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
|
||||||
|
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
|
||||||
|
$this->formatDate($downtime->start),
|
||||||
|
$this->formatTime($downtime->start),
|
||||||
|
$this->formatDate($downtime->end),
|
||||||
|
$this->formatTime($downtime->end)
|
||||||
|
) ?>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr title="<?= $this->translate('The date/time the scheduled downtime is'
|
<tr title="<?= $this->translate('The date/time the scheduled downtime is'
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content object-command">
|
<div class="content object-command">
|
||||||
<?= $delDowntimeForm ?>
|
<?= $delAllDowntimeForm ?>
|
||||||
</div>
|
</div>
|
|
@ -6,7 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content multi-commands">
|
<div class="content multi-commands">
|
||||||
<h3><?= $this->icon('reschedule') ?><?= $this->translate('Commands') ?></h3>
|
<h2> <?= $this->translate('Commands') ?> </h2>
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
sprintf($this->translate('Remove all %d scheduled downtimes'), $downtimes->count()),
|
sprintf($this->translate('Remove all %d scheduled downtimes'), $downtimes->count()),
|
||||||
$removeAllLink,
|
$removeAllLink,
|
||||||
|
|
|
@ -11,135 +11,32 @@ if (! $this->compact): ?>
|
||||||
<?= $this->render('list/components/selectioninfo.phtml'); ?>
|
<?= $this->render('list/components/selectioninfo.phtml'); ?>
|
||||||
</div>
|
</div>
|
||||||
<h1><?= count($downtimes) ?> <?= $this->translate('Downtimes') ?></h1>
|
<h1><?= count($downtimes) ?> <?= $this->translate('Downtimes') ?></h1>
|
||||||
<?= $this->sortBox; ?>
|
<?= $this->sortBox ?>
|
||||||
<?= $this->limiter; ?>
|
<?= $this->limiter ?>
|
||||||
<?= $this->paginator; ?>
|
<?= $this->paginator ?>
|
||||||
<?= $this->filterEditor; ?>
|
<?= $this->filterEditor ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<table data-base-target="_next"
|
<table data-base-target="_next"
|
||||||
class="action multiselect"
|
class="action action-table multiselect"
|
||||||
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show'); ?>"
|
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show'); ?>"
|
||||||
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>"
|
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>"
|
||||||
data-icinga-multiselect-data="downtime_id">
|
data-icinga-multiselect-data="downtime_id">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($downtimes as $downtime): ?>
|
<?php foreach ($downtimes as $downtime):
|
||||||
<?php
|
|
||||||
if (isset($downtime->service_description)) {
|
if (isset($downtime->service_description)) {
|
||||||
$isService = true;
|
$this->isService = true;
|
||||||
$stateName = Service::getStateText($downtime->service_state);
|
$this->stateName = Service::getStateText($downtime->service_state);
|
||||||
} else {
|
} else {
|
||||||
$isService = false;
|
$this->isService = false;
|
||||||
$stateName = Host::getStateText($downtime->host_state);
|
$this->stateName = Host::getStateText($downtime->host_state);
|
||||||
}
|
}
|
||||||
|
$this->downtime = $downtime;
|
||||||
|
$this->displayComment = true;
|
||||||
?>
|
?>
|
||||||
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
<tr>
|
||||||
<td class="state">
|
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
|
||||||
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
|
||||||
<strong><?= $this->translate('Ends'); ?></strong>
|
|
||||||
<br>
|
|
||||||
<?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
|
||||||
<br>
|
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php if ($isService): ?>
|
|
||||||
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
|
|
||||||
$this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name),
|
|
||||||
'monitoring/downtime/show',
|
|
||||||
array('downtime_id' => $downtime->id),
|
|
||||||
array(
|
|
||||||
'title' => sprintf(
|
|
||||||
$this->translate('Show detailed information for this downtime scheduled for service %s on host %s'),
|
|
||||||
$downtime->service_display_name,
|
|
||||||
$downtime->host_display_name
|
|
||||||
),
|
|
||||||
'class' => 'rowaction'
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= $this->icon('host', $this->translate('host')); ?> <?= $this->qlink(
|
|
||||||
$this->escape($downtime->host_display_name),
|
|
||||||
'monitoring/downtime/show',
|
|
||||||
array('downtime_id' => $downtime->id),
|
|
||||||
array(
|
|
||||||
'title' => sprintf(
|
|
||||||
$this->translate('Show detailed information for this downtime scheduled for host %s'),
|
|
||||||
$downtime->host_display_name
|
|
||||||
),
|
|
||||||
'class' => 'rowaction'
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<br>
|
|
||||||
<?= $this->icon('comment', $this->translate('Comment')); ?> [<?= $this->escape($downtime->author_name) ?>] <?= $this->escape($downtime->comment) ?>
|
|
||||||
<br>
|
|
||||||
<small>
|
|
||||||
<?php if ($downtime->is_flexible): ?>
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
|
|
||||||
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDuration($downtime->duration),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
|
|
||||||
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
|
|
||||||
$this->formatDateTime($downtime->scheduled_start),
|
|
||||||
$this->formatDateTime($downtime->scheduled_end),
|
|
||||||
$this->formatDuration($downtime->duration)
|
|
||||||
); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
|
|
||||||
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
|
|
||||||
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</small>
|
|
||||||
</td>
|
|
||||||
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
|
|
||||||
<td style="width: 2em" data-base-target="_self">
|
|
||||||
<?php
|
|
||||||
$delDowntimeForm = clone $delDowntimeForm;
|
|
||||||
$delDowntimeForm->populate(
|
|
||||||
array(
|
|
||||||
'downtime_id' => $downtime->id,
|
|
||||||
'downtime_is_service' => isset($downtime->service_description)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
echo $delDowntimeForm;
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<?php endif ?>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -1,64 +1,72 @@
|
||||||
<table class="action">
|
<td class="state-col state-<?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
||||||
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
|
||||||
<td class="state">
|
|
||||||
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
||||||
<strong><?= $this->translate('Ends'); ?></strong>
|
<strong><?= $this->translate('Ends'); ?></strong>
|
||||||
<br>
|
<p><?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?></p>
|
||||||
<?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||||
<br>
|
<p><?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?></p>
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<small>
|
<span class="comment-header">
|
||||||
|
<?php if ($isService): ?>
|
||||||
|
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
|
||||||
|
$this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name),
|
||||||
|
'monitoring/downtime/show',
|
||||||
|
array('downtime_id' => $downtime->id),
|
||||||
|
array(
|
||||||
|
'title' => sprintf(
|
||||||
|
$this->translate('Show detailed information for this downtime scheduled for service %s on host %s'),
|
||||||
|
$downtime->service_display_name,
|
||||||
|
$downtime->host_display_name
|
||||||
|
),
|
||||||
|
'class' => 'rowaction'
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= $this->icon('host', $this->translate('host')); ?> <?= $this->qlink(
|
||||||
|
$this->escape($downtime->host_display_name),
|
||||||
|
'monitoring/downtime/show',
|
||||||
|
array('downtime_id' => $downtime->id),
|
||||||
|
array(
|
||||||
|
'title' => sprintf(
|
||||||
|
$this->translate('Show detailed information for this downtime scheduled for host %s'),
|
||||||
|
$downtime->host_display_name
|
||||||
|
),
|
||||||
|
'class' => 'rowaction'
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<?= $this->translate('by') ?>
|
||||||
|
<?= $this->escape($downtime->author_name) ?>
|
||||||
|
|
||||||
|
<span class="pull-right">
|
||||||
<?php if ($downtime->is_flexible): ?>
|
<?php if ($downtime->is_flexible): ?>
|
||||||
|
<?= $this->icon('magic', $this->translate('This downtime is flexible')); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
<?php if ($downtime->is_in_effect): ?>
|
||||||
<?= sprintf(
|
<?= $this->icon('plug', $this->translate('This downtime is in effect')); ?>
|
||||||
$this->isService
|
|
||||||
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
|
|
||||||
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDuration($downtime->duration),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$this->isService
|
|
||||||
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
|
|
||||||
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
|
|
||||||
$this->formatDateTime($downtime->scheduled_start),
|
|
||||||
$this->formatDateTime($downtime->scheduled_end),
|
|
||||||
$this->formatDuration($downtime->duration)
|
|
||||||
); ?>
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php else: ?>
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||||
<?= sprintf(
|
<?php
|
||||||
$this->isService
|
$delDowntimeForm = clone $delDowntimeForm;
|
||||||
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
|
$delDowntimeForm->populate(
|
||||||
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
|
array(
|
||||||
$this->formatDate($downtime->start),
|
'downtime_id' => $downtime->id,
|
||||||
$this->formatTime($downtime->start),
|
'downtime_is_service' => isset($downtime->service_description)
|
||||||
$this->formatDate($downtime->end),
|
)
|
||||||
$this->formatTime($downtime->end)
|
);
|
||||||
); ?>
|
echo $delDowntimeForm;
|
||||||
<?php else: ?>
|
?>
|
||||||
<?= sprintf(
|
|
||||||
$this->isService
|
|
||||||
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
|
|
||||||
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
); ?>
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<?php if (isset ($displayComment) && $displayComment): ?>
|
||||||
|
<p class="comment-text">
|
||||||
|
<?= $this->escape($downtime->comment) ?>
|
||||||
|
</p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</small>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
|
@ -10,89 +10,17 @@ use Icinga\Module\Monitoring\Object\Service;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($downtime->objecttype === 'service') {
|
if ($downtime->objecttype === 'service') {
|
||||||
$isService = true;
|
$this->isService = true;
|
||||||
$stateText = Service::getStateText($downtime->service_state);
|
$this->stateName = Service::getStateText($downtime->service_state);
|
||||||
} else {
|
} else {
|
||||||
$isService = false;
|
$this->isService = false;
|
||||||
$stateText = Host::getStateText($downtime->host_state);
|
$this->stateName = Host::getStateText($downtime->host_state);
|
||||||
}
|
}
|
||||||
|
$this->downtime = $downtime;
|
||||||
|
$this->displayComment = false;
|
||||||
?>
|
?>
|
||||||
<tr class="state <?= $stateText . ($downtime->is_in_effect ? ' handled' : '') ?>">
|
<tr>
|
||||||
<td class="state">
|
<?= $this->render('partials/downtime/downtime-header.phtml') ?>
|
||||||
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
|
||||||
<strong><?= $this->translate('Ends') ?></strong>
|
|
||||||
<br>
|
|
||||||
<?= $this->timeUntil(
|
|
||||||
$downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact
|
|
||||||
) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<strong>
|
|
||||||
<?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts') ?>
|
|
||||||
</strong>
|
|
||||||
<br>
|
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
<td class="name oneline">
|
|
||||||
<?php if ($isService): ?>
|
|
||||||
<?= $this->icon('service', $this->translate('Service')) ?>
|
|
||||||
<?= $this->link()->service(
|
|
||||||
$downtime->service_description,
|
|
||||||
$downtime->service_display_name,
|
|
||||||
$downtime->host_name,
|
|
||||||
$downtime->host_display_name
|
|
||||||
) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= $this->icon('host', $this->translate('Host')) ?>
|
|
||||||
<?= $this->link()->host($downtime->host_name, $downtime->host_display_name) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<br>
|
|
||||||
<?php if ($downtime->is_flexible): ?>
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
|
|
||||||
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDuration($downtime->duration),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
|
|
||||||
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
|
|
||||||
$this->formatDateTime($downtime->scheduled_start),
|
|
||||||
$this->formatDateTime($downtime->scheduled_end),
|
|
||||||
$this->formatDuration($downtime->duration)
|
|
||||||
) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php if ($downtime->is_in_effect): ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
|
|
||||||
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
|
|
||||||
$this->formatDate($downtime->start),
|
|
||||||
$this->formatTime($downtime->start),
|
|
||||||
$this->formatDate($downtime->end),
|
|
||||||
$this->formatTime($downtime->end)
|
|
||||||
) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= sprintf(
|
|
||||||
$isService
|
|
||||||
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
|
|
||||||
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
|
|
||||||
$this->formatDate($downtime->scheduled_start),
|
|
||||||
$this->formatTime($downtime->scheduled_start),
|
|
||||||
$this->formatDate($downtime->scheduled_end),
|
|
||||||
$this->formatTime($downtime->scheduled_end)
|
|
||||||
) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue