Enforce escaping on all template content
This commit is contained in:
@@ -12,7 +12,7 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 1, "desc" ]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'channel'
|
||||
|
||||
@@ -16,13 +16,13 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 5, "desc" ]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
|
||||
'<a href="[% uri_for('/device') | none %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
|
||||
+ he.encode(row.dns || row.name || row.ip) + '</a>' :
|
||||
data;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -25,7 +25,7 @@ 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 + '<a href="[% uri_for('/device') | none %]?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) + ') ';
|
||||
@@ -39,7 +39,7 @@ function groupString(d) {
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').DataTable({
|
||||
"serverSide": true,
|
||||
"ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') %]",
|
||||
"ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') | none %]",
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"columns": [
|
||||
{
|
||||
@@ -59,7 +59,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"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>';
|
||||
return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'alias',
|
||||
|
||||
@@ -15,13 +15,13 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 0, "asc" ], [2, "asc"], [ 3, "asc" ], [4, "asc"]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"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>';
|
||||
return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
|
||||
} else {
|
||||
return '[Not Set]';
|
||||
@@ -30,22 +30,22 @@ $(document).ready(function() {
|
||||
}, {
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
|
||||
return '<a href="[% uri_for('/device') | none %]?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>';
|
||||
return '<a href="[% search_device | none %]&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>';
|
||||
return '<a href="[% search_device | none %]&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>';
|
||||
return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
|
||||
return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'dns',
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
<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>
|
||||
<td>[% row.ip | html_entity %]</td>
|
||||
<td>[% row.dns | html_entity %]</td>
|
||||
<td>[% row.name | html_entity %]</td>
|
||||
<td>[% row.model | html_entity %]</td>
|
||||
<td>[% row.location | html_entity %]</td>
|
||||
<td>[% row.module | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.power | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.status | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_capable_ports | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_powered_ports | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_disabled_ports | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_errored_ports | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_power_committed | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_power_delivering | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
@@ -51,7 +51,7 @@ 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 + '<a href="[% uri_for('/device') | none %]?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) + ') ';
|
||||
@@ -65,7 +65,7 @@ function groupString(d) {
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').DataTable({
|
||||
"serverSide": true,
|
||||
"ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') %]",
|
||||
"ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') | none %]",
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"columns": [
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'left_ip',
|
||||
@@ -27,7 +27,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.left_dns || row.left_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
@@ -45,7 +45,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.right_dns || row.right_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
@@ -25,7 +25,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td>
|
||||
<a href="[% search_device %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
|
||||
<a href="[% search_device | none %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
|
||||
[% row.vendor.ucfirst | html_entity %] [% row.model | html_entity %]</a>
|
||||
[% IF row.os %] running "[% row.os | html_entity %]"[% 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">
|
||||
href="[% search_device | none %]&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>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
@@ -21,12 +21,12 @@ $(document).ready(function() {
|
||||
var cell_str = he.encode(data);
|
||||
if (type == 'display') {
|
||||
if (row.time_last && row.node) {
|
||||
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
|
||||
cell_str = '<a href="[% search_node | none %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
else if (row.time_last) {
|
||||
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
cell_str = '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
}
|
||||
}
|
||||
return cell_str;
|
||||
@@ -36,7 +36,7 @@ $(document).ready(function() {
|
||||
"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)
|
||||
cell_str = '<a href="[% search_node | none %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
|
||||
@@ -34,42 +34,42 @@ $(document).ready(function() {
|
||||
"serverSide": true,
|
||||
"searching": false,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') %]?[% url(params('query').hash) %]",
|
||||
"ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') | none %]?[% url(params('query').hash) | none %]",
|
||||
"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>';
|
||||
return '<a href="[% uri_for('/device') | none %]?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="[% report_moduleinventory %]&description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'class',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'type',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'serial',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'hw_ver',
|
||||
@@ -90,12 +90,12 @@ $(document).ready(function() {
|
||||
],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'class',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% report_moduleinventory %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
return '<a href="[% report_moduleinventory | none %]&class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
|
||||
@@ -29,7 +29,7 @@ $(document).ready(function() {
|
||||
[% IF opt %]
|
||||
"serverSide": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/netbios/data') %]?[% url(params('query').hash) %]",
|
||||
"ajax": "[% uri_for('/ajax/content/report/netbios/data') | none %]?[% url(params('query').hash) | none %]",
|
||||
"columns": [
|
||||
{
|
||||
"data": 'domain',
|
||||
@@ -39,7 +39,7 @@ $(document).ready(function() {
|
||||
}, {
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'nbname',
|
||||
@@ -48,7 +48,7 @@ $(document).ready(function() {
|
||||
if (row.domain) {
|
||||
prefix = '\\\\' + row.domain + '\\';
|
||||
}
|
||||
return he.encode(prefix) + '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
return he.encode(prefix) + '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'nbuser',
|
||||
@@ -70,12 +70,12 @@ $(document).ready(function() {
|
||||
"order": [[0, "asc"], [5, "desc"]],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"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>';
|
||||
return '<a href="[% uri_for('/report/netbios') | none %]?domain=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data || '(Blank Domain)') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
|
||||
@@ -15,12 +15,12 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 3, "desc" ]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'vendor',
|
||||
@@ -30,7 +30,7 @@ $(document).ready(function() {
|
||||
}, {
|
||||
"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>';
|
||||
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>';
|
||||
}
|
||||
}, {
|
||||
"data": 'ip_count',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
@@ -27,7 +27,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
@@ -38,7 +38,7 @@ $(document).ready(function() {
|
||||
}, {
|
||||
"data": 'remote_ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% search_node | none %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'remote_port',
|
||||
|
||||
@@ -29,7 +29,7 @@ $(document).ready(function() {
|
||||
[% IF opt %]
|
||||
"serverSide": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/nodevendor/data') %]?[% url(params('query').hash) %]",
|
||||
"ajax": "[% uri_for('/ajax/content/report/nodevendor/data') | none %]?[% url(params('query').hash) | none %]",
|
||||
"columns": [
|
||||
{
|
||||
"data": 'mac',
|
||||
@@ -38,17 +38,17 @@ $(document).ready(function() {
|
||||
if (row.active) {
|
||||
icon = '';
|
||||
}
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + icon + '</a>';
|
||||
return '<a href="[% search_node | none %]&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(row.oui.abbrev || 'blank') + '">' + he.encode(row.oui.company ||'(Unknown Vendor)') + '</a>';
|
||||
return '<a href="[% uri_for('/report/nodevendor') | none %]?vendor=' + encodeURIComponent(row.oui.abbrev || 'blank') + '">' + he.encode(row.oui.company ||'(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>';
|
||||
return '<a href="[% device_ports | none %]&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
|
||||
@@ -66,12 +66,12 @@ $(document).ready(function() {
|
||||
],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'vendor',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(row.abbrev || 'blank') + '">' + he.encode(row.vendor ||'(Unknown Vendor)') + '</a>';
|
||||
return '<a href="[% uri_for('/report/nodevendor') | none %]?vendor=' + encodeURIComponent(row.abbrev || 'blank') + '">' + he.encode(row.vendor ||'(Unknown Vendor)') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
|
||||
@@ -25,7 +25,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
@@ -42,7 +42,7 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 0, "asc" ], [1, "asc"]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
@@ -26,7 +26,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -14,7 +14,7 @@ $(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 3, "desc" ]],
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
@@ -26,7 +26,7 @@ $(document).ready(function() {
|
||||
"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>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
[% 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>';
|
||||
return '<a href="[% device_ports | none %]&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',
|
||||
@@ -64,7 +64,7 @@ $(document).ready(function() {
|
||||
{
|
||||
"data": 'ssid',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/portssid') %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
return '<a href="[% uri_for('/report/portssid') | none %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'broadcast',
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
|
||||
return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'port_count',
|
||||
|
||||
@@ -15,31 +15,31 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'left_device',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
|
||||
return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
|
||||
}, {
|
||||
"data": 'left_port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.left_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.left_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || ''); }
|
||||
}, {
|
||||
"data": 'left_vlans'
|
||||
}, {
|
||||
"data": 'right_device',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
|
||||
return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; }
|
||||
}, {
|
||||
"data": 'right_port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.right_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
'<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.right_device) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
he.encode(data || ''); }
|
||||
}, {
|
||||
"data": 'right_vlans'
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<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 %]">
|
||||
<td class="nd_center-cell"><a href="[% uri_for('/report/ipinventory') | none %]?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>
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"data": [% results | none %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'vlan',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + data + '</a>';
|
||||
return '<a href="[% uri_for('/search') | none %]?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>';
|
||||
return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'dcount',
|
||||
|
||||
Reference in New Issue
Block a user