From cbf7dd00cfd49766223d9dc9a65e6c00bb5d6ebf Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 4 Aug 2025 11:01:45 +0800 Subject: [PATCH] fix: Uploading attachments for conversation allows for direct conversation --- .../system-resource-management/application.ts | 21 +++ .../component/chat-input-operate/index.vue | 2 + ui/src/locales/lang/en-US/ai-chat.ts | 1 + ui/src/locales/lang/zh-CN/ai-chat.ts | 1 + ui/src/locales/lang/zh-Hant/ai-chat.ts | 1 + ui/src/views/chat-user/index.vue | 145 +++++++----------- 6 files changed, 79 insertions(+), 92 deletions(-) diff --git a/ui/src/api/system-resource-management/application.ts b/ui/src/api/system-resource-management/application.ts index 72155d00c..9e94c8ccd 100644 --- a/ui/src/api/system-resource-management/application.ts +++ b/ui/src/api/system-resource-management/application.ts @@ -80,6 +80,26 @@ const putAccessToken: ( return put(`${prefix}/${application_id}/access_token`, data, undefined, loading) } +/** + * 替换社区版-修改AccessToken + * @param 参数 application_id + * data { + * "show_source": boolean, + * "show_history": boolean, + * "draggable": boolean, + * "show_guide": boolean, + * "avatar": file, + * "float_icon": file, + * } + */ +const putXpackAccessToken: ( + application_id: string, + data: any, + loading?: Ref, +) => Promise> = (application_id, data, loading) => { + return put(`${prefix}/${application_id}/setting`, data, undefined, loading) +} + /** * 统计 * @param 参数 application_id, data @@ -282,4 +302,5 @@ export default { postTextToSpeech, speechToText, getMcpTools, + putXpackAccessToken } diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index 9faf009bd..7560e549f 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -454,6 +454,8 @@ const uploadFile = async (file: any, fileList: any) => { }) if (!inputValue.value && uploadImageList.value.length > 0) { inputValue.value = t('chat.uploadFile.imageMessage') + } else { + inputValue.value = t('chat.uploadFile.fileMessage') } } // 粘贴处理 diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index a8f620a98..3299c500b 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -67,6 +67,7 @@ export default { limitMessage2: 'files', sizeLimit: 'Each file must not exceed', imageMessage: 'Please process the image content', + fileMessage: 'Please process the file content', errorMessage: 'Upload Failed', }, executionDetails: { diff --git a/ui/src/locales/lang/zh-CN/ai-chat.ts b/ui/src/locales/lang/zh-CN/ai-chat.ts index 97b71513d..398d8f790 100644 --- a/ui/src/locales/lang/zh-CN/ai-chat.ts +++ b/ui/src/locales/lang/zh-CN/ai-chat.ts @@ -69,6 +69,7 @@ export default { limitMessage2: '个文件', sizeLimit: '单个文件大小不能超过', imageMessage: '请解析图片内容', + fileMessage: '请解析文件内容', errorMessage: '上传失败', }, executionDetails: { diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index 1f8222b8a..bc0a3551f 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -65,6 +65,7 @@ export default { limitMessage2: '個文件', sizeLimit: '單個文件大小不能超過', imageMessage: '請解析圖片內容', + fileMessage: '請解析文件內容', errorMessage: '上傳失敗', }, executionDetails: { diff --git a/ui/src/views/chat-user/index.vue b/ui/src/views/chat-user/index.vue index 6f880838e..6bfa70835 100644 --- a/ui/src/views/chat-user/index.vue +++ b/ui/src/views/chat-user/index.vue @@ -47,41 +47,43 @@

{{ current?.name || '-' }}

- + - + {{ paginationConfig.total }}
- - {{ t('common.save') }} - +
{{ $t('views.chatUser.autoAuthorization') }}
+ +
-
-
{{ $t('views.chatUser.autoAuthorization') }}
- -
+ {{ t('common.save') }} +
- +