diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 0ae25ced4e..f5436962fe 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -153,6 +153,7 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id']) if ($_SESSION['userlevel'] >= "5" && mysql_result(mysql_query("SELECT count(*) FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.local_interface_id"),0)) { + $discovery_links = TRUE; echo('
  • Map diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index 096c20d8a4..1a809c160c 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -9,6 +9,7 @@ print_optionbar_start(); $menu_options = array('basic' => 'Basic', 'details' => 'Details', + 'neighbours' => 'Neighbours', 'arp' => 'ARP Table', 'adsl' => 'ADSL'); @@ -55,7 +56,7 @@ if ($_GET['optc'] == thumbs) { $timeperiods = array('-1day','-1week','-1month','-1year'); $from = '-1day'; - echo("
    "); + echo("
    "); $sql = "select * from ports WHERE device_id = '".$device['device_id']."' ORDER BY ifIndex"; $query = mysql_query($sql); unset ($seperator); @@ -75,22 +76,9 @@ if ($_GET['optc'] == thumbs) } echo("
    "); } else { - if ($_GET['opta'] == "arp") + if ($_GET['opta'] == "arp" || $_GET['opta'] == "adsl" || $_GET['opta'] == "neighbours") { - include("arp.inc.php"); - } elseif ($_GET['opta'] == "adsl") { - echo("
    "); - - echo(""); - $i = "0"; - $interface_query = mysql_query("select * from `ports` AS P, `ports_adsl` AS A WHERE P.device_id = '".$device['device_id']."' AND A.interface_id = P.interface_id AND P.deleted = '0' ORDER BY `ifIndex` ASC"); - while ($interface = mysql_fetch_assoc($interface_query)) - { - include("includes/print-interface-adsl.inc.php"); - $i++; - } - echo("
    PortTrafficSync SpeedAttainable SpeedAttenuationSNR MarginOutput Powers
    "); - echo("
    "); + include("ports/".$_GET['opta'].".inc.php"); } else { if ($_GET['opta'] == "details") { $port_details = 1; } echo("
    "); @@ -102,7 +90,6 @@ if ($_GET['optc'] == thumbs) $i++; } echo("
    "); - echo("
    "); } } diff --git a/html/pages/device/arp.inc.php b/html/pages/device/ports/arp.inc.php similarity index 100% rename from html/pages/device/arp.inc.php rename to html/pages/device/ports/arp.inc.php diff --git a/html/pages/device/ports/neighbours.inc.php b/html/pages/device/ports/neighbours.inc.php new file mode 100644 index 0000000000..37cb0e24bd --- /dev/null +++ b/html/pages/device/ports/neighbours.inc.php @@ -0,0 +1,40 @@ +'); + +$i = "1"; + +echo('Local Port + Remote Port + Remote Device + + '); + +while($neighbour = mysql_fetch_assoc($query)) +{ + + if ($bg_colour == $list_colour_b) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } + + echo(''); + echo("".generate_port_link($neighbour)."
    ".$neighbour['ifAlias'].""); + + if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id']) + { + $remote_port = get_port_by_id($neighbour['remote_interface_id']); + $remote_device = device_by_id_cache($remote_port['device_id']); + echo("".generate_port_link($remote_port)."
    ".$remote_port['ifAlias'].""); + echo("".generate_device_link($remote_device)."
    ".$remote_device['hardware'].""); + } else { + echo("".$neighbour['remote_port'].""); + echo("".$neighbour['remote_hostname']." +
    ".$neighbour['remote_platform'].""); + } + $i++; +} + +echo(""); + +?>