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 aa8d566
Date Fri, 09 Aug 2013 00:16:57 GMT
Updated Branches:
  refs/heads/4.2 a5ca05fde -> aa8d56652


CLOUDSTACK-4142: listNetworkOfferings API has been changed to not return system-owned network
offerings to regular user(domain user). Therefore, change UI to determine whether a network
has EIP service/capability upon listNetworks API response instead of listNetworkOfferings
API response.


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

Branch: refs/heads/4.2
Commit: aa8d56652d96f06c6ee15457c42bf9f684c511fa
Parents: a5ca05f
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Aug 8 17:15:36 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Aug 8 17:16:47 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 66 ++++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aa8d5665/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 5a9faff..2c501aa 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -982,57 +982,47 @@
                         },
 
                         tabFilter: function(args) {
-                            var networkOfferingHavingELB = false;
+                            var networkHavingELB = false;
                             var hasNetworkACL = false;
                             var hasSRXFirewall = false;
                             var isVPC = false;
                             var isAdvancedSGZone = false;
                             var hiddenTabs = [];
                             var isSharedNetwork;
+                          
+                            var thisNetwork = args.context.networks[0];    
+                            if (thisNetwork.vpcid != null) {
+                                isVPC = true;
+                            }
+                            if (thisNetwork.type == 'Shared') {
+                                isSharedNetwork = true;
+                            }
 
-                            // Get network offering data
-                            $.ajax({
-                                url: createURL("listNetworkOfferings&id=" + args.context.networks[0].networkofferingid),
-                                dataType: "json",
-                                async: false,
-                                success: function(json) {
-                                    var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
-
-                                    if (networkoffering.forvpc) {
-                                        isVPC = true;
-                                    }
-
-                                    if (networkoffering.guestiptype == 'Shared') {
-                                        isSharedNetwork = true;
-                                    }
-
-                                    $(networkoffering.service).each(function() {
-                                        var thisService = this;
+                            $(thisNetwork.service).each(function() {
+                                var thisService = this;
 
-                                        if (thisService.name == 'NetworkACL') {
-                                            hasNetworkACL = true;
-                                        } else if (thisService.name == "Lb") {
-                                            $(thisService.capability).each(function() {
-                                                if (this.name == "ElasticLb" && this.value
== "true") {
-                                                    networkOfferingHavingELB = true;
-                                                }
-                                            });
+                                if (thisService.name == 'NetworkACL') {
+                                    hasNetworkACL = true;
+                                } else if (thisService.name == "Lb") {
+                                    $(thisService.capability).each(function() {
+                                        if (this.name == "ElasticLb" && this.value
== "true") {
+                                            networkHavingELB = true;
                                         }
+                                    });
+                                }
 
-                                        if (thisService.name == 'Firewall') {
-                                            $(thisService.provider).each(function() {
-                                                if (this.name == 'JuniperSRX') {
-                                                    hasSRXFirewall = true;
-
-                                                    return false;
-                                                }
+                                if (thisService.name == 'Firewall') {
+                                    $(thisService.provider).each(function() {
+                                        if (this.name == 'JuniperSRX') {
+                                            hasSRXFirewall = true;
 
-                                                return true;
-                                            });
+                                            return false;
                                         }
+
+                                        return true;
                                     });
                                 }
-                            });
+                            });                       
 
                             // Get zone data
                             $.ajax({
@@ -1048,7 +1038,7 @@
                                 }
                             });
 
-                            if (!networkOfferingHavingELB) {
+                            if (!networkHavingELB) {
                                 hiddenTabs.push("addloadBalancer");
                             }
 


Mime
View raw message