diff --git a/ui/src/components/view/DetailSettings.vue b/ui/src/components/view/DetailSettings.vue index 2866d138bfe..c5aec61b7d4 100644 --- a/ui/src/components/view/DetailSettings.vue +++ b/ui/src/components/view/DetailSettings.vue @@ -28,28 +28,44 @@ style="width: 100%" icon="plus" :disabled="!('updateTemplate' in $store.getters.apis && 'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner())" - @click="showAddDetail = true"> + @click="onShowAddDetail"> {{ $t('label.add.setting') }}
- - + + + + + + + + + + + + +

{{ $t(error) }}

- {{ $t('label.add.setting') }} - {{ $t('label.cancel') }}
@@ -169,6 +185,7 @@ export default { this.$set(this.details, index, this.details[index]) }, onAddInputChange (val, obj) { + this.error = false this[obj] = val }, isAdminOrOwner () { @@ -234,7 +251,29 @@ export default { deleteDetail (index) { this.details.splice(index, 1) this.runApi() + }, + onShowAddDetail () { + this.showAddDetail = true + setTimeout(() => { + this.$refs.keyElm.focus() + }) + }, + closeDetail () { + this.newKey = '' + this.newValue = '' + this.error = false + this.showAddDetail = false } } } + +