File tree 4 files changed +21
-13
lines changed
4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 11
11
use Icinga \Module \Kubernetes \Web \Controller ;
12
12
use Icinga \Module \Kubernetes \Web \QuickActions ;
13
13
use Icinga \Module \Kubernetes \Web \ServiceDetail ;
14
+ use Icinga \Module \Kubernetes \Web \ServiceList ;
15
+ use Icinga \Module \Kubernetes \Web \ViewModeSwitcher ;
14
16
use ipl \Stdlib \Filter ;
15
17
use Ramsey \Uuid \Uuid ;
16
18
@@ -43,6 +45,12 @@ public function indexAction(): void
43
45
$ this ->httpNotFound ($ this ->translate ('Service not found ' ));
44
46
}
45
47
48
+ $ this ->addControl (
49
+ (new ServiceList ([$ service ]))
50
+ ->setActionList (false )
51
+ ->setViewMode (ViewModeSwitcher::VIEW_MODE_MINIMAL )
52
+ );
53
+
46
54
$ this ->addControl (new QuickActions ($ service , $ favorite ));
47
55
48
56
$ this ->addContent (new ServiceDetail ($ service ));
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ public function getColumnDefinitions(): array
83
83
'allocate_load_balancer_node_ports ' => $ this ->translate ('Allocated Load Balancer Node Ports ' ),
84
84
'load_balancer_class ' => $ this ->translate ('Load Balancer Class ' ),
85
85
'internal_traffic_policy ' => $ this ->translate ('Internal Traffic Policy ' ),
86
+ 'icinga_state ' => $ this ->translate ('Icinga State ' ),
87
+ 'icinga_state_reason ' => $ this ->translate ('Icinga State Reason ' ),
86
88
'yaml ' => $ this ->translate ('YAML ' ),
87
89
'created ' => $ this ->translate ('Created At ' )
88
90
];
@@ -110,6 +112,8 @@ public function getColumns(): array
110
112
'allocate_load_balancer_node_ports ' ,
111
113
'load_balancer_class ' ,
112
114
'internal_traffic_policy ' ,
115
+ 'icinga_state ' ,
116
+ 'icinga_state_reason ' ,
113
117
'yaml ' ,
114
118
'created '
115
119
];
Original file line number Diff line number Diff line change @@ -71,7 +71,11 @@ protected function assemble(): void
71
71
),
72
72
$ this ->translate ('Load Balancer Class ' ) => $ this ->service ->load_balancer_class ??
73
73
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
+ )
75
79
])),
76
80
new Labels ($ this ->service ->label ),
77
81
new Annotations ($ this ->service ->annotation ),
Original file line number Diff line number Diff line change 5
5
namespace Icinga \Module \Kubernetes \Web ;
6
6
7
7
use Icinga \Module \Kubernetes \Common \BaseListItem ;
8
+ use Icinga \Module \Kubernetes \Common \DefaultListItemCaption ;
8
9
use Icinga \Module \Kubernetes \Common \DefaultListItemHeader ;
9
10
use Icinga \Module \Kubernetes \Common \DefaultListItemMain ;
11
+ use Icinga \Module \Kubernetes \Common \DefaultListItemVisual ;
10
12
use Icinga \Module \Kubernetes \Common \Links ;
11
13
use ipl \Html \Attributes ;
12
14
use ipl \Html \BaseHtmlElement ;
16
18
use ipl \I18n \Translation ;
17
19
use ipl \Web \Widget \HorizontalKeyValue ;
18
20
use ipl \Web \Widget \Link ;
19
- use ipl \Web \Widget \StateBall ;
20
21
21
22
class ServiceListItem extends BaseListItem
22
23
{
23
24
use Translation;
24
25
use DefaultListItemHeader;
26
+ use DefaultListItemCaption;
25
27
use DefaultListItemMain;
26
-
27
- protected function assembleCaption (BaseHtmlElement $ caption ): void
28
- {
29
- // TODO add state reason then replace function by DefaultListItemCaption trait
30
- $ caption ->addHtml (new Text ('Placeholder for Icinga State Reason ' ));
31
- }
28
+ use DefaultListItemVisual;
32
29
33
30
protected function assembleFooter (BaseHtmlElement $ footer ): void
34
31
{
@@ -58,9 +55,4 @@ protected function assembleTitle(BaseHtmlElement $title): void
58
55
)
59
56
);
60
57
}
61
-
62
- protected function assembleVisual (BaseHtmlElement $ visual ): void
63
- {
64
- $ visual ->addHtml (new StateBall ('none ' , StateBall::SIZE_MEDIUM ));
65
- }
66
58
}
You can’t perform that action at this time.
0 commit comments