cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [14/39] git commit: updated refs/heads/ui-vpc-redesign to 8d9a8ca
Date Thu, 16 May 2013 17:12:35 GMT
CLOUDSTACK-747: internalLb in VPC - UI - create tier dialog - only one tier is allowed to have
PublicLb in a VPC.


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

Branch: refs/heads/ui-vpc-redesign
Commit: 7e0006a3e5584e0f89873ebfddf77c0bbcd4c222
Parents: dbb223e
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed May 15 11:01:43 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed May 15 11:03:51 2013 -0700

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js |   36 ++++++++++++------------------------
 ui/scripts/vpc.js             |    9 +++++----
 2 files changed, 17 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e0006a3/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index a018406..0352990 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -122,34 +122,22 @@ function createURL(apiName, options) {
   return urlString;
 }
 
-/*
-function fromdb(val) {
-  return sanitizeXSS(noNull(val));
-}
-*/
-
 function todb(val) {
   return encodeURIComponent(val);
 }
 
-/*
-function noNull(val) {
-  if(val == null)
-    return "";
-  else
-    return val;
-}
-*/
-
-/*
-function sanitizeXSS(val) {  // Prevent cross-site-script(XSS) attack
-  if(val == null || typeof(val) != "string")
-    return val;
-  val = val.replace(/</g, "&lt;");  //replace < whose unicode is \u003c
-  val = val.replace(/>/g, "&gt;");  //replace > whose unicode is \u003e
-  return unescape(val);
-}
-*/
+//LB provider map
+var lbProviderMap = {
+  "publicLb": {
+    "non-vpc": ["VirtualRouter", "Netscaler", "F5"],
+    "vpc": ["VpcVirtualRouter", "Netscaler"]
+  },
+  "internalLb": {
+    "non-vpc": [],
+    "vpc": ["InternalLbVm"]
+  }
+};
+
 
 // Role Functions
 function isAdmin() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e0006a3/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 0c4a446..4890dcc 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -2344,15 +2344,16 @@
                           var items;
                           if(networkSupportingLbExists == true) {
                             items = $.grep(networkOfferings, function(networkOffering) {
-                              var includingLbService = false;
+                              var includingPublicLbService = false;
                               $(networkOffering.service).each(function(){
                                 var thisService = this;
-                                if(thisService.name == "Lb") {
-                                  includingLbService = true;
+                                //only one tier is allowed to have PublicLb provider in a
VPC
+                                if(thisService.name == "Lb" && lbProviderMap.publicLb.vpc.indexOf(thisService.provider[0].name)
!= -1) {                                  
+                                  includingPublicLbService = true;
                                   return false; //break $.each() loop
                                 }
                               });
-                              return !includingLbService;
+                              return !includingPublicLbService;
                             });
                           }
                           else {


Mime
View raw message