Updated Branches: refs/heads/ui-vpc-redesign 8acdd6f43 -> b11c44f91
Internal LB: Pre-select existing VMs on LB rule Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b11c44f9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b11c44f9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b11c44f9 Branch: refs/heads/ui-vpc-redesign Commit: b11c44f91d418d498c994f7fbf2b4791fe89dcab Parents: 8acdd6f Author: Brian Federle <[email protected]> Authored: Wed May 22 11:11:29 2013 -0700 Committer: Brian Federle <[email protected]> Committed: Wed May 22 11:11:33 2013 -0700 ---------------------------------------------------------------------- ui/scripts/vpc.js | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b11c44f9/ui/scripts/vpc.js ---------------------------------------------------------------------- diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index a3dadaa..be7fdd7 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -444,7 +444,34 @@ }, listView: $.extend(true, {}, cloudStack.sections.instances.listView, { type: 'checkbox', - filters: false + filters: false, + dataProvider: function(args) { + $.ajax({ + url: createURL('listVirtualMachines'), + data: { + networkid: args.context.networks[0].id, + listAll: true + }, + success: function(json) { + var instances = json.listvirtualmachinesresponse.virtualmachine; + + // Pre-select existing instances in LB rule + $(instances).map(function(index, instance) { + instance._isSelected = $.grep( + args.context.internalLoadBalancers[0].loadbalancerinstance, + + function(lbInstance) { + return lbInstance.id == instance.id; + } + ).length ? true : false; + }); + + args.response.success({ + data: instances + }); + } + }); + } }), action: function(args) { var vms = args.context.instances;
