Skip to content

Commit 1d7fc2a

Browse files
committed
Suggestion for CIDR in placeholder instead of input
1 parent 6aa691c commit 1d7fc2a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

ui/public/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@
576576
"label.create.template": "Create Template",
577577
"label.create.tier.aclid.description": "The ACL associated with the Network Tier.",
578578
"label.create.tier.externalid.description": "ID of the Network in an external system.",
579-
"label.create.tier.gateway.description": "The Network Tier's gateway in the super CIDR range, not overlapping with the CIDR of other Network Tiers in this VPC.",
579+
"label.create.tier.gateway.description": "Gateway in range of VPC CIDR ({value})",
580580
"label.create.tier.name.description": "A unique name for the Network Tier.",
581-
"label.create.tier.netmask.description": "The Network Tier's netmask. For example 255.255.255.0",
581+
"label.create.tier.netmask.description": "The Network Tier's netmask. Your current is {value}",
582582
"label.create.tier.networkofferingid.description": "The Network offering for the Network Tier.",
583583
"label.create.tungsten.routing.policy": "Create Tungsten-Fabric routing policy",
584584
"label.create.user": "Create User",

ui/src/views/network/VpcTiersTab.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,18 @@
223223
</a-form-item>
224224
<a-form-item ref="gateway" name="gateway" :colon="false">
225225
<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"/>
227227
</template>
228228
<a-input
229-
:placeholder="$t('label.create.tier.gateway.description')"
229+
:placeholder="gatewayPlaceholder"
230230
v-model:value="form.gateway"></a-input>
231231
</a-form-item>
232232
<a-form-item ref="netmask" name="netmask" :colon="false">
233233
<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"/>
235235
</template>
236236
<a-input
237-
:placeholder="$t('label.create.tier.netmask.description')"
237+
:placeholder="netmaskPlaceholder"
238238
v-model:value="form.netmask"></a-input>
239239
</a-form-item>
240240
<a-form-item ref="externalId" name="externalId" :colon="false">
@@ -381,6 +381,8 @@ export default {
381381
selectedNetworkOffering: {},
382382
privateMtuMax: 1500,
383383
errorPrivateMtu: '',
384+
gatewayPlaceholder: '',
385+
netmaskPlaceholder: '',
384386
algorithms: {
385387
Source: 'source',
386388
'Round-robin': 'roundrobin',
@@ -620,8 +622,6 @@ export default {
620622
const cidr = this.resource.cidr
621623
if (cidr && cidr.includes('/')) {
622624
const [address, maskBits] = cidr.split('/')
623-
this.form.gateway = address
624-
625625
const prefix = Number(maskBits)
626626
627627
const subnetMasks = {
@@ -652,8 +652,13 @@ export default {
652652
32: '255.255.255.255'
653653
}
654654
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 })
656660
}
661+
657662
this.showCreateNetworkModal = true
658663
this.rules = {
659664
name: [{ required: true, message: this.$t('label.required') }],

0 commit comments

Comments
 (0)