From 043688e5142144245669800efcfba19d7d7a2563 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 15 Aug 2014 17:03:03 +0200 Subject: [PATCH] Make event history view more fancier refs #6637 --- .../views/scripts/list/eventhistory.phtml | 212 +++++++++--------- 1 file changed, 102 insertions(+), 110 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index 55257bae6..c3c40860e 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -1,122 +1,114 @@ - -compact): ?> -
- tabs->render($this); ?> -
- translate('Sort by') ?> sortControl->render($this); ?> -
- paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> -
- +compact): ?> +
+ tabs->render($this); ?> +
+ translate('Sort by'); ?> sortControl->render($this); ?> +
+ paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> +
+
-translate('No entries found') ?> + translate('No history events matching the filter') ?>
- - type) { - case 'notify': - $icon = 'notification'; - $title = 'Notification'; - $msg = $event->output; - break; - case 'comment': - $icon = 'comment'; - $title = 'Comment'; - $msg = $event->output; - break; - case 'ack': - $icon = 'acknowledgement'; - $title = 'Acknowledgement'; - $msg = $event->output; - break; - case 'dt_comment': - $icon = 'in-downtime'; - $title = 'In Downtime'; - $msg = $event->output; - break; - case 'flapping': - $icon = 'flapping'; - $title = 'Flapping'; - $msg = $event->output; - break; - case 'hard_state': - $icon = '{{HARDSTATE_ICON}}'; - $title = 'Hard State'; - $msg = $event->output . '
Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Hard)'; - $class = 'border-status-' . ( - $isService ? - strtolower($this->util()->getServiceStateName($event->state)) : - strtolower($this->util()->getHostStateName($event->state)) - ); - break; - case 'soft_state': - $icon = '{{SOFTSTATE_ICON}}'; - $title = 'Soft State'; - $msg = $event->output . '
Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Soft)'; - $class = 'border-status-' . ( - $isService ? - strtolower($this->util()->getServiceStateName($event->state)) : - strtolower($this->util()->getHostStateName($event->state)) - ); - break; - case 'dt_start': - $icon = 'downtime-start'; - $title = 'Downtime Start'; - $msg = $event->output; - break; - case 'dt_end': - $icon = 'downtime-end'; - $title = 'Downtime End'; - $msg = $event->output; - break; - } - ?> - - - - - + service); + switch ($event->type) { + case 'notify': + $icon = 'notification'; + $title = $this->translate('Notification'); + $msg = $event->output; + break; + case 'comment': + $icon = 'comment'; + $title = $this->translate('Comment'); + $msg = $event->output; + break; + case 'ack': + $icon = 'acknowledgement'; + $title = $this->translate('Acknowledgement'); + $msg = $event->output; + break; + case 'dt_comment': + $icon = 'in_downtime'; + $title = $this->translate('In Downtime'); + $msg = $event->output; + break; + case 'flapping': + $icon = 'flapping'; + $title = $this->translate('Flapping'); + $msg = $event->output; + break; + case 'hard_state': + $icon = $isService ? 'service' : 'host'; + $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $event->output; + $stateName = ( + $isService + ? strtolower($this->util()->getServiceStateName($event->state)) + : strtolower($this->util()->getHostStateName($event->state)) + ); + $title = strtoupper($stateName); // TODO: Should be translatable! + break; + case 'soft_state': + $icon = 'softstate'; + $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $event->output; + $stateName = ( + $isService + ? strtolower($this->util()->getServiceStateName($event->state)) + : strtolower($this->util()->getHostStateName($event->state)) + ); + $title = strtoupper($stateName); // TODO: Should be translatable! + break; + case 'dt_start': + $icon = 'downtime_start'; + $title = $this->translate('Downtime Start'); + $msg = $event->output; + break; + case 'dt_end': + $icon = 'downtime_end'; + $title = $this->translate('Downtime End'); + $msg = $event->output; + break; + } + ?> + + + + +
"> - timestamp); ?> - - service)): ?> - - service ?> - - - on host ?> - - - - - host ?> - - -
-
- - -
-
+ escape($title); ?> +
+ timestamp); ?> +
+ + + service; ?> + + + translate('on') . ' ' . $event->host; ?> + + + + host; ?> + + +
+
+ icon($icon . '.png', $title); ?> +
+
- -