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;', + ] + ); } ?>