mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
new UI - multiple-selection action - confirm before stop VM.
This commit is contained in:
parent
ae8bdeb0f4
commit
2ae87d665a
@ -123,36 +123,49 @@ function afterLoadInstanceJSP() {
|
|||||||
$("#dialog_info_please_select_one_item_in_middle_menu").dialog("open");
|
$("#dialog_info_please_select_one_item_in_middle_menu").dialog("open");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var id in selectedItemsInMidMenu) {
|
|
||||||
var apiCommand = "command=stopVirtualMachine&id="+id;
|
|
||||||
var apiInfo = {
|
|
||||||
label: "Stop Instance",
|
|
||||||
isAsyncJob: true,
|
|
||||||
asyncJobResponse: "stopvirtualmachineresponse",
|
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
|
||||||
//call listVirtualMachine to get embedded object until bug 6486 ("StopVirtualMachine API should return an embedded object on success") is fixed.
|
|
||||||
var jsonObj;
|
|
||||||
$.ajax({
|
|
||||||
data: createURL("command=listVirtualMachines&id="+id),
|
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
|
||||||
success: function(json) {
|
|
||||||
jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
vmToMidmenu(jsonObj, $midmenuItem1);
|
|
||||||
if( ($("#right_panel_content #tab_content_details").length > 0)
|
|
||||||
&& ($("#right_panel_content #tab_content_details").data("jsonObj") != null )
|
|
||||||
&& (jsonObj.id == $("#right_panel_content #tab_content_details").data("jsonObj").id))
|
|
||||||
vmToRightPanel($midmenuItem1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
doActionForMidMenu(id, apiInfo, apiCommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedItemsInMidMenu = {}; //clear selected items for action
|
$("#dialog_confirmation_stop_vm")
|
||||||
|
.dialog('option', 'buttons', {
|
||||||
|
"Confirm": function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
|
||||||
|
var apiInfo = {
|
||||||
|
label: "Stop Instance",
|
||||||
|
isAsyncJob: true,
|
||||||
|
asyncJobResponse: "stopvirtualmachineresponse",
|
||||||
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
|
//call listVirtualMachine to get embedded object until bug 6486 ("StopVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
|
var jsonObj;
|
||||||
|
$.ajax({
|
||||||
|
data: createURL("command=listVirtualMachines&id="+id),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
vmToMidmenu(jsonObj, $midmenuItem1);
|
||||||
|
if( ($("#right_panel_content #tab_content_details").length > 0)
|
||||||
|
&& ($("#right_panel_content #tab_content_details").data("jsonObj") != null )
|
||||||
|
&& (jsonObj.id == $("#right_panel_content #tab_content_details").data("jsonObj").id))
|
||||||
|
vmToRightPanel($midmenuItem1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var id in selectedItemsInMidMenu) {
|
||||||
|
var apiCommand = "command=stopVirtualMachine&id="+id;
|
||||||
|
doActionForMidMenu(id, apiInfo, apiCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
selectedItemsInMidMenu = {}; //clear selected items for action
|
||||||
|
},
|
||||||
|
"Cancel": function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
|
||||||
|
}
|
||||||
|
}).dialog("open");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user