fix search by device interface IP

This commit is contained in:
Oliver Gorwits
2013-02-17 11:03:50 +00:00
parent 10fe069dce
commit 3829254fc8
2 changed files with 6 additions and 3 deletions

View File

@@ -78,8 +78,11 @@ get '/search' => sub {
if ($nd and $nd->count) {
if ($nd->count == 1) {
# redirect to device details for the one device
return redirect uri_for('/device',
{tab => 'details', q => $q, f => ''});
return redirect uri_for('/device', {
tab => 'details',
q => ($nd->first->dns || $nd->first->ip),
f => '',
});
}
# multiple devices