mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: Fix VPC network offerings listing on VPC tier creation (#9557)
This commit is contained in:
parent
a8ab47bb27
commit
a385ff1a21
@ -522,7 +522,7 @@ export default {
|
||||
}).then(async json => {
|
||||
var lbNetworks = json.listnetworksresponse.network || []
|
||||
if (lbNetworks.length > 0) {
|
||||
this.publicLBExists = true
|
||||
this.publicLBExists = false
|
||||
for (var idx = 0; idx < lbNetworks.length; idx++) {
|
||||
const lbNetworkOffering = await this.getNetworkOffering(lbNetworks[idx].networkofferingid)
|
||||
const index = lbNetworkOffering.service.map(svc => { return svc.name }).indexOf('Lb')
|
||||
@ -546,16 +546,23 @@ export default {
|
||||
}).then(json => {
|
||||
this.networkOfferings = json.listnetworkofferingsresponse.networkoffering || []
|
||||
var filteredOfferings = []
|
||||
if (this.publicLBExists) {
|
||||
for (var index in this.networkOfferings) {
|
||||
const offering = this.networkOfferings[index]
|
||||
const idx = offering.service.map(svc => { return svc.name }).indexOf('Lb')
|
||||
if (idx === -1 || this.lbProviderMap.publicLb.vpc.indexOf(offering.service.map(svc => { return svc.provider[0].name })[idx]) === -1) {
|
||||
const vpcLbServiceIndex = this.resource.service.map(svc => { return svc.name }).indexOf('Lb')
|
||||
for (var index in this.networkOfferings) {
|
||||
const offering = this.networkOfferings[index]
|
||||
const idx = offering.service.map(svc => { return svc.name }).indexOf('Lb')
|
||||
if (this.publicLBExists && (idx === -1 || this.lbProviderMap.publicLb.vpc.indexOf(offering.service.map(svc => { return svc.provider[0].name })[idx]) === -1)) {
|
||||
filteredOfferings.push(offering)
|
||||
} else if (!this.publicLBExists && vpcLbServiceIndex > -1) {
|
||||
const vpcLbServiceProvider = vpcLbServiceIndex === -1 ? undefined : this.resource.service[vpcLbServiceIndex].provider[0].name
|
||||
const offeringLbServiceProvider = idx === -1 ? undefined : offering.service[idx].provider[0].name
|
||||
if (vpcLbServiceProvider && (!offeringLbServiceProvider || (offeringLbServiceProvider && vpcLbServiceProvider === offeringLbServiceProvider))) {
|
||||
filteredOfferings.push(offering)
|
||||
}
|
||||
} else {
|
||||
filteredOfferings.push(offering)
|
||||
}
|
||||
this.networkOfferings = filteredOfferings
|
||||
}
|
||||
this.networkOfferings = filteredOfferings
|
||||
this.form.networkOffering = this.networkOfferings[0].id
|
||||
}).catch(error => {
|
||||
this.$notifyError(error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user