Option to display Port SSID in Device Ports view
This commit is contained in:
@@ -5,6 +5,10 @@
|
|||||||
* User Reports via config, without requiring HTML or Perl
|
* User Reports via config, without requiring HTML or Perl
|
||||||
* Add netdisco-rancid-export script
|
* Add netdisco-rancid-export script
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* Option to display Port SSID in Device Ports view
|
||||||
|
|
||||||
2.024001 - 2014-02-25
|
2.024001 - 2014-02-25
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|||||||
@@ -169,6 +169,20 @@ __PACKAGE__->might_have( power => 'App::Netdisco::DB::Result::DevicePortPower',
|
|||||||
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
|
'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
|
=head2 wireless
|
||||||
|
|
||||||
Returns a row from the C<device_port_wireless> table if one refers to this
|
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__->table("device_port_ssid");
|
||||||
__PACKAGE__->add_columns(
|
__PACKAGE__->add_columns(
|
||||||
"ip",
|
"ip",
|
||||||
{ data_type => "inet", is_nullable => 1 },
|
{ data_type => "inet", is_nullable => 0 },
|
||||||
"port",
|
"port",
|
||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 0 },
|
||||||
"ssid",
|
"ssid",
|
||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 1 },
|
||||||
"broadcast",
|
"broadcast",
|
||||||
@@ -22,6 +22,7 @@ __PACKAGE__->add_columns(
|
|||||||
{ data_type => "macaddr", is_nullable => 1 },
|
{ 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
|
# Created by DBIx::Class::Schema::Loader v0.07015 @ 2012-01-07 14:20:02
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zvgylKzUQtizJZCe1rEdUg
|
# 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_pvid', label => 'Native VLAN', default => 'on' },
|
||||||
{ name => 'c_vmember', label => 'VLAN Membership', default => 'on' },
|
{ name => 'c_vmember', label => 'VLAN Membership', default => 'on' },
|
||||||
{ name => 'c_power', label => 'PoE', default => '' },
|
{ name => 'c_power', label => 'PoE', default => '' },
|
||||||
|
{ name => 'c_ssid', label => 'SSID', default => '' },
|
||||||
{ name => 'c_nodes', label => 'Connected Nodes', default => '' },
|
{ name => 'c_nodes', label => 'Connected Nodes', default => '' },
|
||||||
{ name => 'c_neighbors', label => 'Connected Devices', default => 'on' },
|
{ name => 'c_neighbors', label => 'Connected Devices', default => 'on' },
|
||||||
{ name => 'c_stp', label => 'Spanning Tree', default => '' },
|
{ 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'}] })
|
$set = $set->search_rs({}, { prefetch => [{$nodes_name => 'oui'}] })
|
||||||
if param('c_nodes') && param('n_vendor');
|
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
|
# retrieve neighbor devices, if asked for
|
||||||
$set = $set->search_rs({}, { prefetch => [{neighbor_alias => 'device'}] })
|
$set = $set->search_rs({}, { prefetch => [{neighbor_alias => 'device'}] })
|
||||||
if param('c_neighbors');
|
if param('c_neighbors');
|
||||||
|
|||||||
@@ -187,6 +187,10 @@
|
|||||||
</td>
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
[% IF params.c_ssid %]
|
||||||
|
<td>[% row.ssid.ssid | html_entity %]</td>
|
||||||
|
[% END %]
|
||||||
|
|
||||||
[% IF params.c_power %]
|
[% IF params.c_power %]
|
||||||
[% IF row.power %]
|
[% IF row.power %]
|
||||||
[% IF row.power.admin == 'true' %]
|
[% IF row.power.admin == 'true' %]
|
||||||
|
|||||||
Reference in New Issue
Block a user