From b81e14b3141130418d72c23782525097f06fe298 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Fri, 30 Jan 2026 18:15:54 +0800 Subject: [PATCH] feat: add video processing toast --- static/src/app.ts | 9 +++++++++ static/src/composables/useLegacySocket.ts | 9 +++++++++ static/src/stores/monitor.ts | 1 + static/src/stores/upload.ts | 11 +++++++++++ 4 files changed, 30 insertions(+) diff --git a/static/src/app.ts b/static/src/app.ts index 9f7e218..89fc661 100644 --- a/static/src/app.ts +++ b/static/src/app.ts @@ -2471,6 +2471,15 @@ const appOptions = { return; } + if (hasVideos) { + this.uiPushToast({ + title: '视频处理中', + message: '读取视频需要较长时间,请耐心等待', + type: 'info', + duration: 5000 + }); + } + const message = text; const isCommand = hasText && !hasImages && !hasVideos && message.startsWith('/'); if (isCommand) { diff --git a/static/src/composables/useLegacySocket.ts b/static/src/composables/useLegacySocket.ts index c9c57b8..d5d9215 100644 --- a/static/src/composables/useLegacySocket.ts +++ b/static/src/composables/useLegacySocket.ts @@ -1168,6 +1168,15 @@ export async function initializeLegacySocket(ctx: any) { ctx.$forceUpdate(); ctx.conditionalScrollToBottom(); ctx.monitorQueueTool(data); + + if (data.name === 'view_video' && typeof ctx.uiPushToast === 'function') { + ctx.uiPushToast({ + title: '视频读取中', + message: '读取视频需要较长时间,请耐心等待', + type: 'info', + duration: 5000 + }); + } }; handler(); diff --git a/static/src/stores/monitor.ts b/static/src/stores/monitor.ts index 6dccaef..2f04124 100644 --- a/static/src/stores/monitor.ts +++ b/static/src/stores/monitor.ts @@ -94,6 +94,7 @@ const TOOL_SCENE_MAP: Record = { extract_webpage: 'webExtract', save_webpage: 'webSave', read_file: 'reader', + view_video: 'reader', vlm_analyze: 'ocr', ocr_image: 'ocr', create_folder: 'createFolder', diff --git a/static/src/stores/upload.ts b/static/src/stores/upload.ts index 7ee5287..ee26a6a 100644 --- a/static/src/stores/upload.ts +++ b/static/src/stores/upload.ts @@ -42,6 +42,17 @@ export const useUploadStore = defineStore('upload', { } const uiStore = useUiStore(); const fileStore = useFileStore(); + const isVideoFile = + (file.type && file.type.startsWith('video/')) || + /\.(mp4|mov|m4v|webm|avi|mkv|flv|mpg|mpeg)$/i.test(file.name || ''); + if (isVideoFile) { + uiStore.pushToast({ + title: '视频处理中', + message: '读取视频需要较长时间,请耐心等待', + type: 'info', + duration: 5000 + }); + } this.setUploading(true); const toastId = uiStore.pushToast({ title: '上传文件',