diff --git a/scripts/pi-hole/js/gravity.js b/scripts/pi-hole/js/gravity.js index a208cae1..1a00ee27 100644 --- a/scripts/pi-hole/js/gravity.js +++ b/scripts/pi-hole/js/gravity.js @@ -32,9 +32,23 @@ $("#gravityBtn").on("click", () => { eventsource(); }); +$("#gravityBtn").on("click", () => { + $("#gravityBtn").attr("disabled", true); + eventsource(); +}); + // Handle hiding of alerts $(function(){ $("[data-hide]").on("click", function(){ $(this).closest("." + $(this).attr("data-hide")).hide(); }); + + // Do we want to start updating immediately? + // gravity.php?go + var searchString = window.location.search.substring(1); + if(searchString.indexOf("go") !== -1) + { + $("#gravityBtn").attr("disabled", true); + eventsource(); + } }); diff --git a/settings.php b/settings.php index df41e59d..fd68e495 100644 --- a/settings.php +++ b/settings.php @@ -11,6 +11,14 @@ } + refresh to the gravity page and start updating immediately +?> + + +