mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #147 from laf/issue-145
Updated IPv(4/6), mac and arp pages in overview section visually
This commit is contained in:
@ -32,7 +32,11 @@ foreach (dbFetchRows("SELECT D.device_id AS device_id, `hostname` FROM `ipv4_mac
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo('<table class="table table-condensed">');
|
||||
echo('<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
<strong>ARP Entries</strong>
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$query = "SELECT * FROM `ipv4_mac` AS M, `ports` AS P, `devices` AS D WHERE M.port_id = P.port_id AND P.device_id = D.device_id ";
|
||||
if (isset($_POST['searchby']) && $_POST['searchby'] == "ip")
|
||||
@ -51,7 +55,7 @@ if (is_numeric($_POST['device_id']))
|
||||
}
|
||||
$query .= " ORDER BY M.mac_address";
|
||||
|
||||
echo('<tr class="tablehead"><th>MAC Address</th><th>IP Address</th><th>Device</th><th>Interface</th><th>Remote device</th><th>Remote interface</th></tr>');
|
||||
echo('<tr><th>MAC Address</th><th>IP Address</th><th>Device</th><th>Interface</th><th>Remote device</th><th>Remote interface</th></tr>');
|
||||
foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
if (!$ignore)
|
||||
@ -71,13 +75,13 @@ foreach (dbFetchRows($query, $param) as $entry)
|
||||
if ($arp_host['device_id'] == $entry['device_id']) { $arp_name = "Localhost"; }
|
||||
if ($arp_host['port_id'] == $entry['port_id']) { $arp_if = "Local port"; }
|
||||
|
||||
echo('<tr class="search">
|
||||
<td width="160">' . formatMac($entry['mac_address']) . '</td>
|
||||
<td width="140">' . $entry['ipv4_address'] . '</td>
|
||||
<td width="200" class="list-bold">' . generate_device_link($entry) . '</td>
|
||||
<td class="list-bold">' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
<td width="200">'.$arp_name.'</td>
|
||||
<td class="list-bold">'.$arp_if.'</td>
|
||||
echo('<tr>
|
||||
<td>' . formatMac($entry['mac_address']) . '</td>
|
||||
<td>' . $entry['ipv4_address'] . '</td>
|
||||
<td>' . generate_device_link($entry) . '</td>
|
||||
<td>' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
<td>'.$arp_name.'</td>
|
||||
<td>'.$arp_if.'</td>
|
||||
</tr>');
|
||||
}
|
||||
|
||||
@ -85,5 +89,6 @@ foreach (dbFetchRows($query, $param) as $entry)
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echp('</div>');
|
||||
|
||||
?>
|
||||
|
@ -31,7 +31,11 @@ foreach (dbFetchRows("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hos
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo('<table class="table table-condensed">');
|
||||
echo('<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
<strong>IPv4 Addresses</strong>
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$query = "SELECT * FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D, `ipv4_networks` AS N WHERE I.port_id = A.port_id AND I.device_id = D.device_id AND N.ipv4_network_id = A.ipv4_network_id ";
|
||||
|
||||
@ -47,7 +51,7 @@ if ($_POST['interface'])
|
||||
}
|
||||
$query .= " ORDER BY A.ipv4_address";
|
||||
|
||||
echo('<tr class="tablehead"><th>Device</a></th><th>Interface</th><th>Address</th><th>Description</th></tr>');
|
||||
echo('<tr"><th>Device</a></th><th>Interface</th><th>Address</th><th>Description</th></tr>');
|
||||
|
||||
foreach (dbFetchRows($query, $param) as $interface)
|
||||
{
|
||||
@ -74,9 +78,9 @@ foreach (dbFetchRows($query, $param) as $interface)
|
||||
{
|
||||
$interface = ifLabel ($interface, $interface);
|
||||
|
||||
echo('<tr class="search">
|
||||
<td class="list-bold">' . generate_device_link($interface) . '</td>
|
||||
<td class="list-bold">' . generate_port_link($interface) . ' ' . $error_img . '</td>
|
||||
echo('<tr>
|
||||
<td>' . generate_device_link($interface) . '</td>
|
||||
<td>' . generate_port_link($interface) . ' ' . $error_img . '</td>
|
||||
<td>' . $interface['ipv4_address'] . '/'.$length.'</td>
|
||||
<td>' . $interface['ifAlias'] . "</td>
|
||||
</tr>\n");
|
||||
@ -87,5 +91,6 @@ foreach (dbFetchRows($query, $param) as $interface)
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
|
@ -31,7 +31,11 @@ foreach (dbFetchRows("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hos
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo('<table class="table table-condensed">');
|
||||
echo('<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
<strong>IPv6 Addresses</strong>
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$query = "SELECT * FROM `ipv6_addresses` AS A, `ports` AS I, `devices` AS D, `ipv6_networks` AS N WHERE I.port_id = A.port_id AND I.device_id = D.device_id AND N.ipv6_network_id = A.ipv6_network_id ";
|
||||
|
||||
@ -47,7 +51,7 @@ if ($_POST['interface'])
|
||||
}
|
||||
$query .= " ORDER BY A.ipv6_address";
|
||||
|
||||
echo('<tr class="tablehead"><th>Device</a></th><th>Interface</th><th>Address</th><th>Description</th></tr>');
|
||||
echo('<tr><th>Device</a></th><th>Interface</th><th>Address</th><th>Description</th></tr>');
|
||||
|
||||
foreach (dbFetchRows($query, $param) as $interface)
|
||||
{
|
||||
@ -74,9 +78,9 @@ foreach (dbFetchRows($query, $param) as $interface)
|
||||
{
|
||||
$interface = ifLabel ($interface, $interface);
|
||||
|
||||
echo('<tr class="search">
|
||||
<td class="list-bold">' . generate_device_link($interface) . '</td>
|
||||
<td class="list-bold">' . generate_port_link($interface, makeshortif(fixifname($interface['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
echo('<tr>
|
||||
<td>' . generate_device_link($interface) . '</td>
|
||||
<td>' . generate_port_link($interface, makeshortif(fixifname($interface['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
<td>' . Net_IPv6::compress($interface['ipv6_address']) . '/'.$length.'</td>
|
||||
<td>' . $interface['ifAlias'] . "</td>
|
||||
</tr>\n");
|
||||
@ -87,5 +91,6 @@ foreach (dbFetchRows($query, $param) as $interface)
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo('</div>');
|
||||
|
||||
?>
|
||||
|
@ -31,7 +31,11 @@ foreach (dbFetchRows("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hos
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo('<table class="table table-condensed">');
|
||||
echo('<div class="panel panel-default panel-condensed">
|
||||
<div class="panel-heading">
|
||||
<strong>MAC Addresses</strong>
|
||||
</div>
|
||||
<table class="table table-hover table-condensed table-striped">');
|
||||
|
||||
$query = "SELECT * FROM `ports` AS P, `devices` AS D WHERE P.device_id = D.device_id ";
|
||||
$query .= "AND `ifPhysAddress` LIKE ?";
|
||||
@ -49,7 +53,7 @@ if ($_POST['interface'])
|
||||
}
|
||||
$query .= " ORDER BY P.ifPhysAddress";
|
||||
|
||||
echo('<tr class="tablehead"><th>Device</a></th><th>Interface</th><th>MAC Address</th><th>Description</th></tr>');
|
||||
echo('<tr><th>Device</a></th><th>Interface</th><th>MAC Address</th><th>Description</th></tr>');
|
||||
foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
if (!$ignore)
|
||||
@ -66,9 +70,9 @@ foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
$interface = ifLabel ($interface, $interface);
|
||||
|
||||
echo('<tr class="search">
|
||||
<td class="list-bold">' . generate_device_link($entry) . '</td>
|
||||
<td class="list-bold">' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
echo('<tr>
|
||||
<td>' . generate_device_link($entry) . '</td>
|
||||
<td>' . generate_port_link($entry, makeshortif(fixifname($entry['ifDescr']))) . ' ' . $error_img . '</td>
|
||||
<td>' . formatMac($entry['ifPhysAddress']) . '</td>
|
||||
<td>' . $entry['ifAlias'] . "</td>
|
||||
</tr>\n");
|
||||
@ -79,5 +83,6 @@ foreach (dbFetchRows($query, $param) as $entry)
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo('</div>');
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user