diff --git a/db_graph.php b/db_graph.php
index 9dbdba73..2642bf14 100644
--- a/db_graph.php
+++ b/db_graph.php
@@ -22,7 +22,6 @@ $token = $_SESSION['token'];
Compute graphical statistics from the Pi-hole query database
-
@@ -39,6 +38,11 @@ $token = $_SESSION['token'];
+
+
+ Depending on how large of a range you specified, the request may time out while Pi-hole tries to retrieve all the data.
+
+
diff --git a/db_lists.php b/db_lists.php
index 0ddc9dda..c0e39408 100644
--- a/db_lists.php
+++ b/db_lists.php
@@ -39,6 +39,11 @@ $token = $_SESSION['token'];
+
+
+ Depending on how large of a range you specified, the request may time out while Pi-hole tries to retrieve all the data.
+
+
+
+
+ Depending on how large of a range you specified, the request may time out while Pi-hole tries to retrieve all the data.
+
+
diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js
index d543f16b..8da24ad6 100644
--- a/scripts/pi-hole/js/db_graph.js
+++ b/scripts/pi-hole/js/db_graph.js
@@ -14,6 +14,8 @@ var from = moment(start__).utc().valueOf()/1000;
var end__ = moment();
var until = moment(end__).utc().valueOf()/1000;
+var timeoutWarning = $("#timeoutWarning");
+
$(function () {
$("#querytime").daterangepicker(
{
@@ -80,6 +82,7 @@ function compareNumbers(a, b) {
function updateQueriesOverTime() {
$("#queries-over-time .overlay").show();
+ timeoutWarning.show();
$.getJSON("api_db.php?getGraphData&from="+from+"&until="+until, function(data) {
// convert received objects to arrays
@@ -135,6 +138,7 @@ function updateQueriesOverTime() {
timeLineChart.options.scales.xAxes[0].display=true;
$("#queries-over-time .overlay").hide();
+ timeoutWarning.hide();
timeLineChart.update();
});
}
diff --git a/scripts/pi-hole/js/db_lists.js b/scripts/pi-hole/js/db_lists.js
index 75a21746..43e569f7 100644
--- a/scripts/pi-hole/js/db_lists.js
+++ b/scripts/pi-hole/js/db_lists.js
@@ -14,6 +14,9 @@ var from = moment(start__).utc().valueOf()/1000;
var end__ = moment();
var until = moment(end__).utc().valueOf()/1000;
+var timeoutWarning = $("#timeoutWarning");
+var listsStillLoading = 0;
+
$(function () {
$("#querytime").daterangepicker(
{
@@ -97,6 +100,10 @@ function updateTopClientsChart() {
}
$("#client-frequency .overlay").hide();
+
+ listsStillLoading--;
+ if(listsStillLoading === 0)
+ timeoutWarning.hide();
});
}
@@ -135,6 +142,10 @@ function updateTopDomainsChart() {
}
$("#domain-frequency .overlay").hide();
+
+ listsStillLoading--;
+ if(listsStillLoading === 0)
+ timeoutWarning.hide();
});
}
@@ -171,10 +182,16 @@ function updateTopAdsChart() {
}
$("#ad-frequency .overlay").hide();
+
+ listsStillLoading--;
+ if(listsStillLoading === 0)
+ timeoutWarning.hide();
});
}
$("#querytime").on("apply.daterangepicker", function(ev, picker) {
+ timeoutWarning.show();
+ listsStillLoading = 3;
updateTopClientsChart();
updateTopDomainsChart();
updateTopAdsChart();
diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js
index 8551e9dc..459d87ce 100644
--- a/scripts/pi-hole/js/db_queries.js
+++ b/scripts/pi-hole/js/db_queries.js
@@ -16,6 +16,8 @@ var until = moment(end__).utc().valueOf()/1000;
var instantquery = false;
var daterange;
+var timeoutWarning = $("#timeoutWarning");
+
// Do we want to filter queries?
var GETDict = {};
location.search.substr(1).split("&").forEach(function(item) {GETDict[item.split("=")[0]] = item.split("=")[1];});
@@ -141,6 +143,7 @@ function handleAjaxError( xhr, textStatus, error ) {
var reloadCallback = function()
{
+ timeoutWarning.hide();
statistics = [0,0,0,0];
var data = tableApi.rows().data();
for (var i = 0; i < data.length; i++) {
@@ -171,6 +174,7 @@ var reloadCallback = function()
};
function refreshTableData() {
+ timeoutWarning.show();
var APIstring = "api_db.php?getAllQueries&from="+from+"&until="+until;
statistics = [0,0,0];
tableApi.ajax.url(APIstring).load(reloadCallback);