You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/10/26 00:18:41 UTC

git commit: updated refs/heads/4.2 to 635ab5f

Updated Branches:
  refs/heads/4.2 a59f8096b -> 635ab5fba


CLOUDSTACK-4966: UI > Instances > destroyed VM > implement "expunge" option (for root-admin and domain-admin only).


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/635ab5fb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/635ab5fb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/635ab5fb

Branch: refs/heads/4.2
Commit: 635ab5fbac444d1d14bebfcf84ea08c20a70b975
Parents: a59f809
Author: Jessica Wang <je...@apache.org>
Authored: Fri Oct 25 15:16:17 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Fri Oct 25 15:16:17 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/635ab5fb/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index e225f39..3ad99f7 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -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");