Skip to content

Commit

Permalink
Add new tab to switch between host and service multi-selection
Browse files Browse the repository at this point in the history
refs #8565
  • Loading branch information
majentsch committed Apr 2, 2015
1 parent 5619ac9 commit 45a0982
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
20 changes: 19 additions & 1 deletion modules/monitoring/application/controllers/HostsController.php
Expand Up @@ -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(
Expand All @@ -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');
}

Expand Down
13 changes: 13 additions & 0 deletions modules/monitoring/application/controllers/ServicesController.php
Expand Up @@ -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(
Expand Down

0 comments on commit 45a0982

Please sign in to comment.