diff --git a/images/ajax-loader.gif b/images/ajax-loader.gif new file mode 100644 index 0000000..2539e7c Binary files /dev/null and b/images/ajax-loader.gif differ diff --git a/js/site.js b/js/site.js index fe759ce..5b4263b 100644 --- a/js/site.js +++ b/js/site.js @@ -24,24 +24,26 @@ $(document).ready(function() { - $("body").on("click", "#patternDropdown li", function() { - if(this.value != "custom") { $("input#delay").val($(this).data("val")); } - }); - $('#nextrunselector').datetimepicker(); + $("body").on("click", "#patternDropdown li", function() { + if(this.value != "custom") { $("input#delay").val($(this).data("val")); } + }); + $('#nextrunselector').datetimepicker(); - $("body").on("click", ".runcron", function() { - fullurl = "/runnow.php?jobID=" + $(this).data("id"); - $.ajax(fullurl).done(function(data) { - results = JSON.parse(data); + $("body").on("click", ".runcron", function() { + $("#ajax_loader").show(); + fullurl = "/runnow.php?jobID=" + $(this).data("id"); + $.ajax(fullurl).done(function(data) { + results = JSON.parse(data); - if(results["error"] !== undefined) { - $("#resulttitle").html("Error"); - $("#resultbody").text(results["error"]); - } else { - $("#resulttitle").html("Success"); - $("#resultbody").text(results["message"]); - } - $('#resultmodal').modal('show'); - }) + if(results["error"] !== undefined) { + $("#resulttitle").html("Error"); + $("#resultbody").text(results["error"]); + } else { + $("#resulttitle").html("Success"); + $("#resultbody").text(results["message"]); + } + $("#ajax_loader").hide(); + $('#resultmodal').modal('show'); + }); }); }); diff --git a/templates/overview.html.twig b/templates/overview.html.twig index 3488dee..318cfee 100644 --- a/templates/overview.html.twig +++ b/templates/overview.html.twig @@ -48,4 +48,7 @@ + {% endblock %} \ No newline at end of file