From 3cf24e3d4ffa81897100cbc7221dd2754e8e0f1f Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 16 Oct 2015 18:10:38 +0200 Subject: [PATCH] deployment/show: tabs, link to deployed config --- .../controllers/DeploymentController.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/application/controllers/DeploymentController.php b/application/controllers/DeploymentController.php index 6c37c9d3..21093c7b 100644 --- a/application/controllers/DeploymentController.php +++ b/application/controllers/DeploymentController.php @@ -2,11 +2,32 @@ use Icinga\Module\Director\Web\Controller\ActionController; use Icinga\Module\Director\Objects\DirectorDeploymentLog; +use Icinga\Module\Director\Util; class Director_DeploymentController extends ActionController { public function showAction() { - $this->view->deployment = DirectorDeploymentLog::load($this->params->get('id'), $this->db()); + $deploymentId = $this->params->get('id'); + $this->view->deployment = $deployment = DirectorDeploymentLog::load( + $deploymentId, + $this->db() + ); + + $tabs = $this->getTabs()->add('deployment', array( + 'label' => $this->translate('Deployment'), + 'url' => $this->getRequest()->getUrl() + ))->activate('deployment'); + + if ($deployment->config_checksum !== null) { + $tabs->add('config', array( + 'label' => $this->translate('Config'), + 'url' => 'director/config/show', + 'urlParams' => array( + 'checksum' => Util::binary2hex($deployment->config_checksum), + 'deployment_id' => $deploymentId + ) + )); + } } }