From 635cdcbbc5451a76710b2b7977e1c9a7b0df6dfa Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 4 Mar 2014 13:25:58 +0000 Subject: [PATCH] autorefresh even for search results, nicer headers --- application/controllers/SearchController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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');