Github user kkhatua commented on a diff in the pull request: https://github.com/apache/drill/pull/1203#discussion_r181834064 --- Diff: exec/java-exec/src/main/resources/rest/index.ftl --- @@ -283,20 +308,114 @@ alert(errorThrown); }, success: function(data) { - alert(data["response"]); + alert(data["response"]); button.prop('disabled',true).css('opacity',0.5); } }); } } - </#if> + + function remoteShutdown(button,host) { + var url = location.protocol + "//" + host + "/gracefulShutdown"; + 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> + + function popOutRemoteDbitUI(dbitHost, dbitPort) { --- End diff -- We can't put this and the remaining functions within the IF block since the localhost operations are still valid. i.e. an authenticated client on a specific Drillbit can ping that Drillbit for refresh of the metrics. Only shutdown function needs to be managed with the IF block
---