<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({
    "deferRender": true,
    "data": [% results | none %],
    "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 | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
            he.encode(data || '');
        }
      }, {
        "data": 'device_port.name',
        "render": function(data, type, row, meta) {
          return he.encode(data || '');
        }
      }, {
        "data": 'subnet',
        "render": function(data, type, row, meta) {
          return '[% IF user_has_role('admin') %]<a class="nd_stealth-link" href="[% uri_base | none %]/report/ipinventory?subnet=' + encodeURIComponent(data) + '"><i rel="tooltip" data-placement="left" data-offset="5" data-title="Node Inventory" class="icon-laptop"></i></a> <a class="nd_stealth-link nd_node-ext-link" href="[% uri_base | none %]/?device=' + encodeURIComponent(data) + '"><i rel="tooltip" data-placement="left" data-offset="5" data-title="Discover Devices here" class="icon-search"></i></a>&nbsp;[% END %]'
            + '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
        }
      }
    ],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
  });
});
</script>
