summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/list/hosts.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/scripts/list/hosts.phtml')
-rw-r--r--application/views/scripts/list/hosts.phtml67
1 files changed, 67 insertions, 0 deletions
diff --git a/application/views/scripts/list/hosts.phtml b/application/views/scripts/list/hosts.phtml
new file mode 100644
index 0000000..ce0e37c
--- /dev/null
+++ b/application/views/scripts/list/hosts.phtml
@@ -0,0 +1,67 @@
+<?php
+
+use Icinga\Module\Graphite\Web\Widget\Graphs\Host;
+use Icinga\Web\Url;
+
+/** @var \Icinga\Web\View $this */
+/** @var \Icinga\Web\Widget\FilterEditor $filterEditor */
+/** @var \Icinga\Module\Monitoring\Object\Host[] $hosts */
+/** @var bool $hasMoreHosts */
+/** @var \Icinga\Web\Url $baseUrl */
+
+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($hosts)) {
+ echo '<div class="graphite-graph-color-registry"></div>';
+ echo '<div class="grid">';
+ foreach ($hosts as $host) {
+ $hostGraphs = (string) (new Host($host))->setPreloadDummy()->handleRequest();
+
+ if ($hostGraphs !== '') {
+ echo '<div class="grid-item">'
+ . '<h2>'
+ . $this->qlink(
+ $host->host_name === $host->host_display_name
+ ? $host->host_display_name
+ : $host->host_display_name . ' (' . $this->escape($host->host_name) . ')',
+ $baseUrl->with(['host' => $host->host_name]),
+ null,
+ ['data-base-target' => '_next']
+ )
+ . '</h2>'
+ . $hostGraphs
+ . '</div>';
+ }
+ }
+
+ if ($hasMoreHosts) {
+ 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 hosts found matching the filter.')) . '</p>';
+}
+?>
+</div>