mirror of https://github.com/apache/cloudstack.git
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:
parent
42ed9e13f3
commit
f985e11c28
|
|
@ -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, "<"); //replace < whose unicode is \u003c
|
||||
val = val.replace(/>/g, ">"); //replace > whose unicode is \u003e
|
||||
return unescape(val);
|
||||
}
|
||||
*/
|
||||
|
||||
// Role Functions
|
||||
function isAdmin() {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue