Skip to content

Commit 635ab5f

Browse files
author
Jessica Wang
committed
CLOUDSTACK-4966: UI > Instances > destroyed VM > implement "expunge" option (for root-admin and domain-admin only).
1 parent a59f809 commit 635ab5f

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

‎ui/scripts/instances.js‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,43 @@
593593
poll: pollAsyncJobResult
594594
}
595595
},
596+
597+
expunge: {
598+
label: 'Expunge Instance',
599+
compactLabel: 'Expunge',
600+
messages: {
601+
confirm: function(args) {
602+
return 'Please confirm you want to expunge this instance.';
603+
},
604+
notification: function(args) {
605+
return 'Expunge Instance';
606+
}
607+
},
608+
action: function(args) {
609+
$.ajax({
610+
url: createURL('destroyVirtualMachine'),
611+
data: {
612+
id: args.context.instances[0].id,
613+
expunge: true
614+
},
615+
success: function(json) {
616+
var jid = json.destroyvirtualmachineresponse.jobid;
617+
args.response.success({
618+
_custom: {
619+
jobId: jid,
620+
getActionFilter: function() {
621+
return vmActionfilter;
622+
}
623+
}
624+
});
625+
}
626+
});
627+
},
628+
notification: {
629+
poll: pollAsyncJobResult
630+
}
631+
},
632+
596633
restore: {
597634
label: 'label.action.restore.instance',
598635
compactLabel: 'label.restore',
@@ -2049,6 +2086,7 @@
20492086
if (jsonObj.state == 'Destroyed') {
20502087
if (isAdmin() || isDomainAdmin()) {
20512088
allowedActions.push("restore");
2089+
allowedActions.push("expunge");
20522090
}
20532091
} else if (jsonObj.state == 'Running') {
20542092
allowedActions.push("stop");

0 commit comments

Comments
 (0)