show last discovered in device search, to help when old/duplicates are in DB

This commit is contained in:
Oliver Gorwits
2014-01-30 07:19:52 +00:00
parent 132dc97bc6
commit 1f46629aea
2 changed files with 6 additions and 2 deletions

View File

@@ -19,13 +19,15 @@ get '/ajax/content/search/device' => require_login sub {
my $set; my $set;
if ($has_opt) { if ($has_opt) {
$set = schema('netdisco')->resultset('Device')->search_by_field(scalar params); $set = schema('netdisco')->resultset('Device')
->with_times->search_by_field(scalar params);
} }
else { else {
my $q = param('q'); my $q = param('q');
send_error('Missing query', 400) unless $q; send_error('Missing query', 400) unless $q;
$set = schema('netdisco')->resultset('Device')->search_fuzzy($q); $set = schema('netdisco')->resultset('Device')
->with_times->search_fuzzy($q);
} }
return unless $set->count; return unless $set->count;

View File

@@ -9,6 +9,7 @@
<th>OS Version</th> <th>OS Version</th>
<th>Management IP</th> <th>Management IP</th>
<th>Serial</th> <th>Serial</th>
<th>Last Discovered</th>
</tr> </tr>
</thead> </thead>
</tbody> </tbody>
@@ -22,6 +23,7 @@
<td>[% row.os_ver | html_entity %]</td> <td>[% row.os_ver | html_entity %]</td>
<td>[% row.ip | html_entity %]</td> <td>[% row.ip | html_entity %]</td>
<td>[% row.serial | html_entity %]</td> <td>[% row.serial | html_entity %]</td>
<td>[% row.last_discover_stamp | html_entity %]</td>
</tr> </tr>
[% END %] [% END %]
</tbody> </tbody>