Merge branch 'release/v0.2.8' into develop

* release/v0.2.8:
  fix(agent): Reading of docx multimodal files; Multimodal attachment history record
  fix(web): workflow header hidden operate
  feat(web):  multi_agent app not support share
  feat(web): chart content support files
  fix(web): update app export param key
  fix(web): app features bugfix
  fix(web): improve document preview handling for .doc files and validate docx format
  fix:pdf change version
  fix:cdn pdf
  fix: use real workflow_config id from db to avoid foreign key violation in workflow_executions
  fix: remove redundant local AppRelease import causing NameError in draft_run
  fix: shared app uses release snapshot config instead of draft in draft_run and get_agent_config
  fix: support both query param and body for new_name in copy_app for backward compatibility
  fix: read new_name from request body in copy_app endpoint
This commit is contained in:
Mark
2026-03-19 10:12:42 +08:00
22 changed files with 383 additions and 123 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-17 14:48:57
* @Last Modified time: 2026-03-18 19:49:09
*/
import { useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react'
import { useTranslation } from 'react-i18next'
@@ -30,7 +30,7 @@ import RadioGroupCard from '@/components/RadioGroupCard'
import { getModelListUrl } from '@/api/models'
import ModelConfigModal from './components/ModelConfigModal'
import type { Application } from '@/views/ApplicationManagement/types'
import FeaturesConfig from './components/FeaturesConfig'
// import FeaturesConfig from './components/FeaturesConfig'
const tagColors = ['processing', 'warning', 'default']
const MAX_LENGTH = 5;
@@ -187,15 +187,15 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
model_parameters: values
})
}
const handleSaveFeaturesConfig = (value: FeaturesConfigForm) => {
form.setFieldValue('features', value)
}
// const handleSaveFeaturesConfig = (value: FeaturesConfigForm) => {
// form.setFieldValue('features', value)
// }
return (
<Row className="rb:h-[calc(100vh-64px)]">
<Col span={12} className="rb:h-full rb:overflow-x-auto rb:border-r rb:border-[#DFE4ED] rb:p-[20px_16px_24px_16px]">
<Flex gap={10} justify="end" align="center" className="rb:mb-5!">
<FeaturesConfig value={values?.features as FeaturesConfigForm} refresh={handleSaveFeaturesConfig} />
{/* <FeaturesConfig value={values?.features as FeaturesConfigForm} refresh={handleSaveFeaturesConfig} /> */}
<Button type="primary" onClick={() => handleSave()}>
{t('common.save')}
</Button>
@@ -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

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:29:41
* @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 { useTranslation } from 'react-i18next';
@@ -71,7 +71,7 @@ const ReleasePage: FC<{data: Application; refresh: () => void}> = ({data, refres
}
const handleExport = () => {
if (!selectedVersion) return
appExport(data.id, data.name, {release_version: selectedVersion.id})
appExport(data.id, data.name, { release_id: selectedVersion.id})
}
return (
<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.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={() => 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>
</Space>

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-02-03 16:27:52
* @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 { useNavigate, useParams } from 'react-router-dom';
@@ -183,6 +183,7 @@ const ConfigHeader: FC<ConfigHeaderProps> = ({
appRef?.current?.handleSaveFeaturesConfig?.(value)
onFeaturesChange?.(value)
}, [appRef, onFeaturesChange])
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">
@@ -211,9 +212,9 @@ const ConfigHeader: FC<ConfigHeaderProps> = ({
className={styles.tabs}
/>
</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">
<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={addvariable}>{t('workflow.addvariable')}</Button>
<Button onClick={run}>{t('workflow.run')}</Button>

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-03-05
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-17 18:10:47
* @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',
},
];
@@ -80,7 +80,7 @@ const FileUploadSettingModal = forwardRef<FileUploadSettingModalRef, FileUploadS
const handleOpen = (values?: FileUpload) => {
setVisible(true);
if (values) {
const methods = values.allowed_transfer_methods
const methods = values.allowed_transfer_methods || ['local_file', 'remote_url']
const transferMethod = Array.isArray(methods)
? methods.length === 2 ? 'both' : methods[0]
: methods

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:34:12
* @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
@@ -143,7 +143,7 @@ const ApplicationManagement: React.FC = () => {
<Form.Item name="type" noStyle>
<Select
placeholder={t('application.applicationType')}
options={types.map((type) => ({
options={(activeTab === 'sharing' ? types.filter(type => type !== 'multi_agent') : types).map((type) => ({
value: type,
label: t(`application.${type}`),
}))}
@@ -185,6 +185,7 @@ const ApplicationManagement: React.FC = () => {
<PageScrollList<Application, Query>
ref={scrollListRef}
url={getApplicationListUrl}
needLoading={false}
query={{ ...query, shared_only: activeTab === 'sharing', include_shared: activeTab !== 'apps' }}
renderItem={(item) => (
<RbCard

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-06 21:09:42
* @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
@@ -71,6 +71,12 @@ const transform_file_type = {
'application/vnd.ms-powerpoint': 'document/ppt',
'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
const ALL_FILE_TYPE: {
@@ -88,6 +94,13 @@ const ALL_FILE_TYPE: {
ppt: 'application/vnd.ms-powerpoint',
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',
jpeg: 'image/jpeg',
png: 'image/png',

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-06 21:09:47
* @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
@@ -120,16 +120,16 @@ const UploadFileListModal = forwardRef<UploadFileListModalRef, UploadFileListMod
<Select
placeholder={t('memoryConversation.fileType')}
options={fileTypeOptions}
className="rb:w-30"
className="rb:w-30!"
/>
</FormItem>
<FormItem
{...restField}
name={[name, 'url']}
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>
<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')]"

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:58:03
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 15:35:05
* @Last Modified time: 2026-03-18 20:54:00
*/
/**
* Conversation Page
@@ -160,7 +160,9 @@ const Conversation: FC = () => {
role: 'user',
content: message,
created_at: Date.now(),
files
meta_data: {
files
},
}])
}
@@ -185,7 +187,7 @@ const Conversation: FC = () => {
{
...lastMsg,
content: lastMsg.content + content,
audioUrl: audio_url
meta_data: { audio_url }
}
]
}

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-06 21:10:56
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 14:34:20
* @Last Modified time: 2026-03-18 20:46:35
*/
/**
* Workflow Chat Component
@@ -63,9 +63,12 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
*/
const handleOpen = () => {
setOpen(true)
if (data?.features) setFeatures(data.features)
}
useEffect(() => {
if (data?.features && open) setFeatures(data.features)
}, [open, data?.features])
useEffect(() => {
if (open && graphRef.current && toolbarRef.current) {
getVariables()
@@ -148,10 +151,14 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
setLoading(true)
const message = msg
const files = toolbarRef.current?.getFiles() || []
setChatList(prev => [...prev, {
role: 'user',
content: message,
created_at: Date.now(),
meta_data: {
files
},
}])
setChatList(prev => [...prev, {
role: 'assistant',
@@ -335,7 +342,6 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
})
}
const files = toolbarRef.current?.getFiles() || []
setMessage(undefined)
toolbarRef.current?.setFiles([])
setFileList([])