improved vlan display

git-svn-id: http://www.observium.org/svn/observer/trunk@2787 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-12-15 23:14:50 +00:00
parent 53327231b7
commit 00b22a54a5
2 changed files with 19 additions and 7 deletions

View File

@ -8,7 +8,20 @@ echo("<td width=100 class=list-large> Vlan " . $vlan['vlan_vlan'] . "</td>");
echo("<td width=200 class=box-desc>" . $vlan['vlan_descr'] . "</td>");
echo("<td class=list-bold>");
foreach (dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan_vlan'])) as $port)
$vlan_ports = array();
$otherports = dbFetchRows("SELECT * FROM `ports_vlans` AS V, `ports` as P WHERE V.`device_id` = ? AND V.`vlan` = ? AND P.interface_id = V.interface_id", array($device['device_id'], $vlan['vlan_vlan']));
foreach($otherports as $otherport)
{
$vlan_ports[$otherport[ifIndex]] = $otherport;
}
$otherports = dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan_vlan']));
foreach($otherports as $otherport)
{
$vlan_ports[$otherport[ifIndex]] = array_merge($otherport, array('untagged' => '1'));
}
ksort($vlan_ports);
foreach ($vlan_ports as $port)
{
$port = ifLabel($port, $device);
if ($vars['view'] == "graphs")
@ -29,6 +42,8 @@ foreach (dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?
{
echo($vlan['port_sep'] . generate_port_link($port, makeshortif($port['label'])));
$vlan['port_sep'] = ", ";
if($port['untagged']) { echo("(U)"); }
}
}