mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 10:57:40 +02:00
autorefresh even for search results, nicer headers
This commit is contained in:
parent
915a024030
commit
635cdcbbc5
@ -18,21 +18,23 @@ class SearchController extends ActionController
|
|||||||
{
|
{
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
$this->setAutorefreshInterval(10);
|
||||||
$search = $this->_request->getParam('q');
|
$search = $this->_request->getParam('q');
|
||||||
$dashboard = Widget::create('dashboard')->createPane('Search');
|
$dashboard = Widget::create('dashboard')->createPane('Search');
|
||||||
$pane = $dashboard->getPane('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 . '*',
|
'host_name' => $search . '*',
|
||||||
'sort' => 'host_severity',
|
'sort' => 'host_severity',
|
||||||
'limit' => 10,
|
'limit' => 10,
|
||||||
)));
|
)));
|
||||||
$pane->addComponent('Services', Url::fromPath('monitoring/list/services', array(
|
$pane->addComponent('Services' . $suffix, Url::fromPath('monitoring/list/services', array(
|
||||||
'service_description' => '*' . $search . '*',
|
'service_description' => $search . '*',
|
||||||
'sort' => 'service_severity',
|
'sort' => 'service_severity',
|
||||||
'limit' => 10,
|
'limit' => 10,
|
||||||
)));
|
)));
|
||||||
$pane->addComponent('Hostgroups', Url::fromPath('monitoring/list/hostgroups', array(
|
$pane->addComponent('Hostgroups' . $suffix, Url::fromPath('monitoring/list/hostgroups', array(
|
||||||
'hostgroup' => '*' . $search . '*',
|
'hostgroup' => $search . '*',
|
||||||
'limit' => 10,
|
'limit' => 10,
|
||||||
)));
|
)));
|
||||||
$dashboard->activate('Search');
|
$dashboard->activate('Search');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user