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/4.2 to 4520a01
Date Tue, 13 Aug 2013 01:12:09 GMT
Updated Branches:
  refs/heads/4.2 3dc8d2f94 -> 4520a0177


CLOUDSTACK-4142: listNetworkOfferings API has been changed to not return system-owned network
offerings to regular user. conservemode property was just added to listNetworks API response.
Change IP Address page to get conservemode from listNetworks API instead of listNetworkOfferings
API.


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

Branch: refs/heads/4.2
Commit: 4520a017771b7dcca850798403b2ac8edff882f3
Parents: 3dc8d2f
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Aug 12 18:09:06 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Aug 12 18:11:59 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4520a017/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index c5b1339..3b36f6a 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -136,24 +136,24 @@
         ipAddress: function(args) {
             var allowedActions = args.context.actions;
             var disallowedActions = [];
-            var item = args.context.item;
-            var status = item.state;
+            var ipObj = args.context.item;
+            var status = ipObj.state;
 
             if (status == 'Destroyed' ||
                 status == 'Releasing' ||
                 status == 'Released' ||
                 status == 'Creating' ||
                 status == 'Allocating' ||
-                item.account == 'system' ||
-                item.issystem == true) {
+                ipObj.account == 'system' ||
+                ipObj.issystem == true) {
                 return [];
             }
             
-            if (item.networkOfferingConserveMode == false) {
+            if (args.context.networks[0].networkofferingconservemode == false) {
                 /*
 				(1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
 				*/
-                if (item.issourcenat == true) {
+                if (ipObj.issourcenat == true) {
                     disallowedActions.push('enableStaticNAT');
                     disallowedActions.push('enableVPN');
                 }
@@ -165,11 +165,11 @@
 				3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
 				4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
 				*/
-                else { //item.issourcenat == false
-                    if (item.isstaticnat) { //1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
+                else { //ipObj.issourcenat == false
+                    if (ipObj.isstaticnat) { //1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
                         disallowedActions.push('enableVPN');
                     }
-                    if (item.vpnenabled) { //2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
+                    if (ipObj.vpnenabled) { //2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
                         disallowedActions.push('enableStaticNAT');
                     }
 
@@ -177,7 +177,7 @@
                     $.ajax({
                         url: createURL('listPortForwardingRules'),
                         data: {
-                            ipaddressid: item.id,
+                            ipaddressid: ipObj.id,
                             listAll: true
                         },
                         dataType: 'json',
@@ -195,7 +195,7 @@
                     $.ajax({
                         url: createURL('listLoadBalancerRules'),
                         data: {
-                            publicipid: item.id,
+                            publicipid: ipObj.id,
                             listAll: true
                         },
                         dataType: 'json',
@@ -211,24 +211,24 @@
                 }
             }
 
-            if (item.isstaticnat) {
+            if (ipObj.isstaticnat) {
                 disallowedActions.push('enableStaticNAT');
             } else {
                 disallowedActions.push('disableStaticNAT');
             }
 
-            if (item.networkOfferingHavingVpnService == true) {
-                if (item.vpnenabled) {
+            if (ipObj.networkOfferingHavingVpnService == true) {
+                if (ipObj.vpnenabled) {
                     disallowedActions.push('enableVPN');
                 } else {
                     disallowedActions.push('disableVPN');
                 }
-            } else { //item.networkOfferingHavingVpnService == false
+            } else { //ipObj.networkOfferingHavingVpnService == false
                 disallowedActions.push('disableVPN');
                 disallowedActions.push('enableVPN');
             }
 
-            if (item.issourcenat) {
+            if (ipObj.issourcenat) {
                 disallowedActions.push('enableStaticNAT');
                 disallowedActions.push('disableStaticNAT');
                 disallowedActions.push('remove');
@@ -2706,7 +2706,7 @@
                                                 });
                                             }
                                         }
-                                        if (args.context.ipAddresses[0].networkOfferingConserveMode
== false) {
+                                        if (args.context.networks[0].networkofferingconservemode
== false) {
                                             /*
                        (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer
can be enabled/added.
                        */
@@ -5961,24 +5961,8 @@
 						};
 					}
 				});
-			}
-			
-			//get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService from
guest network's network offering
-            $.ajax({
-                url: createURL('listNetworkOfferings'),
-                data: {
-                    id: args.context.networks[0].networkofferingid
-                },
-                async: false,
-                success: function(json) {
-				    if(json.listnetworkofferingsresponse.networkoffering != null) {
-						var networkOfferingObj = json.listnetworkofferingsresponse.networkoffering[0];
-						ipObj.networkOfferingConserveMode = networkOfferingObj.conservemode;
-					}
-                }
-            });
-        } else { //from VPC section
-            ipObj.networkOfferingConserveMode = false; //conserve mode of IP in VPC is always
off, so hardcode it as false
+			}			
+        } else { //from VPC section            
             ipObj.networkOfferingHavingVpnService = false; //VPN is not supported in IP in
VPC, so hardcode it as false
         }
     }


Mime
View raw message