mirror of https://github.com/apache/cloudstack.git
cluster page - pop up confirmation dialog before execute Delete Cluster action.
This commit is contained in:
parent
9a463172bc
commit
b7daa55a79
|
|
@ -91,6 +91,8 @@ function clusterClearDetailsTab() {
|
|||
$thisTab.find("#name").text("");
|
||||
$thisTab.find("#zonename").text("");
|
||||
$thisTab.find("#podname").text("");
|
||||
$thisTab.find("#hypervisortype").text("");
|
||||
$thisTab.find("#clustertype").text("");
|
||||
|
||||
//actions ***
|
||||
var $actionMenu = $thisTab.find("#action_link #action_menu");
|
||||
|
|
@ -101,7 +103,8 @@ function clusterClearDetailsTab() {
|
|||
var clusterActionMap = {
|
||||
"Delete Cluster": {
|
||||
api: "deleteCluster",
|
||||
isAsyncJob: false,
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doDeleteCluster,
|
||||
inProcessText: "Deleting Cluster....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
$midmenuItem1.slideUp("slow", function() {
|
||||
|
|
@ -114,3 +117,21 @@ var clusterActionMap = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doDeleteCluster($actionLink, $detailsTab, $midmenuItem1) {
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
var id = jsonObj.id;
|
||||
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to delete this cluster")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
$(this).dialog("close");
|
||||
var apiCommand = "command=deleteCluster&id="+id;
|
||||
doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
Loading…
Reference in New Issue