summaryrefslogtreecommitdiffstats
path: root/application/controllers/ServicesController.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:16:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:16:36 +0000
commitd61b7618d9c04ff90fdf8d3b584ad5976faedad9 (patch)
tree6de6eaca7793f0f1f756c9a5a0fa9e07957c8569 /application/controllers/ServicesController.php
parentInitial commit. (diff)
downloadicingaweb2-module-cube-upstream.tar.xz
icingaweb2-module-cube-upstream.zip
Adding upstream version 1.3.2.upstream/1.3.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/controllers/ServicesController.php')
-rw-r--r--application/controllers/ServicesController.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php
new file mode 100644
index 0000000..0914aa2
--- /dev/null
+++ b/application/controllers/ServicesController.php
@@ -0,0 +1,45 @@
+<?php
+
+// Icinga Web 2 Cube Module | (c) 2019 Icinga GmbH | GPLv2
+
+namespace Icinga\Module\Cube\Controllers;
+
+use Icinga\Module\Cube\IcingaDb\IcingaDbCube;
+use Icinga\Module\Cube\IcingaDb\IcingaDbServiceStatusCube;
+use Icinga\Module\Cube\Web\Controller;
+use Icinga\Module\Icingadb\Model\Service;
+use Icinga\Module\Icingadb\Web\Control\SearchBar\ObjectSuggestions;
+
+class ServicesController extends Controller
+{
+ public function indexAction(): void
+ {
+ $this->createTabs()->activate('cube/services');
+
+ $this->renderCube();
+ }
+
+ protected function getCube(): IcingaDbCube
+ {
+ return new IcingaDbServiceStatusCube();
+ }
+
+ public function completeAction(): void
+ {
+ $suggestions = new ObjectSuggestions();
+ $suggestions->setModel(Service::class);
+ $suggestions->forRequest($this->getServerRequest());
+ $this->getDocument()->add($suggestions);
+ }
+
+ public function searchEditorAction(): void
+ {
+ $editor = $this->createSearchEditor(
+ Service::on($this->getDb()),
+ $this->preserveParams
+ );
+
+ $this->getDocument()->add($editor);
+ $this->setTitle($this->translate('Adjust Filter'));
+ }
+}