From 7fe51b06c9d2dc438cb826c2033366dcd945b9ca Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 1 Jun 2022 13:13:04 +0200 Subject: [PATCH] services/grid: Fix search editor integration --- .../controllers/ServicesController.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index 726bb907..5acca489 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -315,6 +315,10 @@ class ServicesController extends Controller $this->view->baseUrl->getParams()->addEncoded($name, $value); } + $searchBar->setEditorUrl(Url::fromPath( + "icingadb/services/grid-search-editor" + )->setParams($preservedParams)); + $this->view->controls = $this->controls; if ($flipped) { @@ -339,6 +343,24 @@ class ServicesController extends Controller $this->setAutorefreshInterval(30); } + public function gridSearchEditorAction() + { + $editor = $this->createSearchEditor( + Service::on($this->getDb()), + Url::fromPath('icingadb/services/grid'), + [ + LimitControl::DEFAULT_LIMIT_PARAM, + SortControl::DEFAULT_SORT_PARAM, + 'flipped', + 'page', + 'problems' + ] + ); + + $this->getDocument()->add($editor); + $this->setTitle(t('Adjust Filter')); + } + protected function fetchCommandTargets(): Query { $db = $this->getDb();