diff --git a/AUTHORS.md b/AUTHORS.md index 0b495e5b1a..8263114812 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -70,4 +70,5 @@ Contributors to LibreNMS: - Richard Kojedzinszky (rkojedzinszky) - Tony Murray (murrant) - Peter Lamperud (vizay) +- Louis Bailleul (alucardfh) [1]: http://observium.org/ "Observium web site" diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index b15c9b7731..996069a44b 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -36,8 +36,8 @@ else { $mac = ''; } -echo " - "; +echo " + "; echo ' '.generate_port_link($port, $port['ifIndex'].'. '.$port['label'])." $error_img $mac
".$port['ifAlias'].''; @@ -62,7 +62,7 @@ if ($port_details) { echo ''; -echo ''; +echo ""; if ($port_details) { $port['graph_type'] = 'port_bits'; @@ -73,7 +73,7 @@ if ($port_details) { echo generate_port_link($port, ""); } -echo ''; +echo ""; if ($port['ifOperStatus'] == 'up') { $port['in_rate'] = ($port['ifInOctets_rate'] * 8); @@ -86,7 +86,7 @@ if ($port['ifOperStatus'] == 'up') { ".format_bi($port['ifOutUcastPkts_rate']).'pps'; } -echo ''; +echo ""; if ($port['ifSpeed']) { echo ''.humanspeed($port['ifSpeed']).''; } @@ -130,19 +130,19 @@ if ($device['os'] == 'ios' || $device['os'] == 'iosxe') { }//end if if ($port_adsl['adslLineCoding']) { - echo ''; + echo ""; echo $port_adsl['adslLineCoding'].'/'.rewrite_adslLineType($port_adsl['adslLineType']); echo '
'; echo 'Sync:'.formatRates($port_adsl['adslAtucChanCurrTxRate']).'/'.formatRates($port_adsl['adslAturChanCurrTxRate']); echo '
'; echo 'Max:'.formatRates($port_adsl['adslAtucCurrAttainableRate']).'/'.formatRates($port_adsl['adslAturCurrAttainableRate']); - echo ''; + echo ""; echo 'Atten:'.$port_adsl['adslAtucCurrAtn'].'dB/'.$port_adsl['adslAturCurrAtn'].'dB'; echo '
'; echo 'SNR:'.$port_adsl['adslAtucCurrSnrMgn'].'dB/'.$port_adsl['adslAturCurrSnrMgn'].'dB'; } else { - echo ''; + echo ""; if ($port['ifType'] && $port['ifType'] != '') { echo ''.fixiftype($port['ifType']).''; } @@ -158,7 +158,7 @@ else { echo '-'; } - echo ''; + echo ""; if ($port['ifPhysAddress'] && $port['ifPhysAddress'] != '') { echo ''.formatMac($port['ifPhysAddress']).''; } @@ -176,13 +176,17 @@ else { }//end if echo ''; -echo ''; +echo ''; + +$neighborsCount=0; +$nbLinks=0; if (strpos($port['label'], 'oopback') === false && !$graph_type) { foreach (dbFetchRows('SELECT * FROM `links` AS L, `ports` AS I, `devices` AS D WHERE L.local_port_id = ? AND L.remote_port_id = I.port_id AND I.device_id = D.device_id', array($if_id)) as $link) { // echo("Directly Connected " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "
"); // $br = "
"; $int_links[$link['port_id']] = $link['port_id']; $int_links_phys[$link['port_id']] = 1; + $nbLinks++; } unset($br); @@ -233,10 +237,23 @@ if (strpos($port['label'], 'oopback') === false && !$graph_type) { }//end foreach }//end if + if(count($int_links) > 3) + { + echo '
+ '; + } + + if ($port_details && $config['enable_port_relationship'] === true && port_permitted($int_link,$device['device_id'])) { foreach ($int_links as $int_link) { + $neighborsCount++; + if($neighborsCount == 4) + { + echo '
[...]
'; + echo '
'; + echo '
'; +} echo ''; // If we're showing graphs, generate the graph and print the img tags diff --git a/html/js/librenms.js b/html/js/librenms.js index 3df1fc5338..9bffaffcaf 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -122,6 +122,7 @@ $(document).ready(function() { } }); }); + }); function submitCustomRange(frmdata) { @@ -135,3 +136,22 @@ function submitCustomRange(frmdata) { return true; } +$(document).on("click", '.collapse-neighbors', function(event) +{ + var caller = $(this); + var button = caller.find('.neighbors-button'); + var list = caller.find('.neighbors-interface-list'); + var continued = caller.find('.neighbors-list-continued'); + + if(button.hasClass("glyphicon-plus")) + { + button.addClass('glyphicon-minus').removeClass('glyphicon-plus'); + }else + { + button.addClass('glyphicon-plus').removeClass('glyphicon-minus'); + } + + list.toggle(); + continued.toggle(); +}); +