Match color coding in pie chart and table in the cgi-scrips firewalllogip.dat, firewalllogport.dat and firewalllogcountry.dat. Colors are coded color1 to color10 while old code for table mapped color0 to color9. Signed-off-by: Michael Eitelwein --- diff --git a/html/cgi-bin/logs.cgi/firewalllogcountry.dat b/html/cgi-bin/logs.cgi/firewalllogcountry.dat index f998a62..7f71497 100644 --- a/html/cgi-bin/logs.cgi/firewalllogcountry.dat +++ b/html/cgi-bin/logs.cgi/firewalllogcountry.dat @@ -448,10 +448,8 @@ for($s=0;$s<$lines;$s++) $percent = $value[$s] * 100 / $linesjc; $percent = sprintf("%.f", $percent); $total = $total + $value[$s]; - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; $color++; print ""; @@ -489,10 +487,8 @@ for($s=0;$s<$lines;$s++) if($cgiparams{'otherspie'} == 2 ){} else{ - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; print ""; diff --git a/html/cgi-bin/logs.cgi/firewalllogip.dat b/html/cgi-bin/logs.cgi/firewalllogip.dat index 7d82d20..117b423 100644 --- a/html/cgi-bin/logs.cgi/firewalllogip.dat +++ b/html/cgi-bin/logs.cgi/firewalllogip.dat @@ -428,10 +428,8 @@ for($s=0;$s<$lines;$s++) $percent = $value[$s] * 100 / $linesjc; $percent = sprintf("%.f", $percent); $total = $total + $value[$s]; - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; print ""; @@ -459,10 +457,8 @@ for($s=0;$s<$lines;$s++) if($cgiparams{'otherspie'} == 2 ){} else{ - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; print ""; diff --git a/html/cgi-bin/logs.cgi/firewalllogport.dat b/html/cgi-bin/logs.cgi/firewalllogport.dat index 5b0db62..583c1b3 100644 --- a/html/cgi-bin/logs.cgi/firewalllogport.dat +++ b/html/cgi-bin/logs.cgi/firewalllogport.dat @@ -429,10 +429,8 @@ for($s=0;$s<$lines;$s++) $percent = $value[$s] * 100 / $linesjc; $percent = sprintf("%.f", $percent); $total = $total + $value[$s]; - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; print ""; @@ -446,10 +444,8 @@ for($s=0;$s<$lines;$s++) if($cgiparams{'otherspie'} == 2 ){} else{ - my $colorIndex = $color % 10; - if($colorIndex == 0) { - $colorIndex = 10; - } + # colors are numbered 1 to 10 + my $colorIndex = ($color % 10) + 1; $col="bgcolor='$color{\"color$colorIndex\"}'"; print "";