diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
commit | 8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch) | |
tree | 2492de6f1528dd44eaa169a5c1555026d9cb75ec /modules/monitoring/application/views/scripts/partials/object/host-header.phtml | |
parent | Initial commit. (diff) | |
download | icingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.tar.xz icingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.zip |
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | modules/monitoring/application/views/scripts/partials/object/host-header.phtml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml new file mode 100644 index 0000000..4de4a01 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml @@ -0,0 +1,51 @@ +<?php +use Icinga\Module\Monitoring\Object\Host; +use Icinga\Web\Url; + +/** @var Host $object */ + +$url = Url::fromRequest(); +$linkHostName = ! ($url->getPath() === 'monitoring/host/show' && $url->getParam('host') === $object->host_name); +?> +<table class="state-table host-detail-state"> + <tr> + <td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>"> + <div class="state-header"><?= Host::getStateText($object->host_state, true) ?></div> + <div class="state-meta"> + <?= $this->timeSince($object->host_last_state_change) ?> + <?php if ((int) $object->host_state > 0 && (int) $object->host_state_type === 0): ?> + <div><?= $this->translate('Soft', 'Soft state') ?> <?= $object->host_attempt ?></div> + <?php endif ?> + </div> + </td> + <td> + <?= $this->iconImage()->host($object) ?> + <?php + if ($linkHostName) { + echo '<a href="' . Url::fromPath('monitoring/host/show', array('host' => $object->host_name)) . '">'; + } + ?> + <span class="selectable"><strong><?= $this->escape($object->host_display_name) ?></strong></span> + <?php if ($object->host_display_name !== $object->host_name): ?> + <span class="selectable host-meta">(<?= $this->escape($object->host_name) ?>)</span> + <?php endif ?> + <?php + if ($linkHostName) { + echo '</a>'; + } + ?> + <?php if ($object->host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name): ?> + <div class="selectable host-meta"> + <?= $this->escape($this->translate('Alias', 'host') . ': ' . $object->host_alias) ?> + </div> + <?php endif ?> + <?= $this->hostFlags($object) ?> + <?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?> + <div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>"><?= $this->escape($object->host_address6) ?></div> + <?php endif ?> + <?php if ($object->host_address && $object->host_address !== $object->host_name): ?> + <div class="selectable host-meta" title="<?= $this->translate('IPv4 address') ?>"><?= $this->escape($object->host_address) ?></div> + <?php endif ?> + </td> + </tr> +</table> |