diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 3c59f4643d..632ca69ec8 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -25,9 +25,14 @@ class Monitoring_HostsController extends Controller public function init() { + // Support switching from service-view using the host and service selection. The filter would error + // on any occurrence of a filter based on service. + $filterString = preg_replace('/(service=[^)&]*)/', '', (string)$this->params); + $hostList = new HostList($this->backend); - $hostList->setFilter(Filter::fromQueryString((string) $this->params)); + $hostList->setFilter(Filter::fromQueryString($filterString)); $this->hostList = $hostList; + $this->getTabs()->add( 'show', array( @@ -40,6 +45,19 @@ public function init() 'icon' => 'host' ) )->activate('show'); + + $this->getTabs()->add( + 'services', + array( + 'title' => sprintf( + $this->translate('Show summarized information for related services') + ), + 'label' => $this->translate('Services'), + 'url' => Url::fromPath('monitoring/services/show')->setParams(Url::fromRequest()->getParams()), + 'icon' => 'services' + ) + )->activate('show'); + $this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/hosts'); } diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index e7199ed267..91da11968b 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -32,6 +32,19 @@ public function init() $serviceList->setFilter(Filter::fromQueryString((string) $this->params->without('service_problem', 'service_handled'))); $this->serviceList = $serviceList; $this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/services'); + + $this->getTabs()->add( + 'hosts', + array( + 'title' => sprintf( + $this->translate('Show summarized information for hosts') + ), + 'label' => $this->translate('Hosts'), + 'url' => Url::fromPath('monitoring/hosts/show')->setParams(Url::fromRequest()->getParams()), + 'icon' => 'host' + ) + )->activate('show'); + $this->getTabs()->add( 'show', array(