Skip to content

Commit fd0673d

Browse files
authored
Merge pull request #142 from Icinga/use-detail-state
Use detail state widget
2 parents 3a41060 + c364e10 commit fd0673d

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

library/Kubernetes/Web/CronJobDetail.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
use Icinga\Module\Kubernetes\Model\CronJob;
1313
use Icinga\Module\Kubernetes\Model\Event;
1414
use Icinga\Module\Kubernetes\Web\ItemList\ResourceList;
15-
use ipl\Html\Attributes;
1615
use ipl\Html\BaseHtmlElement;
17-
use ipl\Html\HtmlDocument;
1816
use ipl\Html\HtmlElement;
1917
use ipl\Html\Text;
2018
use ipl\I18n\Translation;
2119
use ipl\Stdlib\Filter;
2220
use ipl\Web\Widget\EmptyState;
23-
use ipl\Web\Widget\StateBall;
2421

2522
class CronJobDetail extends BaseHtmlElement
2623
{
@@ -74,14 +71,7 @@ protected function assemble(): void
7471
$this->translate('Failed Jobs History Limit') => $this->cronJob->failed_jobs_history_limit,
7572
$this->translate('Last Successful Time') => $lastSuccessfulTime,
7673
$this->translate('Last Schedule Time') => $lastScheduleTime,
77-
$this->translate('Icinga State') => (new HtmlDocument())->addHtml(
78-
new StateBall($this->cronJob->icinga_state, StateBall::SIZE_MEDIUM),
79-
new HtmlElement(
80-
'span',
81-
new Attributes(['class' => 'icinga-state-text']),
82-
new Text($this->cronJob->icinga_state)
83-
)
84-
)
74+
$this->translate('Icinga State') => new DetailState($this->cronJob->icinga_state)
8575
])),
8676
new Labels($this->cronJob->label),
8777
new Annotations($this->cronJob->annotation),

library/Kubernetes/Web/ServiceDetail.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
use Icinga\Module\Kubernetes\Model\Service;
1616
use Icinga\Module\Kubernetes\Model\ServicePort;
1717
use Icinga\Module\Kubernetes\Web\ItemList\ResourceList;
18-
use ipl\Html\Attributes;
1918
use ipl\Html\BaseHtmlElement;
20-
use ipl\Html\HtmlDocument;
2119
use ipl\Html\HtmlElement;
2220
use ipl\Html\Text;
2321
use ipl\I18n\Translation;
2422
use ipl\Stdlib\Filter;
2523
use ipl\Web\Widget\EmptyState;
26-
use ipl\Web\Widget\StateBall;
2724

2825
class ServiceDetail extends BaseHtmlElement
2926
{
@@ -77,14 +74,7 @@ protected function assemble(): void
7774
$this->translate('Load Balancer Class') => $this->service->load_balancer_class ??
7875
new EmptyState($this->translate('None')),
7976
$this->translate('Internal Traffic Policy') => $this->service->internal_traffic_policy,
80-
$this->translate('Icinga State') => (new HtmlDocument())->addHtml(
81-
new StateBall($stateReason->getState(), StateBall::SIZE_MEDIUM),
82-
new HtmlElement(
83-
'span',
84-
new Attributes(['class' => 'icinga-state-text']),
85-
new Text($stateReason->getState())
86-
)
87-
)
77+
$this->translate('Icinga State') => new DetailState($stateReason->getState())
8878
])),
8979
new Labels($this->service->label),
9080
new Annotations($this->service->annotation),

0 commit comments

Comments
 (0)