From 3e577ce65b41a9fb4d3ed02e41d9045087f6e7aa Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 10 Dec 2015 13:00:08 +0100 Subject: [PATCH] HostController: add services tab --- application/controllers/HostController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index 4c968078..dc3b4d34 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -6,4 +6,23 @@ use Icinga\Module\Director\Web\Controller\ObjectController; class HostController extends ObjectController { + public function init() + { + parent::init(); + if ($this->object) { + $this->getTabs()->add('services', array( + 'url' => 'director/host/services', + 'urlParams' => array('name' => $this->object->object_name), + 'label' => 'Services' + )); + } + } + + public function servicesAction() + { + $this->getTabs()->activate('services'); + $this->view->title = $this->translate('Services'); + $this->view->table = $this->loadTable('IcingaService')->enforceFilter('host_id', $this->object->id)->setConnection($this->db()); + $this->render('objects/table', null, true); + } }