diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 38a30442..b60af565 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -224,7 +224,6 @@ function refreshTableData() { $(document).ready(function() { var status; - var dataIndex = 0; var APIstring; if(instantquery) @@ -313,7 +312,13 @@ $(document).ready(function() { "ajax": { "url": APIstring, "error": handleAjaxError, - "dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); } + "dataSrc": function(data){ + var dataIndex = 0; + 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 d7dfe0c0..74e79ee1 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -116,7 +116,6 @@ function autofilter(){ $(document).ready(function() { var status; - var dataIndex = 0; // Do we want to filter queries? var GETDict = {}; @@ -302,7 +301,13 @@ $(document).ready(function() { "ajax": { "url": APIstring, "error": handleAjaxError, - "dataSrc": function(data){ return data.data.map(function(x){ x[0] = x[0]*1e6+(dataIndex++); return x; }); } + "dataSrc": function(data){ + var dataIndex = 0; + return data.data.map(function(x){ + x[0] = x[0] * 1e6 + (dataIndex++); + return x; + }); + } }, "autoWidth" : false, "processing": true,