diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index 40ce005ee..530db3c66 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -18,21 +18,23 @@ class SearchController extends ActionController { public function indexAction() { + $this->setAutorefreshInterval(10); $search = $this->_request->getParam('q'); $dashboard = Widget::create('dashboard')->createPane('Search'); $pane = $dashboard->getPane('Search'); - $pane->addComponent('Hosts', Url::fromPath('monitoring/list/hosts', array( + $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', Url::fromPath('monitoring/list/services', array( - 'service_description' => '*' . $search . '*', + $pane->addComponent('Services' . $suffix, Url::fromPath('monitoring/list/services', array( + 'service_description' => $search . '*', 'sort' => 'service_severity', 'limit' => 10, ))); - $pane->addComponent('Hostgroups', Url::fromPath('monitoring/list/hostgroups', array( - 'hostgroup' => '*' . $search . '*', + $pane->addComponent('Hostgroups' . $suffix, Url::fromPath('monitoring/list/hostgroups', array( + 'hostgroup' => $search . '*', 'limit' => 10, ))); $dashboard->activate('Search');