Skip to content

Commit 322a320

Browse files
committed
Add Icinga state to service
1 parent e734f7d commit 322a320

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

library/Kubernetes/Model/Service.php

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public function getColumnDefinitions(): array
8383
'allocate_load_balancer_node_ports' => $this->translate('Allocated Load Balancer Node Ports'),
8484
'load_balancer_class' => $this->translate('Load Balancer Class'),
8585
'internal_traffic_policy' => $this->translate('Internal Traffic Policy'),
86+
'icinga_state' => $this->translate('Icinga State'),
87+
'icinga_state_reason' => $this->translate('Icinga State Reason'),
8688
'yaml' => $this->translate('YAML'),
8789
'created' => $this->translate('Created At')
8890
];
@@ -110,6 +112,8 @@ public function getColumns(): array
110112
'allocate_load_balancer_node_ports',
111113
'load_balancer_class',
112114
'internal_traffic_policy',
115+
'icinga_state',
116+
'icinga_state_reason',
113117
'yaml',
114118
'created'
115119
];

library/Kubernetes/Web/ServiceDetail.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ protected function assemble(): void
7171
),
7272
$this->translate('Load Balancer Class') => $this->service->load_balancer_class ??
7373
new EmptyState($this->translate('None')),
74-
$this->translate('Internal Traffic Policy') => $this->service->internal_traffic_policy
74+
$this->translate('Internal Traffic Policy') => $this->service->internal_traffic_policy,
75+
$this->translate('Icinga State') => new DetailState($this->service->icinga_state),
76+
$this->translate('Icinga State Reason') => new IcingaStateReason(
77+
$this->service->icinga_state_reason
78+
)
7579
])),
7680
new Labels($this->service->label),
7781
new Annotations($this->service->annotation),

library/Kubernetes/Web/ServiceListItem.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ServiceListItem extends BaseListItem
3131
protected function assembleCaption(BaseHtmlElement $caption): void
3232
{
3333
// TODO add state reason then replace function by DefaultListItemCaption trait
34-
$caption->addHtml(new Text('Placeholder for Icinga State Reason'));
34+
$caption->addHtml(new Text($this->item->icinga_state_reason));
3535
}
3636

3737
protected function assembleFooter(BaseHtmlElement $footer): void
@@ -72,7 +72,7 @@ protected function assembleVisual(BaseHtmlElement $visual): void
7272
};
7373

7474
// TODO add icinga state then replace function by DefaultListItemVisual trait
75-
$visual->addHtml(new StateBall('none', $size));
75+
$visual->addHtml(new StateBall($this->item->icinga_state, $size));
7676

7777
if ($this->getViewMode() === ViewModeSwitcher::VIEW_MODE_MINIMAL) {
7878
return;

0 commit comments

Comments
 (0)