relocate repo files so ND2 is the only code

This commit is contained in:
Oliver Gorwits
2017-04-14 23:08:55 +01:00
parent 9a016ea6ba
commit d23b32500f
469 changed files with 0 additions and 6920 deletions

View File

@@ -0,0 +1,30 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Channel</th>
<th>Count</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 1, "desc" ]],
"data": [% results %],
"columns": [
{
"data": 'channel'
}, {
"data": 'ch_count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,10 @@
[% USE CSV -%]
[% CSV.dump([ 'Channel' 'Count' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.channel) %]
[% mylist.push(row.ch_count) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,63 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Model</th>
<th>Location</th>
<th>Port</th>
<th>SSID</th>
<th>Node Count</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 5, "desc" ]],
"data": [% results %],
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
+ he.encode(row.dns || row.name || row.ip) + '</a>' :
data;
}
}, {
"data": 'model',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'location',
"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 %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'ssid',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'mac_count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,14 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Model' 'Location' 'Port' 'SSID' 'Node Count' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.model) %]
[% mylist.push(row.location) %]
[% mylist.push(row.port) %]
[% mylist.push(row.ssid) %]
[% mylist.push(row.mac_count) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,115 @@
<table id="data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th>IP</th>
<th>DNS</th>
<th>Device</th>
<th>Port</th>
<th>Name</th>
<th>Description</th>
<th class="nd_center-cell">Channel</th>
<th class="nd_center-cell">Tx Power (mW/dBm)</th>
</tr>
</thead>
</table>
<style>
tr.group,
tr.group:hover {
background-color: #ddd !important;
}
</style>
<script>
function groupString(d) {
"use strict";
var s = '';
s = s + 'Device: ';
s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
s = s + he.encode(d.dns || d.device_name || d.ip);
if (d.dns || d.device_name) {
s = s + ' (' + he.encode(d.ip) + ') ';
}
s = s + '</a> Model: ' + he.encode(d.model || '');
s = s + he.encode(d.location ? ' Location: ' + d.location : '');
return s;
}
$(document).ready(function() {
var table = $('#data-table').DataTable({
"serverSide": true,
"ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') %]",
"order": [[ 0, 'asc' ]],
"columns": [
{
// Grouping column
"data": 'ip',
"visible": false
}, {
// Included for filtering
"data": 'dns',
"visible": false
}, {
// Included for filtering
"data": 'device_name',
"visible": false
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'port_name',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'descr',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'channel',
"className": "nd_center-cell"
}, {
"data": 'power',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return (row.power2 ? data + ' / ' + row.power2 : '');
}
}
],
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
var row_data = api.row( i ).data();
$(rows).eq( i ).before(
'<tr class="group"><td colspan="5">' + groupString(row_data) + '</td></tr>'
);
last = group;
}
} );
},
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
// Order by the grouping
$('#data-table tbody').on( 'click', 'tr.group', function () {
var currentOrder = table.order()[0];
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
table.order( [ 0, 'desc' ] ).draw();
}
else {
table.order( [ 0, 'asc' ] ).draw();
}
} );
} );
</script>

View File

@@ -0,0 +1,15 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Model' 'Device Location' 'Port' ' Port Name'
'Port Description' 'Channel' 'Tx Power mW' 'Tx Power dBm' ]) %]
[% FOREACH row IN results %]
[% mydlist = [] %]
[% mydevice = row.dns || row.device_name || row.ip %]
[% mydlist.push(mydevice) %]
[% FOREACH col IN [ row.model row.location row.port row.name row.descr
row.channel row.power row.power2 ] %]
[% mydlist.push(col) %]
[% END %]
[% CSV.dump(mydlist) %]
[%END%]

View File

@@ -0,0 +1,41 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Device</th>
<th class="nd_center-cell">Address</th>
<th class="nd_center-cell">Contact</th>
<th class="nd_center-cell">Location</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="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
}
}, {
"data": 'alias',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'contact',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'location',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Address' 'Contact' 'Location' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.alias) %]
[% mylist.push(row.contact) %]
[% mylist.push(row.location) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,56 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Location</th>
<th class="nd_center-cell">Device</th>
<th class="nd_center-cell">System Name</th>
<th class="nd_center-cell">Vendor</th>
<th class="nd_center-cell">Model</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 0, "asc" ], [2, "asc"], [ 3, "asc" ], [4, "asc"]],
"data": [% results %],
"columns": [
{
"data": 'location',
"render": function(data, type, row, meta) {
if (data) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
} else {
return '[Not Set]';
}
}
}, {
"data": 'ip',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
}
}, {
"data": 'name',
"render": function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'vendor',
"render": function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'model',
"render": function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Location' 'Device' 'System Name' 'Vendor' 'Model' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.dns || row.ip %]
[% FOREACH col IN [ row.location device row.name row.vendor row.model ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,49 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>DNS</th>
<th>IP Address</th>
<th>Contact</th>
<th>Location</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="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
}
}, {
"data": 'dns',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'ip',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'contact',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'location',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,13 @@
[% USE CSV -%]
[% CSV.dump([ 'Name' 'DNS' 'IP Address' 'Contact' 'Location' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.name) %]
[% mylist.push(row.dns) %]
[% mylist.push(row.ip) %]
[% mylist.push(row.contact) %]
[% mylist.push(row.location) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,180 @@
<table id="data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th>IP</th>
<th>DNS</th>
<th>Name</th>
<th>Model</th>
<th>Location</th>
<th>PoE<br>Module</th>
<th class="nd_center-cell">Supply</th>
<th class="nd_center-cell">Power<br>(W)</th>
<th class="nd_center-cell">Capable<br>Ports</th>
<th class="nd_center-cell">Powered<br>Ports</th>
<th class="nd_center-cell">Disabled<br>Ports</th>
<th class="nd_center-cell">Errored<br>Ports</th>
<th class="nd_center-cell">Committed<br>(W)</th>
<th class="nd_center-cell">Delivering<br>(W)</th>
</tr>
</thead>
<tbody>
[% FOREACH row IN results %]
<tr>
<td>[% row.ip %]</td>
<td>[% row.dns %]</td>
<td>[% row.name %]</td>
<td>[% row.model %]</td>
<td>[% row.location %]</td>
<td>[% row.module %]</td>
<td class="nd_center-cell">[% row.power %]</td>
<td class="nd_center-cell">[% row.status %]</td>
<td class="nd_center-cell">[% row.poe_capable_ports %]</td>
<td class="nd_center-cell">[% row.poe_powered_ports %]</td>
<td class="nd_center-cell">[% row.poe_disabled_ports %]</td>
<td class="nd_center-cell">[% row.poe_errored_ports %]</td>
<td class="nd_center-cell">[% row.poe_power_committed %]</td>
<td class="nd_center-cell">[% row.poe_power_delivering %]</td>
</tr>
[% END %]
</tbody>
</table>
<style>
tr.group,
tr.group:hover {
background-color: #ddd !important;
}
</style>
<script>
function groupString(d) {
"use strict";
var s = '';
s = s + 'Device: ';
s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
s = s + he.encode(d.dns || d.name || d.ip);
if (d.dns || d.name) {
s = s + ' (' + he.encode(d.ip) + ') ';
}
s = s + '</a> Model: ' + he.encode(d.model || '');
s = s + he.encode(d.location ? ' Location: ' + d.location : '');
return s;
}
$(document).ready(function() {
var table = $('#data-table').DataTable({
"serverSide": true,
"ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') %]",
"order": [[ 0, 'asc' ]],
"columns": [
{
// Grouping column
"data": 'ip',
"visible": false
}, {
// Included for filtering
"data": 'dns',
"visible": false
}, {
// Included for filtering
"data": 'name',
"visible": false
}, {
// Included for filtering
"data": 'model',
"visible": false
}, {
// Included for filtering
"data": 'location',
"visible": false
}, {
"data": 'module',
"searchable": false
}, {
"data": 'status',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'power',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_capable_ports',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_powered_ports',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_disabled_ports',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_errored_ports',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_power_committed',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'poe_power_delivering',
"className": "nd_center-cell",
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
var row_data = api.row( i ).data();
$(rows).eq( i ).before(
'<tr class="group"><td colspan="9">' + groupString(row_data) + '</td></tr>'
);
last = group;
}
} );
},
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
// Order by the grouping
$('#data-table tbody').on( 'click', 'tr.group', function () {
var currentOrder = table.order()[0];
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
table.order( [ 0, 'desc' ] ).draw();
}
else {
table.order( [ 0, 'asc' ] ).draw();
}
} );
} );
</script>

View File

@@ -0,0 +1,19 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Model' 'Device Location' 'PoE Module' 'Power (W)'
'Supply' 'Capable Ports' 'Powered Ports' 'Disabled Ports'
'Errored Ports' 'Committed (W)' 'Delivering (W)' ]) %]
[% FOREACH row IN results %]
[% mydlist = [] %]
[% mydevice = row.dns || row.name || row.ip %]
[% mydlist.push(mydevice) %]
[% FOREACH col IN [ row.model row.location row.module row.power row.status
row.poe_capable_ports row.poe_powered_ports
row.poe_disabled_ports row.poe_errored_ports
row.poe_power_committed row.poe_power_delivering
] %]
[% mydlist.push(col) %]
[% END %]
[% CSV.dump(mydlist) %]
[%END%]

View File

@@ -0,0 +1,61 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Left Device</th>
<th>Port</th>
<th>Duplex</th>
<th>Right Device</th>
<th>Port</th>
<th>Duplex</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'left_ip',
"render": function(data, type, row, meta) {
return he.encode(row.left_dns || row.left_ip);
}
}, {
"data": 'left_port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.left_dns || row.left_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'left_duplex',
"render": function(data, type, row, meta) {
return he.encode(capitalizeFirstLetter(data || ''));
}
}, {
"data": 'right_ip',
"render": function(data, type, row, meta) {
return he.encode(row.right_dns || row.right_ip);
}
}, {
"data": 'right_port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.right_dns || row.right_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'right_duplex',
"render": function(data, type, row, meta) {
return he.encode(capitalizeFirstLetter(data || ''));
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,13 @@
[% USE CSV -%]
[% CSV.dump([ 'Left Device' 'Port' 'Duplex' 'Right Device' 'Port' 'Duplex' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device_left = row.left_dns || row.left_ip %]
[% device_right = row.right_dns || row.right_ip %]
[% FOREACH col IN [ device_left row.left_port row.left_duplex.ucfirst device_right row.right_port row.right_duplex.ucfirst ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,27 @@
<table id="rg-data-table" class="table table-bordered table-condensed table-striped" width="100%" cellspacing="0">
<thead>
<tr>
[% FOREACH hdr IN headings %]
<th>[% hdr | html_entity %]</th>
[% END %]
</tr>
</thead>
</tbody>
[% FOREACH row IN results %]
<tr>
[% FOREACH col IN columns %]
<td>[% row.item(col) | html_entity %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
<script>
$(document).ready(function() {
$('#rg-data-table').dataTable({
"order": [],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
} );
</script>

View File

@@ -0,0 +1,11 @@
[% USE CSV %]
[% CSV.dump(headings) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% FOREACH col IN columns %]
[% mylist.push(row.item(col)) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,48 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Port</th>
<th>Description</th>
<th>Duplex</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 he.encode(row.device.dns || row.device.name || row.ip);
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'name',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'duplex',
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
return he.encode(capitalizeFirstLetter(data));
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Description' 'Duplex' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = rrow.device.dns || row.device.name || row.ip %]
[% FOREACH col IN [ device row.port row.name row.duplex.ucfirst ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,71 @@
<table id="nsbi-data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th>Model</th>
<th>Operating System Version</th>
<th>Count</th>
</tr>
</thead>
</tbody>
[% FOREACH row IN results %]
<tr>
<td>
<a href="[% search_device %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
[% row.vendor.ucfirst | html_entity %]&nbsp;[% row.model | html_entity %]</a>
[% IF row.os %] running &quot;[% row.os | html_entity %]&quot;[% END %]
</td>
<td>
<a class="nd_linkcell"
href="[% search_device %]&q=[% row.os_ver | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]&os=[% row.os | uri %]&os_ver=[% row.os_ver | uri %]&matchall=on">
[% row.os_ver | html_entity %]</a>
</td>
<td>[% row.os_ver_count | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>
<style>
tr.group,
tr.group:hover {
background-color: #ddd !important;
}
</style>
<script>
$(document).ready(function() {
var table = $('#nsbi-data-table').DataTable({
"columnDefs": [
{ "visible": false, "targets": 0 }
],
sort: false,
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="2">'+group+'</td></tr>'
);
last = group;
}
} );
},
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
// Order by the grouping
$('#nsbi-data-table tbody').on( 'click', 'tr.group', function () {
var currentOrder = table.order()[0];
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
table.order( [ 0, 'desc' ] ).draw();
}
else {
table.order( [ 0, 'asc' ] ).draw();
}
} );
} );
</script>

View File

@@ -0,0 +1,67 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Node</th>
<th>MAC Address</th>
<th class="nd_center-cell">DNS</th>
<th>Last Used</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) {
var cell_str = he.encode(data);
if (type == 'display') {
if (row.time_last && row.node) {
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
+ (row.active ? '' : '&nbsp;<i class="icon-book text-warning"></i>&nbsp;') + '</a>';
}
else if (row.time_last) {
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
}
}
return cell_str;
}
}, {
"data": 'mac',
"render": function(data, type, row, meta) {
var cell_str = he.encode(data || '');
if (type == 'display' && data && row.time_last) {
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
+ (row.active ? '' : '&nbsp;<i class="icon-book text-warning"></i>&nbsp;') + '</a>';
}
return cell_str;
}
}, {
"data": 'dns',
"className": "nd_nowrap nd_center-cell",
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'age',
"render": function(data, type, row, meta) {
if (type == 'display') {
return he.encode(data || 'Never');
}
else {
// so that sorting works correctly on this column
return row.time_last;
}
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV %]
[% CSV.dump([ 'Node' 'MAC Address' 'DNS' 'Last Used' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.ip) %]
[% mylist.push(row.mac) %]
[% mylist.push(row.dns) %]
[% mylist.push(row.time_last) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,111 @@
[% USE url %]
[% IF opt %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Description</th>
<th>Name</th>
<th>Class</th>
<th>Type</th>
<th>Model</th>
<th>Serial</th>
<th>HW Version</th>
<th>SW Version</th>
<th>FW Version</th>
</tr>
</thead>
</table>
[% ELSE %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Class</th>
<th>Count</th>
</tr>
</thead>
</table>
[% END %]
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
[% IF opt %]
"serverSide": true,
"searching": false,
"order": [[ 0, "desc" ]],
"ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') %]?[% url(params('query').hash) %]",
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/device') %]?tab=modules&q=' + encodeURIComponent(data) + '">' + he.encode(row.device.dns || row.device.name || row.ip) + '</a>';
}
}, {
"data": 'description',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'name',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'class',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
}
}, {
"data": 'type',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'model',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'serial',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'hw_ver',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'sw_ver',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'fw_ver',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% ELSE %]
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'class',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
}
}, {
"data": 'count',
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% END %]
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,25 @@
[% USE CSV -%]
[% IF opt %]
[% CSV.dump(['Device' 'Description' 'Name' 'Class' 'Type' 'Model' 'Serial' 'HW Version' 'SW Version' 'FW Version']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.ip %]
[% FOREACH col IN [ device row.description row.name row.class.ucfirst row.type row.model row.serial row.hw_ver row.sw_ver row.fw_ver ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% ELSE %]
[% CSV.dump(['Class' 'Count']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% FOREACH col IN [ row.class.ucfirst row.count ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% END %]

View File

@@ -0,0 +1,93 @@
[% USE url %]
[% IF opt %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Domain</th>
<th>Node</th>
<th>Name</th>
<th>User</th>
<th>First Seen</th>
<th>Last Seen</th>
</tr>
</thead>
</table>
[% ELSE %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Domain</th>
<th>Count</th>
</tr>
</thead>
</table>
[% END %]
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
[% IF opt %]
"serverSide": true,
"order": [[ 0, "desc" ]],
"ajax": "[% uri_for('/ajax/content/report/netbios/data') %]?[% url(params('query').hash) %]",
"columns": [
{
"data": 'domain',
"render": function(data, type, row, meta) {
return he.encode(data || '(Blank Domain)');
}
}, {
"data": 'mac',
"render": function(data, type, row, meta) {
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
}
}, {
"data": 'nbname',
"render": function(data, type, row, meta) {
var prefix = '';
if (row.domain) {
prefix = '\\\\' + row.domain + '\\';
}
return he.encode(prefix) + '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
}
}, {
"data": 'nbuser',
"render": function(data, type, row, meta) {
return he.encode(row.nbuser || '[No User]');
}
}, {
"data": 'time_first',
"render": function(data, type, row, meta) {
return moment(data).format('YYYY-MM-DD HH:mm');
}
}, {
"data": 'time_last',
"render": function(data, type, row, meta) {
return moment(data).format('YYYY-MM-DD HH:mm');
}
}
],
"order": [[0, "asc"], [5, "desc"]],
[% ELSE %]
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'domain',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/netbios') %]?domain=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data || '(Blank Domain)') + '</a>';
}
}, {
"data": 'count',
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
"order": [[1, "desc"]],
[% END %]
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,27 @@
[% USE CSV -%]
[% USE date(format = '%Y-%m-%d %H:%M') %]
[% IF opt %]
[% CSV.dump(['Domain' 'Node' 'Name' 'User' 'First Seen' 'Last Seen']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.device.ip %]
[% FOREACH col IN [ row.domain row.mac.upper row.nbname row.nbuser date.format(row.time_first) date.format(row.time_last) ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% ELSE %]
[% CSV.dump(['Domain' 'Count']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% domain = row.domain || '(Blank Domain)' %]
[% FOREACH col IN [ domain row.count ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% END %]

View File

@@ -0,0 +1,47 @@
[% USE Number.Format %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>MAC</th>
<th>Vendor</th>
<th>Location</th>
<th>IPs</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 3, "desc" ]],
"data": [% results %],
"columns": [
{
"data": 'mac',
"render": function(data, type, row, meta) {
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
}
}, {
"data": 'vendor',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'port',
"render": function(data, type, row, meta) {
return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(row.dns || row.name || row.switch) + '(' + he.encode(data) + ')</a>';
}
}, {
"data": 'ip_count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,13 @@
[% USE CSV -%]
[% CSV.dump([ 'MAC' 'Vendor' 'Switch' 'Port' 'IPs' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.mac.upper) %]
[% mylist.push(row.vendor) %]
[% mylist.push(row.dns || row.name || row.switch) %]
[% mylist.push(row.port) %]
[% mylist.push(row.ip_count) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,58 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Port</th>
<th>Remote ID</th>
<th>Remote IP</th>
<th>Remote Port</th>
<th>Remote Type</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 he.encode(row.dns || row.name || data);
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'remote_id',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'remote_ip',
"render": function(data, type, row, meta) {
return '<a href="[% search_node %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'remote_port',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'remote_type',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Remote ID' 'Remote IP' 'Remote Port' 'Remote Type']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.dns || row.name || row.ip %]
[% FOREACH col IN [ device row.port row.remote_id row.remote_ip row.remote_port row.remote_type ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,88 @@
[% USE url %]
[% IF opt %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>MAC</th>
<th>Vendor</th>
<th>Device (Port)</th>
<th>Device DNS</th>
<th>Device Name</th>
<th>Device IP</th>
</tr>
</thead>
</table>
[% ELSE %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Vendor</th>
<th class="nd_center-cell">Count</th>
</tr>
</thead>
</table>
[% END %]
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
[% IF opt %]
"serverSide": true,
"order": [[ 0, "desc" ]],
"ajax": "[% uri_for('/ajax/content/report/nodevendor/data') %]?[% url(params('query').hash) %]",
"columns": [
{
"data": 'mac',
"render": function(data, type, row, meta) {
var icon = '&nbsp;&nbsp;<i class="icon-book text-warning"></i> ';
if (row.active) {
icon = '';
}
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + icon + '</a>';
}
}, {
"data": 'oui.abbrev',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data ||'(Unknown Vendor)') + '</a>';
}
}, {
"data": 'port',
"render": function(data, type, row, meta) {
return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.switch) + '(' + he.encode(data) + ')</a>';
}
}, {
// Included for filtering
"data": 'device.dns',
"visible": false
}, {
// Included for filtering
"data": 'device.name',
"visible": false
}, {
// Included for filtering
"data": 'switch',
"visible": false
}
],
[% ELSE %]
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'vendor',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data ||'(Unknown Vendor)') + '</a>';
}
}, {
"data": 'count',
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
"order": [[1, "desc"]],
[% END %]
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,26 @@
[% USE CSV -%]
[% IF opt %]
[% CSV.dump(['MAC' 'Vendor' 'Company' 'Device' 'Port']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.switch %]
[% FOREACH col IN [ row.mac.upper row.oui.abbrev row.oui.company device row.port ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% ELSE %]
[% CSV.dump(['Vendor' 'Count']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% vendor = row.vendor || '(Unknown Vendor)' %]
[% FOREACH col IN [ vendor row.count ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% END %]

View File

@@ -0,0 +1,49 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Port</th>
<th>Port Description</th>
<th>Admin Status</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 0, "asc" ], [1, "asc"]],
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return he.encode(row.dns || row.name || row.ip);
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'description',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'up_admin',
"orderable": false,
"searchable": false,
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
"data": [% results %],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Admin Status' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.port) %]
[% mylist.push(row.description) %]
[% mylist.push(row.up_admin) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,50 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Port</th>
<th>Port Description</th>
<th>STP Status</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 0, "asc" ], [1, "asc"]],
"data": [% results %],
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return he.encode(row.dns || row.name || row.ip);
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'description',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'stp',
"orderable": false,
"searchable": false,
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'STP Status' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.port) %]
[% mylist.push(row.description) %]
[% mylist.push(row.stp) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,49 @@
<table id="data-table" class="table table-bordered table-condensed table-striped" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Creation</th>
<th class="nd_center-cell">User</th>
<th class="nd_center-cell">User IP</th>
<th class="nd_center-cell">Action</th>
<th class="nd_center-cell">Reason</th>
<th class="nd_center-cell">Log</th>
<th class="nd_center-cell">Action</th>
</tr>
</thead>
</tbody>
<tr>
<td class="nd_center-cell">-</td>
<td class="nd_center-cell">[% session.logged_in_user | html_entity %]</td>
<td class="nd_center-cell">-</td>
<td class="nd_center-cell">comment</td>
<td class="nd_center-cell">Other</td>
<td class="nd_center-cell"><input data-form="add" class="span4" name="log" type="text" placeholder="Add comment..."></td>
<input data-form="add" name="ip" type="hidden" value="[% params.q | html_entity %]">
<input data-form="add" name="port" type="hidden" value="[% params.f | html_entity %]">
<td class="nd_center-cell">
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
</td>
</tr>
[% WHILE (row = results.next) %]
<tr>
<td class="nd_center-cell">[% row.creation_stamp | html_entity %]</td>
<td class="nd_center-cell">[% row.username | html_entity %]</td>
<td class="nd_center-cell">[% row.userip | html_entity %]</td>
<td class="nd_center-cell">[% row.action | html_entity %]</td>
<td class="nd_center-cell">[% settings.port_control_reasons.item(row.reason) || row.reason | html_entity %]</td>
<td class="nd_center-cell">[% row.log || '-' | html_entity %]</td>
<td class="nd_center-cell"></td>
</tr>
[% END %]
</tbody>
</table>
<script>
$(document).ready(function() {
$('#data-table').dataTable({
sort: false,
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
} );
</script>

View File

@@ -0,0 +1,48 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device</th>
<th>Port</th>
<th>Port Description</th>
<th>Node Count</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"order": [[ 3, "desc" ]],
"data": [% results %],
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return he.encode(row.dns || row.name || row.ip);
}
}, {
"data": 'port',
"type": 'portsort',
"render": function(data, type, row, meta) {
return type === 'display' ?
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
data;
}
}, {
"data": 'description',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'mac_count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Node Count' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.port) %]
[% mylist.push(row.description) %]
[% mylist.push(row.mac_count) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,87 @@
[% USE Number.Format %]
[% IF opt %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Device (Port)</th>
<th>Broadcast</th>
<th>Model</th>
<th>SSID</th>
<th>Vendor</th>
</tr>
</thead>
</table>
[% ELSE %]
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">SSID</th>
<th class="nd_center-cell">Broadcast</th>
<th class="nd_center-cell">Count</th>
</tr>
</thead>
</table>
[% END %]
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"data": [% results %],
[% IF opt %]
"columns": [
{
"data": 'ip',
"render": function(data, type, row, meta) {
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '&f=' + encodeURIComponent(row.port.port) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.ip) + '(' + he.encode(row.port.port) + ')</a>';
}
}, {
"data": 'broadcast',
"render": function(data, type, row, meta) {
return (data ? 'Yes' : 'No');
}
}, {
"data": 'device.model',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'ssid',
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'device.vendor',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
],
[% ELSE %]
"columns": [
{
"data": 'ssid',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/portssid') %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'broadcast',
"render": function(data, type, row, meta) {
return (data ? 'Yes' : 'No');
}
}, {
"data": 'count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
},
],
"order": [[ 2, "desc" ]],
[% END %]
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,26 @@
[% USE CSV -%]
[% IF opt %]
[% CSV.dump(['Device' 'Port' 'Name' 'Broadcast' 'Model' 'SSID' 'Vendor']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.device.ip %]
[% broadcast = row.broadcast ? 'Yes' : 'No' %]
[% FOREACH col IN [ device row.port.port row.device.name broadcast row.device.model row.ssid row.device.vendor ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% ELSE %]
[% CSV.dump(['SSID' 'Count']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% FOREACH col IN [ row.ssid row.count ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% END %]

View File

@@ -0,0 +1,54 @@
<table id="data-table" class="table table-striped table-bordered" 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=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
}
}, {
"data": 'port_count',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'ports_in_use',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'ports_shutdown',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'ports_free',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Total Ports' 'In Use' 'Shutdown' 'Free' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.dns || row.ip %]
[% FOREACH col IN [ device row.port_count row.ports_in_use row.ports_shutdown row.ports_free ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,32 @@
[% USE Number.Format %]
<table id="data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Subnet</th>
<th class="nd_center-cell">Size</th>
<th class="nd_center-cell">Number of Active Nodes</th>
<th class="nd_center-cell">Percent Utilization</th>
</tr>
</thead>
</tbody>
[% FOREACH row IN results %]
<tr>
<td class="nd_center-cell"><a href="[% uri_for('/report/ipinventory') %]?subnet=[% row.subnet | uri %]&daterange=[% params.daterange | uri %]&age_invert=[% params.age_invert | uri %]&limit=[% row.subnet_size | uri %]">
[% row.subnet | html_entity %]</a></td>
<td class="nd_center-cell">[% row.subnet_size | format_number %]</td>
<td class="nd_center-cell">[% row.active | format_number %]</td>
<td class="nd_center-cell">[% row.percent | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>
<script>
$(document).ready(function() {
$('#data-table').dataTable({
"order": [[ 3, 'desc' ]],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
} );
</script>

View File

@@ -0,0 +1,14 @@
[% USE CSV %]
[% CSV.dump([ 'Subnet' 'Size' 'Number of Active Nodes' 'Percent Utilization' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.subnet) %]
[% mylist.push(row.subnet_size) %]
[% mylist.push(row.active) %]
[% mylist.push(row.percent) %]
[% CSV.dump(mylist) %]
[% END %]

View File

@@ -0,0 +1,45 @@
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>VLAN ID</th>
<th>VLAN Name</th>
<th>Device Count</th>
<th>Port Count</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#data-table').dataTable({
"deferRender": true,
"data": [% results %],
"columns": [
{
"data": 'vlan',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + data + '</a>';
}
}, {
"data": 'description',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'dcount',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}, {
"data": 'pcount',
"searchable": false,
"render": function(data, type, row, meta) {
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});
</script>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'VLAN ID' 'VLAN Name' 'Device Count' 'Port Count' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.vlan) %]
[% mylist.push(row.description) %]
[% mylist.push(row.dcount) %]
[% mylist.push(row.pcount) %]
[% CSV.dump(mylist) %]
[% END %]