|
223 | 223 | </a-form-item> |
224 | 224 | <a-form-item ref="gateway" name="gateway" :colon="false"> |
225 | 225 | <template #label> |
226 | | - <tooltip-label :title="$t('label.gateway')" :tooltip="$t('label.create.tier.gateway.description')"/> |
| 226 | + <tooltip-label :title="$t('label.gateway')" :tooltip="gatewayPlaceholder"/> |
227 | 227 | </template> |
228 | 228 | <a-input |
229 | | - :placeholder="$t('label.create.tier.gateway.description')" |
| 229 | + :placeholder="gatewayPlaceholder" |
230 | 230 | v-model:value="form.gateway"></a-input> |
231 | 231 | </a-form-item> |
232 | 232 | <a-form-item ref="netmask" name="netmask" :colon="false"> |
233 | 233 | <template #label> |
234 | | - <tooltip-label :title="$t('label.netmask')" :tooltip="$t('label.create.tier.netmask.description')"/> |
| 234 | + <tooltip-label :title="$t('label.netmask')" :tooltip="netmaskPlaceholder"/> |
235 | 235 | </template> |
236 | 236 | <a-input |
237 | | - :placeholder="$t('label.create.tier.netmask.description')" |
| 237 | + :placeholder="netmaskPlaceholder" |
238 | 238 | v-model:value="form.netmask"></a-input> |
239 | 239 | </a-form-item> |
240 | 240 | <a-form-item ref="externalId" name="externalId" :colon="false"> |
@@ -381,6 +381,8 @@ export default { |
381 | 381 | selectedNetworkOffering: {}, |
382 | 382 | privateMtuMax: 1500, |
383 | 383 | errorPrivateMtu: '', |
| 384 | + gatewayPlaceholder: '', |
| 385 | + netmaskPlaceholder: '', |
384 | 386 | algorithms: { |
385 | 387 | Source: 'source', |
386 | 388 | 'Round-robin': 'roundrobin', |
@@ -620,8 +622,6 @@ export default { |
620 | 622 | const cidr = this.resource.cidr |
621 | 623 | if (cidr && cidr.includes('/')) { |
622 | 624 | const [address, maskBits] = cidr.split('/') |
623 | | - this.form.gateway = address |
624 | | -
|
625 | 625 | const prefix = Number(maskBits) |
626 | 626 |
|
627 | 627 | const subnetMasks = { |
@@ -652,8 +652,13 @@ export default { |
652 | 652 | 32: '255.255.255.255' |
653 | 653 | } |
654 | 654 |
|
655 | | - this.form.netmask = subnetMasks[prefix] || '255.255.255.0' |
| 655 | + const cidrValue = `${address}/${maskBits}` |
| 656 | + const netmask = subnetMasks[prefix] || '255.255.255.0' |
| 657 | +
|
| 658 | + this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidrValue }) |
| 659 | + this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) |
656 | 660 | } |
| 661 | +
|
657 | 662 | this.showCreateNetworkModal = true |
658 | 663 | this.rules = { |
659 | 664 | name: [{ required: true, message: this.$t('label.required') }], |
|
0 commit comments