Files
netdisco/Netdisco/share/views/ajax/report/portutilization.tt
2014-05-27 23:27:04 -04:00

51 lines
1.6 KiB
Plaintext

<table id="data-table" class="table table-striped table-bordered nd_floatinghead" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th class="nd_center-cell">Total Ports</th>
<th class="nd_center-cell">In Use</th>
<th class="nd_center-cell">Shutdown</th>
<th class="nd_center-cell">Free</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"data": [% results %],
"columns": [
{
data: 'ip',
render: function(data, type, row, meta) {
return '<a href="[% device_ports %]&q=' + data + '">' + (row.dns || row.ip) + '</a>';
}
}, {
data: 'port_count',
render: function(data, type, full, meta) {
return data.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
data: 'ports_in_use',
render: function(data, type, full, meta) {
return data.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
data: 'ports_shutdown',
render: function(data, type, full, meta) {
return data.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
data: 'ports_free',
render: function(data, type, full, meta) {
return data.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
]
});
});
</script>