diff --git a/bandwidth/index.cgi b/bandwidth/index.cgi index f6ed8f643..04278e1ce 100755 --- a/bandwidth/index.cgi +++ b/bandwidth/index.cgi @@ -124,54 +124,47 @@ elsif ($missingrule || !$sysconf) { if (@hours) { # Show reporting form print &ui_form_start("index.cgi"); - print "
| $text{'index_by'} | \n"; - print "",&ui_select("by", $in{'by'}, - [ [ 'hour', $text{'index_hour'} ], - [ 'day', $text{'index_day'} ], - [ 'host', $text{'index_host'} ], - [ 'proto', $text{'index_proto'} ], - [ 'iport', $text{'index_iport'} ], - [ 'oport', $text{'index_oport'} ], - [ 'port', $text{'index_port'} ] ])," | \n"; + print &ui_table_row($text{'index_by'}, + &ui_select("by", $in{'by'}, + [ [ 'hour', $text{'index_hour'} ], + [ 'day', $text{'index_day'} ], + [ 'host', $text{'index_host'} ], + [ 'proto', $text{'index_proto'} ], + [ 'iport', $text{'index_iport'} ], + [ 'oport', $text{'index_oport'} ], + [ 'port', $text{'index_port'} ] ])); - print "$text{'index_for'} | \n"; - print "",&ui_select("for", $in{'for'}, - [ [ '', $text{'index_all'} ], - [ 'host', $text{'index_forhost'} ], - [ 'proto', $text{'index_forproto'} ], - [ 'iport', $text{'index_foriport'} ], - [ 'oport', $text{'index_foroport'} ] ]),"\n"; - print &ui_textbox("what", $in{'for'} ? $in{'what'} : "", 20), - " | |
| $text{'index_from'} | \n"; - print "", + print &ui_table_row($text{'index_from'}, &date_input($in{'from_day'}, $in{'from_month'}, - $in{'from_year'}, "from"), - &hourmin_input($in{'from_hour'}, "00", "from")," | |||
| $text{'index_to'} | \n"; - print "", + print &ui_table_row($text{'index_to'}, &date_input($in{'to_day'}, $in{'to_month'}, - $in{'to_year'}, "to"), - &hourmin_input($in{'to_hour'}, "00", "to")," | |||
| \n"; - print &ui_checkbox("low", 1, $text{'index_low'}, $in{'low'}); - print &ui_checkbox("resolv", 1, $text{'index_resolv'}, $in{'resolv'}); - print " | ||||
| ", - &ui_submit($text{'index_search'})," | \n"; - - print "||||
\n"; @@ -344,37 +337,45 @@ if ($in{'by'}) { @order = grep { $count{$_} } @order; } if (@order) { - print "
| ",$text{'index_h'.$in{'by'}}," | \n"; - print "$text{'index_usage'} | \n"; - print "|||
| ",&make_date($k*60*60)," | \n"; + push(@cols, &make_date($k*60*60)); } elsif ($in{'by'} eq 'day') { $date = &make_date_day($k*60*60); - print "$date | \n"; + push(@cols, $date); } else { - print "$k | \n"; + push(@cols, $k); } - print "";
- printf " | ";
- print "",&nice_size($count{$k})," | \n"; + push(@cols, $bar); + push(@cols, &nice_size($icount{$k}), + &nice_size($ocount{$k}), + &nice_size($count{$k})); $total += $count{$k}; + $itotal += $icount{$k}; + $ototal += $ocount{$k}; print "
| ", - &nice_size($total)," | ||||
\n"; diff --git a/bandwidth/lang/en b/bandwidth/lang/en index fe1044962..caced9afe 100644 --- a/bandwidth/lang/en +++ b/bandwidth/lang/en @@ -41,6 +41,9 @@ index_efrom=Invalid starting date and time index_eto=Invalid ending date and time index_err=Failed to generate report index_usage=Network traffic downloaded and uploaded +index_in=Download +index_out=Upload +index_total=Total index_hhour=Hour index_hhost=Host index_hday=Day