diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Search/Node.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Search/Node.pm index 80b4e0df..55af43a1 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Search/Node.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Search/Node.pm @@ -31,14 +31,25 @@ ajax '/ajax/content/search/node' => require_login sub { my $ports = schema('netdisco')->resultset('DevicePort') ->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 or $ips->count or $ports->count; template 'ajax/search/node_by_mac.tt', { - ips => $ips, + ips => $ips, sightings => $sightings, - ports => $ports, + ports => $ports, + wireless => $wireless, }, { layout => undef }; } else { diff --git a/Netdisco/share/views/ajax/device/ports.tt b/Netdisco/share/views/ajax/device/ports.tt index d253d150..6aab58a4 100644 --- a/Netdisco/share/views/ajax/device/ports.tt +++ b/Netdisco/share/views/ajax/device/ports.tt @@ -224,7 +224,13 @@ [% ' id: '_ row.remote_id IF row.remote_id %] [% ' type: '_ row.remote_type IF row.remote_type %]) [% ELSIF row.remote_ip AND row.remote_port %] - + [% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %] + + [% ELSIF row.remote_type AND row.remote_type.match('(cisco\s+AIR-[L|C]?AP|-K9W8-|^AP:\s)') %] + + [% ELSE %] + + [% END %] [% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %] [% ' id: '_ row.remote_id IF row.remote_id %] diff --git a/Netdisco/share/views/ajax/search/node_by_mac.tt b/Netdisco/share/views/ajax/search/node_by_mac.tt index 92c4ac28..5f9b9da7 100644 --- a/Netdisco/share/views/ajax/search/node_by_mac.tt +++ b/Netdisco/share/views/ajax/search/node_by_mac.tt @@ -1,3 +1,4 @@ +[% USE Number.Format %]
| + [% IF first_row %] + [% wireless.mac | html_entity %] + [% ELSE %] + + [% END %] + | + [% IF params.show_vendor %] ++ + | + [% END %] +Wireless Info | +SSID: [% wlan.ssid | html_entity %] + MaxRate: [% wlan.maxrate | html_entity %]Mbps TxRate: [% wlan.txrate | html_entity %]Mbps + SigStr: [% wlan.sigstrength | html_entity %] SigQual: [% wlan.sigqual | html_entity %] + Rx: [% wlan.rxpkt | format_number %] pkts, [% wlan.rxbyte | format_number %] bytes + Tx: [% wlan.txpkt | format_number %] pkts, [% wlan.txbyte | format_number %] bytes + |
+ [% IF params.stamps %]
+ + | [% wlan.get_column('time_last_stamp') | html_entity %] | + [% END %] +