55 lines
1.9 KiB
Plaintext
55 lines
1.9 KiB
Plaintext
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
|
<thead>
|
|
<tr>
|
|
<th class="nd_center-cell">Location</th>
|
|
<th class="nd_center-cell">Device</th>
|
|
<th class="nd_center-cell">System Name</th>
|
|
<th class="nd_center-cell">Vendor</th>
|
|
<th class="nd_center-cell">Model</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var table = $('#data-table').dataTable({
|
|
"deferRender": true,
|
|
"data": [% results %],
|
|
"columns": [
|
|
{
|
|
data: 'location',
|
|
render: function(data, type, row, meta) {
|
|
if (data) {
|
|
return '<a href="[% search_device %]&q=' + data + '&location=' + data + '">' + data + '</a>';
|
|
|
|
} else {
|
|
return '[Not Set]';
|
|
}
|
|
}
|
|
}, {
|
|
data: 'ip',
|
|
render: function(data, type, row, meta) {
|
|
return '<a href="[% uri_for('/device') %]?q=' + data + '">' + (row.dns || row.ip) + '</a>';
|
|
}
|
|
}, {
|
|
data: 'name',
|
|
render: function(data, type, row, meta) {
|
|
return '<a href="[% search_device %]&q=' + data + '&model=' + data + '">' + data + '</a>';
|
|
}
|
|
}, {
|
|
data: 'vendor',
|
|
render: function(data, type, row, meta) {
|
|
return '<a href="[% search_device %]&q=' + data + '&model=' + data + '">' + data + '</a>';
|
|
}
|
|
}, {
|
|
data: 'model',
|
|
render: function(data, type, row, meta) {
|
|
return '<a href="[% search_device %]&q=' + data + '&model=' + data + '">' + data + '</a>';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
});
|
|
</script>
|