From 09c0ebcacdc0e28f13abfb571166398874201949 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 16 Jun 2015 02:36:53 +0200 Subject: [PATCH] list/services: flip host/service for readability Re-allow table.action to manually choose row action link if it should not be the first one. This existed once but got lost. --- .../views/scripts/list/services.phtml | 44 ++++++++++--------- public/js/icinga/events.js | 7 ++- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index bad77424c..e181216b1 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -6,15 +6,15 @@ $selfUrl = 'monitoring/list/services'; if (! $this->compact): ?>
- tabs; ?> + tabs ?>
- render('list/components/selectioninfo.phtml'); ?> - render('list/components/servicesummary.phtml'); ?> + render('list/components/selectioninfo.phtml') ?> + render('list/components/servicesummary.phtml') ?>
- sortBox; ?> - limiter; ?> - paginator; ?> - filterEditor; ?> + sortBox ?> + limiter ?> + paginator ?> + filterEditor ?>
@@ -48,7 +48,7 @@ if (count($services) === 0) { ?> - service_state, true); ?> + service_state, true) ?> service_state !== 99): ?>
timeSince($service->service_last_state_change, $this->compact) ?> @@ -62,23 +62,27 @@ if (count($services) === 0) { iconImage()->service($service) ?> serviceFlags($service)) ?> - qlink( - $service->service_display_name, - $serviceLink, - null, - array('title' => sprintf( - $this->translate('Show detailed information for service %s on host %s'), - $service->service_display_name, - $service->host_display_name - )) - ); ?>showHost): ?> on qlink( +showHost): ?>qlink( $service->host_display_name . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), $hostLink, null, array('title' => sprintf($this->translate('Show detailed information for host %s'), $service->host_display_name)) - ); ?>
+ ) ?>: +qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) +) ?>
perfdata($service->service_perfdata, true, 8) ?>
-

escape($this->ellipsis($service->service_output, 10000)); ?>

+

escape($this->ellipsis($service->service_output, 10000)) ?>

addColumns as $col): ?> escape($service->$col) ?> diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 84354c960..6f226407b 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -42,10 +42,15 @@ // Set first links href in a action table tr as row href: $('table.action tr', el).each(function(idx, el) { - var $a = $('a[href]', el).first(); + var $a = $('a[href].rowaction', el).first(); if ($a.length) { // TODO: Find out whether we leak memory on IE with this: $(el).attr('href', $a.attr('href')); + return; + } + $a = $('a[href]', el).first(); + if ($a.length) { + $(el).attr('href', $a.attr('href')); } });