Merge pull request #609 from SuanmoSuanyangTechnology/fix/v0.2.8_zy
Fix/v0.2.8 zy
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 13:59:45
|
* @Date: 2026-02-03 13:59:45
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-13 17:07:54
|
* @Last Modified time: 2026-03-18 20:01:29
|
||||||
*/
|
*/
|
||||||
import { request } from '@/utils/request'
|
import { request } from '@/utils/request'
|
||||||
import type { ApplicationModalData } from '@/views/ApplicationManagement/types'
|
import type { ApplicationModalData } from '@/views/ApplicationManagement/types'
|
||||||
@@ -137,7 +137,7 @@ export const getExperienceConfig = (share_token: string) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Export application
|
// Export application
|
||||||
export const appExport = (app_id: string, appName: string, data?: { release_version: string }) => {
|
export const appExport = (app_id: string, appName: string, data?: { release_id: string }) => {
|
||||||
return request.getDownloadFile(`/apps/${app_id}/export`, `${appName}.yml`, data)
|
return request.getDownloadFile(`/apps/${app_id}/export`, `${appName}.yml`, data)
|
||||||
}
|
}
|
||||||
// Import application
|
// Import application
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2025-12-10 16:46:17
|
* @Date: 2025-12-10 16:46:17
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-17 14:11:24
|
* @Last Modified time: 2026-03-18 20:48:03
|
||||||
*/
|
*/
|
||||||
import { type FC, useRef, useEffect, useState } from 'react'
|
import { type FC, useRef, useEffect, useState } from 'react'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
@@ -33,7 +33,7 @@ const ChatContent: FC<ChatContentProps> = ({
|
|||||||
const audioRef = useRef<HTMLAudioElement | null>(null)
|
const audioRef = useRef<HTMLAudioElement | null>(null)
|
||||||
const [playingIndex, setPlayingIndex] = useState<number | null>(null)
|
const [playingIndex, setPlayingIndex] = useState<number | null>(null)
|
||||||
|
|
||||||
const handlePlay = (index: number, audioUrl: string) => {
|
const handlePlay = (index: number, audio_url: string) => {
|
||||||
if (playingIndex === index) {
|
if (playingIndex === index) {
|
||||||
audioRef.current?.pause()
|
audioRef.current?.pause()
|
||||||
setPlayingIndex(null)
|
setPlayingIndex(null)
|
||||||
@@ -42,7 +42,7 @@ const ChatContent: FC<ChatContentProps> = ({
|
|||||||
if (audioRef.current) {
|
if (audioRef.current) {
|
||||||
audioRef.current.pause()
|
audioRef.current.pause()
|
||||||
}
|
}
|
||||||
const audio = new Audio(audioUrl)
|
const audio = new Audio(audio_url)
|
||||||
audioRef.current = audio
|
audioRef.current = audio
|
||||||
audio.play()
|
audio.play()
|
||||||
setPlayingIndex(index)
|
setPlayingIndex(index)
|
||||||
@@ -108,6 +108,48 @@ const ChatContent: FC<ChatContentProps> = ({
|
|||||||
{labelFormat(item)}
|
{labelFormat(item)}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
{item.meta_data?.files && item.meta_data?.files.length > 0 && <div>
|
||||||
|
{item.meta_data?.files?.map((file) => {
|
||||||
|
if (file.type.includes('image')) {
|
||||||
|
return (
|
||||||
|
<div key={file.url || file.uid} className={`rb:inline-block rb:group rb:relative rb:rounded-lg ${contentClassNames}`}>
|
||||||
|
<img src={file.url} alt={file.name} className="rb:w-full rb:max-w-80 rb:rounded-lg rb:object-cover rb:cursor-pointer" />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (file.type.includes('video')) {
|
||||||
|
return (
|
||||||
|
<div key={file.url || file.uid} className="rb:w-45 rb:h-16 rb:inline-block rb:group rb:relative rb:rounded-lg">
|
||||||
|
<video src={file.url} controls className="rb:w-45 rb:h-16 rb:rounded-lg rb:object-cover rb:cursor-pointer" />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (file.type.includes('audio')) {
|
||||||
|
return (
|
||||||
|
<div key={file.url || file.uid} className="rb:w-45 rb:h-16 rb:inline-flex rb:items-center rb:group rb:relative rb:rounded-lg rb:bg-[#F0F3F8] rb:py-2 rb:px-2.5 rb:gap-2">
|
||||||
|
<audio src={file.url} controls className="rb:w-45 rb:h-16" />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div key={file.url || file.uid} className="rb:w-45 rb:text-[12px] rb:gap-2.5 rb:flex rb:items-center rb:group rb:relative rb:rounded-lg rb:bg-[#F0F3F8] rb:py-2 rb:px-2.5">
|
||||||
|
{(file.type.includes('doc') || file.type.includes('docx') || file.type.includes('word') || file.type.includes('wordprocessingml.document')) && <div
|
||||||
|
className="rb:size-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/conversation/word_disabled.svg')] rb:hover:bg-[url('@/assets/images/conversation/word.svg')]"
|
||||||
|
></div>}
|
||||||
|
{(file.type.includes('pdf')) && <div
|
||||||
|
className="rb:size-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/conversation/pdf_disabled.svg')] rb:hover:bg-[url('@/assets/images/conversation/pdf.svg')]"
|
||||||
|
></div>}
|
||||||
|
{(file.type.includes('excel') || file.type.includes('spreadsheetml.sheet') || file.type.includes('csv')) && <div
|
||||||
|
className="rb:size-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/conversation/excel_disabled.svg')] rb:hover:bg-[url('@/assets/images/conversation/excel.svg')]"
|
||||||
|
></div>}
|
||||||
|
<div className="rb:flex-1 rb:w-32.5">
|
||||||
|
<div className="rb:leading-4 rb:text-ellipsis rb:overflow-hidden rb:whitespace-nowrap">{file.name}</div>
|
||||||
|
<div className="rb:leading-3.5 rb:mt-0.5 rb:text-[#5B6167] rb:text-ellipsis rb:overflow-hidden rb:whitespace-nowrap">{file.type} · {file.size}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>}
|
||||||
{/* Message bubble */}
|
{/* Message bubble */}
|
||||||
<div className={clsx('rb:border rb:text-left rb:rounded-lg rb:mt-1.5 rb:leading-4.5 rb:p-[10px_12px_2px_12px] rb:inline-block rb:max-w-130 rb:wrap-break-word', contentClassNames, {
|
<div className={clsx('rb:border rb:text-left rb:rounded-lg rb:mt-1.5 rb:leading-4.5 rb:p-[10px_12px_2px_12px] rb:inline-block rb:max-w-130 rb:wrap-break-word', contentClassNames, {
|
||||||
// Error message style (content is null and not assistant message)
|
// Error message style (content is null and not assistant message)
|
||||||
@@ -121,14 +163,14 @@ const ChatContent: FC<ChatContentProps> = ({
|
|||||||
{/* Render message content using Markdown component */}
|
{/* Render message content using Markdown component */}
|
||||||
<Markdown content={renderRuntime ? item.content ?? '' : item.content ?? errorDesc ?? ''} />
|
<Markdown content={renderRuntime ? item.content ?? '' : item.content ?? errorDesc ?? ''} />
|
||||||
|
|
||||||
{item.audioUrl && <>
|
{item.meta_data?.audio_url && <>
|
||||||
<Divider className="rb:my-3!" />
|
<Divider className="rb:my-3!" />
|
||||||
<Space size={12} className="rb:pb-2 rb:pl-1">
|
<Space size={12} className="rb:pb-2 rb:pl-1">
|
||||||
{playingIndex !== index
|
{playingIndex !== index
|
||||||
? <SoundOutlined className="rb:cursor-pointer rb:hover:text-[#155EEF]! rb:size-5.5" onClick={() => handlePlay(index, item.audioUrl!)} />
|
? <SoundOutlined className="rb:cursor-pointer rb:hover:text-[#155EEF]! rb:size-5.5" onClick={() => handlePlay(index, item.meta_data?.audio_url!)} />
|
||||||
: <div
|
: <div
|
||||||
className="rb:size-5.5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/conversation/audio_ing.gif')]"
|
className="rb:size-5.5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/conversation/audio_ing.gif')]"
|
||||||
onClick={() => handlePlay(index, item.audioUrl!)}
|
onClick={() => handlePlay(index, item.meta_data?.audio_url!)}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2025-12-10 16:45:54
|
* @Date: 2025-12-10 16:45:54
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-17 13:46:24
|
* @Last Modified time: 2026-03-18 20:47:42
|
||||||
*/
|
*/
|
||||||
import { type ReactNode } from 'react'
|
import { type ReactNode } from 'react'
|
||||||
|
|
||||||
@@ -22,9 +22,11 @@ export interface ChatItem {
|
|||||||
created_at?: number | string;
|
created_at?: number | string;
|
||||||
status?: string;
|
status?: string;
|
||||||
subContent?: Record<string, any>[];
|
subContent?: Record<string, any>[];
|
||||||
files?: any[];
|
|
||||||
error?: string;
|
error?: string;
|
||||||
audioUrl?: string;
|
meta_data?: {
|
||||||
|
audio_url?: string;
|
||||||
|
files?: any[];
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:29:33
|
* @Date: 2026-02-03 16:29:33
|
||||||
* @Last Modified by: ZhaoYing
|
* @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 { useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@@ -295,6 +295,7 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
|
|||||||
value: type,
|
value: type,
|
||||||
label: t(`application.${type}`),
|
label: t(`application.${type}`),
|
||||||
}))}
|
}))}
|
||||||
|
placeholder={t('common.pleaseSelect')}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -306,6 +307,7 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
|
|||||||
value: type,
|
value: type,
|
||||||
label: t(`application.${type}`),
|
label: t(`application.${type}`),
|
||||||
}))}
|
}))}
|
||||||
|
placeholder={t('common.pleaseSelect')}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Card>}
|
</Card>}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:29:41
|
* @Date: 2026-02-03 16:29:41
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 14:30:41
|
* @Last Modified time: 2026-03-18 20:57:24
|
||||||
*/
|
*/
|
||||||
import { type FC, useState, useEffect, useRef } from 'react';
|
import { type FC, useState, useEffect, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -71,7 +71,7 @@ const ReleasePage: FC<{data: Application; refresh: () => void}> = ({data, refres
|
|||||||
}
|
}
|
||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
if (!selectedVersion) return
|
if (!selectedVersion) return
|
||||||
appExport(data.id, data.name, {release_version: selectedVersion.id})
|
appExport(data.id, data.name, { release_id: selectedVersion.id})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="rb:flex rb:h-[calc(100vh-64px)]">
|
<div className="rb:flex rb:h-[calc(100vh-64px)]">
|
||||||
@@ -132,7 +132,7 @@ const ReleasePage: FC<{data: Application; refresh: () => void}> = ({data, refres
|
|||||||
{data?.type !== 'multi_agent' && <Button onClick={handleExport}>{t('common.export')}</Button>}
|
{data?.type !== 'multi_agent' && <Button onClick={handleExport}>{t('common.export')}</Button>}
|
||||||
{data.current_release_id !== selectedVersion.id && <Button onClick={handleRollback}>{t('application.willRollToThisVersion')}</Button>}
|
{data.current_release_id !== selectedVersion.id && <Button onClick={handleRollback}>{t('application.willRollToThisVersion')}</Button>}
|
||||||
<Button type="primary" ghost onClick={() => releaseShareModalRef.current?.handleOpen()}>{t('application.share')}</Button>
|
<Button type="primary" ghost onClick={() => releaseShareModalRef.current?.handleOpen()}>{t('application.share')}</Button>
|
||||||
<Button type="primary" ghost onClick={() => appSharingModalRef.current?.handleOpen()}>{t('application.sharing')}</Button>
|
{data?.type !== 'multi_agent' && <Button type="primary" ghost onClick={() => appSharingModalRef.current?.handleOpen()}>{t('application.sharing')}</Button>}
|
||||||
</>}
|
</>}
|
||||||
<Button type="primary" onClick={() => releaseModalRef.current?.handleOpen()}>{t('application.release')}</Button>
|
<Button type="primary" onClick={() => releaseModalRef.current?.handleOpen()}>{t('application.release')}</Button>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -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 { type FC, useState, useRef, useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { App } from 'antd'
|
import { App } from 'antd'
|
||||||
@@ -116,7 +122,9 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
role: 'user',
|
role: 'user',
|
||||||
content: message,
|
content: message,
|
||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
files
|
meta_data: {
|
||||||
|
files
|
||||||
|
},
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +144,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
const lastMsg = newList[newList.length - 1]
|
const lastMsg = newList[newList.length - 1]
|
||||||
if (lastMsg.role === 'assistant') {
|
if (lastMsg.role === 'assistant') {
|
||||||
lastMsg.content += content;
|
lastMsg.content += content;
|
||||||
lastMsg.audioUrl = audio_url
|
lastMsg.meta_data = {audio_url}
|
||||||
}
|
}
|
||||||
return newList
|
return newList
|
||||||
})
|
})
|
||||||
@@ -428,7 +436,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
status,
|
status,
|
||||||
error,
|
error,
|
||||||
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content,
|
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content,
|
||||||
audioUrl: audio_url
|
meta_data: { audio_url: audio_url }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newList
|
return newList
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:27:39
|
* @Date: 2026-02-03 16:27:39
|
||||||
* @Last Modified by: ZhaoYing
|
* @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
|
* Chat debugging component for application testing
|
||||||
@@ -92,7 +92,9 @@ const Chat: FC<ChatProps> = ({
|
|||||||
role: 'user',
|
role: 'user',
|
||||||
content: message,
|
content: message,
|
||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
files
|
meta_data: {
|
||||||
|
files
|
||||||
|
},
|
||||||
};
|
};
|
||||||
updateChatList(prev => prev.map(item => ({
|
updateChatList(prev => prev.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
@@ -142,7 +144,7 @@ const Chat: FC<ChatProps> = ({
|
|||||||
{
|
{
|
||||||
...lastMsg,
|
...lastMsg,
|
||||||
content: lastMsg.content + (content || ''),
|
content: lastMsg.content + (content || ''),
|
||||||
audioUrl: audio_url
|
meta_data: { audio_url }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:27:52
|
* @Date: 2026-02-03 16:27:52
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 15:40:53
|
* @Last Modified time: 2026-03-18 21:25:23
|
||||||
*/
|
*/
|
||||||
import { type FC, useRef, useMemo, useCallback } from 'react';
|
import { type FC, useRef, useMemo, useCallback } from 'react';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
@@ -183,6 +183,7 @@ const ConfigHeader: FC<ConfigHeaderProps> = ({
|
|||||||
appRef?.current?.handleSaveFeaturesConfig?.(value)
|
appRef?.current?.handleSaveFeaturesConfig?.(value)
|
||||||
onFeaturesChange?.(value)
|
onFeaturesChange?.(value)
|
||||||
}, [appRef, onFeaturesChange])
|
}, [appRef, onFeaturesChange])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header className="rb:w-full rb:h-16 rb:grid rb:grid-cols-3 rb:p-[16px_16px_16px_24px]! rb:border-b rb:border-[#EAECEE] rb:leading-8">
|
<Header className="rb:w-full rb:h-16 rb:grid rb:grid-cols-3 rb:p-[16px_16px_16px_24px]! rb:border-b rb:border-[#EAECEE] rb:leading-8">
|
||||||
@@ -211,9 +212,9 @@ const ConfigHeader: FC<ConfigHeaderProps> = ({
|
|||||||
className={styles.tabs}
|
className={styles.tabs}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{application?.type === 'workflow'
|
{application?.type === 'workflow' && source !== 'sharing'
|
||||||
? <div className="rb:h-8 rb:flex rb:items-center rb:justify-end rb:gap-2.5">
|
? <div className="rb:h-8 rb:flex rb:items-center rb:justify-end rb:gap-2.5">
|
||||||
<FeaturesConfig source={application?.type} value={features} refresh={handleSaveFeaturesConfig} />
|
<FeaturesConfig source={application?.type} value={features as FeaturesConfigForm} refresh={handleSaveFeaturesConfig} />
|
||||||
<Button onClick={clear}>{t('workflow.clear')}</Button>
|
<Button onClick={clear}>{t('workflow.clear')}</Button>
|
||||||
<Button onClick={addvariable}>{t('workflow.addvariable')}</Button>
|
<Button onClick={addvariable}>{t('workflow.addvariable')}</Button>
|
||||||
<Button onClick={run}>{t('workflow.run')}</Button>
|
<Button onClick={run}>{t('workflow.run')}</Button>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-03-05
|
* @Date: 2026-03-05
|
||||||
* @Last Modified by: ZhaoYing
|
* @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 { forwardRef, useImperativeHandle, useState } from 'react';
|
||||||
import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd';
|
import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd';
|
||||||
@@ -27,22 +27,22 @@ const fileTypeOptions = [
|
|||||||
{
|
{
|
||||||
type: 'document',
|
type: 'document',
|
||||||
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/txt.svg')]"></div>,
|
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',
|
type: 'image',
|
||||||
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/image.svg')]"></div>,
|
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',
|
type: 'audio',
|
||||||
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/audio.svg')]"></div>,
|
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',
|
type: 'video',
|
||||||
icon: <div className="rb:size-9 rb:bg-cover rb:bg-[url('@/assets/images/file/video.svg')]"></div>,
|
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',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:34:12
|
* @Date: 2026-02-03 16:34:12
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 10:50:33
|
* @Last Modified time: 2026-03-18 21:00:12
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Application Management Page
|
* Application Management Page
|
||||||
@@ -143,7 +143,7 @@ const ApplicationManagement: React.FC = () => {
|
|||||||
<Form.Item name="type" noStyle>
|
<Form.Item name="type" noStyle>
|
||||||
<Select
|
<Select
|
||||||
placeholder={t('application.applicationType')}
|
placeholder={t('application.applicationType')}
|
||||||
options={types.map((type) => ({
|
options={(activeTab === 'sharing' ? types.filter(type => type !== 'multi_agent') : types).map((type) => ({
|
||||||
value: type,
|
value: type,
|
||||||
label: t(`application.${type}`),
|
label: t(`application.${type}`),
|
||||||
}))}
|
}))}
|
||||||
@@ -185,6 +185,7 @@ const ApplicationManagement: React.FC = () => {
|
|||||||
<PageScrollList<Application, Query>
|
<PageScrollList<Application, Query>
|
||||||
ref={scrollListRef}
|
ref={scrollListRef}
|
||||||
url={getApplicationListUrl}
|
url={getApplicationListUrl}
|
||||||
|
needLoading={false}
|
||||||
query={{ ...query, shared_only: activeTab === 'sharing', include_shared: activeTab !== 'apps' }}
|
query={{ ...query, shared_only: activeTab === 'sharing', include_shared: activeTab !== 'apps' }}
|
||||||
renderItem={(item) => (
|
renderItem={(item) => (
|
||||||
<RbCard
|
<RbCard
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-06 21:09:42
|
* @Date: 2026-02-06 21:09:42
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-17 14:42:31
|
* @Last Modified time: 2026-03-18 20:32:54
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* File Upload Component
|
* File Upload Component
|
||||||
@@ -71,6 +71,12 @@ const transform_file_type = {
|
|||||||
|
|
||||||
'application/vnd.ms-powerpoint': 'document/ppt',
|
'application/vnd.ms-powerpoint': 'document/ppt',
|
||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'document/pptx',
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'document/pptx',
|
||||||
|
|
||||||
|
'application/vnd.ms-excel': 'document/xls',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'document/xlsx',
|
||||||
|
'text/csv': 'document/csv',
|
||||||
|
|
||||||
|
'application/json': 'document/json'
|
||||||
}
|
}
|
||||||
// Mapping of file extensions to MIME types
|
// Mapping of file extensions to MIME types
|
||||||
const ALL_FILE_TYPE: {
|
const ALL_FILE_TYPE: {
|
||||||
@@ -88,6 +94,13 @@ const ALL_FILE_TYPE: {
|
|||||||
ppt: 'application/vnd.ms-powerpoint',
|
ppt: 'application/vnd.ms-powerpoint',
|
||||||
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
|
||||||
|
xls: 'application/vnd.ms-excel',
|
||||||
|
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
|
||||||
|
csv: 'text/csv',
|
||||||
|
|
||||||
|
json: 'application/json',
|
||||||
|
|
||||||
jpg: 'image/jpeg',
|
jpg: 'image/jpeg',
|
||||||
jpeg: 'image/jpeg',
|
jpeg: 'image/jpeg',
|
||||||
png: 'image/png',
|
png: 'image/png',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-06 21:09:47
|
* @Date: 2026-02-06 21:09:47
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 15:50:31
|
* @Last Modified time: 2026-03-18 21:10:01
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Upload File List Modal Component
|
* Upload File List Modal Component
|
||||||
@@ -120,16 +120,16 @@ const UploadFileListModal = forwardRef<UploadFileListModalRef, UploadFileListMod
|
|||||||
<Select
|
<Select
|
||||||
placeholder={t('memoryConversation.fileType')}
|
placeholder={t('memoryConversation.fileType')}
|
||||||
options={fileTypeOptions}
|
options={fileTypeOptions}
|
||||||
className="rb:w-30"
|
className="rb:w-30!"
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
{...restField}
|
{...restField}
|
||||||
name={[name, 'url']}
|
name={[name, 'url']}
|
||||||
rules={[{ required: true, message: t('common.pleaseEnter') }]}
|
rules={[{ required: true, message: t('common.pleaseEnter') }]}
|
||||||
className="rb:mb-0!"
|
className="rb:mb-0! rb:flex-1!"
|
||||||
>
|
>
|
||||||
<Input placeholder={t('memoryConversation.fileUrl')} className="rb:w-82.5!" />
|
<Input placeholder={t('memoryConversation.fileUrl')} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<div
|
<div
|
||||||
className="rb:w-5 rb:h-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/delete.svg')] rb:hover:bg-[url('@/assets/images/delete_hover.svg')]"
|
className="rb:w-5 rb:h-5 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/delete.svg')] rb:hover:bg-[url('@/assets/images/delete_hover.svg')]"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:58:03
|
* @Date: 2026-02-03 16:58:03
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 15:35:05
|
* @Last Modified time: 2026-03-18 20:54:00
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Conversation Page
|
* Conversation Page
|
||||||
@@ -160,7 +160,9 @@ const Conversation: FC = () => {
|
|||||||
role: 'user',
|
role: 'user',
|
||||||
content: message,
|
content: message,
|
||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
files
|
meta_data: {
|
||||||
|
files
|
||||||
|
},
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +187,7 @@ const Conversation: FC = () => {
|
|||||||
{
|
{
|
||||||
...lastMsg,
|
...lastMsg,
|
||||||
content: lastMsg.content + content,
|
content: lastMsg.content + content,
|
||||||
audioUrl: audio_url
|
meta_data: { audio_url }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-06 21:10:56
|
* @Date: 2026-02-06 21:10:56
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 19:31:28
|
* @Last Modified time: 2026-03-18 20:46:35
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Workflow Chat Component
|
* Workflow Chat Component
|
||||||
@@ -151,10 +151,14 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
|
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const message = msg
|
const message = msg
|
||||||
|
const files = toolbarRef.current?.getFiles() || []
|
||||||
setChatList(prev => [...prev, {
|
setChatList(prev => [...prev, {
|
||||||
role: 'user',
|
role: 'user',
|
||||||
content: message,
|
content: message,
|
||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
|
meta_data: {
|
||||||
|
files
|
||||||
|
},
|
||||||
}])
|
}])
|
||||||
setChatList(prev => [...prev, {
|
setChatList(prev => [...prev, {
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
@@ -338,7 +342,6 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const files = toolbarRef.current?.getFiles() || []
|
|
||||||
setMessage(undefined)
|
setMessage(undefined)
|
||||||
toolbarRef.current?.setFiles([])
|
toolbarRef.current?.setFiles([])
|
||||||
setFileList([])
|
setFileList([])
|
||||||
|
|||||||
Reference in New Issue
Block a user