diff --git a/Netdisco/share/views/ajax/report/deviceaddrnodns.tt b/Netdisco/share/views/ajax/report/deviceaddrnodns.tt index 832fffbe..da252d2a 100644 --- a/Netdisco/share/views/ajax/report/deviceaddrnodns.tt +++ b/Netdisco/share/views/ajax/report/deviceaddrnodns.tt @@ -15,18 +15,26 @@ $(document).ready(function() { "deferRender": true, "data": [% results %], "columns": [{ - data: 'ip', - render: function(data, type, row, meta) { - return '' + (row.dns || row.name || row.ip) + ''; + "data": 'ip', + "render": function(data, type, row, meta) { + return '' + he.encode(row.dns || row.name || row.ip) + ''; } }, { - data: 'alias' + "data": 'alias', + "render": function(data, type, row, meta) { + return he.encode(data || ''); + } }, { - data: 'contact' + "data": 'contact', + "render": function(data, type, row, meta) { + return he.encode(data || ''); + } }, { - data: 'location' + "data": 'location', + "render": function(data, type, row, meta) { + return he.encode(data || ''); + } } ] }); - }); diff --git a/Netdisco/share/views/ajax/report/devicebylocation.tt b/Netdisco/share/views/ajax/report/devicebylocation.tt index 85f6a49c..d4678046 100644 --- a/Netdisco/share/views/ajax/report/devicebylocation.tt +++ b/Netdisco/share/views/ajax/report/devicebylocation.tt @@ -14,37 +14,38 @@ $(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) { + "data": 'location', + "render": function(data, type, row, meta) { if (data) { - return '' + data + ''; + return '' + he.encode(data) + ''; } else { return '[Not Set]'; } } }, { - data: 'ip', - render: function(data, type, row, meta) { - return '' + (row.dns || row.ip) + ''; + "data": 'ip', + "render": function(data, type, row, meta) { + return '' + he.encode(row.dns || row.ip) + ''; } }, { - data: 'name', - render: function(data, type, row, meta) { - return '' + data + ''; + "data": 'name', + "render": function(data, type, row, meta) { + return '' + he.encode(data || '') + ''; } }, { - data: 'vendor', - render: function(data, type, row, meta) { - return '' + data + ''; + "data": 'vendor', + "render": function(data, type, row, meta) { + return '' + he.encode(data || '') + ''; } }, { - data: 'model', - render: function(data, type, row, meta) { - return '' + data + ''; + "data": 'model', + "render": function(data, type, row, meta) { + return '' + he.encode(data || '') + ''; } } ] diff --git a/Netdisco/share/views/ajax/report/devicednsmismatch.tt b/Netdisco/share/views/ajax/report/devicednsmismatch.tt index 95801014..21cc9d67 100644 --- a/Netdisco/share/views/ajax/report/devicednsmismatch.tt +++ b/Netdisco/share/views/ajax/report/devicednsmismatch.tt @@ -12,27 +12,37 @@ diff --git a/Netdisco/share/views/ajax/report/moduleinventory.tt b/Netdisco/share/views/ajax/report/moduleinventory.tt index db8ec92c..53cf983f 100644 --- a/Netdisco/share/views/ajax/report/moduleinventory.tt +++ b/Netdisco/share/views/ajax/report/moduleinventory.tt @@ -47,66 +47,74 @@ function capitaliseFirstLetter(string) { } $(document).ready(function() { - var table = $('#data-table').dataTable({ - "deferRender": true, - "data": [% results %], - "columns": [ - [% IF opt %] { - data: 'ip', - render: function(data, type, row, meta) { - return '' + (row.device.dns || row.device.name || row.ip) + ''; - } - }, { - data: 'description', - render: function(data, type, full, meta) { - return '' + data + ''; - } - }, { - data: 'name', - render: function(data, type, full, meta) { - return '' + data + ''; - } - }, { - data: 'class', - render: function(data, type, full, meta) { - return '' + capitaliseFirstLetter(data) + ''; - } - }, { - data: 'type', - render: function(data, type, full, meta) { - return '' + data + ''; - } - }, { - data: 'model', - render: function(data, type, full, meta) { - return '' + data + ''; - } - }, { - data: 'serial', - render: function(data, type, full, meta) { - return '' + data + ''; - } - }, { - data: 'hw_ver' - }, { - data: 'sw_ver' - }, { - data: 'fw_ver' - } - [% ELSE %] { - data: 'class', - render: function(data, type, full, meta) { - return '' + capitaliseFirstLetter(data) + ''; - } - }, { - data: 'count', - render: function(data, type, full, meta) { - return data.replace(/\B(?=(\d{3})+(?!\d))/g, ","); - } - } - [% END %] - ] - }); - + var table = $('#data-table').dataTable({ + "deferRender": true, + "data": [% results %], + "columns": [ + [% IF opt %] { + "data": 'ip', + "render": function(data, type, row, meta) { + return '' + he.encode(row.device.dns || row.device.name || row.ip) + ''; + } + }, { + "data": 'description', + "render": function(data, type, full, meta) { + return '' + he.encode(data || '') + ''; + } + }, { + "data": 'name', + "render": function(data, type, full, meta) { + return '' + he.encode(data || '') + ''; + } + }, { + "data": 'class', + "render": function(data, type, full, meta) { + return '' + he.encode(capitaliseFirstLetter(data)) + ''; + } + }, { + "data": 'type', + "render": function(data, type, full, meta) { + return '' + he.encode(data || '') + ''; + } + }, { + "data": 'model', + "render": function(data, type, full, meta) { + return '' + he.encode(data || '') + ''; + } + }, { + "data": 'serial', + "render": function(data, type, full, meta) { + return '' + he.encode(data || '') + ''; + } + }, { + "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 %] { + "data": 'class', + "render": function(data, type, full, meta) { + return '' + he.encode(capitaliseFirstLetter(data)) + ''; + } + }, { + "data": 'count', + "render": function(data, type, full, meta) { + return data.replace(/\B(?=(\d{3})+(?!\d))/g, ","); + } + } + [% END %] + ] + }); }); diff --git a/Netdisco/share/views/ajax/report/portadmindown.tt b/Netdisco/share/views/ajax/report/portadmindown.tt index db44b4ab..a75fb481 100644 --- a/Netdisco/share/views/ajax/report/portadmindown.tt +++ b/Netdisco/share/views/ajax/report/portadmindown.tt @@ -11,31 +11,35 @@ - diff --git a/Netdisco/share/views/ajax/report/portblocking.tt b/Netdisco/share/views/ajax/report/portblocking.tt index 62593b7f..81c82c1d 100644 --- a/Netdisco/share/views/ajax/report/portblocking.tt +++ b/Netdisco/share/views/ajax/report/portblocking.tt @@ -7,46 +7,40 @@