diff options
Diffstat (limited to 'application/views/scripts/list/services.phtml')
-rw-r--r-- | application/views/scripts/list/services.phtml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/application/views/scripts/list/services.phtml b/application/views/scripts/list/services.phtml new file mode 100644 index 0000000..90ca03c --- /dev/null +++ b/application/views/scripts/list/services.phtml @@ -0,0 +1,77 @@ +<?php + +use Icinga\Module\Graphite\Web\Widget\Graphs\Service; +use Icinga\Web\Url; + +/** @var \Icinga\Web\View $this */ +/** @var \Icinga\Web\Widget\FilterEditor $filterEditor */ +/** @var \Icinga\Module\Monitoring\Object\Service[] $services */ +/** @var bool $hasMoreServices */ +/** @var \Icinga\Web\Url $hostBaseUrl */ +/** @var \Icinga\Web\Url $serviceBaseUrl */ + +if (! $compact): ?> +<div class="controls"> + <?= $tabs ?> + <?= $paginator ?> + <div class="sort-controls-container"> + <?= $limiter ?> + <?= $sortBox ?> + </div> + <?= $filterEditor ?> + <?= $timeRangePicker ?> +</div> +<?php endif ?> +<div class="content"> +<?php +if (! empty($services)) { + echo '<div class="graphite-graph-color-registry"></div>'; + echo '<div class="grid">'; + foreach ($services as $service) { + echo '<div class="grid-item">' + . '<h2>' + . $this->qlink( + $service->host_name === $service->host_display_name + ? $service->host_display_name + : $service->host_display_name . ' (' . $this->escape($service->host_name) . ')', + $hostBaseUrl->with(['host' => $service->host_name]), + null, + ['data-base-target' => '_next'] + ) + . ': ' + . $this->qlink( + $service->service_description === $service->service_display_name + ? $service->service_display_name + : $service->service_display_name . ' (' . $this->escape($service->service_description) . ')', + $serviceBaseUrl->with([ + 'host' => $service->host_name, + 'service' => $service->service_description + ]), + null, + ['data-base-target' => '_next'] + ) + . '</h2>'; + + echo (new Service($service))->setPreloadDummy()->handleRequest(); + echo '</div>'; + } + + if ($hasMoreServices) { + echo '<div class="action-links">' + . $this->qlink( + mt('monitoring', 'Show More'), + $this->url()->without(array('view', 'limit')), + null, + [ + 'class' => 'action-link', + 'data-base-target' => '_next' + ] + ) + . '</div>'; + } + echo '</div>'; +} else { + echo '<p>' . $this->escape(mt('monitoring', 'No services found matching the filter.')) . '</p>'; +} +?> +</div> |