From bb3316a67a00dcee6deaa2ca92dc6fd8a1ff0c06 Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:00:02 +0800 Subject: [PATCH] perf: moved all labels in form item to the top for adjust long text --- .../content_value/ContentValueString.vue | 2 +- .../components/dialogs/AddFieldsDialog.vue | 10 +------- .../components/dialogs/ConnectionDialog.vue | 21 ++--------------- .../components/dialogs/DeleteKeyDialog.vue | 8 +------ .../src/components/dialogs/GroupDialog.vue | 8 +------ .../components/dialogs/KeyFilterDialog.vue | 5 +--- .../src/components/dialogs/NewKeyDialog.vue | 5 +--- .../components/dialogs/PreferencesDialog.vue | 23 ++++--------------- .../components/dialogs/RenameKeyDialog.vue | 4 ++-- .../src/components/dialogs/SetTtlDialog.vue | 9 +------- frontend/src/langs/en.json | 1 - frontend/src/langs/zh-cn.json | 1 - frontend/src/utils/theme.js | 17 ++++++++++++++ 13 files changed, 32 insertions(+), 82 deletions(-) diff --git a/frontend/src/components/content_value/ContentValueString.vue b/frontend/src/components/content_value/ContentValueString.vue index 312ca4f..f6fffbe 100644 --- a/frontend/src/components/content_value/ContentValueString.vue +++ b/frontend/src/components/content_value/ContentValueString.vue @@ -199,7 +199,7 @@ const onSaveValue = async () => { - {{ $t('cancel_update') }} + {{ $t('cancel') }} diff --git a/frontend/src/components/dialogs/AddFieldsDialog.vue b/frontend/src/components/dialogs/AddFieldsDialog.vue index 3234ba2..89c6052 100644 --- a/frontend/src/components/dialogs/AddFieldsDialog.vue +++ b/frontend/src/components/dialogs/AddFieldsDialog.vue @@ -24,7 +24,6 @@ const newForm = reactive({ reload: true, }) -const formLabelWidth = '60px' const addValueComponent = { [types.STRING]: NewStringValue, [types.HASH]: AddHashValue, @@ -202,14 +201,7 @@ const onClose = () => { @negative-click="onClose" > - + diff --git a/frontend/src/components/dialogs/ConnectionDialog.vue b/frontend/src/components/dialogs/ConnectionDialog.vue index cc8c33c..24beefc 100644 --- a/frontend/src/components/dialogs/ConnectionDialog.vue +++ b/frontend/src/components/dialogs/ConnectionDialog.vue @@ -52,19 +52,6 @@ const tab = ref('general') const testing = ref(false) const showTestResult = ref(false) const testResult = ref('') -const showTestConnSuccResult = computed(() => { - return isEmpty(testResult.value) && showTestResult.value === true -}) -const showTestConnFailResult = computed(() => { - return !isEmpty(testResult.value) && showTestResult.value === true -}) -const formLabelWidth = computed(() => { - // compatible with long english word - if (tab.value === 'advanced' && i18n.locale.value === 'en') { - return '140px' - } - return '80px' -}) const predefineColors = ref(['', '#F75B52', '#F7A234', '#F7CE33', '#4ECF60', '#348CF7', '#B270D3']) const generalFormRef = ref(null) const advanceFormRef = ref(null) @@ -163,12 +150,10 @@ const onClose = () => { @@ -203,12 +188,10 @@ const onClose = () => { { preset="dialog" transform-origin="center" > - + diff --git a/frontend/src/components/dialogs/GroupDialog.vue b/frontend/src/components/dialogs/GroupDialog.vue index 19b1aac..536e178 100644 --- a/frontend/src/components/dialogs/GroupDialog.vue +++ b/frontend/src/components/dialogs/GroupDialog.vue @@ -80,13 +80,7 @@ const onClose = () => { @positive-click="onConfirm" @negative-click="onClose" > - + diff --git a/frontend/src/components/dialogs/KeyFilterDialog.vue b/frontend/src/components/dialogs/KeyFilterDialog.vue index cc0eab4..9858806 100644 --- a/frontend/src/components/dialogs/KeyFilterDialog.vue +++ b/frontend/src/components/dialogs/KeyFilterDialog.vue @@ -25,7 +25,6 @@ const typeOptions = computed(() => { return options }) -const formLabelWidth = '100px' const dialogStore = useDialog() watch( () => dialogStore.keyFilterDialogVisible, @@ -72,11 +71,9 @@ const onClose = () => { > diff --git a/frontend/src/components/dialogs/NewKeyDialog.vue b/frontend/src/components/dialogs/NewKeyDialog.vue index efcf52c..a3ecd0d 100644 --- a/frontend/src/components/dialogs/NewKeyDialog.vue +++ b/frontend/src/components/dialogs/NewKeyDialog.vue @@ -41,7 +41,6 @@ const dbOptions = computed(() => const newFormRef = ref(null) const subFormRef = ref(null) -const formLabelWidth = '100px' const options = computed(() => { return Object.keys(types).map((t) => ({ value: t, @@ -157,12 +156,10 @@ const onClose = () => { diff --git a/frontend/src/components/dialogs/PreferencesDialog.vue b/frontend/src/components/dialogs/PreferencesDialog.vue index e97c633..5d4c73f 100644 --- a/frontend/src/components/dialogs/PreferencesDialog.vue +++ b/frontend/src/components/dialogs/PreferencesDialog.vue @@ -9,7 +9,6 @@ const prefStore = usePreferencesStore() const prevPreferences = ref({}) const tab = ref('general') -const formLabelWidth = '80px' const dialogStore = useDialog() const i18n = useI18n() const message = useMessage() @@ -76,14 +75,7 @@ const onClose = () => { - + @@ -123,14 +115,7 @@ const onClose = () => { - + @@ -144,8 +129,8 @@ const onClose = () => {