diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:48 +0000 |
commit | e6d4dfc040bbe3cb80a2ce65b82493b557f751fc (patch) | |
tree | 40bd6366b01b06f4d96fc8638f23a772263cb5e9 /library/Director/Web/Widget/DeploymentInfo.php | |
parent | Releasing progress-linux version 1.10.2-2~progress7.99u1. (diff) | |
download | icingaweb2-module-director-e6d4dfc040bbe3cb80a2ce65b82493b557f751fc.tar.xz icingaweb2-module-director-e6d4dfc040bbe3cb80a2ce65b82493b557f751fc.zip |
Merging upstream version 1.11.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Director/Web/Widget/DeploymentInfo.php')
-rw-r--r-- | library/Director/Web/Widget/DeploymentInfo.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/library/Director/Web/Widget/DeploymentInfo.php b/library/Director/Web/Widget/DeploymentInfo.php index 110200f..1f87abc 100644 --- a/library/Director/Web/Widget/DeploymentInfo.php +++ b/library/Director/Web/Widget/DeploymentInfo.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Web\Widget; +use Icinga\Module\Director\Auth\Permission; use ipl\Html\HtmlDocument; use Icinga\Authentication\Auth; use Icinga\Module\Director\IcingaConfig\IcingaConfig; @@ -55,7 +56,7 @@ class DeploymentInfo extends HtmlDocument 'url' => $request->getUrl() ))->activate('deployment'); - if ($dep->config_checksum !== null && $auth->hasPermission('director/showconfig')) { + if ($dep->config_checksum !== null && $auth->hasPermission(Permission::SHOW_CONFIG)) { $tabs->add('config', array( 'label' => $this->translate('Config'), 'url' => 'director/config/files', @@ -72,7 +73,8 @@ class DeploymentInfo extends HtmlDocument protected function createInfoTable() { $dep = $this->deployment; - $table = new NameValueTable(); + $table = (new NameValueTable()) + ->addAttributes(['class' => 'deployment-details']); $table->addNameValuePairs([ $this->translate('Deployment time') => $dep->start_time, $this->translate('Sent to') => $dep->peer_identity, @@ -135,16 +137,21 @@ class DeploymentInfo extends HtmlDocument } else { return [$this->translate('Unknown, failed to collect related information'), new Icon('help')]; } - } elseif ($dep->startup_succeeded === 'y') { - return $this->colored('green', [$this->translate('Succeeded'), new Icon('ok')]); } else { - return $this->colored('red', [$this->translate('Failed'), new Icon('cancel')]); - } - } + $div = Html::tag('div')->setSeparator(' '); - protected function colored($color, array $content) - { - return Html::tag('div', ['style' => "color: $color;"], $content)->setSeparator(' '); + if ($dep->startup_succeeded === 'y') { + $div + ->addAttributes(['class' => 'succeeded']) + ->add([$this->translate('Succeeded'), new Icon('ok')]); + } else { + $div + ->addAttributes(['class' => 'failed']) + ->add([$this->translate('Failed'), new Icon('cancel')]); + } + + return $div; + } } public function render() |