File tree 4 files changed +21
-14
lines changed
4 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 10
10
use Icinga \Module \Kubernetes \Model \Favorite ;
11
11
use Icinga \Module \Kubernetes \Web \Controller ;
12
12
use Icinga \Module \Kubernetes \Web \CronJobDetail ;
13
+ use Icinga \Module \Kubernetes \Web \CronJobList ;
13
14
use Icinga \Module \Kubernetes \Web \QuickActions ;
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 ('Cron Job not found ' ));
44
46
}
45
47
48
+ $ this ->addControl (
49
+ (new CronJobList ([$ cronJob ]))
50
+ ->setActionList (false )
51
+ ->setViewMode (ViewModeSwitcher::VIEW_MODE_MINIMAL )
52
+ );
53
+
46
54
$ this ->addControl (new QuickActions ($ cronJob , $ favorite ));
47
55
48
56
$ this ->addContent (new CronJobDetail ($ cronJob ));
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ public function getColumnDefinitions(): array
72
72
'active ' => $ this ->translate ('Active ' ),
73
73
'last_schedule_time ' => $ this ->translate ('Last Schedule Time ' ),
74
74
'last_successful_time ' => $ this ->translate ('Last Successful Time ' ),
75
+ 'icinga_state ' => $ this ->translate ('Icinga State ' ),
76
+ 'icinga_state_reason ' => $ this ->translate ('Icinga State Reason ' ),
75
77
'yaml ' => $ this ->translate ('YAML ' ),
76
78
'created ' => $ this ->translate ('Created At ' )
77
79
];
@@ -95,6 +97,8 @@ public function getColumns(): array
95
97
'active ' ,
96
98
'last_schedule_time ' ,
97
99
'last_successful_time ' ,
100
+ 'icinga_state ' ,
101
+ 'icinga_state_reason ' ,
98
102
'yaml ' ,
99
103
'created '
100
104
];
Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ protected function assemble(): void
56
56
$ this ->translate ('Successful Jobs History Limit ' ) => $ this ->cronJob ->successful_jobs_history_limit ,
57
57
$ this ->translate ('Failed Jobs History Limit ' ) => $ this ->cronJob ->failed_jobs_history_limit ,
58
58
$ this ->translate ('Last Successful Time ' ) => $ lastSuccessfulTime ,
59
- $ this ->translate ('Last Schedule Time ' ) => $ lastScheduleTime
59
+ $ this ->translate ('Last Schedule Time ' ) => $ lastScheduleTime ,
60
+ $ this ->translate ('Icinga State ' ) => new DetailState ($ this ->cronJob ->icinga_state ),
61
+ $ this ->translate ('Icinga State Reason ' ) => new IcingaStateReason (
62
+ $ this ->cronJob ->icinga_state_reason
63
+ )
60
64
])),
61
65
new Labels ($ this ->cronJob ->label ),
62
66
new Annotations ($ this ->cronJob ->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 \Icons ;
11
13
use Icinga \Module \Kubernetes \Common \Links ;
12
14
use ipl \Html \Attributes ;
17
19
use ipl \I18n \Translation ;
18
20
use ipl \Web \Widget \HorizontalKeyValue ;
19
21
use ipl \Web \Widget \Link ;
20
- use ipl \Web \Widget \StateBall ;
21
22
22
23
class CronJobListItem extends BaseListItem
23
24
{
24
25
use Translation;
25
26
use DefaultListItemHeader;
27
+ use DefaultListItemCaption;
26
28
use DefaultListItemMain;
27
-
28
- protected function assembleCaption (BaseHtmlElement $ caption ): void
29
- {
30
- // TODO add state reason then replace function by DefaultListItemCaption trait
31
- $ caption ->addHtml (new Text ('Placeholder for Icinga State Reason ' ));
32
- }
29
+ use DefaultListItemVisual;
33
30
34
31
protected function assembleFooter (BaseHtmlElement $ footer ): void
35
32
{
@@ -73,10 +70,4 @@ protected function assembleTitle(BaseHtmlElement $title): void
73
70
)
74
71
);
75
72
}
76
-
77
- protected function assembleVisual (BaseHtmlElement $ visual ): void
78
- {
79
- // TODO add icinga state then replace function by DefaultListItemVisual trait
80
- $ visual ->addHtml (new StateBall ('none ' , StateBall::SIZE_MEDIUM ));
81
- }
82
73
}
You can’t perform that action at this time.
0 commit comments