summaryrefslogtreecommitdiffstats
path: root/application/controllers/HostsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/HostsController.php')
-rw-r--r--application/controllers/HostsController.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/application/controllers/HostsController.php b/application/controllers/HostsController.php
new file mode 100644
index 0000000..c3e5374
--- /dev/null
+++ b/application/controllers/HostsController.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\IcingaDbHostStatusCube;
+use Icinga\Module\Cube\Ido\IdoHostStatusCube;
+use Icinga\Module\Cube\ProvidedHook\Icingadb\IcingadbSupport;
+use Icinga\Module\Cube\Web\IdoController;
+
+class HostsController extends IdoController
+{
+ public function indexAction()
+ {
+ $this->createTabs()->activate('cube/hosts');
+
+ $this->renderCube();
+ }
+
+ protected function getCube()
+ {
+ if (Module::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
+ return new IcingaDbHostStatusCube();
+ }
+
+ return new IdoHostStatusCube();
+ }
+}