Support for Device Details plugins; Web-Plugin-RANCID
This commit is contained in:
@@ -9,6 +9,7 @@ set(
|
||||
'_additional_css' => [],
|
||||
'_additional_javascript' => [],
|
||||
'_extra_device_port_cols' => [],
|
||||
'_extra_device_details' => [],
|
||||
'_navbar_items' => [],
|
||||
'_search_tabs' => [],
|
||||
'_device_tabs' => [],
|
||||
@@ -76,6 +77,23 @@ register 'register_device_port_column' => sub {
|
||||
push @{ setting('_extra_device_port_cols') }, $config;
|
||||
};
|
||||
|
||||
register 'register_device_details' => sub {
|
||||
my ($self, $config) = plugin_args(@_);
|
||||
|
||||
if (!$config->{name} or !$config->{label}) {
|
||||
return error "bad config to register_device_details";
|
||||
}
|
||||
|
||||
foreach my $item (@{ setting('_extra_device_details') }) {
|
||||
if ($item->{name} eq $config->{name}) {
|
||||
$item = $config;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
push @{ setting('_extra_device_details') }, $config;
|
||||
};
|
||||
|
||||
register 'register_navbar_item' => sub {
|
||||
my ($self, $config) = plugin_args(@_);
|
||||
|
||||
@@ -197,6 +215,10 @@ Additional Device Port Columns
|
||||
|
||||
=item *
|
||||
|
||||
Additional Device Details
|
||||
|
||||
=item *
|
||||
|
||||
Admin Menu function (job control, manual topology, pseudo devices)
|
||||
|
||||
=back
|
||||
|
||||
Reference in New Issue
Block a user