From 237f7f1e60128224a8d1374c15b1c6d8e9693a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Thu, 8 Aug 2013 16:33:42 +0200 Subject: [PATCH] Fix service compact view, remove dashboard.ini trash refs #4192 --- config/dashboard/dashboard.ini | 4 - .../controllers/ListController.php | 2 +- .../views/scripts/list/services-compact.phtml | 252 +++++++++++------- 3 files changed, 156 insertions(+), 102 deletions(-) diff --git a/config/dashboard/dashboard.ini b/config/dashboard/dashboard.ini index c6ae9a42c..e69de29bb 100644 --- a/config/dashboard/dashboard.ini +++ b/config/dashboard/dashboard.ini @@ -1,4 +0,0 @@ -[gdssdg] -title = "gdssdg" -[gdssdg.dsgdsg] -url = "dsdgs" \ No newline at end of file diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 38d53bf3f..9b3313e8f 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -196,7 +196,7 @@ class Monitoring_ListController extends ModuleActionController protected function handleFormatRequest($query) { - if ($this->compactView !== null && $this->_getParam("view", false) === "compact") { + if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) { $this->_helper->viewRenderer($this->compactView); } diff --git a/modules/monitoring/application/views/scripts/list/services-compact.phtml b/modules/monitoring/application/views/scripts/list/services-compact.phtml index 8f9b34560..93486257a 100644 --- a/modules/monitoring/application/views/scripts/list/services-compact.phtml +++ b/modules/monitoring/application/views/scripts/list/services-compact.phtml @@ -1,102 +1,160 @@ paginate(); -$count = $services->count(); -if (! $count) { - echo '- no object is matching this filter -'; - return; -} - -$services->paginate(); - -?> - - - - - - - -fetchAll() as $service): - -$icons = array(); -if ($service->service_acknowledged) { - $icons['ack.gif'] = 'Problem has been acknowledged'; -} - -if ($service->service_in_downtime) { - $icons['downtime.gif'] = 'Service is in a scheduled downtime'; -} - -if ($service->host_problems) { - $icons['server.png'] = 'This services host has a problem'; -} - -$state_classes = array($this->monitoringState($service, 'service')); -if ($service->service_handled || $service->service_acknowledged || ! empty($service->service_downtimes_with_info)) { - $state_classes[] = 'handled'; -} -if ($service->service_last_state_change > (time() - 600)) { - $state_classes[] = 'new'; -} -$state_title = date('Y-m-d H:i:s', $service->service_last_state_change); - -$params = array( - 'host' => $service->host_name, - 'service' => $service->service_description -); -if (isset($this->preserve['backend'])) { - $params['backend'] = $this->preserve['backend']; -} +$viewHelper = $this->getHelper('MonitoringState'); +$trimArea = $this->getHelper('Trim'); ?> - - - - - - + +
+ Sorry, no services found for this search +
+ + + + + Sort by formSelect( + 'sort', + $this->sort, + array('class' => 'autosubmit'), + array( + 'service_severity' => 'Severity', + 'service_last_state_change' => 'Last state change', + 'service_last_time_unknown' => 'Last UNKNOWN', + 'service_last_time_critical' => 'Last CRITICAL', + 'service_last_time_warning' => 'Last WARNING', + 'service_last_time_ok' => 'Last OK', + 'service_description' => 'Service', + ) + ) ?> + + + +paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?> + +
StateService
qlink( - $this->timeSince($service->service_last_state_change), - 'monitoring/show/history', - $params, - array('quote' => false) - ) ?> $alt) { - echo $this->img('img/classic/' . $icon, array( - 'class' => 'icon', - 'title' => $alt - )); -} -echo $this->qlink( - $service->host_name, - 'monitoring/show/host', - $params -) . ': ' . $this->qlink( - $service->service_description, - 'monitoring/show/service', - $params, - array('class' => 'row-action') -) ?>
+ + + + + + + + + + + fetchAll() as $service): ?> + + + + + + + + + + + + + + + + +
StatusServiceOutput
+
start(); ?> + service_icon_image) : ?> + + + end(); ?>
+
+
start(); ?> + service_handled && $service->service_state > 0): ?> + + + + + service_acknowledged && !$service->service_in_downtime): ?> + + + + + service_is_flapping): ?> + + + + + service_notifications_enabled): ?> + + + + + service_in_downtime): ?> + + + + + end(); ?>
+
+
+ qlink( + "".ucfirst($viewHelper->monitoringState($service, 'service'))."". + '
since '. + $this->timeSince($service->service_last_state_change), + 'monitoring/show/history', array( + 'host' => $service->host_name, + 'service' => $service->service_description + ), + array('quote' => false) + );?> + service_state_type == 0): ?> + + + + +
+
+ service_last_comment !== null): ?> + + + + + qlink( + "".$service->service_display_name."
", + 'monitoring/show/service', array( + 'host' => $service->host_name, + 'service' => $service->service_description + ), array( + 'class' => 'row-action', + 'quote' => false + ) + ); ?> + qlink( + $service->host_name, + 'monitoring/show/host', array( + 'host' => $service->host_name + ), array( + 'class' => 'row-action', + 'quote' => false + ) + ); ?> + + service_action_url != ""): ?> + Action + + + service_notes_url != ""): ?> + Notes + + service_state_type == 0): ?> + + + + +
+ escape(substr(strip_tags($service->service_output), 0, 10000)); ?> +
-getLimit(); -$count = $services->count(); - -if ($limit < $count) { - $more = sprintf( - $this->translate( - 'Showing %d of %s, click here for more', - $limit, - $count - ) - ); -} else { - $more = $this->translate( - sprintf( - 'Showing %d objects, click here for details', - $count - ) - ); -} -?>

qlink($more,$this->url()->without('page', 'limit', 'view')) ?>