Port filter supports basic */?/%/_ wildcards (closes #25)

This commit is contained in:
Oliver Gorwits
2012-08-27 21:17:08 +01:00
parent 52468b0ac0
commit 3fefb5b7f0
2 changed files with 5 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
* Typeahead on the main navbar search (for devices only)
* Support for have_nodeip_dns_col setting (closes #14)
* Set focus to navbar search on initial login or when changing to home (closes #24)
* Port filter supports basic */?/%/_ wildcards (closes #25)
[ENHANCEMENTS]

View File

@@ -113,6 +113,10 @@ ajax '/ajax/content/device/ports' => sub {
return unless $set->count;
}
else {
$q =~ s/\*/%/g if index($q, '*') >= 0;
$q =~ s/\?/_/g if index($q, '?') >= 0;
$q = { '-ilike' => $q };
if ($set->search({'me.port' => $q})->count) {
$set = $set->search({'me.port' => $q});
}