1<table id="vs-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>VLAN</th> 5 <th>Device</th> 6 <th>Description</th> 7 <th>Ports</th> 8 <th>Model</th> 9 <th>OS</th> 10 <th>Vendor</th> 11 </tr> 12 </thead> 13</table> 14 15<script type="text/javascript"> 16$(document).ready(function() { 17 var table = $('#vs-data-table').dataTable({ 18 "deferRender": true, 19 "data": [% results | none %], 20 "columns": [{ 21 "data": 'vlans.vlan', 22 "render": function(data, type, row, meta) { 23 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>'; 24 } 25 }, { 26 "data": 'ip', 27 "render": function(data, type, row, meta) { 28 return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(row.dns || row.ip) + '</a>'; 29 } 30 }, { 31 "data": 'vlans.description', 32 "render": function(data, type, row, meta) { 33 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>'; 34 } 35 }, { 36 "data": 'pcount', 37 "searchable": false, 38 "render": function(data, type, row, meta) { 39 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")) + '</a>'; 40 } 41 }, { 42 "data": 'model', 43 "render": function(data, type, row, meta) { 44 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>'; 45 } 46 }, { 47 "data": 'os', 48 "render": function(data, type, row, meta) { 49 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>'; 50 } 51 }, { 52 "data": 'vendor', 53 "render": function(data, type, row, meta) { 54 return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>'; 55 } 56 } 57 ], 58[% INCLUDE 'ajax/datatabledefaults.tt' -%] 59 }); 60});</script> 61