diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
commit | 3e02d5aff85babc3ffbfcf52313f2108e313aa23 (patch) | |
tree | b01f3923360c20a6a504aff42d45670c58af3ec5 /modules/monitoring/application/views/scripts/partials/service/objects-header.phtml | |
parent | Initial commit. (diff) | |
download | icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.tar.xz icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.zip |
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/monitoring/application/views/scripts/partials/service/objects-header.phtml')
-rw-r--r-- | modules/monitoring/application/views/scripts/partials/service/objects-header.phtml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml new file mode 100644 index 0000000..d342d87 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -0,0 +1,45 @@ +<?php +use Icinga\Module\Monitoring\Object\Host; +use Icinga\Module\Monitoring\Object\Service; + +if (! ($serviceCount = count($objects))): return; endif ?> +<table class="state-table service-detail-state"> +<tbody> +<?php foreach ($objects as $i => $service): /** @var Service $service */ + if ($i === 5) { + break; + } ?> + <tr> + <td class="state-col state-<?= Service::getStateText($service->service_state) ?><?= $service->service_handled ? ' handled' : '' ?>"> + <span class="sr-only"><?= Service::getStateText($service->service_state) ?></span> + <div class="state-meta"> + <?= $this->timeSince($service->service_last_state_change, $this->compact) ?> + </div> + </td> + <td> + <?= $this->link()->service( + $service->service_description, + $service->service_display_name, + $service->host_name, + $service->host_display_name + . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : '') + ) ?> + <?= $this->serviceFlags($service) ?> + </td> + </tr> +<?php endforeach ?> +</tbody> +</table> +<?php if ($serviceCount > 5): ?> +<div class="services-link"> + <?= $this->qlink( + sprintf($this->translate('List all %d services'), $serviceCount), + $this->url()->setPath('monitoring/list/services'), + null, + array( + 'data-base-target' => '_next', + 'icon' => 'forward' + ) + ) ?> +</div> +<?php endif ?> |