Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-6243: Added alert box to confirm shutdown of drillbit after clicking shutdown button #1169

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 13 additions & 11 deletions exec/java-exec/src/main/resources/rest/index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,19 @@
}
<#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("Click ok to shutdown")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message should be more of like "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',
complete: function(data) {
alert(data.responseJSON["response"]);
button.prop('disabled',true).css('opacity',0.5);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix indentation here and below. Also add the error: callback for Ajax request.
Like alert with received error ?

});
}
}
</#if>
function getRequestUrl(requestPath) {
Expand Down