Skip to content

Commit

Permalink
Merge pull request #339 from pi-hole/tweak/querylogpage
Browse files Browse the repository at this point in the history
Add error callback to Query Log page
  • Loading branch information
AzureMarker authored Jan 6, 2017
2 parents 2386059 + 459027e commit 9ff6561
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ function add(domain,list) {
}
});
}
function handleAjaxError( xhr, textStatus, error ) {
if ( textStatus === "timeout" ) {
alert( "The server took too long to send the data." );
}
else {
alert( "An error occured while loading the data. Presumably your log is too large to be processed." );
}
$("#all-queries_processing").hide();
tableApi.clear();
tableApi.draw();
}

$(document).ready(function() {

Expand Down Expand Up @@ -104,8 +115,9 @@ $(document).ready(function() {
"<'row'<'col-sm-4'l><'col-sm-8'p>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"ajax": APIstring,
"ajax": {"url": APIstring, "error": handleAjaxError },
"autoWidth" : false,
"processing": true,
"order" : [[0, "desc"]],
"columns": [
{ "width" : "20%", "type": "date" },
Expand Down

0 comments on commit 9ff6561

Please sign in to comment.