mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-4966: UI > Instances > destroyed VM > implement "expunge" option (for root-admin and domain-admin only).
This commit is contained in:
parent
a59f8096ba
commit
635ab5fbac
|
|
@ -593,6 +593,43 @@
|
|||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
expunge: {
|
||||
label: 'Expunge Instance',
|
||||
compactLabel: 'Expunge',
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
return 'Please confirm you want to expunge this instance.';
|
||||
},
|
||||
notification: function(args) {
|
||||
return 'Expunge Instance';
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('destroyVirtualMachine'),
|
||||
data: {
|
||||
id: args.context.instances[0].id,
|
||||
expunge: true
|
||||
},
|
||||
success: function(json) {
|
||||
var jid = json.destroyvirtualmachineresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getActionFilter: function() {
|
||||
return vmActionfilter;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
restore: {
|
||||
label: 'label.action.restore.instance',
|
||||
compactLabel: 'label.restore',
|
||||
|
|
@ -2049,6 +2086,7 @@
|
|||
if (jsonObj.state == 'Destroyed') {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
allowedActions.push("restore");
|
||||
allowedActions.push("expunge");
|
||||
}
|
||||
} else if (jsonObj.state == 'Running') {
|
||||
allowedActions.push("stop");
|
||||
|
|
|
|||
Loading…
Reference in New Issue