navbar_autocomplete config item to disable main navbar autocomplete
This commit is contained in:
@@ -103,6 +103,12 @@ database:
|
||||
netdisco=> update users set port_control = true where username = 'guest';
|
||||
netdisco=> update users set admin = true where username = 'guest';
|
||||
|
||||
=head3 C<navbar_autocomplete>
|
||||
|
||||
Value: Boolean. Default: C<true>.
|
||||
|
||||
Set this to C<false> to disable the device autocomplete in the main navbar.
|
||||
|
||||
=head3 C<suggest_guest>
|
||||
|
||||
Value: Boolean. Default: C<false>.
|
||||
|
||||
@@ -8,6 +8,8 @@ use Dancer::Plugin::Auth::Extensible;
|
||||
use App::Netdisco::Util::Web (); # for sort_port
|
||||
|
||||
ajax '/ajax/data/devicename/typeahead' => require_login sub {
|
||||
return '[]' unless setting('navbar_autocomplete');
|
||||
|
||||
my $q = param('query') || param('term');
|
||||
my $set = schema('netdisco')->resultset('Device')->search_fuzzy($q);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user