From b4bd7f0f63a074b1c92e801a5e32f186e56949e1 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 30 Jul 2019 16:10:34 +0200 Subject: [PATCH] fixed problems in event view and event view custom fields --- pandora_console/include/functions_events.php | 14 +++++++++----- pandora_console/include/styles/events.css | 8 -------- pandora_console/operation/events/events.php | 2 +- pandora_console/pandoradb_data.sql | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 4c57dfd4b0..ca94a9de5c 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -217,7 +217,7 @@ function events_get_all_fields() * * @return string Traduction. */ -function events_get_column_name($field) +function events_get_column_name($field, $table_alias=false) { switch ($field) { case 'id_evento': @@ -293,7 +293,11 @@ function events_get_column_name($field) return __('Options'); case 'mini_severity': - return 'S'; + if ($table_alias === true) { + return 'S'; + } else { + return __('Severity mini'); + } default: return __($field); @@ -308,7 +312,7 @@ function events_get_column_name($field) * * @return array Names array. */ -function events_get_column_names($fields) +function events_get_column_names($fields, $table_alias=false) { if (!isset($fields) || !is_array($fields)) { return []; @@ -318,14 +322,14 @@ function events_get_column_names($fields) foreach ($fields as $f) { if (is_array($f)) { $name = []; - $name['text'] = events_get_column_name($f['text']); + $name['text'] = events_get_column_name($f['text'], $table_alias); $name['class'] = $f['class']; $name['style'] = $f['style']; $name['extra'] = $f['extra']; $name['id'] = $f['id']; $names[] = $name; } else { - $names[] = events_get_column_name($f); + $names[] = events_get_column_name($f, $table_alias); } } diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css index 1ed0028dc8..8b46a97ca6 100644 --- a/pandora_console/include/styles/events.css +++ b/pandora_console/include/styles/events.css @@ -118,14 +118,6 @@ table.dataTable tbody td { border-bottom: 2px solid #dedede; } -.info_table.events tr > td:first-child { - padding-left: 5px; - padding-top: 0; - vertical-align: middle; - width: 40%; - padding-bottom: 0; -} - .filter_input { align-items: center; } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index b316bea7ff..1d48b2bca4 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1258,7 +1258,7 @@ try { ); // Get column names. - $column_names = events_get_column_names($fields); + $column_names = events_get_column_names($fields, true); // Open current filter quick reference. $active_filters_div = '
'; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 6c8811bf22..a406b3e362 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -88,7 +88,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('netflow_daemon', '/usr/bin/nfcapd'), ('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_max_resolution', '50'), -('event_fields', 'evento,id_agente,estado,timestamp'), +('event_fields', 'mini_severity,evento,id_agente,estado,timestamp'), ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'), ('list_ACL_IPs_for_API', '127.0.0.1'), ('enable_pass_policy', 0),