show port error disable state in device ports view
This commit is contained in:
@@ -175,8 +175,7 @@ device port.
|
||||
|
||||
__PACKAGE__->might_have( properties => 'App::Netdisco::DB::Result::DevicePortProperties', {
|
||||
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
|
||||
}, { join_type => 'LEFT OUTER' }
|
||||
);
|
||||
});
|
||||
|
||||
=head2 ssid
|
||||
|
||||
@@ -308,6 +307,15 @@ ID assigned to untagged frames received on the port).
|
||||
|
||||
sub native { return (shift)->vlan }
|
||||
|
||||
=head2 error_disable_cause
|
||||
|
||||
Returns the textual reason given by the device if the port is in an error
|
||||
state, or else `undef` if the port is not in an error state.
|
||||
|
||||
=cut
|
||||
|
||||
sub error_disable_cause { return (shift)->get_column('properties_error_disable_cause') }
|
||||
|
||||
=head2 vlan_count
|
||||
|
||||
Returns the number of VLANs active on this device port. Enable this column by
|
||||
|
||||
@@ -104,6 +104,32 @@ sub only_free_ports {
|
||||
);
|
||||
}
|
||||
|
||||
=head2 with_properties
|
||||
|
||||
This is a modifier for any C<search()> which
|
||||
will add the following additional synthesized columns to the result set:
|
||||
|
||||
=over 4
|
||||
|
||||
=item error_disable_cause
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub with_properties {
|
||||
my ($rs, $cond, $attrs) = @_;
|
||||
|
||||
return $rs
|
||||
->search_rs($cond, $attrs)
|
||||
->search({},
|
||||
{
|
||||
'+select' => ['properties.error_disable_cause'],
|
||||
'+as' => ['properties_error_disable_cause'],
|
||||
join => 'properties',
|
||||
});
|
||||
}
|
||||
|
||||
=head2 with_vlan_count
|
||||
|
||||
This is a modifier for any C<search()> (including the helpers below) which
|
||||
|
||||
Reference in New Issue
Block a user