change id for tag in device and search tab plugins
This commit is contained in:
		| @@ -52,7 +52,7 @@ sub _register_tab { | ||||
|   my ($nav, $config) = @_; | ||||
|   my $stash = setting("${nav}_tabs"); | ||||
|  | ||||
|   if (!length $config->{id} | ||||
|   if (!length $config->{tag} | ||||
|       or !length $config->{label}) { | ||||
|  | ||||
|       error "bad config to register_${nav}_item"; | ||||
| @@ -60,7 +60,7 @@ sub _register_tab { | ||||
|   } | ||||
|  | ||||
|   foreach my $item (@{ $stash }) { | ||||
|       if ($item->{id} eq $config->{id}) { | ||||
|       if ($item->{tag} eq $config->{tag}) { | ||||
|           $item = $config; | ||||
|           return; | ||||
|       } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_device_tab({ id => 'addresses', label => 'Addresses' }); | ||||
| register_device_tab({ tag => 'addresses', label => 'Addresses' }); | ||||
|  | ||||
| # device interface addresses | ||||
| ajax '/ajax/content/device/addresses' => sub { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_device_tab({ id => 'details', label => 'Details' }); | ||||
| register_device_tab({ tag => 'details', label => 'Details' }); | ||||
|  | ||||
| # device details table | ||||
| ajax '/ajax/content/device/details' => sub { | ||||
|   | ||||
| @@ -5,7 +5,7 @@ use Dancer::Plugin::Ajax; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_device_tab({ id => 'modules', label => 'Modules' }); | ||||
| register_device_tab({ tag => 'modules', label => 'Modules' }); | ||||
|  | ||||
| ajax '/ajax/content/device/:thing' => sub { | ||||
|     return "<p>Hello, this is where the ". param('thing') ." content goes.</p>"; | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_device_tab({ id => 'netmap', label => 'Neighbors' }); | ||||
| register_device_tab({ tag => 'netmap', label => 'Neighbors' }); | ||||
|  | ||||
| ajax '/ajax/content/device/netmap' => sub { | ||||
|     content_type('text/html'); | ||||
|   | ||||
| @@ -7,7 +7,7 @@ use Dancer::Plugin::DBIC; | ||||
| use App::Netdisco::Util::Web (); # for sort_port | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_device_tab({ id => 'ports', label => 'Ports' }); | ||||
| register_device_tab({ tag => 'ports', label => 'Ports' }); | ||||
|  | ||||
| # device ports with a description (er, name) matching | ||||
| ajax '/ajax/content/device/ports' => sub { | ||||
|   | ||||
| @@ -8,7 +8,7 @@ use List::MoreUtils (); | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_search_tab({id => 'device', label => 'Device'}); | ||||
| register_search_tab({ tag => 'device', label => 'Device' }); | ||||
|  | ||||
| # device with various properties or a default match-all | ||||
| ajax '/ajax/content/search/device' => sub { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ use Net::MAC (); | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_search_tab({ id => 'node', label => 'Node' }); | ||||
| register_search_tab({ tag => 'node', label => 'Node' }); | ||||
|  | ||||
| # nodes matching the param as an IP or DNS hostname or MAC | ||||
| ajax '/ajax/content/search/node' => sub { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_search_tab({ id => 'port', label => 'Port' }); | ||||
| register_search_tab({ tag => 'port', label => 'Port' }); | ||||
|  | ||||
| # device ports with a description (er, name) matching | ||||
| ajax '/ajax/content/search/port' => sub { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC; | ||||
|  | ||||
| use App::Netdisco::Web::Plugin; | ||||
|  | ||||
| register_search_tab({ id => 'vlan', label => 'VLAN' }); | ||||
| register_search_tab({ tag => 'vlan', label => 'VLAN' }); | ||||
|  | ||||
| # devices carrying vlan xxx | ||||
| ajax '/ajax/content/search/vlan' => sub { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user