Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52B78106C2 for ; Fri, 20 Sep 2013 01:37:43 +0000 (UTC) Received: (qmail 49468 invoked by uid 500); 20 Sep 2013 01:37:43 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 49451 invoked by uid 500); 20 Sep 2013 01:37:43 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 49444 invoked by uid 99); 20 Sep 2013 01:37:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 01:37:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id ECF798A36F7; Fri, 20 Sep 2013 01:37:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jessicawang@apache.org To: commits@cloudstack.apache.org Message-Id: <7fe44b5d9db74b85a55c3bd792e1a048@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 47384e3 Date: Fri, 20 Sep 2013 01:37:42 +0000 (UTC) Updated Branches: refs/heads/master 94e744fe0 -> 47384e30c CLOUDSTACK-4713: EIP/ELB Basic Zone: UI > Network > IP Addresses > make extra API call to get IPs allocated at guest network. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/47384e30 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/47384e30 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/47384e30 Branch: refs/heads/master Commit: 47384e30cc20d10081cbd1ac1f07533a53905f7c Parents: 94e744f Author: Jessica Wang Authored: Thu Sep 19 18:34:42 2013 -0700 Committer: Jessica Wang Committed: Thu Sep 19 18:37:33 2013 -0700 ---------------------------------------------------------------------- ui/scripts/network.js | 78 +++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47384e30/ui/scripts/network.js ---------------------------------------------------------------------- diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 9d4cf38..421582a 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -2054,57 +2054,63 @@ }, dataProvider: function(args) { - var data = {}; - listViewDataProvider(args, data); - - //The following 10 lines caused CLOUDSTACK-4713 (EIP/ELB Basic Zone - unable to see any IPs that are acquired) - /* - if (g_supportELB == "guest") // IPs are allocated on guest network - $.extend(data, { - forvirtualnetwork: false, - forloadbalancing: true - }); - else if (g_supportELB == "public") // IPs are allocated on public network - $.extend(data, { - forvirtualnetwork: true, - forloadbalancing: true - }); - */ - + var items = []; + var data = {}; + listViewDataProvider(args, data); if (args.context.networks) { $.extend(data, { associatedNetworkId: args.context.networks[0].id }); - } - if ("vpc" in args.context) { $.extend(data, { vpcid: args.context.vpc[0].id }); - } - + } + $.ajax({ url: createURL('listPublicIpAddresses'), - data: data, + data: $.extend({}, data, { + forvirtualnetwork: true, //IPs are allocated on public network + }), dataType: "json", - async: true, + async: false, success: function(json) { - var items = json.listpublicipaddressesresponse.publicipaddress; - - $(items).each(function() { - getExtaPropertiesForIpObj(this, args); - }); - - args.response.success({ - actionFilter: actionFilters.ipAddress, - data: items - }); - }, - error: function(data) { - args.response.error(parseXMLHttpResponse(data)); + var ips = json.listpublicipaddressesresponse.publicipaddress; + if(ips != null) { + for(var i = 0; i < ips.length; i++) { + getExtaPropertiesForIpObj(ips[i], args); + items.push(ips[i]); + } + } } }); + + if (g_supportELB == "guest") { + $.ajax({ + url: createURL('listPublicIpAddresses'), + data: $.extend({}, data, { + forvirtualnetwork: false, // ELB IPs are allocated on guest network + forloadbalancing: true + }), + dataType: "json", + async: false, + success: function(json) { + var ips = json.listpublicipaddressesresponse.publicipaddress; + if(ips != null) { + for(var i = 0; i < ips.length; i++) { + getExtaPropertiesForIpObj(ips[i], args); + items.push(ips[i]); + } + } + } + }); + } + + args.response.success({ + actionFilter: actionFilters.ipAddress, + data: items + }); }, // Detail view