From f646102262fd269accccfbe0e07607b1cbcb7f64 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 22 Apr 2025 16:20:01 +0800 Subject: [PATCH] fix: update file upload settings to allow dynamic video extensions and improve input handling for other file types --- .../ai-chat/component/chat-input-operate/index.vue | 2 +- .../base-node/component/FileUploadSettingDialog.vue | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) 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 53d182f92..de004b52e 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 @@ -345,7 +345,7 @@ const upload = ref() const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] const documentExtensions = ['pdf', 'docx', 'txt', 'xls', 'xlsx', 'md', 'html', 'csv'] -const videoExtensions = ['mp4', 'avi', 'mov', 'mkv', 'flv'] +const videoExtensions: any = [] const audioExtensions = ['mp3', 'wav', 'ogg', 'aac', 'm4a'] let otherExtensions = ['ppt', 'doc'] diff --git a/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue b/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue index f05171439..966f4c8b3 100644 --- a/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue +++ b/ui/src/workflow/nodes/base-node/component/FileUploadSettingDialog.vue @@ -56,7 +56,7 @@

{{ $t('common.fileUpload.document') }} {{ + >{{ $t( 'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText' ) @@ -86,7 +86,7 @@

{{ $t('common.fileUpload.image') }} {{ + >{{ $t( 'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText' ) @@ -114,7 +114,7 @@

{{ $t('common.fileUpload.audio') }} {{ + >{{ $t( 'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText' ) @@ -141,7 +141,7 @@

{{ $t('common.fileUpload.other') }} {{ + >{{ $t( 'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText' ) @@ -244,6 +244,11 @@ const showInput = () => { } const handleInputConfirm = () => { if (inputValue.value) { + if (form_data.value.otherExtensions.includes(inputValue.value)) { + inputVisible.value = false + inputValue.value = '' + return + } form_data.value.otherExtensions.push(inputValue.value) } inputVisible.value = false