Skip to content

Commit d9503f4

Browse files
author
Hoang Nguyen
authored
UI - Zone Wizard - Fixes the IP range form fields are too narrow (#5287)
* resize form input to not cut text * fix field width on firefox
1 parent 05d1d56 commit d9503f4

1 file changed

Lines changed: 32 additions & 19 deletions

File tree

ui/src/views/infra/zone/IpAddressRangeForm.vue

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
:layout="isMobile() ? 'horizontal': 'inline'"
3838
:form="form"
3939
@submit="handleAddRange">
40-
<a-row :gutter="12">
41-
<a-col :md="4" :lg="4">
40+
<div class="form-row">
41+
<div class="form-col">
4242
<a-form-item>
4343
<a-input
4444
v-decorator="[ 'gateway', {
@@ -48,8 +48,8 @@
4848
autoFocus
4949
/>
5050
</a-form-item>
51-
</a-col>
52-
<a-col :md="4" :lg="4">
51+
</div>
52+
<div class="form-col">
5353
<a-form-item>
5454
<a-input
5555
v-decorator="[ 'netmask', {
@@ -58,16 +58,16 @@
5858
:placeholder="$t('label.netmask')"
5959
/>
6060
</a-form-item>
61-
</a-col>
62-
<a-col :md="4" :lg="4">
61+
</div>
62+
<div class="form-col">
6363
<a-form-item>
6464
<a-input
6565
v-decorator="[ 'vlan', { rules: [{ required: false }] }]"
6666
:placeholder="$t('label.vlan')"
6767
/>
6868
</a-form-item>
69-
</a-col>
70-
<a-col :md="4" :lg="4">
69+
</div>
70+
<div class="form-col">
7171
<a-form-item>
7272
<a-input
7373
v-decorator="[ 'startIp', {
@@ -86,8 +86,8 @@
8686
:placeholder="$t('label.start.ip')"
8787
/>
8888
</a-form-item>
89-
</a-col>
90-
<a-col :md="4" :lg="4">
89+
</div>
90+
<div class="form-col">
9191
<a-form-item>
9292
<a-input
9393
v-decorator="[ 'endIp', {
@@ -105,13 +105,13 @@
105105
:placeholder="$t('label.end.ip')"
106106
/>
107107
</a-form-item>
108-
</a-col>
109-
<a-col :md="4" :lg="4">
110-
<a-form-item :style="{ display: 'inline-block', float: 'right' }">
108+
</div>
109+
<div class="form-col">
110+
<a-form-item :style="{ display: 'inline-block', float: 'right', marginRight: 0 }">
111111
<a-button type="primary" html-type="submit">{{ $t('label.add') }}</a-button>
112112
</a-form-item>
113-
</a-col>
114-
</a-row>
113+
</div>
114+
</div>
115115
</a-form>
116116
</template>
117117
</a-table>
@@ -180,12 +180,12 @@ export default {
180180
{
181181
title: this.$t('label.gateway'),
182182
dataIndex: 'gateway',
183-
width: 150
183+
width: 140
184184
},
185185
{
186186
title: this.$t('label.netmask'),
187187
dataIndex: 'netmask',
188-
width: 150
188+
width: 140
189189
},
190190
{
191191
title: this.$t('label.vlan'),
@@ -195,12 +195,12 @@ export default {
195195
{
196196
title: this.$t('label.start.ip'),
197197
dataIndex: 'startIp',
198-
width: 130
198+
width: 140
199199
},
200200
{
201201
title: this.$t('label.end.ip'),
202202
dataIndex: 'endIp',
203-
width: 130
203+
width: 140
204204
},
205205
{
206206
title: '',
@@ -283,3 +283,16 @@ export default {
283283
}
284284
}
285285
</script>
286+
287+
<style scoped lang="less">
288+
.form-row {
289+
display: grid;
290+
grid-template-columns: 145px 145px 130px 145px 145px 70px;
291+
justify-content: center;
292+
293+
@media (max-width: 768px) {
294+
display: flex;
295+
flex-direction: column;
296+
}
297+
}
298+
</style>

0 commit comments

Comments
 (0)