show last discovered in device search, to help when old/duplicates are in DB
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user