From cc5fa0a7b4d3de0110fe674268c7f553fedca41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Mon, 21 Oct 2013 17:42:29 +0200 Subject: [PATCH] Fix suburls in grids not being recognized --- modules/monitoring/application/views/scripts/list/hosts.phtml | 2 +- modules/monitoring/library/Monitoring/DataView/HostStatus.php | 2 +- .../monitoring/library/Monitoring/DataView/ServiceStatus.php | 3 ++- public/js/icinga/components/container.js | 2 +- public/js/icinga/components/mainDetailGrid.js | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 6c31cd963..2cb65a17b 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -93,7 +93,7 @@ $viewHelper = $this->getHelper('MonitoringState');
host_unhandled_service_count): ?> - + host_unhandled_service_count; ?> diff --git a/modules/monitoring/library/Monitoring/DataView/HostStatus.php b/modules/monitoring/library/Monitoring/DataView/HostStatus.php index 73bc09dc2..2bb70c9e8 100644 --- a/modules/monitoring/library/Monitoring/DataView/HostStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/HostStatus.php @@ -105,7 +105,7 @@ class HostStatus extends DataView public function getFilterColumns() { - return array('hostgroups', 'servicegroups', 'service_problems'); + return array('hostgroups', 'servicegroups', 'service_problem'); } public function isValidFilterTarget($column) diff --git a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php index 0a42434ac..8a008b2c1 100644 --- a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php @@ -72,6 +72,7 @@ class ServiceStatus extends DataView 'host_modified_host_attributes', 'service', 'service_hard_state', + 'service_problem', 'service_perfdata', 'service_active_checks_enabled', 'service_active_checks_enabled_changed', @@ -130,7 +131,7 @@ class ServiceStatus extends DataView public function getFilterColumns() { - return array('hostgroups', 'servicegroups', 'service_problems'); + return array('hostgroups', 'servicegroups', 'service_problem'); } public function isValidFilterTarget($column) diff --git a/public/js/icinga/components/container.js b/public/js/icinga/components/container.js index efa016e93..f38c70a28 100644 --- a/public/js/icinga/components/container.js +++ b/public/js/icinga/components/container.js @@ -291,11 +291,11 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe return true; } var url = URI($(target).attr('href')); + var explicitTarget = $(target).attr('data-icinga-target'); var isHash = ('#' + url.fragment() === url.href()); if (isHash) { - explicitTarget = this.containerType === CONTAINER_TYPES.MAIN ? 'main' : 'detail'; } if (explicitTarget) { diff --git a/public/js/icinga/components/mainDetailGrid.js b/public/js/icinga/components/mainDetailGrid.js index b2e53a5dc..a75845ecf 100644 --- a/public/js/icinga/components/mainDetailGrid.js +++ b/public/js/icinga/components/mainDetailGrid.js @@ -210,8 +210,10 @@ function(Container, $, logger, URI, tpl, urlMgr, Selectable, TableMultiSelection // don't open the link return; } - var url = URI($('a', this).attr('href')); + if (targetEl.tagName.toLowerCase() === 'a') { + url = URI($(targetEl).attr('href')); + } var segments = url.segment(); if (selection.size() === 0) { // don't open anything