diff --git a/application/views/scripts/list/hosts.phtml b/application/views/scripts/list/hosts.phtml index d012cbd..7e31688 100644 --- a/application/views/scripts/list/hosts.phtml +++ b/application/views/scripts/list/hosts.phtml @@ -4,6 +4,7 @@ use Icinga\Module\Graphite\EmbedGraphs; use Icinga\Web\Url; /** @var \Icinga\Web\View $this */ +/** @var \Icinga\Web\Widget\FilterEditor $filterEditor */ /** @var \Icinga\Module\Monitoring\DataView\DataView $hosts */ if (! $compact): ?> @@ -18,30 +19,37 @@ if (! $compact): ?>
-hasResult()): ?> -

-
- -peekAhead($compact) as $host): ?> -

qlink( - $host->host_name === $host->host_display_name - ? $host->host_display_name - : $host->host_display_name . ' (' . $this->escape($host->host_name) . ')', - Url::fromPath('monitoring/host/show', ['host' => $host->host_name]) - ) ?>

- host_name) ?> - -hasMore()): ?> - - +getFilter()->isEmpty()) { + echo '

' . $this->escape($this->translate('Please specify a filter')) . '

'; +} elseif ($hosts->hasResult()) { + foreach ($hosts->peekAhead($compact) as $host) { + echo '

' + . $this->qlink( + $host->host_name === $host->host_display_name + ? $host->host_display_name + : $host->host_display_name . ' (' . $this->escape($host->host_name) . ')', + Url::fromPath('monitoring/host/show', ['host' => $host->host_name]) + ) + . '

'; + echo EmbedGraphs::host($host->host_name); + } + + if ($hosts->hasMore()) { + echo ''; + } +} else { + echo '

' . $this->escape(mt('monitoring', 'No hosts found matching the filter.')) . '

'; +} +?> diff --git a/application/views/scripts/list/services.phtml b/application/views/scripts/list/services.phtml index cced3bc..ed7ba95 100644 --- a/application/views/scripts/list/services.phtml +++ b/application/views/scripts/list/services.phtml @@ -4,6 +4,7 @@ use Icinga\Module\Graphite\EmbedGraphs; use Icinga\Web\Url; /** @var \Icinga\Web\View $this */ +/** @var \Icinga\Web\Widget\FilterEditor $filterEditor */ /** @var \Icinga\Module\Monitoring\DataView\DataView $services */ if (! $compact): ?> @@ -18,38 +19,47 @@ if (! $compact): ?>
-hasResult()): ?> -

-
- -peekAhead($compact) as $service): ?> -

qlink( - $service->host_name === $service->host_display_name - ? $service->host_display_name - : $service->host_display_name . ' (' . $this->escape($service->host_name) . ')', - Url::fromPath('monitoring/host/show', ['host' => $service->host_name]) - ) ?>: qlink( - $service->service_description === $service->service_display_name - ? $service->service_display_name - : $service->service_display_name . ' (' . $this->escape($service->service_description) . ')', - Url::fromPath('monitoring/service/show', [ - 'host' => $service->host_name, - 'service' => $service->service_description - ]) - ) ?>

- host_name, $service->service_description) ?> - -hasMore()): ?> - - +getFilter()->isEmpty()) { + echo '

' . $this->escape($this->translate('Please specify a filter')) . '

'; +} elseif ($services->hasResult()) { + foreach ($services->peekAhead($compact) as $service) { + echo '

' + . $this->qlink( + $service->host_name === $service->host_display_name + ? $service->host_display_name + : $service->host_display_name . ' (' . $this->escape($service->host_name) . ')', + Url::fromPath('monitoring/host/show', ['host' => $service->host_name]) + ) + . ': ' + . $this->qlink( + $service->service_description === $service->service_display_name + ? $service->service_display_name + : $service->service_display_name . ' (' . $this->escape($service->service_description) . ')', + Url::fromPath('monitoring/service/show', [ + 'host' => $service->host_name, + 'service' => $service->service_description + ]) + ) + . '

'; + echo EmbedGraphs::service($service->host_name, $service->service_description); + } + + if ($services->hasMore()) { + echo ''; + } +} else { + echo '

' . $this->escape(mt('monitoring', 'No services found matching the filter.')) . '

'; +} +?>