DRILL-6243: Added alert box to confirm shutdown of drillbit after clicking shutdown button
closes #1169 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/35956648 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/35956648 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/35956648 Branch: refs/heads/master Commit: 35956648493bee79ef7a8fac8c60a0e857fdf70c Parents: 4aadfa8 Author: dvjyothsna <[email protected]> Authored: Wed Mar 14 16:36:42 2018 -0700 Committer: Vitalii Diravka <[email protected]> Committed: Sat Mar 24 20:35:32 2018 +0200 ---------------------------------------------------------------------- .../java-exec/src/main/resources/rest/index.ftl | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/35956648/exec/java-exec/src/main/resources/rest/index.ftl ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/resources/rest/index.ftl b/exec/java-exec/src/main/resources/rest/index.ftl index e2924fa..0886fae 100644 --- a/exec/java-exec/src/main/resources/rest/index.ftl +++ b/exec/java-exec/src/main/resources/rest/index.ftl @@ -272,17 +272,22 @@ } <#if model.shouldShowAdminInfo() || !model.isAuthEnabled()> function shutdown(button) { - var requestPath = "/gracefulShutdown"; - var url = getRequestUrl(requestPath); - var result = $.ajax({ - type: 'POST', - url: url, - contentType : 'text/plain', - complete: function(data) { - alert(data.responseJSON["response"]); - button.prop('disabled',true).css('opacity',0.5); - } - }); + if (confirm("Are you sure you want to shutdown Drillbit running on " + location.host + " node?")) { + var requestPath = "/gracefulShutdown"; + var url = getRequestUrl(requestPath); + var result = $.ajax({ + type: 'POST', + url: url, + contentType : 'text/plain', + error: function (request, textStatus, errorThrown) { + alert(errorThrown); + }, + success: function(data) { + alert(data["response"]); + button.prop('disabled',true).css('opacity',0.5); + } + }); + } } </#if> function getRequestUrl(requestPath) {
