You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2012/07/31 22:45:16 UTC

git commit: CS-15760

Updated Branches:
  refs/heads/vpc 7706a9c32 -> c4e2fe7b7


CS-15760

Don't show Configuration tab for VPC static NAT


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

Branch: refs/heads/vpc
Commit: c4e2fe7b74fd7c7ff5e95e689c7caf35a82cbe32
Parents: 7706a9c
Author: Brian Federle <br...@citrix.com>
Authored: Tue Jul 31 13:44:23 2012 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Tue Jul 31 13:44:54 2012 -0700

----------------------------------------------------------------------
 ui/scripts/network.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4e2fe7b/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 9a7a569..b02bb80 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1253,15 +1253,27 @@
 
               var disabledTabs = [];
               var ipAddress = args.context.ipAddresses[0];
+              var disableVpn = false, disableIpRules = false;
+
               if (!ipAddress.vpnenabled) {
-                disabledTabs.push('vpn');
+                disableVpn = true;
+              }
+              
+              if (ipAddress.issystem == true) {
+                disableVpn = true;
+                
+                if (ipAddress.isstaticnat == true || ipAddress.virtualmachineid != null) {
+                  disableIpRules = true;
+                }
               }
-              if(ipAddress.issystem == true) {
-                disabledTabs.push('vpn');
 
-                if(ipAddress.isstaticnat == true || ipAddress.virtualmachineid != null)
-                  disabledTabs.push('ipRules');
+              if (ipAddress.vpcid && ipAddress.issourcenat) {
+                disableIpRules = true;
               }
+
+              if (disableVpn) disabledTabs.push('vpn');
+              if (disableIpRules) disabledTabs.push('ipRules');
+              
               return disabledTabs;
             },
             actions: {