Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06932DD30 for ; Wed, 24 Oct 2012 21:28:09 +0000 (UTC) Received: (qmail 46674 invoked by uid 500); 24 Oct 2012 21:28:08 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 46639 invoked by uid 500); 24 Oct 2012 21:28:08 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 46632 invoked by uid 99); 24 Oct 2012 21:28:08 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2012 21:28:08 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A629F4F059; Wed, 24 Oct 2012 21:28:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: CS-16566: Remove egress rule tab if network ACL not present Message-Id: <20121024212808.A629F4F059@tyr.zones.apache.org> Date: Wed, 24 Oct 2012 21:28:08 +0000 (UTC) Updated Branches: refs/heads/master 6ad1ed05e -> a96b27b5a 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/a96b27b5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a96b27b5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a96b27b5 Branch: refs/heads/master Commit: a96b27b5ac6005ed6176942ee7a9eb2494899694 Parents: 6ad1ed0 Author: Brian Federle Authored: Wed Oct 24 14:02:16 2012 -0700 Committer: Brian Federle Committed: Wed Oct 24 14:28:02 2012 -0700 ---------------------------------------------------------------------- ui/scripts/network.js | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a96b27b5/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; },