CLOUDSTACK-588:restoreVirtualMachine api functionality on the UI while the VMs are in running or stopped state

This commit is contained in:
Pranav Saxena 2012-12-06 02:35:49 +05:30
parent 40682fc43d
commit 30dd34d258
2 changed files with 44 additions and 0 deletions

View File

@ -11210,11 +11210,20 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
background-position: -168px -31px;
}
.reset .icon{
background-position: -168px -31px;
}
.restoreVM:hover .icon,
.restore:hover .icon {
background-position: -168px -613px;
}
.reset:hover .icon {
background-position: -168px -613px;
}
.enableVPN .icon {
background-position: -198px -3px;
}

View File

@ -475,6 +475,39 @@
}
},
reset: {
label: 'Reset VM',
messages:{
confirm:function(args) {
return 'Do you want to restore the VM ?';
},
notification:function(args) {
return 'Reset VM';
}
},
action:function(args){
$.ajax({
url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
dataType: "json",
async: true,
success: function(json) {
var item = json.restorevmresponse;
args.response.success({data:item});
}
});
},
notification: {
poll: function(args) {
args.complete({ data: { state: 'Stopped' }});
}
}
},
edit: {
label: 'label.edit',
action: function(args) {
@ -1201,6 +1234,7 @@
allowedActions.push("restart");
allowedActions.push("destroy");
allowedActions.push("changeService");
allowedActions.push("reset");
if (isAdmin())
allowedActions.push("migrate");
@ -1222,6 +1256,7 @@
allowedActions.push("edit");
allowedActions.push("start");
allowedActions.push("destroy");
allowedActions.push("reset");
if(isAdmin())
allowedActions.push("migrateToAnotherStorage");