diff --git a/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml b/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml index 3fe11bcca..058620dc4 100644 --- a/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml +++ b/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml @@ -1,164 +1,89 @@ baseFilter = isset($this->baseFilter) ? $this->baseFilter : null; - -// don't fetch rows until they are actually needed to improve dashlet performance -if (!$stats instanceof stdClass) { +// Don't fetch rows until they are actually needed to improve dashlet performance +if (! $stats instanceof stdClass) { $stats = $stats->fetchRow(); } - -$selfUrl = 'monitoring/list/hosts'; -$currentUrl = Url::fromRequest()->getRelativeUrl(); ?> - = $this->qlink( - sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total), - $selfUrl, - null, - array('title' => sprintf( - $this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total), - $stats->hosts_total - )) - ) ?>: - - hosts_up): ?> - - = $this->qlink( - $stats->hosts_up, - Url::urlAddFilterOptional( - $selfUrl, - Filter::where('host_state', 0), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state UP', - 'List %u hosts which are currently in state UP', - $stats->hosts_up - ), - $stats->hosts_up - ) - ) - ); ?> - - - - hosts_down_unhandled): ?> - - = $this->qlink( - $stats->hosts_down_unhandled, - Url::urlAddFilterOptional( - $selfUrl, - Filter::matchAll(Filter::where('host_state', 1), Filter::where('host_unhandled', 1)), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state DOWN', - 'List %u hosts which are currently in state DOWN', - $stats->hosts_down_unhandled - ), - $stats->hosts_down_unhandled - )) - ); ?> - - - hosts_down_handled): ?> - - = $this->qlink( - $stats->hosts_down_handled, - Url::urlAddFilterOptional( - $selfUrl, - Filter::matchAll(Filter::where('host_state', 1), Filter::where('host_unhandled', 0)), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state DOWN (Acknowledged)', - 'List %u hosts which are currently in state DOWN (Acknowledged)', - $stats->hosts_down_handled - ), - $stats->hosts_down_handled - )) - ); ?> - - - - hosts_down): ?> - - - - hosts_unreachable_unhandled): ?> - - = $this->qlink( - $stats->hosts_unreachable_unhandled, - Url::urlAddFilterOptional( - $selfUrl, - Filter::matchAll(Filter::where('host_state', 2), Filter::where('host_unhandled', 1)), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state UNREACHABLE', - 'List %u hosts which are currently in state UNREACHABLE', - $stats->hosts_unreachable_unhandled - ), - $stats->hosts_unreachable_unhandled - )) - ); ?> - - - hosts_unreachable_handled > 0): ?> - - = $this->qlink( - $stats->hosts_unreachable_handled, - Url::urlAddFilterOptional( - $selfUrl, - Filter::matchAll(Filter::where('host_state', 2), Filter::where('host_unhandled', 0)), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state UNREACHABLE (Acknowledged)', - 'List %u hosts which are currently in state UNREACHABLE (Acknowledged)', - $stats->hosts_unreachable_handled - ), - $stats->hosts_unreachable_handled - )) - ); ?> - - - - hosts_unreachable): ?> - - - - hosts_pending): ?> - - = $this->qlink( - $stats->hosts_pending, - Url::urlAddFilterOptional( - $selfUrl, - Filter::where('host_state', 99), - $this->baseFilter - ), - null, - array('title' => sprintf( - $this->translatePlural( - 'List %u host that is currently in state PENDING', - 'List %u hosts which are currently in state PENDING', - $stats->hosts_pending - ), - $stats->hosts_pending - )) - ); ?> - - - +