From 24412530a550b412be0ecb7d0b382f43f4f05b42 Mon Sep 17 00:00:00 2001 From: bingryan <41174435+bingryan@users.noreply.github.com> Date: Sun, 18 Jun 2023 21:29:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20clear=20menu=20for?= =?UTF-8?q?=20sidebar=20(#54)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 1 + src/locales/zh-CN.ts | 1 + src/views/siderbar/List.vue | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 4d46d17..d8ecaea 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -26,6 +26,7 @@ export default { common: { edit: 'Edit', delete: 'Delete', + clear: 'Clear', copy: 'Copy', copyQA: 'CopyQA', newChat: 'New Chat', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index aa4698a..607a2c9 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -26,6 +26,7 @@ export default { common: { edit: '编辑', delete: '删除', + clear: '清理', copy: '复制', copyQA: '复制QA', newChat: '新建聊天', diff --git a/src/views/siderbar/List.vue b/src/views/siderbar/List.vue index c4dd1ff..8fbc366 100644 --- a/src/views/siderbar/List.vue +++ b/src/views/siderbar/List.vue @@ -75,6 +75,10 @@ }); } + async function clearSelect(id: number) { + await chatStore.clearCache(id); + } + const contextMenuTheme = computed(() => { return appStore.theme === 'dark' ? 'mac dark' : 'mac'; }); @@ -98,6 +102,13 @@ }), onClick: () => editSelect(id), }, + { + label: t('common.clear'), + icon: h('i', { + class: 'fa-solid fa-broom', + }), + onClick: () => clearSelect(id), + }, ], zIndex: 60, minWidth: 100,