CLOUDSTACK-747: internalLb in VPC - UI - create tier dialog - only one tier is allowed to have PublicLb in a VPC.

This commit is contained in:
Jessica Wang 2013-05-15 11:01:43 -07:00
parent 42ed9e13f3
commit f985e11c28
2 changed files with 16 additions and 27 deletions

View File

@ -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;
}
*/
//LB provider map
var lbProviderMap = {
"publicLb": {
"non-vpc": ["VirtualRouter", "Netscaler", "F5"],
"vpc": ["VpcVirtualRouter", "Netscaler"]
},
"internalLb": {
"non-vpc": [],
"vpc": ["InternalLbVm"]
}
};
/*
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);
}
*/
// Role Functions
function isAdmin() {

View File

@ -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 {