summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/list/services.phtml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:44:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:44:18 +0000
commit23be945fd2810ee82e3a23cbcd2352c9bda43d4f (patch)
treedd511b321f308264952cffb005a4288ea4e478e6 /application/views/scripts/list/services.phtml
parentInitial commit. (diff)
downloadicingaweb2-module-graphite-23be945fd2810ee82e3a23cbcd2352c9bda43d4f.tar.xz
icingaweb2-module-graphite-23be945fd2810ee82e3a23cbcd2352c9bda43d4f.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/views/scripts/list/services.phtml')
-rw-r--r--application/views/scripts/list/services.phtml77
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']
+ )
+ . '&#58; '
+ . $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>