config = $config; $this->db = $db; $this->api = $api; $this->branch = $branch; if ($deploymentId) { $this->deploymentId = (int) $deploymentId; } } /** * @throws \Icinga\Exception\IcingaException * @throws \Zend_Form_Exception */ protected function assemble() { $config = $this->config; 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( $this->translate('Actions'), [ $deployForm, Html::tag('br'), Link::create( $this->translate('Last related activity'), 'director/config/activity', ['checksum' => $config->getLastActivityHexChecksum()], ['class' => 'icon-clock', 'data-base-target' => '_next'] ), Html::tag('br'), Link::create( $this->translate('Diff with other config'), 'director/config/diff', ['left' => $config->getHexChecksum()], ['class' => 'icon-flapping', 'data-base-target' => '_self'] ) ] )->addNameValueRow( $this->translate('Statistics'), sprintf( $this->translate('%d files rendered in %0.2fs'), count($config->getFiles()), $config->getDuration() / 1000 ) ); $this->add($links); } }