cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 380a961
Date Mon, 12 Aug 2013 01:25:41 GMT
Updated Branches:
  refs/heads/master f1c611ac6 -> 380a96166


CLOUDSTACK-4142: listNetworkOfferings API has been changed to not return system-owned network
offerings to regular user(domain user). This API change causes several UI bugs. Change UI
to determine whether an IP Address has VPN service upon listNetworks API response instead
of listNetworkOfferings API response.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/380a9616
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/380a9616
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/380a9616

Branch: refs/heads/master
Commit: 380a9616640322440386e5295894ffd3c8913988
Parents: f1c611a
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Sun Aug 11 18:16:16 2013 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Sun Aug 11 18:25:17 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 64 +++++++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/380a9616/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 53580a6..d875182 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -5977,9 +5977,37 @@
         }
     };
 
-    function getExtaPropertiesForIpObj(ipObj, args) {
-        if ('networks' in args.context) { //from Guest Network section
-            //get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService
from guest network's network offering
+    function getExtaPropertiesForIpObj(ipObj, args) {	    
+        if (!('vpc' in args.context)) { //from Guest Network section            
+			var services = args.context.networks[0].service;
+			if(services != null) {
+				for(var i = 0; i < services.length; i++) {                                    		
+					var thisService = services[i];					
+					if (thisService.name == "Vpn") {
+					    ipObj.networkOfferingHavingVpnService = true; 
+						break;
+					}
+				}
+			}		
+			if (ipObj.networkOfferingHavingVpnService == true) {
+				$.ajax({
+					url: createURL('listRemoteAccessVpns'),
+					data: {
+						listAll: true,
+						publicipid: ipObj.id
+					},
+					async: false,
+					success: function(vpnResponse) {
+						var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
+						if (isVPNEnabled) {
+							ipObj.vpnenabled = true;
+							ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
+						};
+					}
+				});
+			}
+			
+			//get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService from
guest network's network offering
             $.ajax({
                 url: createURL('listNetworkOfferings'),
                 data: {
@@ -5987,32 +6015,10 @@
                 },
                 async: false,
                 success: function(json) {
-                    var networkOfferingObj = json.listnetworkofferingsresponse.networkoffering[0];
-                    ipObj.networkOfferingConserveMode = networkOfferingObj.conservemode;
-
-                    $(networkOfferingObj.service).each(function() {
-                        var thisService = this;
-                        if (thisService.name == "Vpn")
-                            ipObj.networkOfferingHavingVpnService = true;
-                    });
-
-                    if (ipObj.networkOfferingHavingVpnService == true) {
-                        $.ajax({
-                            url: createURL('listRemoteAccessVpns'),
-                            data: {
-                                listAll: true,
-                                publicipid: ipObj.id
-                            },
-                            async: false,
-                            success: function(vpnResponse) {
-                                var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
-                                if (isVPNEnabled) {
-                                    ipObj.vpnenabled = true;
-                                    ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
-                                };
-                            }
-                        });
-                    }
+				    if(json.listnetworkofferingsresponse.networkoffering != null) {
+						var networkOfferingObj = json.listnetworkofferingsresponse.networkoffering[0];
+						ipObj.networkOfferingConserveMode = networkOfferingObj.conservemode;
+					}
                 }
             });
         } else { //from VPC section


Mime
View raw message