diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index bfb0e8c64d..cfdf50cf17 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -113,6 +113,8 @@ $fields_available['instructions'] = __('Instructions'); $fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); $fields_available['module_status'] = __('Module Status'); +$fields_available['mini_severity'] = __('Severity mini'); + // Remove fields already selected. foreach ($fields_available as $key => $available) { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index c974251170..5f83669b4b 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -288,6 +288,9 @@ function events_get_column_name($field) case 'options': return __('Options'); + case 'mini_severity': + return 'S'; + default: return __($field); } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index a4a347ba90..ee44713385 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -209,6 +209,10 @@ if (is_ajax()) { ob_start(); $order = get_datatable_order(true); + if (is_array($order) && $order['field'] == 'mini_severity') { + $order['field'] = 'te.criticity'; + } + $fields = [ 'te.id_evento', 'te.id_agente', @@ -1168,6 +1172,10 @@ try { 'text' => 'evento', 'class' => 'mw120px', ], + [ + 'text' => 'mini_severity', + 'class' => 'no-padding', + ], 'id_evento', // 'id_agente', // 'id_usuario', @@ -1213,6 +1221,12 @@ try { $fields = $default_fields; } + if (in_array('mini_severity', $fields) > 0) { + $fields[array_search('mini_severity', $fields)] = [ + 'text' => 'mini_severity', + 'class' => 'no-padding-imp', + ]; + } $evento_id = array_search('evento', $fields); if ($evento_id !== false) { @@ -1584,16 +1598,17 @@ function process_datatables_item(item) { output += ''; // Add event severity to end of text. - evn = '
'; - evn += '
'; // Grouped events. if(item.event_rep && item.event_rep > 1) { evn += '('+item.event_rep+') '; } - evn += item.evento+'
'; - evn += output; - evn += '
' + evn += item.evento+''; + + item.mini_severity = '
'; + item.mini_severity += output; + item.mini_severity += '
'; criticity = '
' + text + "
";