DeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branchDeployedConfigInfoHeader: do not re-deploy...

...when being in a branch
This commit is contained in:
Thomas Gelf 2021-08-25 11:38:29 +02:00
parent a851f58e42
commit 430f54837b
2 changed files with 18 additions and 7 deletions

View File

@ -283,6 +283,7 @@ class ConfigController extends ActionController
$config,
$this->db(),
$this->api(),
$this->getBranch(),
$deploymentId
));

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Director\Web\Widget;
use Icinga\Module\Director\Db\Branch\Branch;
use ipl\Html\HtmlDocument;
use Icinga\Module\Director\Core\DeploymentApiInterface;
use Icinga\Module\Director\Db;
@ -28,15 +29,20 @@ class DeployedConfigInfoHeader extends HtmlDocument
/** @var DeploymentApiInterface */
protected $api;
/** @var Branch */
protected $branch;
public function __construct(
IcingaConfig $config,
Db $db,
DeploymentApiInterface $api,
Branch $branch,
$deploymentId = null
) {
$this->config = $config;
$this->db = $db;
$this->api = $api;
$this->branch = $branch;
if ($deploymentId) {
$this->deploymentId = (int) $deploymentId;
}
@ -49,13 +55,17 @@ class DeployedConfigInfoHeader extends HtmlDocument
protected function assemble()
{
$config = $this->config;
$deployForm = DeployConfigForm::load()
->setDb($this->db)
->setApi($this->api)
->setChecksum($config->getHexChecksum())
->setDeploymentId($this->deploymentId)
->setAttrib('class', 'inline')
->handleRequest();
if ($this->branch->isBranch()) {
$deployForm = null;
} else {
$deployForm = DeployConfigForm::load()
->setDb($this->db)
->setApi($this->api)
->setChecksum($config->getHexChecksum())
->setDeploymentId($this->deploymentId)
->setAttrib('class', 'inline')
->handleRequest();
}
$links = new NameValueTable();
$links->addNameValueRow(