From 2067454537b9c8096a07bc49ae66b7dd54278b54 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Mon, 23 Nov 2020 16:55:14 +0700 Subject: [PATCH] FIX - Detail setting tab interface (#861) * fixes detail setting tab interface * autofocus to the key Signed-off-by: Rohit Yadav --- ui/src/components/view/DetailSettings.vue | 73 +++++++++++++++++------ 1 file changed, 56 insertions(+), 17 deletions(-) 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 } } } + +