Option to display Port SSID in Device Ports view
This commit is contained in:
		| @@ -169,6 +169,20 @@ __PACKAGE__->might_have( power => 'App::Netdisco::DB::Result::DevicePortPower', | ||||
|   'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port', | ||||
| }); | ||||
|  | ||||
| =head2 ssid | ||||
|  | ||||
| Returns a row from the C<device_port_ssid> table if one refers to this | ||||
| device port. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| __PACKAGE__->might_have( | ||||
|     ssid => 'App::Netdisco::DB::Result::DevicePortSsid', | ||||
|     {   'foreign.ip'   => 'self.ip', | ||||
|         'foreign.port' => 'self.port', | ||||
|     } | ||||
| ); | ||||
|  | ||||
| =head2 wireless | ||||
|  | ||||
| Returns a row from the C<device_port_wireless> table if one refers to this | ||||
|   | ||||
| @@ -11,9 +11,9 @@ use base 'DBIx::Class::Core'; | ||||
| __PACKAGE__->table("device_port_ssid"); | ||||
| __PACKAGE__->add_columns( | ||||
|   "ip", | ||||
|   { data_type => "inet", is_nullable => 1 }, | ||||
|   { data_type => "inet", is_nullable => 0 }, | ||||
|   "port", | ||||
|   { data_type => "text", is_nullable => 1 }, | ||||
|   { data_type => "text", is_nullable => 0 }, | ||||
|   "ssid", | ||||
|   { data_type => "text", is_nullable => 1 }, | ||||
|   "broadcast", | ||||
| @@ -22,6 +22,7 @@ __PACKAGE__->add_columns( | ||||
|   { data_type => "macaddr", is_nullable => 1 }, | ||||
| ); | ||||
|  | ||||
| __PACKAGE__->set_primary_key("port", "ip"); | ||||
|  | ||||
| # Created by DBIx::Class::Schema::Loader v0.07015 @ 2012-01-07 14:20:02 | ||||
| # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zvgylKzUQtizJZCe1rEdUg | ||||
|   | ||||
| @@ -24,6 +24,7 @@ hook 'before' => sub { | ||||
|     { name => 'c_pvid',        label => 'Native VLAN',       default => 'on' }, | ||||
|     { name => 'c_vmember',     label => 'VLAN Membership',   default => 'on' }, | ||||
|     { name => 'c_power',       label => 'PoE',               default => ''   }, | ||||
|     { name => 'c_ssid',        label => 'SSID',              default => ''   }, | ||||
|     { name => 'c_nodes',       label => 'Connected Nodes',   default => ''   }, | ||||
|     { name => 'c_neighbors',   label => 'Connected Devices', default => 'on' }, | ||||
|     { name => 'c_stp',         label => 'Spanning Tree',     default => ''   }, | ||||
|   | ||||
| @@ -149,6 +149,9 @@ get '/ajax/content/device/ports' => require_login sub { | ||||
|     $set = $set->search_rs({}, { prefetch => [{$nodes_name => 'oui'}] }) | ||||
|       if param('c_nodes') && param('n_vendor'); | ||||
|  | ||||
|     # retrieve SSID, if asked for | ||||
|     $set = $set->search({}, { prefetch => 'ssid' }) if param('c_ssid'); | ||||
|  | ||||
|     # retrieve neighbor devices, if asked for | ||||
|     $set = $set->search_rs({}, { prefetch => [{neighbor_alias => 'device'}] }) | ||||
|       if param('c_neighbors'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user