1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>Device</th> 5 <th>Port</th> 6 <th>Remote ID</th> 7 <th>Remote IP</th> 8 <th>Remote Port</th> 9 <th>Remote Type</th> 10 </tr> 11 </thead> 12</table> 13 14<script type="text/javascript"> 15$(document).ready(function() { 16 var table = $('#data-table').dataTable({ 17 "deferRender": true, 18 "data": [% results | none %], 19 "columns": [ 20 { 21 "data": 'ip', 22 "render": function(data, type, row, meta) { 23 return he.encode(row.dns || row.name || data); 24 } 25 }, { 26 "data": 'port', 27 "type": 'portsort', 28 "render": function(data, type, row, meta) { 29 return type === 'display' ? 30 '<a href="[% device_ports | none %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' : 31 he.encode(data || ''); 32 } 33 }, { 34 "data": 'remote_id', 35 "render": function(data, type, row, meta) { 36 return he.encode(data || ''); 37 } 38 }, { 39 "data": 'remote_ip', 40 "render": function(data, type, row, meta) { 41 return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>'; 42 } 43 }, { 44 "data": 'remote_port', 45 "render": function(data, type, row, meta) { 46 return he.encode(data || ''); 47 } 48 }, { 49 "data": 'remote_type', 50 "render": function(data, type, row, meta) { 51 return he.encode(data || ''); 52 } 53 } 54 ], 55[% INCLUDE 'ajax/datatabledefaults.tt' -%] 56 }); 57}); 58</script> 59