mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
kleiner Zwischenfix
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@464 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -1285,7 +1285,6 @@ srv/web/ipfire/cgi-bin/index.cgi
|
||||
srv/web/ipfire/cgi-bin/ipinfo.cgi
|
||||
srv/web/ipfire/cgi-bin/iptables.cgi
|
||||
srv/web/ipfire/cgi-bin/logs.cgi
|
||||
#srv/web/ipfire/cgi-bin/logs.cgi/colours.txt
|
||||
#srv/web/ipfire/cgi-bin/logs.cgi/config.dat
|
||||
#srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
|
||||
#srv/web/ipfire/cgi-bin/logs.cgi/firewalllogip.dat
|
||||
@@ -1664,6 +1663,7 @@ srv/web/ipfire/html
|
||||
#srv/web/ipfire/html/themes/ipfire/images/n6.gif
|
||||
#srv/web/ipfire/html/themes/ipfire/images/spacer.gif
|
||||
#srv/web/ipfire/html/themes/ipfire/include
|
||||
#srv/web/ipfire/html/themes/ipfire/include/colours.txt
|
||||
#srv/web/ipfire/html/themes/ipfire/include/functions.pl
|
||||
#srv/web/ipfire/html/themes/ipfire/include/style.css
|
||||
#srv/web/ipfire/html/updatecache
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
!"R" "G" "B" "Colour Name"
|
||||
57 44 187 colour1
|
||||
79 125 255 colour2
|
||||
79 185 255 colour3
|
||||
79 225 255 colour4
|
||||
189 225 255 colour5
|
||||
195 183 255 colour6
|
||||
195 125 255 colour7
|
||||
195 241 197 colour8
|
||||
195 241 140 colour9
|
||||
86 202 145 colour10
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
# JC HERITIER
|
||||
# page inspired from the initial firewalllog.dat
|
||||
#
|
||||
# modified for ipcop by Markus Hoffmann und Michael Winkler and for ipfire by Christian Schmidt
|
||||
# Modified for IPFire by Christian Schmidt
|
||||
# and Michael Tremer (www.ipfire.org)
|
||||
|
||||
use strict;
|
||||
use Geo::IP::PurePerl;
|
||||
@@ -41,11 +42,11 @@ $cgiparams{'showpie'} = 1;
|
||||
$cgiparams{'sortcolumn'} = 1;
|
||||
|
||||
my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
|
||||
'Sep', 'Oct', 'Nov', 'Dec' );
|
||||
'Sep', 'Oct', 'Nov', 'Dec' );
|
||||
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
|
||||
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
|
||||
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
|
||||
$Lang::tr{'december'} );
|
||||
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
|
||||
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
|
||||
$Lang::tr{'december'} );
|
||||
|
||||
my @now = localtime();
|
||||
my $dow = $now[6];
|
||||
@@ -77,17 +78,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
|
||||
my $start = -1;
|
||||
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
|
||||
{
|
||||
my @temp = split(',',$ENV{'QUERY_STRING'});
|
||||
$start = $temp[0];
|
||||
$cgiparams{'MONTH'} = $temp[1];
|
||||
$cgiparams{'DAY'} = $temp[2];
|
||||
my @temp = split(',',$ENV{'QUERY_STRING'});
|
||||
$start = $temp[0];
|
||||
$cgiparams{'MONTH'} = $temp[1];
|
||||
$cgiparams{'DAY'} = $temp[2];
|
||||
}
|
||||
|
||||
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
|
||||
!($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
|
||||
{
|
||||
$cgiparams{'DAY'} = $now[3];
|
||||
$cgiparams{'MONTH'} = $now[4];
|
||||
$cgiparams{'DAY'} = $now[3];
|
||||
$cgiparams{'MONTH'} = $now[4];
|
||||
}
|
||||
elsif($cgiparams{'ACTION'} eq '>>')
|
||||
{
|
||||
@@ -153,9 +154,9 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
|
||||
my $day = $cgiparams{'DAY'};
|
||||
my $daystr='';
|
||||
if ($day <= 9) {
|
||||
$daystr = " $day"; }
|
||||
$daystr = " $day"; }
|
||||
else {
|
||||
$daystr = $day;
|
||||
$daystr = $day;
|
||||
}
|
||||
|
||||
my $skip=0;
|
||||
@@ -179,12 +180,12 @@ if (!$skip)
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
|
||||
$skip=0;
|
||||
@@ -201,14 +202,14 @@ if ($multifile) {
|
||||
$skip=1;
|
||||
}
|
||||
if (!$skip) {
|
||||
while (<FILE>) {
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
while (<FILE>) {
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
}
|
||||
|
||||
my $MODNAME="fwlogs";
|
||||
@@ -219,9 +220,9 @@ my $MODNAME="fwlogs";
|
||||
|
||||
|
||||
if ($errormessage) {
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<font class='base'>$errormessage </font>\n";
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<font class='base'>$errormessage </font>\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'settings'}:");
|
||||
@@ -230,33 +231,33 @@ print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='10%' class='base'>$Lang::tr{'month'}: </td>
|
||||
<td width='10%'>
|
||||
<select name='MONTH'>
|
||||
<td width='10%' class='base'>$Lang::tr{'month'}: </td>
|
||||
<td width='10%'>
|
||||
<select name='MONTH'>
|
||||
END
|
||||
;
|
||||
my $month;
|
||||
for ($month = 0; $month < 12; $month++)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($month == $cgiparams{'MONTH'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$month'>$longmonths[$month]</option>\n";
|
||||
print "\t<option ";
|
||||
if ($month == $cgiparams{'MONTH'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$month'>$longmonths[$month]</option>\n";
|
||||
}
|
||||
print <<END
|
||||
</select>
|
||||
</td>
|
||||
<td width='10%' class='base' align='right'> $Lang::tr{'day'}: </td>
|
||||
<td width='40%'>
|
||||
<select name='DAY'>
|
||||
</select>
|
||||
</td>
|
||||
<td width='10%' class='base' align='right'> $Lang::tr{'day'}: </td>
|
||||
<td width='40%'>
|
||||
<select name='DAY'>
|
||||
END
|
||||
;
|
||||
for ($day = 1; $day <= 31; $day++)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($day == $cgiparams{'DAY'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$day'>$day</option>\n";
|
||||
print "\t<option ";
|
||||
if ($day == $cgiparams{'DAY'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$day'>$day</option>\n";
|
||||
}
|
||||
|
||||
if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
|
||||
@@ -274,8 +275,8 @@ print <<END
|
||||
</table>
|
||||
<table width='100%'>
|
||||
<tr><td width='20%' align='right' valign="center">$Lang::tr{'Number of IPs for the pie chart'}:</td>
|
||||
<td width='10%' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
|
||||
<td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
|
||||
<td width='10%' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
|
||||
<td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
END
|
||||
@@ -319,11 +320,11 @@ my @tabjc2;
|
||||
|
||||
if ($sortcolumn == 1)
|
||||
{
|
||||
@tabjc2 = sort { $b <=> $a } values (%tabjc);
|
||||
@tabjc2 = sort { $b <=> $a } values (%tabjc);
|
||||
}
|
||||
else
|
||||
{
|
||||
@tabjc2 = sort { $a <=> $b } keys (%tabjc);
|
||||
@tabjc2 = sort { $a <=> $b } keys (%tabjc);
|
||||
}
|
||||
|
||||
my $colour=1;
|
||||
@@ -337,17 +338,17 @@ my $v;
|
||||
|
||||
if ($sortcolumn == 1)
|
||||
{
|
||||
for ($v=0;$v<$pienumber;$v++){
|
||||
findkey($tabjc2[$v]);
|
||||
}
|
||||
for ($v=0;$v<$pienumber;$v++){
|
||||
findkey($tabjc2[$v]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach $v (@tabjc2) {
|
||||
$key[$indice] = $v;
|
||||
$value[$indice] = $tabjc{$v};
|
||||
$indice++;
|
||||
}
|
||||
foreach $v (@tabjc2) {
|
||||
$key[$indice] = $v;
|
||||
$value[$indice] = $tabjc{$v};
|
||||
$indice++;
|
||||
}
|
||||
}
|
||||
|
||||
my @ips;
|
||||
@@ -360,44 +361,44 @@ my $o;
|
||||
|
||||
if($cgiparams{'otherspie'} == 2 ){}
|
||||
else{
|
||||
my $numothers;
|
||||
for($o=0;$o<$pienumber;$o++){
|
||||
$numothers = $numothers + $numb[$o];
|
||||
}
|
||||
$numothers = $linesjc - $numothers;
|
||||
if ($numothers > 0) {
|
||||
$ips[$pienumber]="$Lang::tr{'otherip'}";
|
||||
$numb[$pienumber] = $numothers;
|
||||
}
|
||||
my $numothers;
|
||||
for($o=0;$o<$pienumber;$o++){
|
||||
$numothers = $numothers + $numb[$o];
|
||||
}
|
||||
$numothers = $linesjc - $numothers;
|
||||
if ($numothers > 0) {
|
||||
$ips[$pienumber]="$Lang::tr{'otherip'}";
|
||||
$numb[$pienumber] = $numothers;
|
||||
}
|
||||
}
|
||||
|
||||
my @data = (\@ips,\@numb);
|
||||
use GD::Graph::colour qw( :files );
|
||||
GD::Graph::colour::read_rgb( "/srv/web/ipfire/cgi-bin/logs.cgi/colours.txt" );
|
||||
GD::Graph::colour::read_rgb( "/srv/web/ipfire/html/themes/ipfie/include/colours.txt" );
|
||||
|
||||
if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
|
||||
my $mygraph = GD::Graph::pie->new(500, 350);
|
||||
$mygraph->set(
|
||||
'title' => '',
|
||||
'pie_height' => 50,
|
||||
'start_angle' => 89
|
||||
) or warn $mygraph->error;
|
||||
my $mygraph = GD::Graph::pie->new(500, 350);
|
||||
$mygraph->set(
|
||||
'title' => '',
|
||||
'pie_height' => 50,
|
||||
'start_angle' => 89
|
||||
) or warn $mygraph->error;
|
||||
|
||||
$mygraph->set_value_font(GD::gdMediumBoldFont);
|
||||
$mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] );
|
||||
my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
|
||||
$mygraph->set_value_font(GD::gdMediumBoldFont);
|
||||
$mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] );
|
||||
my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
|
||||
|
||||
my @filenames = glob("/srv/web/ipfire/html/fwlogs/ip*.png");
|
||||
unlink(@filenames);
|
||||
my $imagerandom = rand(1000000);
|
||||
my $imagename = "/srv/web/ipfire/html/fwlogs/ip$imagerandom.png";
|
||||
open(FILE,">$imagename");
|
||||
print FILE $myimage->png;
|
||||
close(FILE);
|
||||
#####################################################
|
||||
print "<table align='center'><tr><td>";
|
||||
print "<img src='/fwlogs/ip$imagerandom.png'>";
|
||||
print "</td></tr></table>";
|
||||
my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-ip*.png");
|
||||
unlink(@filenames);
|
||||
my $imagerandom = rand(1000000);
|
||||
my $imagename = "/srv/web/ipfire/html/graphs/fwlog-ip$imagerandom.png";
|
||||
open(FILE,">$imagename");
|
||||
print FILE $myimage->png;
|
||||
close(FILE);
|
||||
#####################################################
|
||||
print "<table align='center'><tr><td>";
|
||||
print "<img src='/graphs/fwlog-ip$imagerandom.png'>";
|
||||
print "</td></tr></table>";
|
||||
}
|
||||
|
||||
print <<END
|
||||
@@ -529,6 +530,6 @@ sub findkey {
|
||||
}
|
||||
}
|
||||
}sub checkversion {
|
||||
#Automatic Updates is disabled
|
||||
return "0","0";
|
||||
}
|
||||
#Automatic Updates is disabled
|
||||
return "0","0";
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
# JC HERITIER
|
||||
# page inspired from the initial firewalllog.dat
|
||||
#
|
||||
# modified for ipcop by Markus Hoffmann und Michael Winkler and for ipfire by Christian Schmidt
|
||||
# Modified for IPFire by Christian Schmidt
|
||||
# and Michael Tremer (www.ipfire.org)
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -39,11 +40,11 @@ $cgiparams{'showpie'} = 1;
|
||||
$cgiparams{'sortcolumn'} = 1;
|
||||
|
||||
my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
|
||||
'Sep', 'Oct', 'Nov', 'Dec' );
|
||||
'Sep', 'Oct', 'Nov', 'Dec' );
|
||||
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
|
||||
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
|
||||
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
|
||||
$Lang::tr{'december'} );
|
||||
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
|
||||
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
|
||||
$Lang::tr{'december'} );
|
||||
|
||||
my @now = localtime();
|
||||
my $dow = $now[6];
|
||||
@@ -75,17 +76,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
|
||||
my $start = -1;
|
||||
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
|
||||
{
|
||||
my @temp = split(',',$ENV{'QUERY_STRING'});
|
||||
$start = $temp[0];
|
||||
$cgiparams{'MONTH'} = $temp[1];
|
||||
$cgiparams{'DAY'} = $temp[2];
|
||||
my @temp = split(',',$ENV{'QUERY_STRING'});
|
||||
$start = $temp[0];
|
||||
$cgiparams{'MONTH'} = $temp[1];
|
||||
$cgiparams{'DAY'} = $temp[2];
|
||||
}
|
||||
|
||||
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
|
||||
!($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
|
||||
{
|
||||
$cgiparams{'DAY'} = $now[3];
|
||||
$cgiparams{'MONTH'} = $now[4];
|
||||
$cgiparams{'DAY'} = $now[3];
|
||||
$cgiparams{'MONTH'} = $now[4];
|
||||
}
|
||||
elsif($cgiparams{'ACTION'} eq '>>')
|
||||
{
|
||||
@@ -151,9 +152,9 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
|
||||
my $day = $cgiparams{'DAY'};
|
||||
my $daystr='';
|
||||
if ($day <= 9) {
|
||||
$daystr = " $day"; }
|
||||
$daystr = " $day"; }
|
||||
else {
|
||||
$daystr = $day;
|
||||
$daystr = $day;
|
||||
}
|
||||
|
||||
my $skip=0;
|
||||
@@ -177,12 +178,12 @@ if (!$skip)
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
|
||||
$skip=0;
|
||||
@@ -199,14 +200,14 @@ if ($multifile) {
|
||||
$skip=1;
|
||||
}
|
||||
if (!$skip) {
|
||||
while (<FILE>) {
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
while (<FILE>) {
|
||||
if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
|
||||
$log[$lines] = $_;
|
||||
$lines++;
|
||||
}
|
||||
}
|
||||
close (FILE);
|
||||
}
|
||||
}
|
||||
|
||||
my $MODNAME="fwlogs";
|
||||
@@ -216,9 +217,9 @@ my $MODNAME="fwlogs";
|
||||
&Header::openbigbox('100%', 'left', '', $errormessage);
|
||||
|
||||
if ($errormessage) {
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<font class='base'>$errormessage </font>\n";
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<font class='base'>$errormessage </font>\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'settings'}:");
|
||||
@@ -227,33 +228,33 @@ print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='10%' class='base'>$Lang::tr{'month'}: </td>
|
||||
<td width='10%'>
|
||||
<select name='MONTH'>
|
||||
<td width='10%' class='base'>$Lang::tr{'month'}: </td>
|
||||
<td width='10%'>
|
||||
<select name='MONTH'>
|
||||
END
|
||||
;
|
||||
my $month;
|
||||
for ($month = 0; $month < 12; $month++)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($month == $cgiparams{'MONTH'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$month'>$longmonths[$month]</option>\n";
|
||||
print "\t<option ";
|
||||
if ($month == $cgiparams{'MONTH'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$month'>$longmonths[$month]</option>\n";
|
||||
}
|
||||
print <<END
|
||||
</select>
|
||||
</td>
|
||||
<td width='10%' class='base' align='right'> $Lang::tr{'day'}: </td>
|
||||
<td width='40%'>
|
||||
<select name='DAY'>
|
||||
</select>
|
||||
</td>
|
||||
<td width='10%' class='base' align='right'> $Lang::tr{'day'}: </td>
|
||||
<td width='40%'>
|
||||
<select name='DAY'>
|
||||
END
|
||||
;
|
||||
for ($day = 1; $day <= 31; $day++)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($day == $cgiparams{'DAY'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$day'>$day</option>\n";
|
||||
print "\t<option ";
|
||||
if ($day == $cgiparams{'DAY'}) {
|
||||
print "selected='selected' "; }
|
||||
print "value='$day'>$day</option>\n";
|
||||
}
|
||||
|
||||
if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
|
||||
@@ -316,11 +317,11 @@ my @tabjc2;
|
||||
|
||||
if ($sortcolumn == 1)
|
||||
{
|
||||
@tabjc2 = sort { $b <=> $a } values (%tabjc);
|
||||
@tabjc2 = sort { $b <=> $a } values (%tabjc);
|
||||
}
|
||||
else
|
||||
{
|
||||
@tabjc2 = sort { $a <=> $b } keys (%tabjc);
|
||||
@tabjc2 = sort { $a <=> $b } keys (%tabjc);
|
||||
}
|
||||
|
||||
my $colour=1;
|
||||
@@ -337,17 +338,17 @@ my $v;
|
||||
|
||||
if ($sortcolumn == 1)
|
||||
{
|
||||
for ($v=0;$v<$pienumber;$v++){
|
||||
findkey($tabjc2[$v]);
|
||||
}
|
||||
for ($v=0;$v<$pienumber;$v++){
|
||||
findkey($tabjc2[$v]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach $v (@tabjc2) {
|
||||
$key[$indice] = $v;
|
||||
$value[$indice] = $tabjc{$v};
|
||||
$indice++;
|
||||
}
|
||||
foreach $v (@tabjc2) {
|
||||
$key[$indice] = $v;
|
||||
$value[$indice] = $tabjc{$v};
|
||||
$indice++;
|
||||
}
|
||||
}
|
||||
|
||||
my @ports;
|
||||
@@ -360,44 +361,44 @@ my $o;
|
||||
|
||||
if($cgiparams{'otherspie'} == 2 ){}
|
||||
else{
|
||||
my $numothers;
|
||||
for($o=0;$o<$pienumber;$o++){
|
||||
$numothers = $numothers + $numb[$o];
|
||||
}
|
||||
$numothers = $linesjc - $numothers;
|
||||
if ($numothers > 0) {
|
||||
$ports[$pienumber]="$Lang::tr{'otherport'}";
|
||||
$numb[$pienumber] = $numothers;
|
||||
}
|
||||
my $numothers;
|
||||
for($o=0;$o<$pienumber;$o++){
|
||||
$numothers = $numothers + $numb[$o];
|
||||
}
|
||||
$numothers = $linesjc - $numothers;
|
||||
if ($numothers > 0) {
|
||||
$ports[$pienumber]="$Lang::tr{'otherport'}";
|
||||
$numb[$pienumber] = $numothers;
|
||||
}
|
||||
}
|
||||
|
||||
my @data = (\@ports,\@numb);
|
||||
use GD::Graph::colour qw( :files );
|
||||
GD::Graph::colour::read_rgb( "/srv/web/ipfire/cgi-bin/logs.cgi/colours.txt" );
|
||||
GD::Graph::colour::read_rgb( "/srv/web/ipfire/html/themes/ipfie/include/colours.txt" );
|
||||
|
||||
if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
|
||||
my $mygraph = GD::Graph::pie->new(500, 350);
|
||||
$mygraph->set(
|
||||
'title' => '',
|
||||
'pie_height' => 50,
|
||||
'start_angle' => 89
|
||||
) or warn $mygraph->error;
|
||||
my $mygraph = GD::Graph::pie->new(500, 350);
|
||||
$mygraph->set(
|
||||
'title' => '',
|
||||
'pie_height' => 50,
|
||||
'start_angle' => 89
|
||||
) or warn $mygraph->error;
|
||||
|
||||
$mygraph->set_value_font(GD::gdMediumBoldFont);
|
||||
$mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] );
|
||||
my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
|
||||
$mygraph->set_value_font(GD::gdMediumBoldFont);
|
||||
$mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] );
|
||||
my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
|
||||
|
||||
my @filenames = glob("/srv/web/ipfire/html/fwlogs/port*.png");
|
||||
unlink(@filenames);
|
||||
my $imagerandom = rand(1000000);
|
||||
my $imagename = "/srv/web/ipfire/html/fwlogs/port$imagerandom.png";
|
||||
open(FILE,">$imagename");
|
||||
print FILE $myimage->png;
|
||||
close(FILE);
|
||||
#####################################################
|
||||
print "<table align='center'><tr><td>";
|
||||
print "<img src='/fwlogs/port$imagerandom.png'>";
|
||||
print "</td></tr></table>";
|
||||
my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png");
|
||||
unlink(@filenames);
|
||||
my $imagerandom = rand(1000000);
|
||||
my $imagename = "/srv/web/ipfire/html/graphs/fwlog-port$imagerandom.png";
|
||||
open(FILE,">$imagename");
|
||||
print FILE $myimage->png;
|
||||
close(FILE);
|
||||
#####################################################
|
||||
print "<table align='center'><tr><td>";
|
||||
print "<img src='/graphs/fwlog-port$imagerandom.png'>";
|
||||
print "</td></tr></table>";
|
||||
}
|
||||
|
||||
print <<END
|
||||
@@ -520,6 +521,7 @@ sub findkey {
|
||||
}
|
||||
}
|
||||
sub checkversion {
|
||||
#Automatic Updates is disabled
|
||||
return "0","0";
|
||||
}
|
||||
#Automatic Updates is disabled
|
||||
return "0","0";
|
||||
}
|
||||
|
||||
|
||||
11
html/html/themes/ipfire/include/colours.txt
Normal file
11
html/html/themes/ipfire/include/colours.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
!"R" "G" "B" "Colour Name"
|
||||
205 91 69 colour1
|
||||
238 106 80 colour2
|
||||
255 114 86 colour3
|
||||
238 149 114 colour4
|
||||
255 160 122 colour5
|
||||
255 160 122 colour6
|
||||
205 175 149 colour7
|
||||
238 203 173 colour8
|
||||
255 218 185 colour9
|
||||
255 228 196 colour10
|
||||
Reference in New Issue
Block a user