feat: add video processing toast

This commit is contained in:
JOJO 2026-01-30 18:15:54 +08:00
parent bb91d22631
commit b81e14b314
4 changed files with 30 additions and 0 deletions

View File

@ -2471,6 +2471,15 @@ const appOptions = {
return; return;
} }
if (hasVideos) {
this.uiPushToast({
title: '视频处理中',
message: '读取视频需要较长时间,请耐心等待',
type: 'info',
duration: 5000
});
}
const message = text; const message = text;
const isCommand = hasText && !hasImages && !hasVideos && message.startsWith('/'); const isCommand = hasText && !hasImages && !hasVideos && message.startsWith('/');
if (isCommand) { if (isCommand) {

View File

@ -1168,6 +1168,15 @@ export async function initializeLegacySocket(ctx: any) {
ctx.$forceUpdate(); ctx.$forceUpdate();
ctx.conditionalScrollToBottom(); ctx.conditionalScrollToBottom();
ctx.monitorQueueTool(data); ctx.monitorQueueTool(data);
if (data.name === 'view_video' && typeof ctx.uiPushToast === 'function') {
ctx.uiPushToast({
title: '视频读取中',
message: '读取视频需要较长时间,请耐心等待',
type: 'info',
duration: 5000
});
}
}; };
handler(); handler();

View File

@ -94,6 +94,7 @@ const TOOL_SCENE_MAP: Record<string, string> = {
extract_webpage: 'webExtract', extract_webpage: 'webExtract',
save_webpage: 'webSave', save_webpage: 'webSave',
read_file: 'reader', read_file: 'reader',
view_video: 'reader',
vlm_analyze: 'ocr', vlm_analyze: 'ocr',
ocr_image: 'ocr', ocr_image: 'ocr',
create_folder: 'createFolder', create_folder: 'createFolder',

View File

@ -42,6 +42,17 @@ export const useUploadStore = defineStore('upload', {
} }
const uiStore = useUiStore(); const uiStore = useUiStore();
const fileStore = useFileStore(); 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); this.setUploading(true);
const toastId = uiStore.pushToast({ const toastId = uiStore.pushToast({
title: '上传文件', title: '上传文件',