[prev in list] [next in list] [prev in thread] [next in thread]
List: ipcop-svn
Subject: [Ipcop-svn] SF.net SVN: ipcop:[1749]
From: owes () users ! sourceforge ! net
Date: 2008-08-31 12:24:11
Message-ID: E1KZlyV-00064v-PF () d5vjzd1 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 1749
http://ipcop.svn.sourceforge.net/ipcop/?rev=1749&view=rev
Author: owes
Date: 2008-08-31 12:24:09 +0000 (Sun, 31 Aug 2008)
Log Message:
-----------
apply CodingStyle
Modified Paths:
--------------
ipcop/trunk/html/cgi-bin/graphs.cgi
Modified: ipcop/trunk/html/cgi-bin/graphs.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/graphs.cgi 2008-08-30 14:35:33 UTC (rev 1748)
+++ ipcop/trunk/html/cgi-bin/graphs.cgi 2008-08-31 12:24:09 UTC (rev 1749)
@@ -28,94 +28,100 @@
&Header::showhttpheaders();
-my $graphdir = "/home/httpd/html/graphs";
-&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+my $graphdir = '/home/httpd/html/graphs';
+&General::readhash('/var/ipcop/ethernet/settings', \%netsettings);
$ENV{'QUERY_STRING'} =~ s/&//g;
@cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
$cgigraphs[1] = '' unless defined $cgigraphs[1];
if ($cgigraphs[1] =~ /(network|GREEN|BLUE|ORANGE|RED)/) {
- &Header::openpage($Lang::tr{'network traffic graphs'}, 1, '');
-} else {
- &Header::openpage($Lang::tr{'system graphs'}, 1, '');
+ &Header::openpage($Lang::tr{'network traffic graphs'}, 1, '');
}
+else {
+ &Header::openpage($Lang::tr{'system graphs'}, 1, '');
+}
&Header::openbigbox('100%', 'left');
if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|cpu|memory|swap|diskuse|disk)/) {
- my $graph = $cgigraphs[1];
- my $graphname = ucfirst(lc($cgigraphs[1]));
- my ($title, $count) = split('_', $graphname);
+ my $graph = $cgigraphs[1];
+ my $graphname = ucfirst(lc($cgigraphs[1]));
+ my ($title, $count) = split('_', $graphname);
$title = $title." ".$count if ( $count >= 2 );
- &Header::openbox('100%', 'center', "$title $Lang::tr{'graph'}");
+ &Header::openbox('100%', 'center', "$title $Lang::tr{'graph'}");
- if (-e "$graphdir/${graph}-day.png") {
- my $ftime = localtime((stat("$graphdir/${graph}-day.png"))[9]);
- print "<center>";
- print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br \
/><hr />\n";
- print "<img src='/graphs/${graph}-day.png' border='0' \
alt='${graph}-$Lang::tr{'day'}' /><hr />";
- print "<img src='/graphs/${graph}-week.png' border='0' \
alt='${graph}-$Lang::tr{'week'}' /><hr />";
- print "<img src='/graphs/${graph}-month.png' border='0' \
alt='${graph}-$Lang::tr{'month'}' /><hr />";
- print "<img src='/graphs/${graph}-year.png' border='0' \
alt='${graph}-$Lang::tr{'year'}' />";
- } else {
- print $Lang::tr{'no information available'};
- }
- &Header::closebox();
- print "<div align='center'><table width='80%'><tr><td align='center'>";
- if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED)/) {
- print "<a href='/cgi-bin/graphs.cgi?graph=network'>";
- } else {
- print "<a href='/cgi-bin/graphs.cgi'>";
- }
- print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
- ;
-} elsif ($cgigraphs[1] =~ /network/) {
- for my $color ('GREEN', 'ORANGE', 'BLUE') {
- my $icount = $netsettings{"${color}_COUNT"};
- while($icount > 0) {
- push (@graphs, ("${color}_${icount}"));
- $icount--;
- }
- }
- push (@graphs, ("RED_1"));
+ if (-e "$graphdir/${graph}-day.png") {
+ my $ftime = localtime((stat("$graphdir/${graph}-day.png"))[9]);
+ print "<center>";
+ print "<b>$Lang::tr{'the statistics were last updated at'}: \
$ftime</b></center><br /><hr />\n"; + print "<img \
src='/graphs/${graph}-day.png' border='0' alt='${graph}-$Lang::tr{'day'}' /><hr />"; \
+ print "<img src='/graphs/${graph}-week.png' border='0' \
alt='${graph}-$Lang::tr{'week'}' /><hr />"; + print "<img \
src='/graphs/${graph}-month.png' border='0' alt='${graph}-$Lang::tr{'month'}' /><hr \
/>"; + print "<img src='/graphs/${graph}-year.png' border='0' \
alt='${graph}-$Lang::tr{'year'}' />"; + }
+ else {
+ print $Lang::tr{'no information available'};
+ }
+ &Header::closebox();
+ print "<div align='center'><table width='80%'><tr><td align='center'>";
+ if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED)/) {
+ print "<a href='/cgi-bin/graphs.cgi?graph=network'>";
+ }
+ else {
+ print "<a href='/cgi-bin/graphs.cgi'>";
+ }
+ print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
+ ;
+}
+elsif ($cgigraphs[1] =~ /network/) {
+ for my $color ('GREEN', 'ORANGE', 'BLUE') {
+ my $icount = $netsettings{"${color}_COUNT"};
+ while($icount > 0) {
+ push (@graphs, ("${color}_${icount}"));
+ $icount--;
+ }
+ }
+ push (@graphs, ("RED_1"));
- foreach my $graphname (@graphs) {
- my ($title, $count) = split('_', $graphname);
- $title = ucfirst(lc($title));
+ foreach my $graphname (@graphs) {
+ my ($title, $count) = split('_', $graphname);
+ $title = ucfirst(lc($title));
$title = $title." ".$count if ( $count >= 2 );
- &Header::openbox('100%', 'center', "$title $Lang::tr{'graph'}");
+ &Header::openbox('100%', 'center', "$title $Lang::tr{'graph'}");
- if (-e "$graphdir/${graphname}-day.png") {
- my $ftime = localtime((stat("$graphdir/${graphname}-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: \
$ftime</b></center><br />\n";
- print "<a href='/cgi-bin/graphs.cgi?graph=$graphname'>";
- print "<img src='/graphs/${graphname}-day.png' \
alt='${graphname}-$Lang::tr{'day'}' border='0' />";
- print "</a><br />";
- } else {
- print $Lang::tr{'no information available'};
- }
- if ( $graphname eq 'GREEN_1' ) {
- print<<END
+ if (-e "$graphdir/${graphname}-day.png") {
+ my $ftime = localtime((stat("$graphdir/${graphname}-day.png"))[9]);
+ print "<center><b>$Lang::tr{'the statistics were last updated at'}: \
$ftime</b></center><br />\n"; + print "<a \
href='/cgi-bin/graphs.cgi?graph=$graphname'>"; + print "<img \
src='/graphs/${graphname}-day.png' alt='${graphname}-$Lang::tr{'day'}' border='0' \
/>"; + print "</a><br />";
+ }
+ else {
+ print $Lang::tr{'no information available'};
+ }
+ if ( $graphname eq 'GREEN_1' ) {
+ print<<END
<table width='100%'>
<tr>
- <td width='95%' align='center'> </td>
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/Info-AW.html#info_traffic-graphs' \
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' \
title='$Lang::tr{'online help en'}' /></a>
- </td>
+ <td width='95%' align='center'> </td>
+ <td width='5%' align='right'>
+ <a href='${General::adminmanualurl}/Info-AW.html#info_traffic-graphs' \
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' \
title='$Lang::tr{'online help en'}' /></a> + </td>
</tr>
</table>
END
- ;
- }
- &Header::closebox();
- }
-} else {
- &disp_graph("CPU $Lang::tr{'graph'}", "cpu", "cpu-$Lang::tr{'day'}");
- &disp_graph("Memory $Lang::tr{'graph'}", "memory", \
"$Lang::tr{'memory'}:-$Lang::tr{'day'}");
- &disp_graph("Swap $Lang::tr{'graph'}", "swap", \
"$Lang::tr{'swap'}-$Lang::tr{'day'}") unless ( -e "/etc/FLASH" );
- &disp_graph("Diskuse $Lang::tr{'graph'}", "diskuse", "$Lang::tr{'disk \
usage'}:-$Lang::tr{'day'}");
- &disp_graph("Disk $Lang::tr{'graph'}", "disk", "disk-$Lang::tr{'day'}");
+ ;
+ }
+ &Header::closebox();
+ }
}
+else {
+ &disp_graph("CPU $Lang::tr{'graph'}", "cpu", "cpu-$Lang::tr{'day'}");
+ &disp_graph("Memory $Lang::tr{'graph'}", "memory", \
"$Lang::tr{'memory'}:-$Lang::tr{'day'}"); + &disp_graph("Swap $Lang::tr{'graph'}", \
"swap", "$Lang::tr{'swap'}-$Lang::tr{'day'}") unless ( -e "/etc/FLASH" ); + \
&disp_graph("Diskuse $Lang::tr{'graph'}", "diskuse", "$Lang::tr{'disk \
usage'}:-$Lang::tr{'day'}"); + &disp_graph("Disk $Lang::tr{'graph'}", "disk", \
"disk-$Lang::tr{'day'}"); +}
&Header::closebigbox();
&Header::closepage();
@@ -123,33 +129,33 @@
sub disp_graph
{
- my $title = shift;
- my $file = shift;
- my $alt = shift;
+ my $title = shift;
+ my $file = shift;
+ my $alt = shift;
- &Header::openbox('100%', 'center', $title);
- if (-e "$graphdir/$file-day.png") {
- my $ftime = localtime((stat("$graphdir/$file-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: \
$ftime</b></center><br />\n";
- print "<a href='/cgi-bin/graphs.cgi?graph=$file'>";
- print "<img src='/graphs/$file-day.png' alt='$alt' border='0' />";
- print "</a><br />";
- } else {
- print $Lang::tr{'no information available'};
- }
+ &Header::openbox('100%', 'center', $title);
+ if (-e "$graphdir/$file-day.png") {
+ my $ftime = localtime((stat("$graphdir/$file-day.png"))[9]);
+ print "<center><b>$Lang::tr{'the statistics were last updated at'}: \
$ftime</b></center><br />\n"; + print "<a \
href='/cgi-bin/graphs.cgi?graph=$file'>"; + print "<img \
src='/graphs/$file-day.png' alt='$alt' border='0' />"; + print "</a><br />";
+ } else {
+ print $Lang::tr{'no information available'};
+ }
- if ( $file eq 'cpu' ) {
- print<<END
+ if ( $file eq 'cpu' ) {
+ print<<END
<table width='100%'>
<tr>
- <td width='95%' align='center'> </td>
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/Info-AW.html#info_traffic-graphs' \
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' \
title='$Lang::tr{'online help en'}' /></a>
- </td>
+ <td width='95%' align='center'> </td>
+ <td width='5%' align='right'>
+ <a href='${General::adminmanualurl}/Info-AW.html#info_traffic-graphs' \
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' \
title='$Lang::tr{'online help en'}' /></a> + </td>
</tr>
</table>
END
- ;
- }
- &Header::closebox();
+ ;
+ }
+ &Header::closebox();
}
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic