From 834c18e49ee280eed0c90752e1fab044d40030d1 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 14 Mar 2019 09:07:17 +0100 Subject: [PATCH] [Netflow live] Remove unit from statistics table Former-commit-id: 2b0289fef0b663b558794b2ac1b16d0128c68bc9 --- pandora_console/include/functions_netflow.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 81711005c3..f197b43063 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -236,11 +236,10 @@ function sort_netflow_data(&$netflow_data) * @param string start_date Start date. * @param string end_date End date. * @param string aggregate Aggregate field. - * @param string unit Unit to show. * * @return The statistics table. */ -function netflow_stat_table($data, $start_date, $end_date, $aggregate, $unit) +function netflow_stat_table($data, $start_date, $end_date, $aggregate) { global $nfdump_date_format; @@ -256,7 +255,7 @@ function netflow_stat_table($data, $start_date, $end_date, $aggregate, $unit) $table->head = []; $table->head[0] = ''.netflow_format_aggregate($aggregate).''; - $table->head[1] = ''.netflow_format_unit($unit).''; + $table->head[1] = ''.__('Value').''; $table->style[0] = 'padding: 6px;'; $table->style[1] = 'padding: 6px;'; @@ -264,14 +263,20 @@ function netflow_stat_table($data, $start_date, $end_date, $aggregate, $unit) $agg = $data[$j]['agg']; if (!isset($values[$agg])) { $values[$agg] = $data[$j]['data']; - $table->data[$x][0] = $agg; - $table->data[$x][1] = format_numeric($data[$j]['data']).' '.netflow_format_unit($unit); } else { $values[$agg] += $data[$j]['data']; - $table->data[$x][0] = $agg; - $table->data[$x][1] = format_numeric($data[$j]['data']).' '.netflow_format_unit($unit); } + $table->data[$x][0] = $agg; + $table->data[$x][1] = format_for_graph( + $data[$j]['data'], + 2, + '.', + ',', + 1024, + 'B' + ); + $j++; $x++; } @@ -1214,7 +1219,7 @@ function netflow_draw_item($start_date, $end_date, $interval_length, $type, $fil $filter, $aggregate, $max_aggregates, - $unit, + true, $connection_name, $address_resolution ); @@ -1223,7 +1228,7 @@ function netflow_draw_item($start_date, $end_date, $interval_length, $type, $fil } if ($output == 'HTML' || $output == 'PDF') { - $html = netflow_stat_table($data, $start_date, $end_date, $aggregate, $unit); + $html = netflow_stat_table($data, $start_date, $end_date, $aggregate); return $html; } else if ($output == 'XML') { return netflow_stat_xml($data);