icingaweb2/modules/monitoring/application/views/scripts/show/components/header.phtml

47 lines
1.9 KiB
PHTML

<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$isService = $object->getType() === $object::TYPE_SERVICE;
?>
<?php if (! $this->compact): ?>
<?= $tabs ?>
<?php endif ?>
<table class="objectstate">
<tr class="state <?= Host::getStateText($object->host_state); ?><?= $object->host_handled ? ' handled' : '' ?>">
<td class="state"<?= $isService ? '' : ' rowspan="2"' ?>>
<strong><?= Host::getStateText($object->host_state, true); ?></strong><br>
<?= $this->prefixedTimeSince($object->host_last_state_change, true) ?>
</td>
<td>
<b><?= $this->escape($object->host_display_name) ?></b>
<?php if ($object->host_display_name !== $object->host_name): ?>
<small>(<?= $this->escape($object->host_name) ?>)</small>
<?php endif ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
<br>
<?= $this->escape($object->host_address) ?>
<?php endif ?>
</td>
</tr>
<?php if ($isService): ?>
<tr class="state <?= Service::getStateText($object->service_state); ?><?= $object->service_handled ? ' handled' : '' ?>">
<td class="state">
<strong><?= Service::getStateText($object->service_state, true); ?></strong><br>
<?= $this->prefixedTimeSince($object->service_last_state_change, true) ?>
</td>
<td>
<b><?= $this->translate('Service') ?>: <?= $this->escape($object->service_display_name) ?></b>
<?php if ($object->service_display_name !== $object->service_description): ?>
<small>(<?= $this->escape($object->service_description) ?>)</small>
<?php endif ?>
<?= $this->render('show/components/statusIcons.phtml') ?>
</td>
</tr>
<?php endif ?>
</table>