make port settings page less ugly. also add soem alcatel crap

git-svn-id: http://www.observium.org/svn/observer/trunk@1947 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-03-21 12:18:26 +00:00
parent 608bf7e4eb
commit 0515b4e013
3 changed files with 42 additions and 20 deletions
+39 -18
View File
@@ -17,42 +17,63 @@ if ($updated && $update_message)
print_error($update_message);
}
echo("<div style='float: left;'>
echo("<div style='float: left; width: 100%'>
<form id='ignoreport' name='ignoreport' method='post' action=''>
<input type=hidden name='ignoreport' value='yes'>
<input type=hidden name=device value='".$device['device_id']."'>
<table>
<tr><th>Port</th><th>ifDescr</th><th>ifAdminStatus</th><th>ifOperStatus</th><th>Disable</th><th>Ignore</th></tr>
<input type=hidden name=device value='".$port['device_id']."'>");
echo("<table cellpadding=3 cellspacing=0 width=100%>
<tr align=center>
<th width=75>Index</th>
<th width=150>Name</th>
<th width=50>Admin</th>
<th width=50>Oper</th>
<th width=50>Disable</th>
<th width=50>Ignore</th>
<th>Description</th>
</tr>
");
$row=1;
$query = mysql_query("SELECT * FROM `ports` WHERE device_id='".$device['device_id']."' ORDER BY `ifIndex` ");
while ($device = mysql_fetch_array($query))
while ($port = mysql_fetch_array($query))
{
echo("<tr>");
echo("<td align=right>". $device['ifIndex']."</td>");
echo("<td align=left>".$device['ifDescr'] . "</td>");
echo("<td align=right>". $device['ifAdminStatus']."</td>");
$port = ifLabel($port);
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr bgcolor=$row_colour>");
echo("<td align=center>". $port['ifIndex']."</td>");
echo("<td align=left>".$port['label'] . "</td>");
echo("<td align=right>". $port['ifAdminStatus']."</td>");
# Mark interfaces which are OperDown (but not AdminDown) yet not ignored or disabled, or up yet ignored or disabled
# - as to draw the attention to a possible problem.
$isportbad = ($device['ifOperStatus'] == 'down' && $device['ifAdminStatus'] != 'down') ? 1 : 0;
$dowecare = ($device['ignore'] == 0 && $device['disabled'] == 0) ? 1 : 0;
$isportbad = ($port['ifOperStatus'] == 'down' && $port['ifAdminStatus'] != 'down') ? 1 : 0;
$dowecare = ($port['ignore'] == 0 && $port['disabled'] == 0) ? 1 : 0;
$outofsync = ($isportbad && $dowecare) ? "class=red" : "";
echo("<td align=right><span ".$outofsync.">". $device['ifOperStatus']."</span></td>");
echo("<td align=right><span ".$outofsync.">". $port['ifOperStatus']."</span></td>");
echo("<td>");
echo("<input type=checkbox name='disabled_".$device['interface_id']."'".($device['disabled'] ? 'checked' : '').">");
echo("<input type=hidden name='olddis_".$device['interface_id']."' value=".($device['disabled'] ? 1 : 0).">");
echo("<td align=center>");
echo("<input type=checkbox name='disabled_".$port['interface_id']."'".($port['disabled'] ? 'checked' : '').">");
echo("<input type=hidden name='olddis_".$port['interface_id']."' value=".($port['disabled'] ? 1 : 0).">");
echo("</td>");
echo("<td>");
echo("<input type=checkbox name='ignore_".$device['interface_id']."'".($device['ignore'] ? 'checked' : '').">");
echo("<input type=hidden name='oldign_".$device['interface_id']."' value=".($device['ignore'] ? 1 : 0).">");
echo("<td align=center>");
echo("<input type=checkbox name='ignore_".$port['interface_id']."'".($port['ignore'] ? 'checked' : '').">");
echo("<input type=hidden name='oldign_".$port['interface_id']."' value=".($port['ignore'] ? 1 : 0).">");
echo("</td>");
echo("<td align=left>".$port['ifAlias'] . "</td>");
echo("</tr>
");
$row++;
}
echo('<tr><td></td><td></td><td></td><td></td><td><input type="submit" value="Save"></td></tr>');
+2 -2
View File
@@ -4,8 +4,8 @@
if (!$os)
{
if (strpos($sysObjectId, ".1.3.6.1.4.1.6527.1.800") != FALSE) { $os = "aos"; }
if (strpos($sysObjectId, ".1.3.6.1.4.1.6527.1.3") != FALSE) { $os = "timos"; }
if (strpos($sysObjectId, ".1.3.6.1.4.1.6486.800") !== FALSE) { $os = "aos"; }
if (strpos($sysObjectId, ".1.3.6.1.4.1.6527.1.3") !== FALSE) { $os = "timos"; }
}
+1
View File
@@ -86,6 +86,7 @@ $config['os'][$os]['group'] = "aos";
$config['os'][$os]['text'] = "Alcatel-Lucent OS";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['ifXmcbc'] = 1;
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";