<table id="da-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Address</th>
<th>DNS</th>
<th class="nd_center-cell">Interface</th>
<th>Description</th>
<th>Prefix</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#da-data-table').dataTable({
"processing": true,
"stateSave": true,
"pageLength": [% settings.table_pagesize %],
"language": {
"search": 'Filter records: '
},
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'alias',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'dns',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
data;
}
}, {
"data": 'name',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'subnet',
"render": function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}
]
});
});
</script>