ui: fix add management ip range form (#5427)

Add management IP range form shows same pod multiple times when the pods has multiple IP ranges.
This PR fixes the behaviour.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2021-09-10 19:02:32 +05:30 committed by GitHub
parent 35efdd1842
commit 8baf384359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@
rules: [{ required: true, message: `${$t('label.required')}` }]
}]"
>
<a-select-option v-for="item in items" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
<a-select-option v-for="item in pods" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item :label="$t('label.gateway')" class="form__item">
@ -144,6 +144,7 @@ export default {
return {
componentLoading: false,
items: [],
pods: [],
total: 0,
domains: [],
domainsLoading: false,
@ -215,8 +216,8 @@ export default {
}).then(response => {
this.items = []
this.total = response.listpodsresponse.count || 0
const pods = response.listpodsresponse.pod ? response.listpodsresponse.pod : []
for (const pod of pods) {
this.pods = response.listpodsresponse.pod ? response.listpodsresponse.pod : []
for (const pod of this.pods) {
if (pod && pod.startip && pod.startip.length > 0) {
for (var idx = 0; idx < pod.startip.length; idx++) {
this.items.push({