CLOUDSTACK-747: internalLb in VPC - internal LB detail View - implement action assign VM to internal lb.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3c2be57c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3c2be57c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3c2be57c Branch: refs/heads/master Commit: 3c2be57c35877c98d165c5f5be464815f6af2484 Parents: 7c05bb1 Author: Jessica Wang <jessicaw...@apache.org> Authored: Tue May 21 15:57:58 2013 -0700 Committer: Jessica Wang <jessicaw...@apache.org> Committed: Tue May 21 15:58:39 2013 -0700 ---------------------------------------------------------------------- ui/scripts/vpc.js | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2be57c/ui/scripts/vpc.js ---------------------------------------------------------------------- diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index e47cb12..23e7b0c 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -446,13 +446,33 @@ type: 'checkbox', filters: false }), - action: function(args) { - args.response.success(); + action: function(args) { + var vms = args.context.instances; + var array1 = []; + for(var i = 0; i < vms.length; i++) { + array1.push(vms[i].id); + } + var virtualmachineids = array1.join(','); + + $.ajax({ + url: createURL('assignToLoadBalancerRule'), + data: { + id: args.context.internalLoadBalancers[0].id, + virtualmachineids: virtualmachineids + }, + dataType: 'json', + async: true, + success: function(data) { + debugger; + var jid = data.assigntoloadbalancerruleresponse.jobid; + args.response.success({ + _custom: { jobId: jid } + }); + } + }); }, notification: { - poll: function(args) { - args.complete(); - } + poll: pollAsyncJobResult } } },