From e29181c1d5a7b48094d297cc9a99e1de6c68a8b4 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 12:10:55 +0100 Subject: [PATCH 1/6] #12706 fixed line break --- pandora_console/include/styles/events.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css index 8bcdd7187f..fcf7b864b5 100644 --- a/pandora_console/include/styles/events.css +++ b/pandora_console/include/styles/events.css @@ -108,7 +108,7 @@ td > input[id^="checkbox-multi"] { height: 2.5em; } -.info_table.events tr > td span:not(.invisible) { +.info_table.events tr:not(.group) > td span:not(.invisible) { display: inline-block; overflow: hidden; text-overflow: ellipsis; From adffdc3cd0febb94865bd0637332cbba69759164 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 16:55:14 +0100 Subject: [PATCH 2/6] #12706 fixed line break in events metaconsole --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index e0263ea844..0863e35607 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1167,7 +1167,7 @@ if (is_ajax() === true) { parse_str($url_link_hash, $url_hash_array); - $redirection_form = "
"; + $redirection_form = ""; $redirection_form .= html_print_input_hidden( 'loginhash', $url_hash_array['loginhash'], From 83c6d3735edc06e7d0c9d21afdba963a211f1541 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 17:06:16 +0100 Subject: [PATCH 3/6] #12688 fixed filter module status in tree --- pandora_console/include/class/Tree.class.php | 13 +++++++++---- pandora_console/include/class/TreeModule.class.php | 5 ++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index fc02023b3e..1d8ac12d63 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -303,18 +303,23 @@ class Tree $this->filter['statusModule'] = -1; } + $filter_status = ''; + if ((int) $this->filter['statusModule'] !== -1 && $this->type === 'module') { + $filter_status = ' AND tae.estado = '.$this->filter['statusModule']; + } + $show_init_condition = ($this->filter['show_not_init_agents']) ? '' : ' AND ta.notinit_count <> ta.total_count'; if ($this->getEmptyModuleFilterStatus()) { - return $show_init_condition; + return $show_init_condition.$filter_status; } if ((int) $this->filter['statusModule'] === 6) { - return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)'; + return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)'.$filter_status; } if ($this->filter['statusModule'] === 'fired') { - return ' AND ta.fired_count > 0'; + return ' AND ta.fired_count > 0'.$filter_status; } $field_filter = modules_get_counter_by_states($this->filter['statusModule']); @@ -322,7 +327,7 @@ class Tree return ' AND 1=0'; } - return "AND ta.$field_filter > 0".$show_init_condition; + return "AND ta.$field_filter > 0".$show_init_condition.$filter_status; } diff --git a/pandora_console/include/class/TreeModule.class.php b/pandora_console/include/class/TreeModule.class.php index 46253643a5..94710bfe19 100644 --- a/pandora_console/include/class/TreeModule.class.php +++ b/pandora_console/include/class/TreeModule.class.php @@ -28,9 +28,8 @@ class TreeModule extends Tree $this->L1fieldNameSql = 'tam.nombre'; $this->L1inner = ''; $this->L1orderByFinal = 'name'; - $this->L1innerInside = 'INNER JOIN tagente_modulo tam - ON ta.id_agente = tam.id_agente'; - + $this->L1innerInside = 'INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae ON tae.id_agente_modulo = tam.id_agente_modulo'; $this->L2condition = "AND tam.nombre = '".$this->symbol2name($this->rootID)."'"; } From 590c7f748048b154e111bf384aa85f03fdccea65 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 17:22:19 +0100 Subject: [PATCH 4/6] #12686 fixed filter in tree module group --- pandora_console/include/class/Tree.class.php | 2 +- pandora_console/include/class/TreeModuleGroup.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 1d8ac12d63..da0034ac88 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -304,7 +304,7 @@ class Tree } $filter_status = ''; - if ((int) $this->filter['statusModule'] !== -1 && $this->type === 'module') { + if ((int) $this->filter['statusModule'] !== -1 && ($this->type === 'module' || $this->type === 'module_group')) { $filter_status = ' AND tae.estado = '.$this->filter['statusModule']; } diff --git a/pandora_console/include/class/TreeModuleGroup.class.php b/pandora_console/include/class/TreeModuleGroup.class.php index 77f4b364c4..47dba241ac 100644 --- a/pandora_console/include/class/TreeModuleGroup.class.php +++ b/pandora_console/include/class/TreeModuleGroup.class.php @@ -31,8 +31,8 @@ class TreeModuleGroup extends Tree 'tmg.id_mg AS id', ]; $this->L1inner = 'INNER JOIN tmodule_group tmg ON tmg.id_mg = x2.g'; - $this->L1innerInside = 'INNER JOIN tagente_modulo tam - ON ta.id_agente = tam.id_agente'; + $this->L1innerInside = 'INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae ON tae.id_agente_modulo = tam.id_agente_modulo'; $this->L1orderByFinal = 'tmg.name'; $this->L2condition = 'AND tam.id_module_group = '.$this->rootID; From 8f69c109d5d4a6a4e68e693257b73253605d6aa8 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 17:55:41 +0100 Subject: [PATCH 5/6] #12686 fixed filter in tree module tag --- pandora_console/include/class/Tree.class.php | 2 +- pandora_console/include/class/TreeTag.class.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index da0034ac88..96ced52e6f 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -304,7 +304,7 @@ class Tree } $filter_status = ''; - if ((int) $this->filter['statusModule'] !== -1 && ($this->type === 'module' || $this->type === 'module_group')) { + if ((int) $this->filter['statusModule'] !== -1 && ($this->type === 'module' || $this->type === 'module_group' || $this->type === 'tag')) { $filter_status = ' AND tae.estado = '.$this->filter['statusModule']; } diff --git a/pandora_console/include/class/TreeTag.class.php b/pandora_console/include/class/TreeTag.class.php index d2d748c903..16e2358c0e 100644 --- a/pandora_console/include/class/TreeTag.class.php +++ b/pandora_console/include/class/TreeTag.class.php @@ -29,6 +29,8 @@ class TreeTag extends Tree $this->L1innerInside = ' INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae + ON tae.id_agente_modulo = tam.id_agente_modulo INNER JOIN ttag_module ttm ON ttm.id_agente_modulo = tam.id_agente_modulo '; From bb92202ba26020a63e656bca19560a79b51c36c5 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 26 Dec 2023 18:33:31 +0100 Subject: [PATCH 6/6] #12706 fixed events groups by agent --- pandora_console/operation/events/events.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 0863e35607..66a6908442 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -3080,7 +3080,10 @@ function process_datatables_callback(table, settings) { .data() .each( function ( group, i ) { $(rows).eq( i ).show(); - if ( last !== group ) { + // Compare only "a" tag because in metaconsole the node has "form". + let last_to_compare = $(last).filter('a').html(); + let group_to_compare = $(group).filter('a').html(); + if ( last_to_compare !== group_to_compare ) { $(rows).eq( i ).before( '' +''