Commit b202e065 authored by Benoit Rat's avatar Benoit Rat

www: clean tables html code

We have clean the code to have an html as clear as possible to debug
Now we also use the following tag:
<th> For header
<td> For data
parent 1172737e
......@@ -296,20 +296,48 @@ table.altrowstabledash td {
border-style: solid;
border-color: #a9c6c9;
}
table tr.sub{
color:white;
background-color:#3A8AAF;
}
.oddrowcolor{
table .oddrowcolor{
background-color: #d4e3e5;
}
.evenrowcolor{
table .evenrowcolor{
background-color: #c3dde0;
}
.tableheader {
background-color: #95BEE6;
color:white;
table.firstcol {
text-align:center;
margin: 0 auto;
}
table.firstcol th {
padding: 3px;
color:white;
background-color:#3A8AAF;
}
table.firstcol tr td:first-of-type {
font-weight:bold;
}
table.firstcol tr input {
text-align:center;
}
#network table.firstcol td:first-of-type, #epcalib table.firstcol td:first-of-type
{
text-align:left;
}
#management table td.first
{
width:150px;
text-align:left;
font-weight:bold;
}
.tableheader {
background-color: #95BEE6;
color:white;
font-weight:bold;
}
.tablerow {
......
......@@ -50,26 +50,26 @@
// Starting the form (timing + ports)
echo '<form method="post">';
echo "<table border='1' align='left' class='altrowstable' id='alternatecolor'>";
echo "<table border='1' align='left' class='altrowstable firstcol' id='alternatecolor'>";
// Timing values:
echo '<tr class="sub"><th>Switch Timing Values</th></tr>';
echo '<tr><th>PPS Width: </th><th><INPUT type="text" value = "100000" name="pps" > </th></tr>';
echo '<tr><th>Use NMEA: </th><th><INPUT type="text" value = "1" name="nmea" > </th></tr>';
echo '<tr><th>Switch Mode: [Master/GrandMaster] </th><th><INPUT type="text" value = "GrandMaster" name="switchmode" > </th></tr>';
echo '<tr><td>PPS Width: </td><td><INPUT type="text" value = "100000" name="pps" > </td></tr>';
echo '<tr><td>Use NMEA: </td><td><INPUT type="text" value = "1" name="nmea" > </td></tr>';
echo '<tr><td>Switch Mode: [Master/GrandMaster] </td><td><INPUT type="text" value = "GrandMaster" name="switchmode" > </td></tr>';
// port values:
for($i=0; $i<18; $i++){
echo '<tr class="empty"><th></th></tr>';
echo '<tr class="sub"><th>Endpoint '.($i+1).'</th></tr>';
if($i<4){ echo '<tr><th>Rx min:</th><th><INPUT type="text" value = "160000" name="rx'.$i.'" > </th></tr>';
}else{ echo '<tr><th>Rx min:</th><th><INPUT type="text" value = "161200" name="rx'.$i.'" > </th></tr>';}
echo '<tr><th>Tx min:</th><th><INPUT type="text" value = "0" name="tx'.$i.'" > </th></tr>';
echo '<tr><th>Mac address:</th><th><INPUT type="text" value = "auto" name="mac'.$i.'" > </th></tr>';
if($i==0){ echo '<tr><th>Endpoint mode: [wr_slave/wr_master] </th><th><INPUT type="text" value = "wr_slave" name="mode'.$i.'" > </th></tr>';
}else{ echo '<tr><th>Endpoint mode: [wr_slave/wr_master] </th><th><INPUT type="text" value = "wr_master" name="mode'.$i.'" > </th></tr>';}
if($i<4){ echo '<tr><td>Rx min:</td><td><INPUT type="text" value = "160000" name="rx'.$i.'" > </td></tr>';
}else{ echo '<tr><td>Rx min:</td><td><INPUT type="text" value = "161200" name="rx'.$i.'" > </td></tr>';}
echo '<tr><td>Tx min:</td><td><INPUT type="text" value = "0" name="tx'.$i.'" > </td></tr>';
echo '<tr><td>Mac address:</td><td><INPUT type="text" value = "auto" name="mac'.$i.'" > </td></tr>';
if($i==0){ echo '<tr><td>Endpoint mode: [wr_slave/wr_master] </td><td><INPUT type="text" value = "wr_slave" name="mode'.$i.'" > </td></tr>';
}else{ echo '<tr><td>Endpoint mode: [wr_slave/wr_master] </td><td><INPUT type="text" value = "wr_master" name="mode'.$i.'" > </td></tr>';}
}
......
......@@ -26,15 +26,15 @@
//$modes = parse_wrsw_hal_file();
$modes = parse_ppsi_conf_file();
echo '<table align=center border="1" class="altrowstable" id="alternatecolor" width="50%">';
echo '<table class="altrowstable" id="alternatecolor" style="width:100%;text-align:center">';
//echo '<tr><th><center>Endpoint</center></th><th><center>Mode</center></th></tr>';
for($i = 0; $i < 9; $i++){
echo '<tr>';
echo '<td><center><b>wr'.($i+1).'</b></center></td>';
echo '<td><center><a href="modifymode.php?wr='.($i+1).'&mode='.$modes[$i+1].'">'.$modes[$i+1].'</a></center></td>';
echo '<th>wr'.($i+1).'</td>';
echo '<td><a href="modifymode.php?wr='.($i+1).'&mode='.$modes[$i+1].'">'.$modes[$i+1].'</a></th>';
echo '<td><center><b>wr'.($i+1+9).'</b></center></td>';
echo '<td><center><a href="modifymode.php?wr='.($i+1+9).'&mode='.$modes[$i+1+9].'">'.$modes[$i+1+9].'</a></center></td>';
echo '<th>wr'.($i+1+9).'</th>';
echo '<td><a href="modifymode.php?wr='.($i+1+9).'&mode='.$modes[$i+1+9].'">'.$modes[$i+1+9].'</a></td>';
echo '</tr>';
}
......
......@@ -18,6 +18,7 @@ $interfacesfile = "/usr/etc/network/interfaces";
* Displays the current status of each enpoint.
*
* @author José Luis Gutiérrez <jlgutierrez@ugr.es>
* @author Benoit Rat <benoit<AT>sevensols.com>
*
* Displays the current status of each endpoint as wr_mon tool
* in the swich does. It retrieves the information from wr_mon
......@@ -132,33 +133,33 @@ function wrs_main_info(){
}
}
echo "<table border='1' align='center' class='altrowstabledash' id='alternatecolor'>";
echo '<tr class="sub"><td> <b><center>Switch Info </center></b></td></tr>';
echo "<table class='altrowstable firstcol' id='alternatecolor' width='80%'>";
echo '<tr><th>Switch Info</th></tr>';
$str = shell_exec("uname -n");
if(strcmp($str,"(none)")) shell_exec("/bin/busybox hostname -F /etc/hostname");
echo '<tr><th align=center><b><font color="darkblue">Hostname</font></b></th><th><center>'; $str = shell_exec("uname -n"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Switch Mode</font></b> </th><th><center>'; $str = check_switch_mode(); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">IP Address</font></b> </th><th><center>'; $ip = shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"); echo $ip;
echo '(<a href="network.php">'; echo wrs_interface_setup(); echo '</a>)'; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">HW Address</font></b> </th><th><center>'; $mac = shell_exec("ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'"); echo $mac; echo '</center></th></tr>';
//echo '<tr><th> <b>OS Release:</b> </th><th><center>'; $str = shell_exec("uname -r"); echo $str; echo '</center></th></tr>';
//echo '<tr><th> <b>OS name:</b> </th><th><center>'; $str = shell_exec("uname -s"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Kernel Version</font></b> </th><th><center>'; $str = shell_exec("uname -r"); echo $str; $str = shell_exec("uname -v"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Firmware Version</font></b> </th><th><center> '; $str = shell_exec("/wr/bin/wrs_version | awk '{print $4}'");
echo '<a href="showfile.php?help_id=gateware&name=GateWare Info" onClick="showPopup(this.href);return(false);"</a>';
echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">PCB Version</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -p"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">FPGA</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -f"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Compiling Date</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -c"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">White-Rabbit Date</font></b></th><th><center>'; $str = shell_exec("export TZ=".$_SESSION['utc']." /wr/bin/wr_date -n get"); echo str_replace("\n","<br>",$str); echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">PPSi</font></b> </th><th><center>'; echo wrs_check_ptp_status() ? '[<A HREF="ptp.php">on</A>]' : '[<A HREF="ptp.php">off</A>]'; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Net-SNMP Server</font></b> </th><th><center>'; echo check_snmp_status() ? '[on] ' : '[off] '; echo '&nbsp;&nbsp;ver. '; echo shell_exec("snmpd -v | grep version | awk '{print $3}'");
echo '( port '; $str = shell_exec("cat ".$GLOBALS['etcdir']."snmpd.conf | grep agent | cut -d: -f3 | awk '{print $1}'"); echo $str; echo ')'; echo /*" <a href='help.php?help_id=snmp' onClick='showPopup(this.href);return(false);'> [OIDs]</a>*/"</center></th></tr>";
echo '<tr><th align=center> <b><font color="darkblue">NTP Server</font></b> </th><th><center> <A HREF="management.php">'; $str = check_ntp_server(); echo $str; echo '</A> '.$_SESSION['utc'].'</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Max. Filesize Upload</font> </b></th><th><center>'; echo shell_exec("cat ".$GLOBALS['phpinifile']." | grep upload_max_filesize | awk '{print $3}'"); echo '</center></th></tr>';
echo '<tr><td>Hostname</td><td>'; $str = shell_exec("uname -n"); echo $str; echo '</td></tr>';
echo '<tr><td>Switch Mode</td><td>'; $str = check_switch_mode(); echo $str; echo '</td></tr>';
echo '<tr><td>IP Address</td><td>'; $ip = shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"); echo $ip;
echo '(<a href="network.php">'; echo wrs_interface_setup(); echo '</a>)'; echo '</td></tr>';
echo '<tr><td>HW Address</td><td>'; $mac = shell_exec("ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'"); echo $mac; echo '</td></tr>';
//echo '<tr><td>OS Release:</td><td>'; $str = shell_exec("uname -r"); echo $str; echo '</td></tr>';
//echo '<tr><td>OS name:</td><td>'; $str = shell_exec("uname -s"); echo $str; echo '</td></tr>';
echo '<tr><td>Kernel Version</td><td>'; $str = shell_exec("uname -r"); echo $str; $str = shell_exec("uname -v"); echo $str; echo '</td></tr>';
echo '<tr><td>Firmware Version</td><td> '; $str = shell_exec("/wr/bin/wrs_version | awk '{print $4}'");
echo '<a href="showfile.php?help_id=gateware&name=GateWare Info" onClick="showPopup(this.href);return(false);">';
echo $str; echo '</a></td></tr>';
echo '<tr><td>PCB Version</td><td>'; $str = shell_exec("/wr/bin/wrs_version -p"); echo $str; echo '</td></tr>';
echo '<tr><td>FPGA</td><td>'; $str = shell_exec("/wr/bin/wrs_version -f"); echo $str; echo '</td></tr>';
echo '<tr><td>Compiling Date</td><td>'; $str = shell_exec("/wr/bin/wrs_version -c"); echo $str; echo '</td></tr>';
echo '<tr><td>White-Rabbit Date</td><td>'; $str = shell_exec("export TZ=".$_SESSION['utc']." /wr/bin/wr_date -n get"); echo str_replace("\n","<br>",$str); echo '</td></tr>';
echo '<tr><td>PPSi</td><td>'; echo wrs_check_ptp_status() ? '[<a href="ptp.php">on</A>]' : '[<a href="ptp.php">off</A>]'; echo '</td></tr>';
echo '<tr><td>Net-SNMP Server</td><td>'; echo check_snmp_status() ? '[on] ' : '[off] '; echo '&nbsp;&nbsp;ver. '; echo shell_exec("snmpd -v | grep version | awk '{print $3}'");
echo '( port '; $str = shell_exec("cat ".$GLOBALS['etcdir']."snmpd.conf | grep agent | cut -d: -f3 | awk '{print $1}'"); echo $str; echo ')'; echo /*" <a href='help.php?help_id=snmp' onClick='showPopup(this.href);return(false);'> [OIDs]</a>*/"</td></tr>";
echo '<tr><td>NTP Server</td><td> <a href="management.php">'; $str = check_ntp_server(); echo $str; echo '</A> '.$_SESSION['utc'].'</td></tr>';
echo '<tr><td>Max. Filesize Upload</td><td>'; echo shell_exec("cat ".$GLOBALS['phpinifile']." | grep upload_max_filesize | awk '{print $3}'"); echo '</td></tr>';
echo '</table>';
......
......@@ -91,45 +91,40 @@
<hr>
<br><br>
<center><p><strong>Load configuration files</strong></p></center>
<table border="1" align="center" class='altrowstable' id='alternatecolor' width="80%">
<table class='altrowstable' id='alternatecolor' width="100%">
<tr>
<FORM method="POST" ENCTYPE="multipart/form-data">
<th>PPSi Config </th>
<th ><INPUT type=file name="ppsi_conf" ></th>
<th><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></th>
<td class="first">PPSi Config </td>
<td ><INPUT type=file name="ppsi_conf" ></td>
<td><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></td>
</form>
</tr>
<tr>
<FORM method="POST" ENCTYPE="multipart/form-data">
<th>SFP Config </th>
<th ><INPUT type=file name="sfp_conf" ></th>
<th><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></th>
<td class="first">SFP Config </td>
<td ><INPUT type=file name="sfp_conf" ></td>
<td><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></td>
</form>
</tr>
<tr>
<FORM method="POST" ENCTYPE="multipart/form-data">
<th>SNMP Config</th>
<th ><INPUT type=file name="snmp_conf" ></th>
<th><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></th>
<td class="first">SNMP Config</td>
<td ><INPUT type=file name="snmp_conf" ></td>
<td><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></td>
</form>
</tr>
<tr>
<FORM method="POST" ENCTYPE="multipart/form-data">
<th>HAL Config </th>
<th ><INPUT type=file name="hal_conf" ></th>
<th><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></th>
<td class="first">HAL Config </td>
<td ><INPUT type=file name="hal_conf" ></td>
<td><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></td>
</form>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<FORM method="POST" ENCTYPE="multipart/form-data">
<th>Restore from backup</th>
<th ><INPUT type=file name="restore_conf" ></th>
<th><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></th>
<td class="first">Restore from backup</td>
<td ><INPUT type=file name="restore_conf" ></td>
<td><INPUT type=submit value="Load" class="btn" ><INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000></td>
</form>
</tr>
......
<?php include 'functions.php'; include 'head.php'; ?>
<body id="ptp">
<body id="network">
<div class="main">
<div class="page">
<div class="header" >
......@@ -41,21 +41,21 @@
echo '
<table border="0" class="altrowstable" id="alternatecolor" align="center">
<table class="altrowstable firstcol" id="alternatecolor">
<tr>
<th><font color="blue">Current eth0</font></th>
</tr><tr></tr><tr></tr>
<th>Current eth0</th>
</tr>
<tr>
<th align=left>IP Address: </th>
<th ><INPUT type="text" STYLE="text-align:center;" align="center" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'").'" readonly name="ip" ></th>
<td>IP Address: </td>
<td ><INPUT type="text" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'").'" readonly name="ip" ></td>
</tr>
<tr>
<th align=left>Netmask: </th>
<th><INPUT type="text" STYLE="text-align:center;" align="center" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f4 | awk '{ print $1}'").'" readonly name="netmask" ></th>
<td>Netmask: </td>
<td><INPUT type="text" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f4 | awk '{ print $1}'").'" readonly name="netmask" ></td>
</tr>
<tr>
<th align=left>Broadcast: </th>
<th><INPUT type="text" STYLE="text-align:center;" align="center" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f3 | awk '{ print $1}'").'" readonly name="broadcast" ></th>
<td>Broadcast: </td>
<td><INPUT type="text" value="'.shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f3 | awk '{ print $1}'").'" readonly name="broadcast" ></td>
</tr>
</table>';
}
......@@ -91,24 +91,24 @@
echo '<FORM method="POST">
<table border="0" align="center" class="altrowstable" id="alternatecolor">
<tr>
<th align=left>IP Address: </th>
<th><INPUT STYLE="text-align:center;" type="text" value="192.168.1.10" name="ip" ></th>
<td>IP Address: </td>
<td><INPUT type="text" value="192.168.1.10" name="ip" ></td>
</tr>
<tr>
<th align=left>Netmask: </th>
<th><INPUT STYLE="text-align:center;" type="text" value="255.255.255.0" name="netmask" ></th>
<td>Netmask: </td>
<td><INPUT type="text" value="255.255.255.0" name="netmask" ></td>
</tr>
<tr>
<th align=left>Network: </th>
<th><INPUT STYLE="text-align:center;" type="text" value="192.168.1.0" name="network" ></th>
<td>Network: </td>
<td><INPUT type="text" value="192.168.1.0" name="network" ></td>
</tr>
<tr>
<th align=left>Broadcast: </th>
<th><INPUT STYLE="text-align:center;" type="text" value="192.168.1.255" name="broadcast" ></th>
<td>Broadcast: </td>
<td><INPUT type="text" value="192.168.1.255" name="broadcast" ></td>
</tr>
<tr>
<th align=left>Gateway: </th>
<th><INPUT STYLE="text-align:center;" type="text" value="192.168.1.1" name="gateway" ></th>
<td>Gateway: </td>
<td><INPUT type="text" value="192.168.1.1" name="gateway" ></td>
</tr>
</table>
<INPUT type="submit" value="Save New Configuration" class="btn last">
......
......@@ -50,7 +50,7 @@
echo '<table align=center border="1" class="altrowstable" id="alternatecolor">';
echo '<tr align=center><th><font color="blue">Endpoint</font></th><th><font color="blue">VLAN ID</font></th><th><font color="blue">Mode</font></th><th><font color="blue">Priority</font></th><th><font color="blue">Mask</font></th></tr>';
echo '<tr class="sub" align=center><th>Endpoint</th><th>VLAN ID</th><th>Mode</font></th><th>Priority</th><th>Mask</th></tr>';
echo '<form method=POST>';
for($i = 0; $i < 18; $i++){
......
......@@ -47,18 +47,19 @@
}else{
echo '*all fields are mandatory<br><br>';
echo "<div><table border='1' align='left' class='altrowstable' id='alternatecolor'>";
//echo '<tr><td> <b><center> </center></b></td></tr>';
echo '<form method="post">';
echo "<div><table class='altrowstable firstcol' id='alternatecolor'>";
//echo '<tr><td> <b><center> </center></b></td></tr>';
if (($_POST['number']!=2)){
for($i=0; $i<$_POST['number']; $i++){
echo '<tr><th>SFP '.($i+1).'</th></tr>';
echo '<tr><th>Part Number</th><th><INPUT type="text" name="sfpnumber'.$i.'" > </th></tr>';
echo '<tr><th>Alpha</th><th><INPUT type="text" name="alpha'.$i.'" > </th></tr>';
echo '<tr><th>Delta Tx</th><th><INPUT type="text" name="tx'.$i.'" > </th></tr>';
echo '<tr><th>Delta Rx</th><th><INPUT type="text" name="rx'.$i.'" > </th></tr>';
echo '<tr><td>Part Number</td><td><INPUT type="text" name="sfpnumber'.$i.'" > </td></tr>';
echo '<tr><td>Alpha</td><td><INPUT type="text" name="alpha'.$i.'" > </td></tr>';
echo '<tr><td>Delta Tx</td><td><INPUT type="text" name="tx'.$i.'" > </td></tr>';
echo '<tr><td>Delta Rx</td><td><INPUT type="text" name="rx'.$i.'" > </td></tr>';
}
}else{
......@@ -68,15 +69,15 @@
echo '<tr><th>SFP '.($i+1).'</th></tr>';
if($i==0){
echo '<tr><th>Part Number</th><th><INPUT type="text" value = "AXGE-1254-0531" name="sfpnumber'.$i.'" > </th></tr>';
echo '<tr><th>Alpha</th><th><INPUT type="text" value="2.67871791665542e-04" name="alpha'.$i.'" > </th></tr>';
echo '<tr><th>Delta Tx</th><th><INPUT type="text" value="10" name="tx'.$i.'" > </th></tr>';
echo '<tr><th>Delta Rx</th><th><INPUT type="text" value="10" name="rx'.$i.'" > </th></tr>';
echo '<tr><td>Part Number</td><td><INPUT type="text" value = "AXGE-1254-0531" name="sfpnumber'.$i.'" > </td></tr>';
echo '<tr><td>Alpha</td><td><INPUT type="text" value="2.67871791665542e-04" name="alpha'.$i.'" > </td></tr>';
echo '<tr><td>Delta Tx</td><td><INPUT type="text" value="10" name="tx'.$i.'" > </td></tr>';
echo '<tr><td>Delta Rx</td><td><INPUT type="text" value="10" name="rx'.$i.'" > </td></tr>';
}else{
echo '<tr><th>Part Number</th><th><INPUT type="text" value = "AXGE-3454-0531" name="sfpnumber'.$i.'" > </th></tr>';
echo '<tr><th>Alpha</th><th><INPUT type="text" value="-2.67800055584799e-04" name="alpha'.$i.'" > </th></tr>';
echo '<tr><th>Delta Tx</th><th><INPUT type="text" value="10" name="tx'.$i.'" > </th></tr>';
echo '<tr><th>Delta Rx</th><th><INPUT type="text" value="10" name="rx'.$i.'" > </th></tr>';
echo '<tr><td>Part Number</td><td><INPUT type="text" value = "AXGE-3454-0531" name="sfpnumber'.$i.'" > </td></tr>';
echo '<tr><td>Alpha</td><td><INPUT type="text" value="-2.67800055584799e-04" name="alpha'.$i.'" > </td></tr>';
echo '<tr><td>Delta Tx</td><td><INPUT type="text" value="10" name="tx'.$i.'" > </td></tr>';
echo '<tr><td>Delta Rx</td><td><INPUT type="text" value="10" name="rx'.$i.'" > </td></tr>';
}
}
......
......@@ -31,8 +31,8 @@
$vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'");
$vlans = explode("\n", $vlans);
echo '<table align=center border="1" class="altrowstable" id="alternatecolor" width="100%">';
echo '<tr align=center><th><font color="blue">Vlan ID</font></th><th><font color="blue">FID</font></th><th><font color="blue">Ports</font></th><th><font color="blue">Drop?</font></th><th><font color="blue">Priority</font></th><th><font color="blue">Action</font></th></tr>';
echo '<table class="altrowstable firstcol" id="alternatecolor" width="100%">';
echo '<tr class="sub" align=center><th>Vlan ID</th><th>FID</th><th>Ports</th><th>Drop?</th><th>Priority</th><th>Action</th></tr>';
$counter = 0;
foreach($vlans as $line){
$counter++;
......@@ -41,9 +41,9 @@
$line = explode(" ", $line);
if(strcmp($line[3],"0x")){
echo '<tr align=center><th bgcolor="'.$vlancolor[$line[1]].'">VLAN '.$line[1].'</th><th>'.$line[2].'</th><th>'.parse_mask2ports($line[3]).'</th><th>'.$line[4].'</th><th>'.$line[5].'</th><th><A HREF="delvlan.php?vlan='.$line[1].'.">Delete</A></th></tr>';
echo '<tr align=center><td bgcolor="'.$vlancolor[$line[1]].'">VLAN '.$line[1].'</td><td>'.$line[2].'</td><td>'.parse_mask2ports($line[3]).'</td><td>'.$line[4].'</td><td>'.$line[5].'</td><td><A HREF="delvlan.php?vlan='.$line[1].'.">Delete</A></td></tr>';
}else{
echo '<tr align=center><th>'.$line[1].'</th><th>'.$line[2].'</th><th>'.parse_mask2ports($line[3].$line[4]).'</th><th>'.$line[5].'</th><th>'.$line[6].'</th><th><A HREF="delvlan.php?vlan='.$line[1].'.">Delete</A></th></tr>';
echo '<tr align=center><td>'.$line[1].'</td><td>'.$line[2].'</td><td>'.parse_mask2ports($line[3].$line[4]).'</td><td>'.$line[5].'</td><td>'.$line[6].'</td><td><A HREF="delvlan.php?vlan='.$line[1].'.">Delete</A></td></tr>';
}
}
......@@ -52,16 +52,16 @@
//Form for a new one:
echo '<tr align=center>
<FORM method="POST" action="newvlan.php" "ENCTYPE="multipart/form-data">
<th align=center><INPUT type="text" size="3" name="vid" ></th>
<th align=center><INPUT type="text" size="3"name="fid" ></th>
<th align=center><INPUT type="text" size="5" name="mask" ></th>
<th align=center>
<td align=center><INPUT type="text" size="3" name="vid" ></td>
<td align=center><INPUT type="text" size="3"name="fid" ></td>
<td align=center><INPUT type="text" size="5" name="mask" ></td>
<td align=center>
<select name="drop">
<option value="1">YES</option>
<option selected="selected" value="0">NO</option>
</select>
</th>
<th align=center>
</td>
<td align=center>
<select name="prio">
<option selected="selected"value=""></option>
<option value="0">0</option>
......@@ -73,8 +73,8 @@
<option value="6">6</option>
<option value="7">7</option>
</select>
</th>
<th align=center><INPUT type=submit value="Add VLAN" class="btn"></th>
</td>
<td align=center><INPUT type=submit value="Add VLAN" class="btn"></td>
</form>
</tr>';
echo '</table>';
......@@ -86,8 +86,8 @@
//Display Port2Vlan assignment
echo '<br><br>';
echo '<center><strong>Port2Vlan assignments</strong></center><hr>';
echo '<table align=center border="1" class="altrowstable" id="alternatecolor1" width="100%">';
echo '<tr align=center><th><font color="blue">Port</font></strong></th><th><font color="blue">QMode</font></th><th><font color="blue">Priority</font></th><th><font color="blue">VLAN ID</font></th><th><font color="blue">MAC Address</font></th></tr>';
echo '<table class="altrowstable firstcol" id="alternatecolor1" width="100%">';
echo '<tr><th>Port</strong></th><th>QMode</th><th>Priority</th><th>VLAN ID</th><th>MAC Address</th></tr>';
$tmp_vlan_file="/tmp/port2vlan.conf";
$vlans = shell_exec("/wr/bin/wrs_vlans --elist >".$tmp_vlan_file);
......@@ -101,12 +101,12 @@
if($counter>=2 && !empty($line)){
$line = explode(" ", $line);
echo '<tr align=center><th>WR'.($line[1]+1).'</th><th>'.$line[2]." (".$line[3].')</th><th>'.($line[5]).'</th><th bgcolor="'.$vlancolor[$line[6]].'">VLAN '.$line[6].'</th><th>'.$line[7].'</th></th></tr>';
echo '<tr align=center><td>WR'.($line[1]+1).'</td><td>'.$line[2]." (".$line[3].')</td><td>'.($line[5]).'</td><td bgcolor="'.$vlancolor[$line[6]].'">VLAN '.$line[6].'</td><td>'.$line[7].'</td></td></tr>';
}
}
echo '<tr><th></th><th></th><th></th><th></th><th align=center><FORM method="POST" action="port2vlan.php"><INPUT type=submit align=center value="Edit Table" class="btn"></form></th></tr>';
echo '<tr><td></td><td></td><td></td><td></td><td align=center><FORM method="POST" action="port2vlan.php"><INPUT type=submit align=center value="Edit Table" class="btn"></form></td></tr>';
echo '</table>';
?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment