X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Flogs.cgi%2Ffirewalllogport.dat;h=7a32a906f087766d7c125641a81bff68385f393e;hp=3727d2efab2430b4dff3a900a1c2a4e9fdb27d8b;hb=057652c5e548c5e0b0e4e07559c21b7916335af9;hpb=9c1009572a9395aeebd235017bf4f53a84acd42b diff --git a/html/cgi-bin/logs.cgi/firewalllogport.dat b/html/cgi-bin/logs.cgi/firewalllogport.dat index 3727d2efa..7a32a906f 100644 --- a/html/cgi-bin/logs.cgi/firewalllogport.dat +++ b/html/cgi-bin/logs.cgi/firewalllogport.dat @@ -222,7 +222,7 @@ if ($errormessage) { &Header::closebox(); } -&Header::openbox('100%', 'left', "$Lang::tr{'settings'}:"); +&Header::openbox('100%', 'left', "$Lang::tr{'settings'}"); print < @@ -267,15 +267,15 @@ print < - + + + + $Lang::tr{'Number of Ports for the pie chart'}: + + - - - - -
$Lang::tr{'Number of Ports for the pie chart'}:
- + END ; @@ -324,7 +324,7 @@ else @tabjc2 = sort { $a <=> $b } keys (%tabjc); } -my $colour=1; +my $color=10; @@ -374,7 +374,11 @@ else{ my @data = (\@ports,\@numb); use GD::Graph::colour qw( :files ); -GD::Graph::colour::read_rgb( "/srv/web/ipfire/html/themes/ipfire/include/colours.txt" ); + +my %color = (); +my %mainsettings = (); +&General::readhash("${General::swroot}/main/settings", \%mainsettings); +&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { my $mygraph = GD::Graph::pie->new(500, 350); @@ -385,7 +389,7 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { ) or warn $mygraph->error; $mygraph->set_value_font(GD::gdMediumBoldFont); - $mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] ); + $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] ); my $myimage = $mygraph->plot(\@data) or die $mygraph->error; my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png"); @@ -402,104 +406,77 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { } print < + - - - - + + + + END ; my $total=0; my $show=0; -my @colour; -my $colour1; -my $colour2; -my $colour3; -my $colour4; -my $colour5; -my $colour6; -my $colour7; -my $colour8; -my $colour9; -my $colour10; - -@colour = GD::Graph::colour::_rgb("colour1"); -$colour1 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour2"); -$colour2 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour3"); -$colour3 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour4"); -$colour4 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour5"); -$colour5 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour6"); -$colour6 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour7"); -$colour7 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour8"); -$colour8 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour9"); -$colour9 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); -@colour = GD::Graph::colour::_rgb("colour10"); -$colour10 = GD::Graph::colour::rgb2hex($colour[0], $colour[1], $colour[2]); my $s; my $percent; +my $col=""; + for($s=0;$s<$lines;$s++) { $show++; $percent = $value[$s] * 100 / $linesjc; - $percent = sprintf("%.3f", $percent); + $percent = sprintf("%.f", $percent); $total = $total + $value[$s]; - if ( ($colour % 10) == 1 ){print "\n";} - if ( ($colour % 10) == 2 ){print "\n";} - if ( ($colour % 10) == 3 ){print "\n";} - if ( ($colour % 10) == 4 ){print "\n";} - if ( ($colour % 10) == 5 ){print "\n";} - if ( ($colour % 10) == 6 ){print "\n";} - if ( ($colour % 10) == 7 ){print "\n";} - if ( ($colour % 10) == 8 ){print "\n";} - if ( ($colour % 10) == 9 ){print "\n";} - if ( ($colour % 10) == 0 ){print "\n";} - - $colour++; - print ""; - print ""; - print ""; - print ""; + if ( ($color % 10) == 1 ){print ""; $col="BGCOLOR='$color{'color1'}'";} + if ( ($color % 10) == 2 ){print ""; $col="BGCOLOR='$color{'color2'}'";} + if ( ($color % 10) == 3 ){print ""; $col="BGCOLOR='$color{'color3'}'";} + if ( ($color % 10) == 4 ){print ""; $col="BGCOLOR='$color{'color4'}'";} + if ( ($color % 10) == 5 ){print ""; $col="BGCOLOR='$color{'color5'}'";} + if ( ($color % 10) == 6 ){print ""; $col="BGCOLOR='$color{'color6'}'";} + if ( ($color % 10) == 7 ){print ""; $col="BGCOLOR='$color{'color7'}'";} + if ( ($color % 10) == 8 ){print ""; $col="BGCOLOR='$color{'color8'}'";} + if ( ($color % 10) == 9 ){print ""; $col="BGCOLOR='$color{'color9'}'";} + if ( ($color % 10) == 0 ){print ""; $col="BGCOLOR='$color{'color10'}'";} + + $color++; + print ""; + print ""; + print ""; + print ""; print ""; } if($cgiparams{'otherspie'} == 2 ){} else{ -if ( ($colour % 10) == 1 ){print "\n";} -if ( ($colour % 10) == 2 ){print "\n";} -if ( ($colour % 10) == 3 ){print "\n";} -if ( ($colour % 10) == 4 ){print "\n";} -if ( ($colour % 10) == 5 ){print "\n";} -if ( ($colour % 10) == 6 ){print "\n";} -if ( ($colour % 10) == 7 ){print "\n";} -if ( ($colour % 10) == 8 ){print "\n";} -if ( ($colour % 10) == 9 ){print "\n";} -if ( ($colour % 10) == 0 ){print "\n";} - +if ( ($color % 10) == 1 ){print ""; $col="BGCOLOR='$color{'color1'}'";} +if ( ($color % 10) == 2 ){print ""; $col="BGCOLOR='$color{'color2'}'";} +if ( ($color % 10) == 3 ){print ""; $col="BGCOLOR='$color{'color3'}'";} +if ( ($color % 10) == 4 ){print ""; $col="BGCOLOR='$color{'color4'}'";} +if ( ($color % 10) == 5 ){print ""; $col="BGCOLOR='$color{'color5'}'";} +if ( ($color % 10) == 6 ){print ""; $col="BGCOLOR='$color{'color6'}'";} +if ( ($color % 10) == 7 ){print ""; $col="BGCOLOR='$color{'color7'}'";} +if ( ($color % 10) == 8 ){print ""; $col="BGCOLOR='$color{'color8'}'";} +if ( ($color % 10) == 9 ){print ""; $col="BGCOLOR='$color{'color9'}'";} +if ( ($color % 10) == 0 ){print ""; $col="BGCOLOR='$color{'color10'}'";} + +if ( $linesjc ne "0") +{ my $dif; $dif = $linesjc - $total; $percent = $dif * 100 / $linesjc; -$percent = sprintf("%.3f", $percent); +$percent = sprintf("%.f", $percent); print < - - - + + + + END ; } +} print < END @@ -524,4 +501,3 @@ sub checkversion { #Automatic Updates is disabled return "0","0"; } -
PortCountPercentPortCountPercent
$key[$s]$value[$s]$percent
$key[$s]$value[$s]$percent
$Lang::tr{'otherport'}$dif$percent$Lang::tr{'otherport'}$dif$percent