cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [2/5] git commit: Don't show egress tab for advanced SG zones
Date Wed, 05 Dec 2012 00:06:59 GMT
Don't show egress tab for advanced SG zones


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

Branch: refs/heads/master
Commit: 5f1f1e7534ae76c3209c18b74b08f227efcb1696
Parents: 4bab97b
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Dec 4 11:22:52 2012 -0800
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Dec 4 11:22:52 2012 -0800

----------------------------------------------------------------------
 ui/scripts/network.js |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5f1f1e75/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 1363154..7cdf977 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -805,7 +805,10 @@
               var networkOfferingHavingELB = false;
               var hasNetworkACL = false;
               var isVPC = false;
-              
+              var isAdvancedSGZone = false;
+              var hiddenTabs = [];
+
+              // Get network offering data
               $.ajax({
                 url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid),
                 dataType: "json",
@@ -833,13 +836,25 @@
                 }
               });
 
-              var hiddenTabs = [];
-              
+              // Get zone data
+              $.ajax({
+                url: createURL('listZones'),
+                data: {
+                  id: args.context.networks[0].zoneid
+                },
+                async: false,
+                success: function(json) {
+                  var zone = json.listzonesresponse.zone[0];
+
+                  isAdvancedSGZone = zone.securitygroupsenabled;
+                }
+              });
+
               if (!networkOfferingHavingELB) {
                 hiddenTabs.push("addloadBalancer");
               }
 
-              if (isVPC) {
+              if (isVPC || isAdvancedSGZone) {
                 hiddenTabs.push('egressRules');
               }
               


Mime
View raw message