From 554b2b9f72c9ba8b3cfc307444fbe1326f378d47 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Tue, 2 Jan 2024 15:43:50 +0800 Subject: [PATCH] fix: move "import data" to dropdown of add button --- frontend/src/components/icons/Checkbox.vue | 34 +++++++++ frontend/src/components/icons/Down.vue | 21 +++++ .../src/components/sidebar/BrowserPane.vue | 76 ++++++++++--------- 3 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 frontend/src/components/icons/Checkbox.vue create mode 100644 frontend/src/components/icons/Down.vue diff --git a/frontend/src/components/icons/Checkbox.vue b/frontend/src/components/icons/Checkbox.vue new file mode 100644 index 0000000..7059b8d --- /dev/null +++ b/frontend/src/components/icons/Checkbox.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/frontend/src/components/icons/Down.vue b/frontend/src/components/icons/Down.vue new file mode 100644 index 0000000..d2020a0 --- /dev/null +++ b/frontend/src/components/icons/Down.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/frontend/src/components/sidebar/BrowserPane.vue b/frontend/src/components/sidebar/BrowserPane.vue index 60bb8d6..08ebf6e 100644 --- a/frontend/src/components/sidebar/BrowserPane.vue +++ b/frontend/src/components/sidebar/BrowserPane.vue @@ -20,12 +20,13 @@ import RedisTypeSelector from '@/components/common/RedisTypeSelector.vue' import { types } from '@/consts/support_redis_type.js' import Plus from '@/components/icons/Plus.vue' import useConnectionStore from 'stores/connections.js' -import ListCheckbox from '@/components/icons/ListCheckbox.vue' import Close from '@/components/icons/Close.vue' import More from '@/components/icons/More.vue' import Export from '@/components/icons/Export.vue' import { ConnectionType } from '@/consts/connection_type.js' import Import from '@/components/icons/Import.vue' +import Down from '@/components/icons/Down.vue' +import Checkbox from '@/components/icons/Checkbox.vue' const props = defineProps({ server: String, @@ -63,18 +64,20 @@ const dbSelectOptions = computed(() => { }) }) -const moreOptions = computed(() => { - return [ - { key: 'import', label: i18n.t('interface.import_key'), icon: render.renderIcon(Import, { strokeWidth: 3.5 }) }, - { key: 'divider', type: 'divider' }, - { key: 'flush', label: i18n.t('interface.flush_db'), icon: render.renderIcon(Delete, { strokeWidth: 3.5 }) }, - { - key: 'disconnect', - label: i18n.t('interface.disconnect'), - icon: render.renderIcon(Unlink, { strokeWidth: 3.5 }), - }, - ] -}) +const addOptions = computed(() => [ + { key: 'import', label: i18n.t('interface.import_key'), icon: render.renderIcon(Import, { strokeWidth: 3.5 }) }, +]) + +const moreOptions = computed(() => [ + // { key: 'import', label: i18n.t('interface.import_key'), icon: render.renderIcon(Import, { strokeWidth: 3.5 }) }, + { key: 'flush', label: i18n.t('interface.flush_db'), icon: render.renderIcon(Delete, { strokeWidth: 3.5 }) }, + { key: 'divider', type: 'divider' }, + { + key: 'disconnect', + label: i18n.t('interface.disconnect'), + icon: render.renderIcon(Unlink, { strokeWidth: 3.5 }), + }, +]) const loadProgress = computed(() => { const db = browserStore.getDatabase(props.server, props.db) @@ -258,27 +261,32 @@ onMounted(() => onReload()) + - - - {{ $t('interface.reload') }} - - - - {{ $t('interface.new_key') }} - + + + + + + + + @@ -343,7 +351,7 @@ onMounted(() => onReload())