diff --git a/ui/src/views/image/RegisterOrUploadIso.vue b/ui/src/views/image/RegisterOrUploadIso.vue index 501d52848cc..b244a2bda52 100644 --- a/ui/src/views/image/RegisterOrUploadIso.vue +++ b/ui/src/views/image/RegisterOrUploadIso.vue @@ -91,14 +91,7 @@ :loading="zoneLoading" :placeholder="apiParams.zoneid.description"> - - - {{ opt.name || opt.description }} - - - - {{ opt.name || opt.description }} - + {{ opt.name || opt.description }} @@ -205,7 +198,7 @@ export default { }, created () { this.zones = [] - if (this.$store.getters.userInfo.roletype === 'Admin') { + if (this.$store.getters.userInfo.roletype === 'Admin' && this.currentForm === 'Create') { this.zones = [ { id: '-1', @@ -235,7 +228,7 @@ export default { this.zones = this.zones.concat(listZones) }).finally(() => { this.zoneLoading = false - this.selectedZone = this.currentForm === 'Create' ? (this.zones[0].id ? this.zones[0].id : '') : ((this.zones[1].id) ? this.zones[1].id : '') + this.selectedZone = (this.zones[0].id ? this.zones[0].id : '') }) }, fetchOsType () { diff --git a/ui/src/views/image/RegisterOrUploadTemplate.vue b/ui/src/views/image/RegisterOrUploadTemplate.vue index 19d85fc4e8d..d0b46892bc7 100644 --- a/ui/src/views/image/RegisterOrUploadTemplate.vue +++ b/ui/src/views/image/RegisterOrUploadTemplate.vue @@ -95,6 +95,10 @@ }]" :loading="zones.loading" mode="multiple" + optionFilterProp="children" + :filterOption="(input, option) => { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }" :placeholder="apiParams.zoneids.description" @change="handlerSelectZone"> @@ -122,13 +126,16 @@ } ] }]" + showSearch + optionFilterProp="children" + :filterOption="(input, option) => { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }" @change="handlerSelectZone" :placeholder="apiParams.zoneid.description" :loading="zones.loading"> - - {{ zone.name || zone.description }} - + {{ zone.name || zone.description }} @@ -517,7 +524,7 @@ export default { this.allowed = false - if (store.getters.userInfo.roletype === this.rootAdmin) { + if (store.getters.userInfo.roletype === this.rootAdmin && this.currentForm === 'Create') { this.allowed = true listZones.push({ id: this.$t('label.all.zone'),