mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: make vpc cidr required when not showing cidrsize (#11393)
Fixes #11391 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
bd252b5983
commit
f5b4858012
@ -72,7 +72,7 @@
|
|||||||
:placeholder="apiParams.cidr.description"/>
|
:placeholder="apiParams.cidr.description"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
v-if="selectedVpcOffering && selectedVpcOffering.networkmode === 'ROUTED'"
|
v-if="selectedVpcOfferingHavingRoutedNetworkMode"
|
||||||
ref="cidrsize"
|
ref="cidrsize"
|
||||||
name="cidrsize">
|
name="cidrsize">
|
||||||
<template #label>
|
<template #label>
|
||||||
@ -267,6 +267,9 @@ export default {
|
|||||||
return sourcenatService && sourcenatService.length === 1
|
return sourcenatService && sourcenatService.length === 1
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
},
|
||||||
|
selectedVpcOfferingHavingRoutedNetworkMode () {
|
||||||
|
return this.selectedVpcOffering && this.selectedVpcOffering.networkmode === 'ROUTED'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -388,6 +391,7 @@ export default {
|
|||||||
handleVpcOfferingChange (value) {
|
handleVpcOfferingChange (value) {
|
||||||
this.selectedVpcOffering = {}
|
this.selectedVpcOffering = {}
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
this.updateCidrRule()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for (var offering of this.vpcOfferings) {
|
for (var offering of this.vpcOfferings) {
|
||||||
@ -397,9 +401,17 @@ export default {
|
|||||||
if (this.isASNumberRequired()) {
|
if (this.isASNumberRequired()) {
|
||||||
this.fetchZoneASNumbers()
|
this.fetchZoneASNumbers()
|
||||||
}
|
}
|
||||||
return
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.updateCidrRule()
|
||||||
|
},
|
||||||
|
updateCidrRule () {
|
||||||
|
if (!this.selectedVpcOfferingHavingRoutedNetworkMode) {
|
||||||
|
this.rules.cidr = [{ required: true, message: this.$t('message.error.required.input') }]
|
||||||
|
} else {
|
||||||
|
delete this.rules.cidr
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleASNumberChange (selectedIndex) {
|
handleASNumberChange (selectedIndex) {
|
||||||
this.selectedAsNumber = this.asNumbersZone[selectedIndex].asnumber
|
this.selectedAsNumber = this.asNumbersZone[selectedIndex].asnumber
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user