Match color coding of pie chart and table in firwalllog[ip|port|country].dat
Message ID | 568E4D0C.1060201@eitelwein.net |
---|---|
State | Dropped |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.tremer.info [172.28.1.200]) by septima.ipfire.org (Postfix) with ESMTP id 053EE60EC8 for <patchwork@ipfire.org>; Thu, 7 Jan 2016 12:33:38 +0100 (CET) Received: from hedwig.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 68A6FA76; Thu, 7 Jan 2016 12:33:37 +0100 (CET) Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=82.98.82.95; helo=outgoing.selfhost.de; envelope-from=michael@eitelwein.net; receiver=development@lists.ipfire.org Received: from outgoing.selfhost.de (out.selfhost.de [82.98.82.95]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPS id 940B0A4D for <development@lists.ipfire.org>; Thu, 7 Jan 2016 12:33:35 +0100 (CET) Received: (qmail 30941 invoked from network); 7 Jan 2016 11:33:34 -0000 Received: from unknown (HELO mail.eitelwein.net) (postmaster@bncmfdox.mail.selfhost.de@93.229.67.100) by mailout.selfhost.de with ESMTPA; 7 Jan 2016 11:33:34 -0000 Received: from localhost (smtp.eitelwein.net [IPv6:2001:4dd0:ff00:89e5::208]) by mail.eitelwein.net (Postfix) with ESMTP id 9BE40238 for <development@lists.ipfire.org>; Thu, 7 Jan 2016 12:33:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at eitelwein.net Received: from mail.eitelwein.net ([IPv6:2001:4dd0:ff00:89e5::208]) by localhost (vscan.eitelwein.net [IPv6:2001:4dd0:ff00:89e5::208]) (amavisd-new, port 10024) with ESMTP id WJci3jI3Qogh for <development@lists.ipfire.org>; Thu, 7 Jan 2016 12:33:33 +0100 (CET) Received: from [IPv6:2001:4dd0:ff00:89e5:2437:bfa4:d2bb:2c74] (unknown [IPv6:2001:4dd0:ff00:89e5:2437:bfa4:d2bb:2c74]) by mail.eitelwein.net (Postfix) with ESMTPSA id 56CC1EA for <development@lists.ipfire.org>; Thu, 7 Jan 2016 12:33:33 +0100 (CET) To: development@lists.ipfire.org From: Michael Eitelwein <michael@eitelwein.net> Subject: [PATCH] Match color coding of pie chart and table in firwalllog[ip|port|country].dat Message-ID: <568E4D0C.1060201@eitelwein.net> Date: Thu, 7 Jan 2016 12:33:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Michael Eitelwein
Jan. 7, 2016, 10:33 p.m. UTC
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 <michael@eitelwein.net>
---
Comments
Hello Michael, thank you very much for sending in your patches and welcome to the project. :) This patch looks good and I think it could be merged. I am not sure about the coding style though. This is usually a bit difficult to make out in the patch format, but coding style in those old files is messed up pretty much already. We usually use tabs, but there is some code that uses spaces instead. Best, -Michael On Thu, 2016-01-07 at 12:33 +0100, Michael Eitelwein wrote: > 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 <michael@eitelwein.net> > --- > 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 "<tr>"; > @@ -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 "<tr>"; > > 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 "<tr>"; > > @@ -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 "<tr>"; > > 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 "<tr>"; > > @@ -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 "<tr>";