From e46be287656a124c11a0ce39c0c683cbd0d29b8d Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 19 Apr 2022 09:30:27 +0200 Subject: [PATCH] performance events view#8800 --- .../reporting_builder.item_editor.php | 2 +- pandora_console/include/functions_events.php | 22 +++++++++---------- pandora_console/include/styles/events.css | 1 + 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 2186c455d2..724d695f6a 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2464,7 +2464,7 @@ $class = 'databox filters'; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 0c8e35b844..899c17ee45 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -757,7 +757,7 @@ function events_get_all( if (is_array($fields) === false && $fields === 'count' || (is_array($fields) === true && $fields[0] === 'count') ) { - $fields = ['te.*']; + $fields = ['te.id_evento']; $count = true; } else if (!is_array($fields)) { error_log('[events_get_all] Fields must be an array or "count".'); @@ -1406,17 +1406,15 @@ function events_get_all( case '1': // Group by events. - $group_by .= 'te.estado, te.evento, te.id_agente, te.id_agentmodule'; + $group_by .= 'te.estado, te.event_type, te.id_agente, te.id_agentmodule'; $group_by .= $extra; break; case '2': // Group by agents. $tagente_join = 'INNER'; - // $group_by .= 'te.id_agente, te.event_type'; - // $group_by .= $extra; $group_by = ''; - $order_by = events_get_sql_order('id_agente', 'asc'); + $order_by = events_get_sql_order('te.id_agente', 'asc'); if (isset($order, $sort_field)) { $order_by .= ','.events_get_sql_order( $sort_field, @@ -1477,13 +1475,13 @@ function events_get_all( $group_selects = ''; if ($group_by != '') { - $group_selects = ',COUNT(id_evento) AS event_rep - ,GROUP_CONCAT(DISTINCT user_comment SEPARATOR "
") AS comments, - MAX(utimestamp) as timestamp_last, - MIN(utimestamp) as timestamp_first, - MAX(id_evento) as max_id_evento'; - if ($count === false) { + $group_selects = ',COUNT(id_evento) AS event_rep, + GROUP_CONCAT(DISTINCT user_comment SEPARATOR "
") AS comments, + MAX(utimestamp) as timestamp_last, + MIN(utimestamp) as timestamp_first, + MAX(id_evento) as max_id_evento'; + $idx = array_search('te.user_comment', $fields); if ($idx !== false) { unset($fields[$idx]); @@ -1573,7 +1571,7 @@ function events_get_all( ('.$sql.') tbase'; } - if ($count) { + if ($count === true) { $sql = 'SELECT count(*) as nitems FROM ('.$sql.') tt'; } diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css index 517a54036e..4b8177b2af 100644 --- a/pandora_console/include/styles/events.css +++ b/pandora_console/include/styles/events.css @@ -181,6 +181,7 @@ fieldset { color: #777; border: none; margin-top: -2em; + box-sizing: border-box; } /* Image open dialog in group events by agents*/