From f8a54d16c160af63e81389e6d57e0fe044dba544 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 11 Oct 2023 12:49:54 +0200 Subject: [PATCH 01/19] Update VMware migration hash code --- .../extras/discovery/DiscoveryApplicationsMigrateCodes.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini index 2dc698cb74..6323aec140 100644 --- a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini +++ b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini @@ -1,4 +1,4 @@ -pandorafms.vmware=459175dce8ab811e874ce2e7216f0db4 +pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe pandorafms.mssql=1cc215409741d19080269ffba112810e pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6 From 3ce6c6de19aaa6243e85f9c87d844bce5b5d568b Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 11 Oct 2023 15:34:10 +0200 Subject: [PATCH 02/19] #12203 Fix sintaxis module editor webserver --- .../godmode/agentes/configurar_agente.php | 16 ++++++++++++++++ .../agentes/module_manager_editor_web.php | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index b78b98f3c7..4e331c2e18 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1348,6 +1348,14 @@ if ($update_module === true || $create_module === true) { } $configuration_data = (string) get_parameter('configuration_data'); + $array_configuration_data = explode(PHP_EOL, io_safe_output($configuration_data)); + $configuration_data = ''; + foreach ($array_configuration_data as $value) { + $configuration_data .= trim($value).PHP_EOL; + } + + $configuration_data = io_safe_input($configuration_data); + $old_configuration_data = (string) get_parameter('old_configuration_data'); $new_configuration_data = ''; @@ -1488,6 +1496,14 @@ if ($update_module === true || $create_module === true) { } $plugin_parameter = (string) get_parameter('plugin_parameter'); + + $array_plugin_parameter = explode(PHP_EOL, io_safe_output($plugin_parameter)); + $plugin_parameter = ''; + foreach ($array_plugin_parameter as $value) { + $plugin_parameter .= trim($value).PHP_EOL; + } + + $plugin_parameter = io_safe_input($plugin_parameter); } $parent_module_id = (int) get_parameter('parent_module_id'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_web.php b/pandora_console/godmode/agentes/module_manager_editor_web.php index 727e16d5bf..6089a932ee 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_web.php +++ b/pandora_console/godmode/agentes/module_manager_editor_web.php @@ -318,7 +318,7 @@ foreach ($texts as $code => $text) { return; } - $(plugin_parameter).val('task_begin\ncookie 0\nresource 0\ntask_end'); + $(plugin_parameter).val('task_begin\nget https://demoweb.com/page/\ncheck_string text string or HTML code to search (regexp)\ntask_end\n'); $('#button-btn_loadbasic').attr('disabled', 'disabled'); From 7bba90cd4fafce3e654e2e1a24a1cfb0afa1c779 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 19 Oct 2023 17:18:13 +0200 Subject: [PATCH 03/19] #12288 added spinner in netflow and fixed bug filter --- pandora_console/include/styles/pandora.css | 5 +++ .../operation/netflow/nf_live_view.php | 29 +++++++++++-- .../operation/network/network_report.php | 41 +++++++++++++++---- .../operation/network/network_usage_map.php | 25 ++++++++++- 4 files changed, 86 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 1e89e83243..5146b18401 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1292,6 +1292,11 @@ p.center { margin: 0 5px; } +.loading-text { + font-size: 19px; + text-align: center; +} + /* Legacy spinner */ #loading { position: fixed; diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index a60abc178a..d9d9302bab 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -87,7 +87,7 @@ if (is_ajax() === true) { $filter_id = (int) get_parameter('filter_id', 0); $filter['id_name'] = get_parameter('new_filter_name', ''); $filter['id_group'] = (int) get_parameter('assign_group', 0); -$filter['aggregate'] = get_parameter('aggregate', ''); +$filter['aggregate'] = get_parameter('aggregate', 'dstip'); $filter['ip_dst'] = get_parameter('ip_dst', ''); $filter['ip_src'] = get_parameter('ip_src', ''); $filter['dst_port'] = get_parameter('dst_port', ''); @@ -145,7 +145,8 @@ if ($custom_date === '1') { } // Read buttons. -$draw = get_parameter('draw_button', ''); +// Change default value for not autoload default filter when load view. +$draw = get_parameter('draw_button', 1); $save = get_parameter('save_button', ''); $update = get_parameter('update_button', ''); @@ -639,6 +640,7 @@ if (empty($draw) === false) { // Draw the netflow chart. html_print_div( [ + 'id' => 'container_netflow', 'class' => $netflowContainerClass, 'content' => netflow_draw_item( $date_from, @@ -653,6 +655,22 @@ if (empty($draw) === false) { ), ] ); + $spinner = html_print_div( + [ + 'content' => '', + 'class' => 'spinner-fixed inherit', + 'style' => 'position: initial;', + ], + true + ); + html_print_div( + [ + 'id' => 'spinner', + 'content' => '

'.__('Loading netflow data, plase wait...').'

'.$spinner, + 'class' => 'invisible', + 'style' => 'position: initial;', + ] + ); } } else { ui_print_info_message(__('No data to show')); @@ -891,8 +909,6 @@ ui_include_time_picker(); $(document).ready( function() { displayMonitoringFilter(); - // Update visibility of controls. - nf_view_click_period(); // Hide update filter button if ($("#filter_id").val() == 0) { $("#submit-update_button").hide(); @@ -912,6 +928,11 @@ ui_include_time_picker(); $('#filter_group_color').css('color', '#000000'); } }); + + $("#button-draw_button").on('click', function(){ + $("#container_netflow").remove(); + $("#spinner").removeClass("invisible"); + }); }); $("#text-time, #text-time_lower").timepicker({ diff --git a/pandora_console/operation/network/network_report.php b/pandora_console/operation/network/network_report.php index 980d50d405..93292566d6 100644 --- a/pandora_console/operation/network/network_report.php +++ b/pandora_console/operation/network/network_report.php @@ -239,12 +239,16 @@ $data = netflow_get_top_summary( // Get the params to return the builder. $hidden_main_link = [ - 'time_greater' => $time_greater, - 'date_greater' => $date_greater, - 'time_lower' => $time_lower, - 'date_lower' => $date_lower, - 'top' => $top, - 'action' => $action, + 'custom_date' => get_parameter('custom_date', '0'), + 'date' => get_parameter('date', SECONDS_1DAY), + 'date_init' => get_parameter('date_init'), + 'time_init' => get_parameter('time_init'), + 'date_end' => get_parameter('date_end'), + 'time_end' => get_parameter('time_end'), + 'date_text' => get_parameter('date_text'), + 'date_units' => get_parameter('date_units'), + 'top' => $top, + 'action' => $action, ]; unset($table); @@ -426,18 +430,34 @@ if (empty($data)) { // Print results. html_print_div( [ + 'id' => 'content-netflow', 'style' => 'max-width: -webkit-fill-available; display: flex', 'class' => '', 'content' => $resultsTable.$pieGraph, ] ); + + $spinner = html_print_div( + [ + 'content' => '', + 'class' => 'spinner-fixed inherit', + 'style' => 'position: initial;', + ], + true + ); + html_print_div( + [ + 'id' => 'spinner', + 'content' => '

Loading netflow data, plase wait...

'.$spinner, + 'class' => 'invisible', + 'style' => 'position: initial;', + ] + ); } ?>