mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Only display plus icon if there is something to display
This commit is contained in:
@ -179,8 +179,7 @@ echo '</td>';
|
|||||||
echo '<td width=375 valign=top class="interface-desc">';
|
echo '<td width=375 valign=top class="interface-desc">';
|
||||||
|
|
||||||
$neighborsCount=0;
|
$neighborsCount=0;
|
||||||
echo '<div class="collapse-neighbors"><span class="neighbors-button glyphicon glyphicon-plus" aria-hidden="true"></span>
|
$displayPlus=0;
|
||||||
<span class="neighbors-interface-list-firsts" style="display: inline;">';
|
|
||||||
if (strpos($port['label'], 'oopback') === false && !$graph_type) {
|
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) {
|
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("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "</a><br />");
|
// echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "</a><br />");
|
||||||
@ -194,6 +193,11 @@ if (strpos($port['label'], 'oopback') === false && !$graph_type) {
|
|||||||
if ($port_details && $config['enable_port_relationship'] === true) {
|
if ($port_details && $config['enable_port_relationship'] === true) {
|
||||||
// Show which other devices are on the same subnet as this interface
|
// Show which other devices are on the same subnet as this interface
|
||||||
foreach (dbFetchRows("SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%'", array($port['port_id'])) as $net) {
|
foreach (dbFetchRows("SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%'", array($port['port_id'])) as $net) {
|
||||||
|
if($displayPlus == 0) {
|
||||||
|
$displayPlus=1;
|
||||||
|
echo '<div class="collapse-neighbors"><span class="neighbors-button glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
|
<span class="neighbors-interface-list-firsts" style="display: inline;">';
|
||||||
|
}
|
||||||
$ipv4_network_id = $net['ipv4_network_id'];
|
$ipv4_network_id = $net['ipv4_network_id'];
|
||||||
$sql = 'SELECT I.port_id FROM ipv4_addresses AS A, ports AS I, devices AS D
|
$sql = 'SELECT I.port_id FROM ipv4_addresses AS A, ports AS I, devices AS D
|
||||||
WHERE A.port_id = I.port_id
|
WHERE A.port_id = I.port_id
|
||||||
@ -314,7 +318,11 @@ if ($port_details && $config['enable_port_relationship'] === true && port_permit
|
|||||||
|
|
||||||
unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
|
unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
|
||||||
|
|
||||||
echo '</span></div></td></tr>';
|
if($displayPlus)
|
||||||
|
{
|
||||||
|
echo '</span></div>';
|
||||||
|
}
|
||||||
|
echo '</td></tr>';
|
||||||
|
|
||||||
// If we're showing graphs, generate the graph and print the img tags
|
// If we're showing graphs, generate the graph and print the img tags
|
||||||
if ($graph_type == 'etherlike') {
|
if ($graph_type == 'etherlike') {
|
||||||
|
Reference in New Issue
Block a user