File tree 3 files changed +53
-5
lines changed
library/Icingadb/Widget/ItemList
3 files changed +53
-5
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,23 @@ protected function getItemClass(): string
28
28
29
29
protected function createListItem (object $ data ): BaseListItem
30
30
{
31
+ $ viewMode = $ this ->getViewMode ();
31
32
/** @var UnreachableParent|DependencyNode $data */
32
33
if ($ data ->redundancy_group_id !== null ) {
34
+ if ($ viewMode === 'minimal ' ) {
35
+ return new RedundancyGroupListItemMinimal ($ data ->redundancy_group , $ this );
36
+ }
37
+
38
+ if ($ viewMode === 'detailed ' ) {
39
+ $ this ->removeAttribute ('class ' , 'default-layout ' );
40
+ }
41
+
33
42
return new RedundancyGroupListItem ($ data ->redundancy_group , $ this );
34
43
}
35
44
36
45
$ object = $ data ->service_id !== null ? $ data ->service : $ data ->host ;
37
46
38
- switch ($ this -> getViewMode () ) {
47
+ switch ($ viewMode ) {
39
48
case 'minimal ' :
40
49
$ class = $ object instanceof Host ? HostListItemMinimal::class : ServiceListItemMinimal::class;
41
50
break ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /* Icinga DB Web | (c) 2024 Icinga GmbH | GPLv2 */
4
+
5
+ namespace Icinga \Module \Icingadb \Widget \ItemList ;
6
+
7
+ use Icinga \Module \Icingadb \Common \ListItemMinimalLayout ;
8
+ use ipl \Web \Widget \StateBall ;
9
+
10
+ class RedundancyGroupListItemMinimal extends RedundancyGroupListItem
11
+ {
12
+ use ListItemMinimalLayout;
13
+
14
+ protected function getStateBallSize (): string
15
+ {
16
+ return StateBall::SIZE_BIG ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change 1
- .redundancy-group-list-item {
2
- .caption {
3
- display : flex ;
4
- justify-content : end ;
1
+ .item-list.detailed ,
2
+ .item-list.common ,
3
+ .item-list.minimal {
4
+ .list-item.redundancy-group-list-item {
5
+ .title > * {
6
+ margin : 0 .28125em ; // 0 calculated width
7
+
8
+ & :first-child {
9
+ margin-left : 0 ;
10
+ }
11
+
12
+ & :last-child {
13
+ margin-right : 0 ;
14
+ }
15
+ }
16
+
17
+ .caption .object-statistics {
18
+ justify-self : end ;
19
+ }
20
+ }
21
+ }
22
+
23
+ .item-list.minimal > .list-item.redundancy-group-list-item {
24
+ .caption .object-statistics {
25
+ font-size : 0.75em ;
5
26
}
6
27
}
You can’t perform that action at this time.
0 commit comments