#24 Show device age in device search view
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) %]
|
||||
|
||||
Reference in New Issue
Block a user