1[% USE Number.Format %]
2<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
3  <thead>
4    <tr>
5      <th>MAC</th>
6      <th>Vendor</th>
7      <th>Location</th>
8      <th>IPs</th>
9    </tr>
10  </thead>
11</table>
12
13<script type="text/javascript">
14$(document).ready(function() {
15  var table = $('#data-table').dataTable({
16    "deferRender": true,
17    "order": [[ 3, "desc" ]],
18    "data": [% results | none %],
19    "columns": [
20      {
21        "data": 'mac',
22        "render": function(data, type, row, meta) {
23          return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
24        }
25      }, {
26        "data": 'vendor',
27        "render": function(data, type, row, meta) {
28          return he.encode(data || '');
29        }
30      }, {
31        "data": 'port',
32        "render": function(data, type, row, meta) {
33          return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(row.dns || row.name || row.switch) + '(' + he.encode(data) + ')</a>';
34        }
35      }, {
36        "data": 'ip_count',
37        "searchable": false,
38        "render": function(data, type, row, meta) {
39          return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
40        }
41      }
42    ],
43[% INCLUDE 'ajax/datatabledefaults.tt' -%]
44  });
45});
46</script>
47
48