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/ui-vpc-redesign to f985e11
Date Wed, 15 May 2013 21:24:09 GMT
Updated Branches:
  refs/heads/ui-vpc-redesign 42ed9e13f -> f985e11c2


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/f985e11c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f985e11c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f985e11c

Branch: refs/heads/ui-vpc-redesign
Commit: f985e11c28f451183e64129a774edb4afe460bac
Parents: 42ed9e1
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 14:23:49 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/f985e11c/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/f985e11c/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 96c983b..c54535d 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -2499,15 +2499,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