feat: add video processing toast
This commit is contained in:
parent
bb91d22631
commit
b81e14b314
@ -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) {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -94,6 +94,7 @@ const TOOL_SCENE_MAP: Record<string, string> = {
|
||||
extract_webpage: 'webExtract',
|
||||
save_webpage: 'webSave',
|
||||
read_file: 'reader',
|
||||
view_video: 'reader',
|
||||
vlm_analyze: 'ocr',
|
||||
ocr_image: 'ocr',
|
||||
create_folder: 'createFolder',
|
||||
|
||||
@ -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: '上传文件',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user