setAutorefreshInterval(10); $search = $this->_request->getParam('q'); if (! $search) { $this->view->hint = $this->translate('Ready to search, waiting for your input'); return; } $dashboard = Widget::create('dashboard')->createPane('Search'); $pane = $dashboard->getPane('Search'); $suffix = strlen($search) ? ': ' . rtrim($search, '*') . '*' : ''; $pane->addComponent('Hosts' . $suffix, Url::fromPath('monitoring/list/hosts', array( 'host_name' => $search . '*', 'sort' => 'host_severity', 'limit' => 10, ))); $pane->addComponent('Services' . $suffix, Url::fromPath('monitoring/list/services', array( 'service_description' => $search . '*', 'sort' => 'service_severity', 'limit' => 10, ))); $pane->addComponent('Hostgroups' . $suffix, Url::fromPath('monitoring/list/hostgroups', array( 'hostgroup' => $search . '*', 'limit' => 10, ))); $pane->addComponent('Servicegroups' . $suffix, Url::fromPath('monitoring/list/servicegroups', array( 'servicegroup' => $search . '*', 'limit' => 10, ))); $dashboard->activate('Search'); $this->view->dashboard = $dashboard; $this->view->tabs = $dashboard->getTabs(); } } // @codeCoverageIgnoreEnd