icingaweb2-module-director/application/controllers/DeploymentController.php

36 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2015-10-20 22:34:04 +02:00
namespace Icinga\Module\Director\Controllers;
use Icinga\Module\Director\Web\Controller\ActionController;
use Icinga\Module\Director\Objects\DirectorDeploymentLog;
use Icinga\Module\Director\Util;
2015-10-20 22:34:04 +02:00
class DeploymentController extends ActionController
{
public function showAction()
{
$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
)
));
}
}
}