Updated Branches: refs/heads/master-6-17-stable 258fc140f -> 40bc81c36
CLOUDSTACK-3130: UI > VPC section - Enable Static NAT - Select VM for static NAT- show no VMs when no tier is selected. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/40bc81c3 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/40bc81c3 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/40bc81c3 Branch: refs/heads/master-6-17-stable Commit: 40bc81c363c418e985c78fae0c34d1f7ca54e105 Parents: 258fc14 Author: Jessica Wang <jessicaw...@apache.org> Authored: Tue Jun 25 16:36:42 2013 -0700 Committer: Jessica Wang <jessicaw...@apache.org> Committed: Tue Jun 25 16:40:07 2013 -0700 ---------------------------------------------------------------------- ui/scripts/network.js | 12 +++++--- ui/scripts/vpc.js | 68 +--------------------------------------------- 2 files changed, 9 insertions(+), 71 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/40bc81c3/ui/scripts/network.js ---------------------------------------------------------------------- diff --git a/ui/scripts/network.js b/ui/scripts/network.js index d18e796..8882b70 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -2155,11 +2155,15 @@ return; } - if('vpc' in args.context) { - if($tierSelect.size() && $tierSelect.val() != '-1' ){ - data.networkid = $tierSelect.val(); - } + // if no tier is selected + if($tierSelect.val() == '-1'){ + args.response.success({ data: null }); + return; + } + + if('vpc' in args.context) { $.extend(data, { + networkid: $tierSelect.val(), vpcid: args.context.vpc[0].id }); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/40bc81c3/ui/scripts/vpc.js ---------------------------------------------------------------------- diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index ca02c77..f610889 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -471,73 +471,7 @@ detailView: { isMaximized: true, name: 'Internal LB details', - actions: { - /* - assignVm: { - label: 'Assign VMs to Internal LB', - messages: { - notification: function(args) { return 'Assign VMs to Internal LB'; } - }, - listView: $.extend(true, {}, cloudStack.sections.instances.listView, { - type: 'checkbox', - 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; - 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) { - var jid = data.assigntoloadbalancerruleresponse.jobid; - args.response.success({ - _custom: { jobId: jid } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - */ + actions: { remove: { label: 'Delete Internal LB', messages: {