You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2012/10/25 10:17:54 UTC

[11/22] git commit: CS-16566: Remove egress rule tab if network ACL not present

CS-16566: Remove egress rule tab if network ACL not present

-If network ACL feature is not part of a network's offering, then hide
 the egress rule tab

-Also includes code cleanup of network tabFilter


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

Branch: refs/heads/marvin-parallel
Commit: a25501a68f5bfcc97736680e4b1891ebe0d918a7
Parents: e4394f0
Author: Brian Federle <br...@citrix.com>
Authored: Wed Oct 24 14:02:16 2012 -0700
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Oct 25 13:47:32 2012 +0530

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a25501a6/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 66e9cfc..61e342c 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -782,30 +782,41 @@
 
             tabFilter: function(args) {
               var networkOfferingHavingELB = false;
+              var hasNetworkACL = false;
+              
               $.ajax({
                 url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid),
                 dataType: "json",
                 async: false,
                 success: function(json) {
                   var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
+
                   $(networkoffering.service).each(function(){
                     var thisService = this;
-                    if(thisService.name == "Lb") {
+
+                    if (thisService.name == 'NetworkACL') {
+                      hasNetworkACL = true;
+                    } else if (thisService.name == "Lb") {
                       $(thisService.capability).each(function(){
-                        if(this.name == "ElasticLb" && this.value == "true") {
+                        if (this.name == "ElasticLb" && this.value == "true") {
                           networkOfferingHavingELB = true;
-                          return false; //break $.each() loop
                         }
                       });
-                      return false; //break $.each() loop
                     }
                   });
                 }
               });
 
               var hiddenTabs = [];
-              if(networkOfferingHavingELB == false)
+              
+              if (!networkOfferingHavingELB) {
                 hiddenTabs.push("addloadBalancer");
+              }
+
+              if (!hasNetworkACL) {
+                hiddenTabs.push('egressRules');
+              }
+              
               return hiddenTabs;
             },