Fix suburls in grids not being recognized

This commit is contained in:
Jannis Moßhammer 2013-10-21 17:42:29 +02:00
parent b553b4b61e
commit cc5fa0a7b4
5 changed files with 8 additions and 5 deletions

View File

@ -93,7 +93,7 @@ $viewHelper = $this->getHelper('MonitoringState');
<div> <div>
<?php if ($host->host_unhandled_service_count): ?> <?php if ($host->host_unhandled_service_count): ?>
<span class="badge pull-right" title="<?= $host->host_unhandled_service_count; ?> Service Problems on Host"> <span class="badge pull-right" title="<?= $host->host_unhandled_service_count; ?> Service Problems on Host">
<a href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name, 'service_problems' => 1)); ?>"> <a data-icinga-target="detail" href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name, 'service_problem' => 1)); ?>">
<?= $host->host_unhandled_service_count; ?> <?= $host->host_unhandled_service_count; ?>
</a> </a>
</span> </span>

View File

@ -105,7 +105,7 @@ class HostStatus extends DataView
public function getFilterColumns() public function getFilterColumns()
{ {
return array('hostgroups', 'servicegroups', 'service_problems'); return array('hostgroups', 'servicegroups', 'service_problem');
} }
public function isValidFilterTarget($column) public function isValidFilterTarget($column)

View File

@ -72,6 +72,7 @@ class ServiceStatus extends DataView
'host_modified_host_attributes', 'host_modified_host_attributes',
'service', 'service',
'service_hard_state', 'service_hard_state',
'service_problem',
'service_perfdata', 'service_perfdata',
'service_active_checks_enabled', 'service_active_checks_enabled',
'service_active_checks_enabled_changed', 'service_active_checks_enabled_changed',
@ -130,7 +131,7 @@ class ServiceStatus extends DataView
public function getFilterColumns() public function getFilterColumns()
{ {
return array('hostgroups', 'servicegroups', 'service_problems'); return array('hostgroups', 'servicegroups', 'service_problem');
} }
public function isValidFilterTarget($column) public function isValidFilterTarget($column)

View File

@ -291,11 +291,11 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe
return true; return true;
} }
var url = URI($(target).attr('href')); var url = URI($(target).attr('href'));
var explicitTarget = $(target).attr('data-icinga-target'); var explicitTarget = $(target).attr('data-icinga-target');
var isHash = ('#' + url.fragment() === url.href()); var isHash = ('#' + url.fragment() === url.href());
if (isHash) { if (isHash) {
explicitTarget = this.containerType === CONTAINER_TYPES.MAIN ? 'main' : 'detail'; explicitTarget = this.containerType === CONTAINER_TYPES.MAIN ? 'main' : 'detail';
} }
if (explicitTarget) { if (explicitTarget) {

View File

@ -210,8 +210,10 @@ function(Container, $, logger, URI, tpl, urlMgr, Selectable, TableMultiSelection
// don't open the link // don't open the link
return; return;
} }
var url = URI($('a', this).attr('href')); var url = URI($('a', this).attr('href'));
if (targetEl.tagName.toLowerCase() === 'a') {
url = URI($(targetEl).attr('href'));
}
var segments = url.segment(); var segments = url.segment();
if (selection.size() === 0) { if (selection.size() === 0) {
// don't open anything // don't open anything