Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B81989BDE for ; Wed, 15 May 2013 21:24:09 +0000 (UTC) Received: (qmail 90587 invoked by uid 500); 15 May 2013 21:24:09 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 90538 invoked by uid 500); 15 May 2013 21:24:09 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 90529 invoked by uid 99); 15 May 2013 21:24:09 -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, 15 May 2013 21:24:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2CE67B82D; Wed, 15 May 2013 21:24:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jessicawang@apache.org To: commits@cloudstack.apache.org Message-Id: <5f906e37cea6469e9d6c52b44f7d0554@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/ui-vpc-redesign to f985e11 Date: Wed, 15 May 2013 21:24:09 +0000 (UTC) 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 Authored: Wed May 15 11:01:43 2013 -0700 Committer: Jessica Wang 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, ">"); //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 {