From 33cf9468b6dbf664dc42aca4a63ea4eb6dcc07ae Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Sat, 7 Jul 2012 13:35:01 -0700 Subject: [PATCH] cloudstack 3.0 UI - VPC - tier - implement Remove Tier action. --- ui/scripts/ui-custom/vpc.js | 6 ++++-- ui/scripts/vpc.js | 21 ++++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index cc9edab1f41..90ce2a621eb 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -392,8 +392,10 @@ action({ context: context, response: { - success: function(args) { - success({ remove: true }); + success: function(args) { + success($.extend(args, { + remove: true + })); } } }); diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index f3747be57e8..a18fc6f67d6 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -399,11 +399,26 @@ remove: { label: 'Remove tier', - action: function(args) { - args.response.success(); + action: function(args) { + $.ajax({ + url: createURL('deleteNetwork'), + dataType: "json", + data: { + id: args.context.tiers[0].id + }, + success: function(json) { + var jid = json.deletenetworkresponse.jobid; + args.response.success( + {_custom: + {jobId: jid + } + } + ); + } + }); }, notification: { - poll: function(args) { args.complete(); } + poll: pollAsyncJobResult } } },