Skip to content

Commit b5040b2

Browse files
sukhwinder33445nilmerg
authored andcommitted
EventRenderer: Fix soft_state event visual
- Only the CheckAttempt visual must be skipped in case $layout is minimal|header, not the whole condition body.
1 parent 223de33 commit b5040b2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

library/Icingadb/View/EventRenderer.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,22 @@ public function assembleVisual($item, HtmlDocument $visual, string $layout): voi
123123

124124
break;
125125
case 'state_change':
126-
if ($layout !== 'minimal' && $layout !== 'header' && $item->state->state_type === 'soft') {
126+
if ($item->state->state_type === 'soft') {
127127
$stateType = 'soft_state';
128128
$previousStateType = 'previous_soft_state';
129129

130130
if ($item->state->previous_soft_state === 0) {
131131
$previousStateType = 'hard_state';
132132
}
133133

134-
$visual->addHtml(
135-
new CheckAttempt(
136-
(int) $item->state->check_attempt,
137-
(int) $item->state->max_check_attempts
138-
)
139-
);
134+
if ($layout !== 'minimal' && $layout !== 'header') {
135+
$visual->addHtml(
136+
new CheckAttempt(
137+
(int) $item->state->check_attempt,
138+
(int) $item->state->max_check_attempts
139+
)
140+
);
141+
}
140142
} else {
141143
$stateType = 'hard_state';
142144
$previousStateType = 'previous_hard_state';

0 commit comments

Comments
 (0)