[#81] Identify wireless nodes and provide information when available
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2.021001
|
||||
|
||||
[NEW FEATURES]
|
||||
|
||||
* [#81] Identify wireless nodes and provide information when available
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* [#32] Show device layers in Details tab
|
||||
|
||||
@@ -112,6 +112,17 @@ the current Node's.
|
||||
__PACKAGE__->has_many( ips => 'App::Netdisco::DB::Result::NodeIp',
|
||||
{ 'foreign.mac' => 'self.mac', 'foreign.active' => 'self.active' } );
|
||||
|
||||
=head2 wireless
|
||||
|
||||
Returns the set of C<node_wireless> entries associated with this Node. That
|
||||
is, the SSIDs and wireless statistics associated with this MAC address
|
||||
at the time of discovery.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( wireless => 'App::Netdisco::DB::Result::NodeWireless',
|
||||
{ 'foreign.mac' => 'self.mac' } );
|
||||
|
||||
=head2 oui
|
||||
|
||||
Returns the C<oui> table entry matching this Node. You can then join on this
|
||||
|
||||
@@ -47,5 +47,17 @@ __PACKAGE__->set_primary_key("mac", "ssid");
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3xsSiWzL85ih3vhdews8Hg
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
=head2 node
|
||||
|
||||
Returns the C<node> table entry matching this wireless entry.
|
||||
|
||||
The JOIN is of type LEFT, in case the C<node> is no longer present in the
|
||||
database but the relation is being used in C<search()>.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( node => 'App::Netdisco::DB::Result::Node',
|
||||
{ 'foreign.mac' => 'self.mac' },
|
||||
{ join_type => 'LEFT' } );
|
||||
|
||||
1;
|
||||
|
||||
@@ -48,6 +48,7 @@ hook 'before' => sub {
|
||||
var('connected_properties' => [
|
||||
{ name => 'n_age', label => 'Age Stamp', default => '' },
|
||||
{ name => 'n_ip', label => 'IP Address', default => 'on' },
|
||||
{ name => 'n_ssid', label => 'SSID', default => 'on' },
|
||||
{ name => 'n_archived', label => 'Archived Data', default => '' },
|
||||
]);
|
||||
|
||||
|
||||
@@ -129,6 +129,10 @@ get '/ajax/content/device/ports' => require_login sub {
|
||||
$set = $set->search_rs({}, { prefetch => [{$nodes_name => 'ips'}] })
|
||||
if param('c_nodes');
|
||||
|
||||
# retrieve wireless SSIDs, if asked for
|
||||
$set = $set->search_rs({}, { prefetch => [{$nodes_name => 'wireless'}] })
|
||||
if param('c_nodes');
|
||||
|
||||
# retrieve neighbor devices, if asked for
|
||||
$set = $set->search_rs({}, { prefetch => [{neighbor_alias => 'device'}] })
|
||||
if param('c_neighbors');
|
||||
|
||||
@@ -243,8 +243,19 @@
|
||||
[% FOREACH node IN row.$nodes %]
|
||||
[% '<br/>' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %]
|
||||
[% '<i class="icon-book"></i> ' IF NOT node.active %]
|
||||
[% '<i class="icon-signal"></i> ' IF node.wireless.defined %]
|
||||
<a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
|
||||
[% node.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF (node.vlan > 0) && (node.vlan != row.vlan) %]
|
||||
(on vlan [% node.vlan | html_entity %])
|
||||
[% END %]
|
||||
[% IF params.n_ssid AND node.wireless.defined %]
|
||||
(SSID:
|
||||
[% FOREACH wlan IN node.wireless %]
|
||||
[%+ wlan.ssid | html_entity %]
|
||||
[% END %]
|
||||
)
|
||||
[% END %]
|
||||
[% ' (' _ node.time_last_age _ ')' IF params.n_age %]
|
||||
[% IF params.n_ip %]
|
||||
[% FOREACH ip IN node.ips %]
|
||||
|
||||
Reference in New Issue
Block a user