Do not search with empty search string, add servicegroups
This commit is contained in:
parent
ac90ccfd22
commit
ad0432f3be
|
@ -20,6 +20,10 @@ class SearchController extends ActionController
|
|||
{
|
||||
$this->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, '*') . '*' : '';
|
||||
|
@ -37,6 +41,10 @@ class SearchController extends ActionController
|
|||
'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();
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
<?= $this->tabs ?>
|
||||
</div>
|
||||
|
||||
<?php if ($this->dashboard): ?>
|
||||
<div class="content dashboard">
|
||||
<?= $this->dashboard ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="content">
|
||||
<strong><?= $this->hint ?></strong>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
|
Loading…
Reference in New Issue