From 1753480ff8f1b7dacf81cb0a7a17f6ac97e9b57f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 12 Jul 2012 15:09:30 -0700 Subject: [PATCH] cloudstack 3.0 UI - VPC - implement Delete VPC action. --- ui/scripts/network.js | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 56f78237540..7e4c8d5fc11 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -3529,7 +3529,7 @@ } }, editVpc: { - label: 'Edit VPC', + label: 'Configure VPC', textLabel: 'label.configure', action: { custom: cloudStack.uiCustom.vpc(cloudStack.vpc) @@ -3538,7 +3538,44 @@ }, detailView: { - name: 'label.details', + name: 'label.details', + actions: { + remove: { + label: 'remove VPC', + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete the VPC'; + }, + notification: function(args) { + return 'remove VPC'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteVPC"), + data: { + id: args.context.vpc[0].id + }, + success: function(json) { + var jid = json.deletevpcresponse.jobid; + args.response.success( + {_custom: + { + jobId: jid //take snapshot from a volume doesn't change any property in this volume. So, don't need to specify getUpdatedItem() to return updated volume. Besides, createSnapshot API doesn't return updated volume. + } + } + ); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, tabs: { details: { title: 'label.details',