icingaweb2/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml

86 lines
3.9 KiB
PHTML

<table class="action">
<tbody>
<?php $i = 0; foreach ($downtimes as $downtime):
if (++ $i > 5) {
continue;
} ?>
<tr class="state <?= $downtime->stateText ?>">
<td class="state">
<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) ?>
</td>
<td class="name oneline">
<?php if ($downtime->isService): ?>
<?= $this->icon('service', $this->translate('Service')) ?>
<strong><?= $downtime->host_name ?>: <?= $downtime->service_description ?></strong>
<?php else: ?>
<?= $this->icon('host', $this->translate('Host')) ?>
<strong><?= $downtime->host_name ?>.</strong>
<?php endif; ?>
<?php if ($downtime->is_flexible): ?>
<?php if ($downtime->is_in_effect): ?>
<?= sprintf(
$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 else: ?>
<?php if ($downtime->is_in_effect): ?>
<?= sprintf(
$this->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(
$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 ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p>
<?php if ($i > 5): ?>
<?= $this->qlink(
sprintf($this->translate('show all %d downtimes'), $i),
$listAllLink,
null,
array(
'icon' => $i > 5 ? 'down-open' : '',
'data-base-target' => "_next"
)
) ?>
<?php endif ?>
</p>