From 5cdcf3624335acbeef4a1b2ffb47e0f02079eb6c Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 17 Sep 2014 09:46:42 +0200 Subject: [PATCH] monitoring: Add HostController's show action view script --- .../application/views/scripts/host/show.phtml | 27 +++++++++++++++++ .../show/components/hostservicesummary.phtml | 30 +++++++++---------- 2 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 modules/monitoring/application/views/scripts/host/show.phtml diff --git a/modules/monitoring/application/views/scripts/host/show.phtml b/modules/monitoring/application/views/scripts/host/show.phtml new file mode 100644 index 000000000..8023c1821 --- /dev/null +++ b/modules/monitoring/application/views/scripts/host/show.phtml @@ -0,0 +1,27 @@ +
+ render('show/components/header.phtml') ?> + render('show/components/hostservicesummary.phtml') ?> +
+
+ render('show/components/output.phtml') ?> + render('show/components/grapher.phtml') ?> + + + + render('show/components/acknowledgement.phtml') ?> + render('show/components/comments.phtml') ?> + render('show/components/notifications.phtml') ?> + render('show/components/downtime.phtml') ?> + render('show/components/flapping.phtml') ?> + render('show/components/perfdata.phtml') ?> + render('show/components/checksource.phtml') ?> + render('show/components/actions.phtml') ?> + render('show/components/command.phtml') ?> + render('show/components/hostgroups.phtml') ?> + render('show/components/contacts.phtml') ?> + render('show/components/checkstatistics.phtml') ?> + render('show/components/customvars.phtml') ?> + render('show/components/flags.phtml') ?> + +
+
diff --git a/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml b/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml index ffa3c806e..0390bcffc 100644 --- a/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml +++ b/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml @@ -6,10 +6,10 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); ?>

compact ? ' data-base-target="col1"' : '' ?>> -qlink(sprintf($this->translate('%s configured services:'), $this->stats->services_total), $selfUrl) ?> -stats->services_ok > 0): ?> +qlink(sprintf($this->translate('%s configured services:'), $object->stats->services_total), $selfUrl) ?> +stats->services_ok > 0): ?> qlink( - $this->stats->services_ok, + $object->stats->services_ok, $selfUrl, array('service_state' => 0), array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('ok')))) @@ -19,12 +19,12 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) { $pre = 'services_' . $state; - if ($this->stats->$pre) { + if ($object->stats->$pre) { $handled = $pre . '_handled'; $unhandled = $pre . '_unhandled'; $paramsHandled = array('service_state' => $stateId, 'service_handled' => 1); $paramsUnhandled = array('service_state' => $stateId, 'service_handled' => 0); - if ($this->stats->$unhandled) { + if ($object->stats->$unhandled) { $compareUrl = $selfUrl->with($paramsUnhandled)->getRelativeUrl(); } else { $compareUrl = $selfUrl->with($paramsHandled)->getRelativeUrl(); @@ -35,34 +35,34 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ } else { $active = ''; } - - echo ''; - if ($this->stats->$unhandled) { + + echo ''; + if ($object->stats->$unhandled) { echo $this->qlink( - $this->stats->$unhandled, + $object->stats->$unhandled, $selfUrl, $paramsUnhandled, array('title' => sprintf($this->translate('Unhandled services with state %s'), strtoupper($this->translate($state)))) ); } - if ($this->stats->$handled) { + if ($object->stats->$handled) { if ($selfUrl->with($paramsHandled)->getRelativeUrl() === $currentUrl) { $active = ' active'; } else { $active = ''; } - if ($this->stats->$unhandled) { + if ($object->stats->$unhandled) { echo ''; } echo $this->qlink( - $this->stats->$handled, + $object->stats->$handled, $selfUrl, $paramsHandled, array('title' => sprintf($this->translate('Handled services with state %s'), strtoupper($this->translate($state)))) ); - if ($this->stats->$unhandled) { + if ($object->stats->$unhandled) { echo "\n"; } } @@ -71,9 +71,9 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ } ?> -stats->services_pending): ?> +stats->services_pending): ?> qlink( - $this->stats->services_pending, + $object->stats->services_pending, $selfUrl, array('service_state' => 99), array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending'))))