#24 Show device age in device search view

This commit is contained in:
Oliver Gorwits
2018-03-10 11:09:04 +00:00
parent 66e3d2d64e
commit a2269c469f
6 changed files with 39 additions and 10 deletions

View File

@@ -2,13 +2,13 @@
<thead>
<tr>
<th>Device</th>
<th>Contact</th>
<th>Location</th>
<th>System Name</th>
<th>Model</th>
<th>OS Version</th>
<th>Management IP</th>
<th>Serial</th>
<th>First Seen</th>
<th>Last Discovered</th>
</tr>
</thead>
@@ -24,11 +24,6 @@ $(document).ready(function() {
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
}
}, {
"data": 'contact',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'location',
"render": function(data, type, row, meta) {
@@ -59,6 +54,11 @@ $(document).ready(function() {
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'first_seen_stamp',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'last_discover_stamp',
"render": function(data, type, row, meta) {

View File

@@ -1,10 +1,10 @@
[% USE CSV -%]
[% CSV.dump(['Device','Contact','Location','System Name','Model','OS Version','Management IP','Serial']) %]
[% CSV.dump(['Device','Location','System Name','Model','OS Version','Management IP','Serial','First Seen','Last Discovered']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.dns || row.ip %]
[% FOREACH col IN [ device row.contact row.location row.name row.model row.os_ver row.ip row.serial] %]
[% FOREACH col IN [ device row.location row.name row.model row.os_ver row.ip row.serial row.first_seen_stamp row.last_discover_stamp] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]