diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 74edb06c..38a30442 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -313,16 +313,7 @@ $(document).ready(function() { "ajax": { "url": APIstring, "error": handleAjaxError, - "dataSrc": function(data){ - var new_data = new Array(); - for(obj of data.data) - { - obj[0] *= parseInt(1e6); - obj[0] += dataIndex++; - new_data.push(obj); - } - return new_data; - } + "dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); } }, "autoWidth" : false, "processing": true, diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index bcd3252a..d7dfe0c0 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -302,16 +302,7 @@ $(document).ready(function() { "ajax": { "url": APIstring, "error": handleAjaxError, - "dataSrc": function(data){ - var new_data = new Array(); - for(obj of data.data) - { - obj[0] *= parseInt(1e6); - obj[0] += dataIndex++; - new_data.push(obj); - } - return new_data; - } + "dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); } }, "autoWidth" : false, "processing": true,