feat(web): chart content support files

This commit is contained in:
zhaoying
2026-03-18 20:55:31 +08:00
parent 04b2205769
commit be46ed8865
9 changed files with 101 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:29:33
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 19:37:15
* @Last Modified time: 2026-03-18 19:49:09
*/
import { useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react'
import { useTranslation } from 'react-i18next'
@@ -295,6 +295,7 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
value: type,
label: t(`application.${type}`),
}))}
placeholder={t('common.pleaseSelect')}
/>
</Form.Item>
<Form.Item
@@ -306,6 +307,7 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
value: type,
label: t(`application.${type}`),
}))}
placeholder={t('common.pleaseSelect')}
/>
</Form.Item>
</Card>}

View File

@@ -1,3 +1,9 @@
/*
* @Author: ZhaoYing
* @Date: 2026-03-13 17:27:52
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 20:54:35
*/
import { type FC, useState, useRef, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { App } from 'antd'
@@ -116,7 +122,9 @@ const TestChat: FC<TestChatProps> = ({
role: 'user',
content: message,
created_at: Date.now(),
files
meta_data: {
files
},
}])
}
@@ -136,7 +144,7 @@ const TestChat: FC<TestChatProps> = ({
const lastMsg = newList[newList.length - 1]
if (lastMsg.role === 'assistant') {
lastMsg.content += content;
lastMsg.audioUrl = audio_url
lastMsg.meta_data = {audio_url}
}
return newList
})
@@ -428,7 +436,7 @@ const TestChat: FC<TestChatProps> = ({
status,
error,
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content,
audioUrl: audio_url
meta_data: { audio_url: audio_url }
}
}
return newList

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:27:39
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-17 15:27:57
* @Last Modified time: 2026-03-18 20:52:33
*/
/**
* Chat debugging component for application testing
@@ -92,7 +92,9 @@ const Chat: FC<ChatProps> = ({
role: 'user',
content: message,
created_at: Date.now(),
files
meta_data: {
files
},
};
updateChatList(prev => prev.map(item => ({
...item,
@@ -142,7 +144,7 @@ const Chat: FC<ChatProps> = ({
{
...lastMsg,
content: lastMsg.content + (content || ''),
audioUrl: audio_url
meta_data: { audio_url }
}
]
}

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-03-05
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 19:35:57
* @Last Modified time: 2026-03-18 20:29:28
*/
import { forwardRef, useImperativeHandle, useState } from 'react';
import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd';
@@ -27,22 +27,22 @@ const fileTypeOptions = [
{
type: 'document',
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/txt.svg')]"></div>,
formats: 'TXT, MD, MDX, MARKDOWN, PDF, DOC, DOCX',
formats: 'TXT, PDF, DOC, DOCX, XLSX, CSV, JSON',
},
{
type: 'image',
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/image.svg')]"></div>,
formats: 'JPG, JPEG, PNG, GIF, WEBP, SVG',
formats: 'JPG, JPEG, PNG, GIF, WEBP',
},
{
type: 'audio',
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/audio.svg')]"></div>,
formats: 'MP3, M4A, WAV, AMR, MPGA',
formats: 'MP3, M4A, WAV, OGG, FLAC',
},
{
type: 'video',
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/video.svg')]"></div>,
formats: 'MP4, MOV, MPEG, WEBM',
formats: 'MP4, MOV, AVI, WEBM',
},
];