#11701 Fix alert view

This commit is contained in:
miguel angel rasteu 2023-07-06 15:51:15 +02:00
parent 141c34618e
commit d46edcd49d

View File

@ -316,6 +316,8 @@ if (count($actions) == 1 && isset($actions[0])) {
['class' => 'invert_filter'] ['class' => 'invert_filter']
); );
} else { } else {
$table->head[1] = __('Every time that the alert is fired');
$table->head[2] = __('Threshold');
foreach ($actions as $kaction => $action) { foreach ($actions as $kaction => $action) {
$table->data[$kaction][0] = $action['name']; $table->data[$kaction][0] = $action['name'];
if ((int) $kaction === 0) { if ((int) $kaction === 0) {
@ -327,13 +329,13 @@ if (count($actions) == 1 && isset($actions[0])) {
foreach ($action['escalation'] as $k => $v) { foreach ($action['escalation'] as $k => $v) {
if ($v > 0) { if ($v > 0) {
$table->data[$kaction][$k] .= html_print_image( $table->data[$kaction][2] .= html_print_image(
'images/tick.png', 'images/tick.png',
true, true,
['class' => 'invert_filter'] ['class' => 'invert_filter']
); );
} else { } else {
$table->data[$kaction][$k] = html_print_image( $table->data[$kaction][2] = html_print_image(
'images/blade.png', 'images/blade.png',
true true
); );
@ -364,7 +366,7 @@ if (count($actions) == 1 && isset($actions[0])) {
} }
} }
$table->head[($kaction + 1)] = '#'.($kaction); // $table->head[($kaction + 1)] = ''.($kaction);
if (count($action['escalation']) === 0) { if (count($action['escalation']) === 0) {
$table->data[$kaction][($kaction + 2)] = html_print_image( $table->data[$kaction][($kaction + 2)] = html_print_image(
'images/blade.png', 'images/blade.png',
@ -375,16 +377,16 @@ if (count($actions) == 1 && isset($actions[0])) {
$action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold']; $action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold'];
if ($action_threshold == 0) { if ($action_threshold == 0) {
$table->data[$kaction][($k + 1)] = __('No'); $table->data[$kaction][3] = __('No');
} else { } else {
$table->data[$kaction][($k + 1)] = human_time_description_raw( $table->data[$kaction][1] = human_time_description_raw(
$action_threshold, $action_threshold,
true, true,
'tiny' 'tiny'
); );
} }
$table->head[($kaction + 1)] = __('Threshold'); // $table->head[($kaction + 1)] = __('Threshold');
} }
} }