Add new tab to switch between host and service multi-selection

refs #8565
This commit is contained in:
Matthias Jentsch 2015-04-02 16:44:05 +02:00
parent 5619ac960c
commit 45a0982beb
2 changed files with 32 additions and 1 deletions

View File

@ -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 @@ class Monitoring_HostsController extends Controller
'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');
}

View File

@ -32,6 +32,19 @@ class Monitoring_ServicesController extends Controller
$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(