diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1d96b2a282..9d9d05c3b9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,7 +1,7 @@ 2012-12-07 Sergio Martin * include/functions_categories.php: Add categories - library of functions + library of functions 2012-12-07 Sergio Martin @@ -13,6 +13,11 @@ godmode/modules/manage_network_components.php: Added id_category to network components and module editors +2012-12-07 Ramon Novoa + + * include/functions_netflow.php: More aesthetic fixes to netflow + charts. + 2012-12-07 Ramon Novoa * include/functions_graph.php, diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 281e6eab00..0657585cb4 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1117,20 +1117,20 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi } if ($aggregate != 'none') { if ($output == 'HTML') { - $html = "" . __('Unit') . ": $unit"; - $html .= " " . __('Aggregate') . ": $aggregate"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); + $html .= " " . __('Aggregate') . ": " . netflow_format_aggregate ($aggregate); if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit); + $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, netflow_format_unit ($unit)); return $html; } else if ($output == 'PDF') { - $html = "" . __('Unit') . ": $unit"; - $html .= " " . __('Aggregate') . ": $aggregate"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); + $html .= " " . __('Aggregate') . ": " . netflow_format_aggregate ($aggregate); if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit, 2, true); + $html .= graph_netflow_aggregate_area ($data, $interval, 660, 320, netflow_format_unit ($unit), 2, true); return $html; } else if ($output == 'XML') { $xml = "$unit\n"; @@ -1142,18 +1142,18 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi } else { if ($output == 'HTML') { - $html = "" . __('Unit') . ": $unit"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_total_area ($data, $interval, 660, 320, $unit); + $html .= graph_netflow_total_area ($data, $interval, 660, 320, netflow_format_unit ($unit)); return $html; } else if ($output == 'PDF') { - $html = "" . __('Unit') . ": $unit"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_total_area ($data, $interval, 660, 320, $unit, 2, true); + $html .= graph_netflow_total_area ($data, $interval, 660, 320, netflow_format_unit ($unit), 2, true); return $html; } else if ($output == 'XML') { $xml = "$unit\n"; @@ -1170,14 +1170,14 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi break; } if ($output == 'HTML') { - $html = "" . __('Unit') . ": $unit"; - $html .= " " . __('Aggregate') . ": $aggregate"; - $html .= graph_netflow_aggregate_pie ($data, $aggregate); + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); + $html .= " " . __('Aggregate') . ": " . netflow_format_aggregate ($aggregate); + $html .= graph_netflow_aggregate_pie ($data, netflow_format_aggregate ($aggregate)); return $html; } else if ($output == 'PDF') { - $html = "" . __('Unit') . ": $unit"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); $html .= " " . __('Aggregate') . ": $aggregate"; - $html .= graph_netflow_aggregate_pie ($data, $aggregate, 2, true); + $html .= graph_netflow_aggregate_pie ($data, netflow_format_aggregate ($aggregate), 2, true); return $html; } else if ($output == 'XML') { $xml = "$unit\n"; @@ -1193,8 +1193,8 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi break; } if ($output == 'HTML' || $output == 'PDF') { - $html = "" . __('Unit') . ": $unit"; - $html .= " " . __('Aggregate') . ": $aggregate"; + $html = "" . __('Unit') . ": " . netflow_format_unit ($unit); + $html .= " " . __('Aggregate') . ": " . netflow_format_aggregate ($aggregate); if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } @@ -1473,13 +1473,13 @@ function netflow_generate_unique_id ($type, $filter, $start_date) { function netflow_format_unit ($unit) { switch ($unit){ case 'megabytes': - return __('MBytes'); + return __('MB'); case 'megabytespersecond': - return __('MBytes/s'); + return __('MB/s'); case 'kilobytes': - return __('kBytes'); + return __('kB'); case 'kilobytespersecond': - return __('kBytes/s'); + return __('kB/s'); default: return ''; }