|
242 | 242 | </a-form-item> |
243 | 243 | <a-form-item ref="gateway" name="gateway" :colon="false"> |
244 | 244 | <template #label> |
245 | | - <tooltip-label :title="$t('label.gateway')" :tooltip="$t('label.create.tier.gateway.description')"/> |
| 245 | + <tooltip-label :title="$t('label.gateway')" :tooltip="gatewayPlaceholder"/> |
246 | 246 | </template> |
247 | 247 | <a-input |
248 | | - :placeholder="$t('label.create.tier.gateway.description')" |
| 248 | + :placeholder="gatewayPlaceholder" |
249 | 249 | v-model:value="form.gateway"></a-input> |
250 | 250 | </a-form-item> |
251 | 251 | <a-form-item ref="netmask" name="netmask" :colon="false"> |
252 | 252 | <template #label> |
253 | | - <tooltip-label :title="$t('label.netmask')" :tooltip="$t('label.create.tier.netmask.description')"/> |
| 253 | + <tooltip-label :title="$t('label.netmask')" :tooltip="netmaskPlaceholder"/> |
254 | 254 | </template> |
255 | 255 | <a-input |
256 | | - :placeholder="$t('label.create.tier.netmask.description')" |
| 256 | + :placeholder="netmaskPlaceholder" |
257 | 257 | v-model:value="form.netmask"></a-input> |
258 | 258 | </a-form-item> |
259 | 259 | <a-form-item ref="externalId" name="externalId" :colon="false"> |
@@ -363,6 +363,7 @@ import { api } from '@/api' |
363 | 363 | import { mixinForm } from '@/utils/mixin' |
364 | 364 | import Status from '@/components/widgets/Status' |
365 | 365 | import TooltipLabel from '@/components/widgets/TooltipLabel' |
| 366 | +import { getNetmaskFromCidr } from '@/utils/network' |
366 | 367 |
|
367 | 368 | export default { |
368 | 369 | name: 'VpcTiersTab', |
@@ -400,6 +401,8 @@ export default { |
400 | 401 | selectedNetworkOffering: {}, |
401 | 402 | privateMtuMax: 1500, |
402 | 403 | errorPrivateMtu: '', |
| 404 | + gatewayPlaceholder: '', |
| 405 | + netmaskPlaceholder: '', |
403 | 406 | algorithms: { |
404 | 407 | Source: 'source', |
405 | 408 | 'Round-robin': 'roundrobin', |
@@ -696,6 +699,13 @@ export default { |
696 | 699 | this.initForm() |
697 | 700 | this.fetchNetworkAclList() |
698 | 701 | this.fetchNetworkOfferings() |
| 702 | + const cidr = this.resource.cidr |
| 703 | + const netmask = getNetmaskFromCidr(cidr) |
| 704 | + if (netmask) { |
| 705 | + this.gatewayPlaceholder = this.$t('label.create.tier.gateway.description', { value: cidr }) |
| 706 | + this.netmaskPlaceholder = this.$t('label.create.tier.netmask.description', { value: netmask }) |
| 707 | + } |
| 708 | +
|
699 | 709 | this.showCreateNetworkModal = true |
700 | 710 | this.rules = { |
701 | 711 | name: [{ required: true, message: this.$t('label.required') }], |
|
0 commit comments