mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
new UI - instance page - implement multiple-selection Reboot VM action.
This commit is contained in:
parent
c2fb123fd8
commit
641c7e617f
@ -141,6 +141,45 @@ function afterLoadInstanceJSP() {
|
||||
return false;
|
||||
});
|
||||
|
||||
//Reboot VM button
|
||||
$("#midmenu_rebootvm_link").show();
|
||||
$("#midmenu_rebootvm_link").bind("click", function(event) {
|
||||
var itemCounts = 0;
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
itemCounts ++;
|
||||
}
|
||||
if(itemCounts == 0) {
|
||||
$("#dialog_info_please_select_one_item_in_middle_menu").dialog("open");
|
||||
return false;
|
||||
}
|
||||
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
var apiCommand = "command=rebootVirtualMachine&id="+id;
|
||||
var apiInfo = {
|
||||
label: "Reboot Instance",
|
||||
isAsyncJob: true,
|
||||
asyncJobResponse: "rebootvirtualmachineresponse",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
//call listVirtualMachine to get embedded object until Bug 6751("rebootVirtualMachine API should return an embedded object") 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);
|
||||
}
|
||||
}
|
||||
doActionForMidMenu(id, apiInfo, apiCommand);
|
||||
}
|
||||
|
||||
selectedItemsInMidMenu = {}; //clear selected items for action
|
||||
return false;
|
||||
});
|
||||
|
||||
// switch between different tabs
|
||||
var tabArray = [$("#tab_details"), $("#tab_volume"), $("#tab_statistics"), $("#tab_router")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_volume"), $("#tab_content_statistics"), $("#tab_content_router")];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user