relocate repo files so ND2 is the only code
This commit is contained in:
67
share/views/ajax/report/ipinventory.tt
Normal file
67
share/views/ajax/report/ipinventory.tt
Normal file
@@ -0,0 +1,67 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Node</th>
|
||||
<th>MAC Address</th>
|
||||
<th class="nd_center-cell">DNS</th>
|
||||
<th>Last Used</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
var cell_str = he.encode(data);
|
||||
if (type == 'display') {
|
||||
if (row.time_last && row.node) {
|
||||
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
else if (row.time_last) {
|
||||
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
}
|
||||
}
|
||||
return cell_str;
|
||||
}
|
||||
}, {
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
var cell_str = he.encode(data || '');
|
||||
if (type == 'display' && data && row.time_last) {
|
||||
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
return cell_str;
|
||||
}
|
||||
}, {
|
||||
"data": 'dns',
|
||||
"className": "nd_nowrap nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'age',
|
||||
"render": function(data, type, row, meta) {
|
||||
if (type == 'display') {
|
||||
return he.encode(data || 'Never');
|
||||
}
|
||||
else {
|
||||
// so that sorting works correctly on this column
|
||||
return row.time_last;
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user