|
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"> |
@@ -344,6 +344,7 @@ import { api } from '@/api' |
344 | 344 | import { mixinForm } from '@/utils/mixin' |
345 | 345 | import Status from '@/components/widgets/Status' |
346 | 346 | import TooltipLabel from '@/components/widgets/TooltipLabel' |
| 347 | +import { getNetmaskFromCidr } from '@/utils/network' |
347 | 348 |
|
348 | 349 | export default { |
349 | 350 | name: 'VpcTiersTab', |
@@ -381,6 +382,8 @@ export default { |
381 | 382 | selectedNetworkOffering: {}, |
382 | 383 | privateMtuMax: 1500, |
383 | 384 | errorPrivateMtu: '', |
| 385 | + gatewayPlaceholder: '', |
| 386 | + netmaskPlaceholder: '', |
384 | 387 | algorithms: { |
385 | 388 | Source: 'source', |
386 | 389 | 'Round-robin': 'roundrobin', |
@@ -617,6 +620,13 @@ export default { |
617 | 620 | this.initForm() |
618 | 621 | this.fetchNetworkAclList() |
619 | 622 | this.fetchNetworkOfferings() |
| 623 | + const cidr = this.resource.cidr |
| 624 | + const netmask = getNetmaskFromCidr(cidr) |
| 625 | + if (netmask) { |
| 626 | + this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidr }) |
| 627 | + this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) |
| 628 | + } |
| 629 | +
|
620 | 630 | this.showCreateNetworkModal = true |
621 | 631 | this.rules = { |
622 | 632 | name: [{ required: true, message: this.$t('label.required') }], |
|
0 commit comments