[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[3509]
From:       owes () users ! sourceforge ! net
Date:       2009-08-29 6:50:12
Message-ID: E1MhHlM-0004jf-3B () dn4whf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 3509
          http://ipcop.svn.sourceforge.net/ipcop/?rev=3509&view=rev
Author:   owes
Date:     2009-08-29 06:50:11 +0000 (Sat, 29 Aug 2009)

Log Message:
-----------
Beautify routing table and ARP table as we now use output from ip (iproute2)

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-28 18:01:04 UTC (rev 3508)
+++ ipcop/trunk/html/cgi-bin/netstatus.cgi	2009-08-29 06:50:11 UTC (rev 3509)
@@ -211,16 +211,62 @@
 &Header::openbox('100%', 'left', "$Lang::tr{'routing table entries'}:");
 $output = `/sbin/ip route list`;
 $output = &Header::cleanhtml($output,"y");
-$output = &General::color_devices($output);
-print "<pre>$output</pre>\n";
+print <<END
+<table width='100%'>
+<tr>
+    <td width='25%' align='center' class='boldbase'>$Lang::tr{'destination ip or \
net'}</td> +    <td width='25%' align='center' class='boldbase'>$Lang::tr{'gateway \
ip'}</td> +    <td width='25%' align='center' \
class='boldbase'>$Lang::tr{'interface'}</td> +    <td width='25%' \
class='boldbase'>$Lang::tr{'remark'}</td> +</tr>
+END
+;
+foreach my $line (split(/\n/, $output))
+{
+    if ($line =~ m/^(.*) dev ([^ ]+) (.*) src (.*)$/) {
+        print "<tr><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'>".&General::color_devices($3)."</td><td>&nbsp;</td></tr>";
 +    }
+    else {
+        print "<tr><td colspan='4'>$line</td></tr>";
+    }
+}
+print "</table>";
 &Header::closebox();
 
 print "<a name='arp'/>\n";
 &Header::openbox('100%', 'left', "$Lang::tr{'arp table entries'}:");
 $output = `/sbin/ip neigh list`;
 $output = &Header::cleanhtml($output,"y");
-$output = &General::color_devices($output);
-print "<pre>$output</pre>\n";
+print <<END
+<table width='100%'>
+<tr>
+    <td width='25%' align='center' class='boldbase'>$Lang::tr{'ip address'}</td>
+    <td width='25%' align='center' class='boldbase'>$Lang::tr{'interface'}</td>
+    <td width='25%' align='center' class='boldbase'>$Lang::tr{'mac address'}</td>
+    <td width='25%' class='boldbase'>$Lang::tr{'status'}</td>
+</tr>
+END
+;
+foreach my $line (split(/\n/, $output))
+{
+    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'>$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'>-</td><td>$3</td></tr>"; +    }
+    else {
+        print "<tr><td colspan='4'>$line</td></tr>";
+    }
+}
+print "</table>";
 &Header::closebox();
 
 &Header::closebigbox();


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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