summaryrefslogtreecommitdiffstats
path: root/application/controllers/ServicesController.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:42:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:42:52 +0000
commitda0f8427204ad57aad08059906df0ea10a7ccf31 (patch)
treeccda92692e296a50dac104945f62b4402d5e4447 /application/controllers/ServicesController.php
parentInitial commit. (diff)
downloadicingaweb2-module-cube-da0f8427204ad57aad08059906df0ea10a7ccf31.tar.xz
icingaweb2-module-cube-da0f8427204ad57aad08059906df0ea10a7ccf31.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/controllers/ServicesController.php')
-rw-r--r--application/controllers/ServicesController.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php
new file mode 100644
index 0000000..ec08bbb
--- /dev/null
+++ b/application/controllers/ServicesController.php
@@ -0,0 +1,30 @@
+<?php
+
+// Icinga Web 2 Cube Module | (c) 2019 Icinga GmbH | GPLv2
+
+namespace Icinga\Module\Cube\Controllers;
+
+use Icinga\Application\Modules\Module;
+use Icinga\Module\Cube\IcingaDb\IcingaDbServiceStatusCube;
+use Icinga\Module\Cube\Ido\IdoServiceStatusCube;
+use Icinga\Module\Cube\ProvidedHook\Icingadb\IcingadbSupport;
+use Icinga\Module\Cube\Web\IdoController;
+
+class ServicesController extends IdoController
+{
+ public function indexAction()
+ {
+ $this->createTabs()->activate('cube/services');
+
+ $this->renderCube();
+ }
+
+ protected function getCube()
+ {
+ if (Module::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
+ return new IcingaDbServiceStatusCube();
+ }
+
+ return new IdoServiceStatusCube();
+ }
+}