From 4cc3eb13b95e18fd4da8a3e611ce070083fc588a Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 11 Mar 2019 17:53:21 +0100 Subject: [PATCH] Fixed order_by filter (some filter where lost) Former-commit-id: 8f58c2615e5e8d5ba85908a888ec3dd2bcdf6f14 --- .../operation/network/network_report.php | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/pandora_console/operation/network/network_report.php b/pandora_console/operation/network/network_report.php index 53428890cc..e638c39bc2 100644 --- a/pandora_console/operation/network/network_report.php +++ b/pandora_console/operation/network/network_report.php @@ -139,6 +139,7 @@ $table->data['1']['2'] .= html_print_submit_button( ); echo '
'; +html_print_input_hidden('order_by', $order_by); if (!empty($main_value)) { html_print_input_hidden('main_value', $main_value); } @@ -191,7 +192,10 @@ if (!$is_network) { __('Flows'), 'flows', $order_by, - $hidden_main_link + array_merge( + $hidden_main_link, + ['main_value' => $main_value] + ) ); } @@ -199,13 +203,19 @@ $table->head['pkts'] = network_print_explorer_header( __('Packets'), 'pkts', $order_by, - $hidden_main_link + array_merge( + $hidden_main_link, + ['main_value' => $main_value] + ) ); $table->head['bytes'] = network_print_explorer_header( __('Bytes'), 'bytes', $order_by, - $hidden_main_link + array_merge( + $hidden_main_link, + ['main_value' => $main_value] + ) ); // Add the order. @@ -301,7 +311,20 @@ foreach ($data as $item) { $table->data[] = $row; // Build the pie graph data structure. - $chart_data[$item['host']] = $item['sum_bytes']; + switch ($order_by) { + case 'pkts': + $chart_data[$item['host']] = $item['sum_bytes']; + break; + + case 'flows': + $chart_data[$item['host']] = $item['sum_flows']; + break; + + case 'bytes': + default: + $chart_data[$item['host']] = $item['sum_bytes']; + break; + } } if (empty($data)) {