Updated Branches: refs/heads/master 5435495e1 -> 9f564fc77
CLOUDSTACK-747: internal LB in VPC - internalLB detailView - implement Delete Internal LB action. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9f564fc7 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9f564fc7 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9f564fc7 Branch: refs/heads/master Commit: 9f564fc77f1bbc108d10b474e03dcf4a197d5d7c Parents: 5435495 Author: Jessica Wang <jessicaw...@apache.org> Authored: Tue Jun 4 13:58:11 2013 -0700 Committer: Jessica Wang <jessicaw...@apache.org> Committed: Tue Jun 4 13:58:34 2013 -0700 ---------------------------------------------------------------------- ui/scripts/vpc.js | 45 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 38 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f564fc7/ui/scripts/vpc.js ---------------------------------------------------------------------- diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 39934b3..f4c53b4 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -433,9 +433,7 @@ } ); } - }); - - args.response.success(); + }); }, notification: { poll: pollAsyncJobResult @@ -444,12 +442,12 @@ }, detailView: { - name: 'Internal Lb details', + name: 'Internal LB details', actions: { assignVm: { - label: 'Assign VMs to LB', + label: 'Assign VMs to Internal LB', messages: { - notification: function(args) { return 'Assign VM to internal LB rule'; } + notification: function(args) { return 'Assign VMs to Internal LB'; } }, listView: $.extend(true, {}, cloudStack.sections.instances.listView, { type: 'checkbox', @@ -509,7 +507,40 @@ notification: { poll: pollAsyncJobResult } - } + }, + remove: { + label: 'Delete Internal LB', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete Internal LB'; + }, + notification: function(args) { + return 'Delete Internal LB'; + } + }, + action: function(args) { + var data = { + id: args.context.internalLoadBalancers[0].id + }; + $.ajax({ + url: createURL('deleteLoadBalancer'), + data: data, + async: true, + success: function(json) { + var jid = json.deleteloadbalancerresponse.jobid; + args.response.success({ + _custom: { jobId: jid } + }); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } }, tabs: { details: {