From: <ow...@us...> - 2009-08-29 18:01:13
|
Revision: 3517 http://ipcop.svn.sourceforge.net/ipcop/?rev=3517&view=rev Author: owes Date: 2009-08-29 18:01:06 +0000 (Sat, 29 Aug 2009) Log Message: ----------- Add table row colouring for route and ARP lists. This will require new screenshots, sorry Eric. Modified Paths: -------------- ipcop/trunk/html/cgi-bin/netstatus.cgi Modified: ipcop/trunk/html/cgi-bin/netstatus.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/netstatus.cgi 2009-08-29 17:36:53 UTC (rev 3516) +++ ipcop/trunk/html/cgi-bin/netstatus.cgi 2009-08-29 18:01:06 UTC (rev 3517) @@ -221,19 +221,23 @@ </tr> END ; +my $count = 0; foreach my $line (split(/\n/, $output)) { + print "<tr class='table".int(($count % 2) + 1)."colour'>"; if ($line =~ m/^(.*) dev ([^ ]+) (.*) src (.*)$/) { - print "<tr><td align='center'>$1</td><td align='center'>$4</td>"; + print "<td align='center'>$1</td><td align='center'>$4</td>"; print "<td align='center'>".&General::color_devices($2)."</td><td>$3</td></tr>"; } elsif ($line =~ m/^(.*) via (.*) dev (.*)$/) { - print "<tr><td align='center'>$1</td><td align='center'>$2</td>"; + print "<td align='center'>$1</td><td align='center'>$2</td>"; print "<td align='center'>".&General::color_devices($3)."</td><td> </td></tr>"; } else { - print "<tr><td colspan='4'>$line</td></tr>"; + print "<td colspan='4'>$line</td></tr>"; } + + $count++; } print "</table>"; &Header::closebox(); @@ -252,19 +256,23 @@ </tr> END ; +my $count = 0; foreach my $line (split(/\n/, $output)) { + print "<tr class='table".int(($count % 2) + 1)."colour'>"; if ($line =~ m/^(.*) dev ([^ ]+) lladdr ([0-9a-f:]*) (.*)$/) { - print "<tr><td align='center'>$1</td><td align='center'>".&General::color_devices($2)."</td>"; + print "<td align='center'>$1</td><td align='center'>".&General::color_devices($2)."</td>"; print "<td align='center'>$3</td><td>$4</td></tr>"; } elsif ($line =~ m/^(.*) dev ([^ ]+) (.*)$/) { - print "<tr><td align='center'>$1</td><td align='center'>".&General::color_devices($2)."</td>"; + print "<td align='center'>$1</td><td align='center'>".&General::color_devices($2)."</td>"; print "<td align='center'>-</td><td>$3</td></tr>"; } else { - print "<tr><td colspan='4'>$line</td></tr>"; + print "<td colspan='4'>$line</td></tr>"; } + + $count++; } print "</table>"; &Header::closebox(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |