Identify wireless APs and IP Phones by icon in device port view
Provide wireless information in node search by MAC
This commit is contained in:
@@ -31,6 +31,16 @@ ajax '/ajax/content/search/node' => require_login sub {
|
|||||||
my $ports = schema('netdisco')->resultset('DevicePort')
|
my $ports = schema('netdisco')->resultset('DevicePort')
|
||||||
->search({mac => $mac->as_IEEE});
|
->search({mac => $mac->as_IEEE});
|
||||||
|
|
||||||
|
my $wireless = schema('netdisco')->resultset('NodeWireless')->search(
|
||||||
|
{ mac => $mac->as_IEEE },
|
||||||
|
{ order_by => { '-desc' => 'time_last' },
|
||||||
|
'+columns' => [
|
||||||
|
{
|
||||||
|
time_last_stamp => \"to_char(time_last, 'YYYY-MM-DD HH24:MI')"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return unless $sightings->count
|
return unless $sightings->count
|
||||||
or $ips->count
|
or $ips->count
|
||||||
or $ports->count;
|
or $ports->count;
|
||||||
@@ -39,6 +49,7 @@ ajax '/ajax/content/search/node' => require_login sub {
|
|||||||
ips => $ips,
|
ips => $ips,
|
||||||
sightings => $sightings,
|
sightings => $sightings,
|
||||||
ports => $ports,
|
ports => $ports,
|
||||||
|
wireless => $wireless,
|
||||||
}, { layout => undef };
|
}, { layout => undef };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -224,7 +224,13 @@
|
|||||||
[% ' id: '_ row.remote_id IF row.remote_id %]
|
[% ' id: '_ row.remote_id IF row.remote_id %]
|
||||||
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
|
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
|
||||||
[% ELSIF row.remote_ip AND row.remote_port %]
|
[% ELSIF row.remote_ip AND row.remote_port %]
|
||||||
|
[% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %]
|
||||||
|
<i class="icon-phone"></i>
|
||||||
|
[% ELSIF row.remote_type AND row.remote_type.match('(cisco\s+AIR-[L|C]?AP|-K9W8-|^AP:\s)') %]
|
||||||
|
<i class="icon-signal"></i>
|
||||||
|
[% ELSE %]
|
||||||
<i class="icon-unlink text-error"></i>
|
<i class="icon-unlink text-error"></i>
|
||||||
|
[% END %]
|
||||||
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
|
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
|
||||||
[% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %]
|
[% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %]
|
||||||
[% ' id: '_ row.remote_id IF row.remote_id %]
|
[% ' id: '_ row.remote_id IF row.remote_id %]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
[% USE Number.Format %]
|
||||||
<table class="table table-bordered table-hover nd_floatinghead">
|
<table class="table table-bordered table-hover nd_floatinghead">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -117,5 +118,34 @@
|
|||||||
</tr>
|
</tr>
|
||||||
[% SET first_row = 0 %]
|
[% SET first_row = 0 %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
[% WHILE (wlan = wireless.next) %]
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
[% IF first_row %]
|
||||||
|
<a class="nd_linkcell"
|
||||||
|
href="[% search_node %]&q=[% wireless.mac | uri %]">[% wireless.mac | html_entity %]</a>
|
||||||
|
[% ELSE %]
|
||||||
|
|
||||||
|
[% END %]
|
||||||
|
</td>
|
||||||
|
[% IF params.show_vendor %]
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
[% END %]
|
||||||
|
<td>Wireless Info</td>
|
||||||
|
<td class="nd_center-cell">SSID: [% wlan.ssid | html_entity %]<br>
|
||||||
|
MaxRate: [% wlan.maxrate | html_entity %]Mbps TxRate: [% wlan.txrate | html_entity %]Mbps<br>
|
||||||
|
SigStr: [% wlan.sigstrength | html_entity %] SigQual: [% wlan.sigqual | html_entity %]<br>
|
||||||
|
Rx: [% wlan.rxpkt | format_number %] pkts, [% wlan.rxbyte | format_number %] bytes<br>
|
||||||
|
Tx: [% wlan.txpkt | format_number %] pkts, [% wlan.txbyte | format_number %] bytes<br>
|
||||||
|
</td>
|
||||||
|
[% IF params.stamps %]
|
||||||
|
<td> </td>
|
||||||
|
<td>[% wlan.get_column('time_last_stamp') | html_entity %]</td>
|
||||||
|
[% END %]
|
||||||
|
</tr>
|
||||||
|
[% SET first_row = 0 %]
|
||||||
|
[% END %]
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user