mirror of https://github.com/apache/cloudstack.git
cloudstack 3.0 UI - VPC - create tier dialog - check all tiers under the VPC. If any of them includes LB service, exclude network offering including LB service from network offering dropdown.
This commit is contained in:
parent
1e407f62ad
commit
d0b8e59ab4
|
|
@ -1126,48 +1126,69 @@
|
||||||
label: 'label.network.offering',
|
label: 'label.network.offering',
|
||||||
validation: { required: true },
|
validation: { required: true },
|
||||||
dependsOn: 'zoneId',
|
dependsOn: 'zoneId',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
//debugger;
|
var networkSupportingLbExists = false;
|
||||||
//args.context is null (Brian will fix it to have value)
|
|
||||||
/*
|
|
||||||
var networkSupportingLbExists = false;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworks'),
|
url: createURL('listNetworks'),
|
||||||
data: {
|
data: {
|
||||||
vpcid: args.context.vpc[0].id,
|
vpcid: args.context.vpc[0].id,
|
||||||
supportedservices: LB
|
supportedservices: 'LB'
|
||||||
},
|
},
|
||||||
async: false,
|
success: function(json) {
|
||||||
success: function(json) {
|
var networkSupportingLbExists;
|
||||||
if(json.listnetworksresponse.network != null && json.listnetworksresponse.network.length > 0) {
|
if(json.listnetworksresponse.network != null && json.listnetworksresponse.network.length > 0)
|
||||||
networkSupportingLbExists = true;
|
networkSupportingLbExists = true;
|
||||||
}
|
else
|
||||||
|
networkSupportingLbExists = false;
|
||||||
|
|
||||||
|
//???
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('listNetworkOfferings'),
|
||||||
|
data: {
|
||||||
|
forvpc: true,
|
||||||
|
zoneid: args.zoneId,
|
||||||
|
guestiptype: 'Isolated',
|
||||||
|
supportedServices: 'SourceNat',
|
||||||
|
specifyvlan: false,
|
||||||
|
state: 'Enabled'
|
||||||
|
},
|
||||||
|
success: function(json) {
|
||||||
|
var networkOfferings = json.listnetworkofferingsresponse.networkoffering;
|
||||||
|
|
||||||
|
var items;
|
||||||
|
if(networkSupportingLbExists == true) {
|
||||||
|
items = $.grep(networkOfferings, function(networkOffering) {
|
||||||
|
var includingLbService = false;
|
||||||
|
$(networkOffering.service).each(function(){
|
||||||
|
var thisService = this;
|
||||||
|
if(thisService.name == "Lb") {
|
||||||
|
includingLbService = true;
|
||||||
|
return false; //break $.each() loop
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return !includingLbService;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
items = networkOfferings;
|
||||||
|
}
|
||||||
|
|
||||||
|
args.response.success({
|
||||||
|
data: $.map(items, function(item) {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
description: item.name
|
||||||
|
};
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//???
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: createURL('listNetworkOfferings'),
|
|
||||||
data: {
|
|
||||||
forvpc: true,
|
|
||||||
zoneid: args.zoneId,
|
|
||||||
guestiptype: 'Isolated',
|
|
||||||
supportedServices: 'SourceNat',
|
|
||||||
specifyvlan: false,
|
|
||||||
state: 'Enabled'
|
|
||||||
},
|
|
||||||
success: function(json) {
|
|
||||||
var networkOfferings = json.listnetworkofferingsresponse.networkoffering;
|
|
||||||
args.response.success({
|
|
||||||
data: $.map(networkOfferings, function(zone) {
|
|
||||||
return {
|
|
||||||
id: zone.id,
|
|
||||||
description: zone.name
|
|
||||||
};
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gateway: {
|
gateway: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue