style(web): translate the comments in the src/views directory into English

This commit is contained in:
zhaoying
2026-02-04 10:27:27 +08:00
parent 9e195ea63b
commit 7e650d86a5
24 changed files with 115 additions and 995 deletions

View File

@@ -2153,6 +2153,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
resilience: 'Resilience', resilience: 'Resilience',
suggestions: 'Personalized Suggestions', suggestions: 'Personalized Suggestions',
suggestionLoading: 'Your personalized suggestions are being generated', suggestionLoading: 'Your personalized suggestions are being generated',
item: 'item',
}, },
reflectionEngine: { reflectionEngine: {
reflectionEngineConfig: 'Reflection Engine Configuration', reflectionEngineConfig: 'Reflection Engine Configuration',

View File

@@ -2242,6 +2242,7 @@ export const zh = {
resilience: '恢复力', resilience: '恢复力',
suggestions: '个性化建议', suggestions: '个性化建议',
suggestionLoading: '您的个性化建议正在生成中', suggestionLoading: '您的个性化建议正在生成中',
item: '个',
}, },
reflectionEngine: { reflectionEngine: {
reflectionEngineConfig: '反思引擎配置', reflectionEngineConfig: '反思引擎配置',

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 15:52:44 * @Date: 2026-02-03 15:52:44
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 15:54:22 * @Last Modified time: 2026-02-04 10:00:02
*/ */
import { forwardRef, useImperativeHandle, useState } from 'react'; import { forwardRef, useImperativeHandle, useState } from 'react';
import { Switch, Button, Tooltip } from 'antd'; import { Switch, Button, Tooltip } from 'antd';
@@ -106,7 +106,6 @@ const ApiKeyDetailModal = forwardRef<ApiKeyModalRef, { handleCopy: (content: str
</span> </span>
</div> </div>
{/* 高级设置 */}
{data.expires_at && <> {data.expires_at && <>
<div className="rb:text-[#5B6167] rb:font-medium rb:leading-5 rb:my-4">{t('apiKey.advancedSettings')}</div> <div className="rb:text-[#5B6167] rb:font-medium rb:leading-5 rb:my-4">{t('apiKey.advancedSettings')}</div>

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 15:52:47 * @Date: 2026-02-03 15:52:47
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 15:52:47 * @Last Modified time: 2026-02-04 10:00:01
*/ */
import { forwardRef, useImperativeHandle, useState } from 'react'; import { forwardRef, useImperativeHandle, useState } from 'react';
import { Form, Input, Switch, App, DatePicker } from 'antd'; import { Form, Input, Switch, App, DatePicker } from 'antd';
@@ -162,7 +162,6 @@ const ApiKeyModal = forwardRef<ApiKeyModalRef, CreateModalProps>(({
<Switch /> <Switch />
</FormItem> </FormItem>
{/* 高级设置 */}
<div className="rb:text-[#5B6167] rb:font-medium rb:leading-5 rb:mb-4">{t('apiKey.advancedSettings')}</div> <div className="rb:text-[#5B6167] rb:font-medium rb:leading-5 rb:mb-4">{t('apiKey.advancedSettings')}</div>
<FormItem <FormItem

View File

@@ -255,7 +255,7 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
const { memory, knowledge_retrieval, tools, ...rest } = values const { memory, knowledge_retrieval, tools, ...rest } = values
const { knowledge_bases = [], ...knowledgeRest } = knowledge_retrieval || {} const { knowledge_bases = [], ...knowledgeRest } = knowledge_retrieval || {}
const { memory_content } = memory || {} const { memory_content } = memory || {}
// 从原数据中获取memory的其他必要属性 // Get other necessary properties of memory from original data
const originalMemory = data.memory || ({} as MemoryConfig) const originalMemory = data.memory || ({} as MemoryConfig)
const params: Config = { const params: Config = {
@@ -425,7 +425,7 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
<Knowledge /> <Knowledge />
</Form.Item> </Form.Item>
{/* 记忆配置 */} {/* Memory Configuration */}
<Card title={t('application.memoryConfiguration')}> <Card title={t('application.memoryConfiguration')}>
<Space size={24} direction='vertical' style={{ width: '100%' }}> <Space size={24} direction='vertical' style={{ width: '100%' }}>
<SwitchWrapper title="dialogueHistoricalMemory" desc="dialogueHistoricalMemoryDesc" name={['memory', 'enabled']} /> <SwitchWrapper title="dialogueHistoricalMemory" desc="dialogueHistoricalMemoryDesc" name={['memory', 'enabled']} />
@@ -442,7 +442,7 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
<VariableList /> <VariableList />
</Form.Item> </Form.Item>
{/* 工具配置 */} {/* Tool Configuration */}
<Form.Item name="tools"> <Form.Item name="tools">
<ToolList /> <ToolList />
</Form.Item> </Form.Item>

View File

@@ -162,7 +162,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => {
} }
> >
<div className="rb:text-[#5B6167] rb:text-[12px] rb:mb-2">{t('application.apiKeySubTitle')}</div> <div className="rb:text-[#5B6167] rb:text-[12px] rb:mb-2">{t('application.apiKeySubTitle')}</div>
{/* 总览数据 */} {/* Overview Data */}
<Row> <Row>
<Col span={6}> <Col span={6}>
<Statistic title={t('application.apiKeyTotal')} value={apiKeyList.length} /> <Statistic title={t('application.apiKeyTotal')} value={apiKeyList.length} />
@@ -171,7 +171,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => {
<Statistic title={t('application.apiKeyRequestTotal')} value={totalRequests} /> <Statistic title={t('application.apiKeyRequestTotal')} value={totalRequests} />
</Col> </Col>
</Row> </Row>
{/* API Key 列表 */} {/* API Key List */}
{apiKeyList.sort((a, b) => b.created_at - a.created_at).map(item => ( {apiKeyList.sort((a, b) => b.created_at - a.created_at).map(item => (
<div key={item.id} className="rb:mt-4 rb:p-[10px_12px] rb:bg-[#F0F3F8] rb:border rb:border-[#DFE4ED] rb:rounded-lg"> <div key={item.id} className="rb:mt-4 rb:p-[10px_12px] rb:bg-[#F0F3F8] rb:border rb:border-[#DFE4ED] rb:rounded-lg">
<div className="rb:flex rb:items-center rb:justify-between"> <div className="rb:flex rb:items-center rb:justify-between">

View File

@@ -146,7 +146,7 @@ const ReleasePage: FC<{data: Application; refresh: () => void}> = ({data, refres
</div> </div>
</RbCard> </RbCard>
{/* 日志 */} {/* Logs */}
<RbCard title={t('application.changeLog')} headerType="borderless"> <RbCard title={t('application.changeLog')} headerType="borderless">
<Space size={16} direction="vertical" style={{ width: '100%' }}> <Space size={16} direction="vertical" style={{ width: '100%' }}>
{selectedVersion && ( {selectedVersion && (

View File

@@ -69,7 +69,7 @@ const theme = {
const EditorContent = forwardRef<EditorRef, LexicalEditorProps>(({ const EditorContent = forwardRef<EditorRef, LexicalEditorProps>(({
className = '', className = '',
value, value,
placeholder = "请输入内容...", placeholder = "Please enter content...",
onChange, onChange,
}, ref) => { }, ref) => {
const [editor] = useLexicalComposerContext(); const [editor] = useLexicalComposerContext();

View File

@@ -137,7 +137,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
layout="vertical" layout="vertical"
scrollToFirstError={{ behavior: 'instant', block: 'end', focus: true }} scrollToFirstError={{ behavior: 'instant', block: 'end', focus: true }}
> >
{/* 变量类型 */} {/* Variable Type */}
<FormItem <FormItem
name="type" name="type"
label={t('application.variableType')} label={t('application.variableType')}
@@ -154,7 +154,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
optionRender={(props) => <div className="rb:flex rb:justify-between rb:items-center">{props.label} <Tag color="blue">{variableType[props.value as keyof typeof variableType]}</Tag></div>} optionRender={(props) => <div className="rb:flex rb:justify-between rb:items-center">{props.label} <Tag color="blue">{variableType[props.value as keyof typeof variableType]}</Tag></div>}
/> />
</FormItem> </FormItem>
{/* 变量名称 */} {/* Variable Name */}
<FormItem <FormItem
name="name" name="name"
label={t('application.variableName')} label={t('application.variableName')}
@@ -172,7 +172,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
}} }}
/> />
</FormItem> </FormItem>
{/* 显示名称 */} {/* Display Name */}
<FormItem <FormItem
name="display_name" name="display_name"
label={t('application.displayName')} label={t('application.displayName')}
@@ -180,14 +180,14 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
> >
<Input placeholder={t('common.enter')} /> <Input placeholder={t('common.enter')} />
</FormItem> </FormItem>
{/* 描述 */} {/* Description */}
<FormItem <FormItem
name="description" name="description"
label={t('application.description')} label={t('application.description')}
> >
<Input placeholder={t('common.enter')} /> <Input placeholder={t('common.enter')} />
</FormItem> </FormItem>
{/* 最大长度 */} {/* Max Length */}
{['text', 'paragraph'].includes(values?.type) && ( {['text', 'paragraph'].includes(values?.type) && (
<FormItem <FormItem
name="max_length" name="max_length"
@@ -196,7 +196,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
<InputNumber placeholder={t('common.enter')} style={{ width: '100%' }} /> <InputNumber placeholder={t('common.enter')} style={{ width: '100%' }} />
</FormItem> </FormItem>
)} )}
{/* 默认值 */} {/* Default Value */}
{/* {['text', 'paragraph', 'number', 'checkbox'].includes(values?.type) && ( {/* {['text', 'paragraph', 'number', 'checkbox'].includes(values?.type) && (
<FormItem <FormItem
name="default_value" name="default_value"
@@ -208,7 +208,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
{['checkbox'].includes(values.type) && <Select options={[{ value: true, label: t('application.defaultChecked') }, { value: false, label: t('application.notDefaultChecked') }]} />} {['checkbox'].includes(values.type) && <Select options={[{ value: true, label: t('application.defaultChecked') }, { value: false, label: t('application.notDefaultChecked') }]} />}
</FormItem> </FormItem>
)} */} )} */}
{/* 选项 */} {/* Options */}
{['dropdownOptions'].includes(values?.type) && ( {['dropdownOptions'].includes(values?.type) && (
<FormItem <FormItem
name="options" name="options"
@@ -217,7 +217,7 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
<SortableList /> <SortableList />
</FormItem> </FormItem>
)} )}
{/* API 扩展 */} {/* API Extension */}
{['apiVariable'].includes(values?.type) && ( {['apiVariable'].includes(values?.type) && (
<FormItem <FormItem
name="api_extension" name="api_extension"
@@ -237,14 +237,14 @@ const VariableEditModal = forwardRef<VariableEditModalRef, VariableEditModalProp
/> />
</FormItem> </FormItem>
)} )}
{/* 是否必填 */} {/* Required */}
<FormItem <FormItem
name="required" name="required"
valuePropName="checked" valuePropName="checked"
> >
<Checkbox>{t('application.required')}</Checkbox> <Checkbox>{t('application.required')}</Checkbox>
</FormItem> </FormItem>
{/* 是否隐藏 */} {/* Hidden */}
{/* <FormItem {/* <FormItem
name="hidden" name="hidden"
valuePropName="checked" valuePropName="checked"

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 17:00:20 * @Date: 2026-02-03 17:00:20
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 17:00:20 * @Last Modified time: 2026-02-04 10:03:35
*/ */
/** /**
* Line Chart Component * Line Chart Component
@@ -126,7 +126,6 @@ const LineChart: FC<LineCardProps> = ({ config }) => {
}, [t]) }, [t])
useEffect(() => { useEffect(() => {
// 语言切换时重新生成数据
if (config) { if (config) {
getCaculateData(config) getCaculateData(config)
} }

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 16:37:12 * @Date: 2026-02-03 16:37:12
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 16:37:12 * @Last Modified time: 2026-02-04 10:05:39
*/ */
/** /**
* Invite Register Page * Invite Register Page
@@ -211,7 +211,7 @@ const InviteRegister: React.FC = () => {
} }
const { error } = validatePasswordStrength(value); const { error } = validatePasswordStrength(value);
if (error && value.length >= 8) { if (error && value.length >= 8) {
return Promise.resolve(); // 强度提示但不阻止提交 return Promise.resolve();
} else if (error) { } else if (error) {
return Promise.reject(new Error(error)); return Promise.reject(new Error(error));
} }

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 17:30:11 * @Date: 2026-02-03 17:30:11
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 17:30:11 * @Last Modified time: 2026-02-04 10:08:49
*/ */
/** /**
* Result Component * Result Component
@@ -91,20 +91,20 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
list.forEach((data: AnyObject) => { list.forEach((data: AnyObject) => {
switch(data.event) { switch(data.event) {
case 'text_preprocessing': // 开始预处理文本 case 'text_preprocessing': // Start text preprocessing
setTextPreprocessing(prev => ({ setTextPreprocessing(prev => ({
...prev, ...prev,
status: 'processing', status: 'processing',
start_at: data.data.time start_at: data.data.time
})) }))
break break
case 'text_preprocessing_result': // 预处理文本分块中 case 'text_preprocessing_result': // Text preprocessing in progress
setTextPreprocessing(prev => ({ setTextPreprocessing(prev => ({
...prev, ...prev,
data: [...prev.data, data.data?.data] data: [...prev.data, data.data?.data]
})) }))
break break
case 'text_preprocessing_complete': // 预处理文本完成 case 'text_preprocessing_complete': // Text preprocessing complete
setTextPreprocessing(prev => ({ setTextPreprocessing(prev => ({
...prev, ...prev,
result: data.data?.data, result: data.data?.data,
@@ -112,20 +112,20 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
end_at: data.data.time end_at: data.data.time
})) }))
break break
case 'knowledge_extraction': // 开始知识抽取 case 'knowledge_extraction': // Start knowledge extraction
setKnowledgeExtraction(prev => ({ setKnowledgeExtraction(prev => ({
...prev, ...prev,
status: 'processing', status: 'processing',
start_at: data.data.time start_at: data.data.time
})) }))
break break
case 'knowledge_extraction_result': // 知识抽取中 case 'knowledge_extraction_result': // Knowledge extraction in progress
setKnowledgeExtraction(prev => ({ setKnowledgeExtraction(prev => ({
...prev, ...prev,
data: [...prev.data, data.data?.data] data: [...prev.data, data.data?.data]
})) }))
break break
case 'knowledge_extraction_complete': // 知识抽取完成 case 'knowledge_extraction_complete': // Knowledge extraction complete
setKnowledgeExtraction(prev => ({ setKnowledgeExtraction(prev => ({
...prev, ...prev,
result: data.data?.data, result: data.data?.data,
@@ -133,20 +133,20 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
end_at: data.data.time end_at: data.data.time
})) }))
break break
case 'creating_nodes_edges': // 开始创建节点和边 case 'creating_nodes_edges': // Start creating nodes and edges
setCreatingNodesEdges(prev => ({ setCreatingNodesEdges(prev => ({
...prev, ...prev,
status: 'processing', status: 'processing',
start_at: data.data.time start_at: data.data.time
})) }))
break break
case 'creating_nodes_edges_result': // 创建节点和边中 case 'creating_nodes_edges_result': // Creating nodes and edges in progress
setCreatingNodesEdges(prev => ({ setCreatingNodesEdges(prev => ({
...prev, ...prev,
data: [...prev.data, data.data?.data] data: [...prev.data, data.data?.data]
})) }))
break break
case 'creating_nodes_edges_complete': // 创建节点和边完成 case 'creating_nodes_edges_complete': // Creating nodes and edges complete
setCreatingNodesEdges(prev => ({ setCreatingNodesEdges(prev => ({
...prev, ...prev,
result: data.data?.data, result: data.data?.data,
@@ -154,20 +154,20 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
end_at: data.data.time end_at: data.data.time
})) }))
break break
case 'deduplication': // 开始去重消歧 case 'deduplication': // Start deduplication and disambiguation
setDeduplication(prev => ({ setDeduplication(prev => ({
...prev, ...prev,
status: 'processing', status: 'processing',
start_at: data.data.time start_at: data.data.time
})) }))
break break
case 'dedup_disambiguation_result': // 去重消歧中 case 'dedup_disambiguation_result': // Deduplication and disambiguation in progress
setDeduplication(prev => ({ setDeduplication(prev => ({
...prev, ...prev,
data: [...prev.data, data.data.data] data: [...prev.data, data.data.data]
})) }))
break break
case 'dedup_disambiguation_complete': // 去重消歧完成 case 'dedup_disambiguation_complete': // Deduplication and disambiguation complete
setDeduplication(prev => ({ setDeduplication(prev => ({
...prev, ...prev,
result: data.data?.data, result: data.data?.data,
@@ -175,9 +175,9 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
end_at: data.data.time end_at: data.data.time
})) }))
break break
case 'generating_results': // 开始生成结果 case 'generating_results': // Generating results
break break
case 'result': // 结果 case 'result': // Result
setTestResult(data.data?.extracted_result) setTestResult(data.data?.extracted_result)
break break
} }
@@ -228,7 +228,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
<RbAlert color="blue" icon={<ExclamationCircleFilled />} className="rb:mb-3.5"> <RbAlert color="blue" icon={<ExclamationCircleFilled />} className="rb:mb-3.5">
{t('memoryExtractionEngine.processing')} {t('memoryExtractionEngine.processing')}
</RbAlert> </RbAlert>
{/* 整体进度 */} {/* Overall Progress */}
<div className="rb:mb-2"> <div className="rb:mb-2">
<div className="rb:flex rb:items-center rb:justify-between rb:text-[12px] rb:leading-4 rb:font-regular"> <div className="rb:flex rb:items-center rb:justify-between rb:text-[12px] rb:leading-4 rb:font-regular">
{t('memoryExtractionEngine.overallProgress')} {t('memoryExtractionEngine.overallProgress')}
@@ -246,7 +246,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
</RbAlert> </RbAlert>
} }
<Space size={16} direction="vertical" style={{ width: '100%' }}> <Space size={16} direction="vertical" style={{ width: '100%' }}>
{/* 文本预处理 */} {/* Text Preprocessing */}
<RbCard <RbCard
title={t(`memoryExtractionEngine.text_preprocessing`)} title={t(`memoryExtractionEngine.text_preprocessing`)}
extra={formatTag(textPreprocessing.status)} extra={formatTag(textPreprocessing.status)}
@@ -266,7 +266,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
</RbAlert> </RbAlert>
} }
</RbCard> </RbCard>
{/* 知识抽取 */} {/* Knowledge Extraction */}
<RbCard <RbCard
title={t(`memoryExtractionEngine.knowledge_extraction`)} title={t(`memoryExtractionEngine.knowledge_extraction`)}
extra={formatTag(knowledgeExtraction.status)} extra={formatTag(knowledgeExtraction.status)}
@@ -286,7 +286,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
})} })}
</RbAlert>} </RbAlert>}
</RbCard> </RbCard>
{/* 创建实体关系 */} {/* Creating Entity Relationships */}
<RbCard <RbCard
title={t(`memoryExtractionEngine.creating_nodes_edges`)} title={t(`memoryExtractionEngine.creating_nodes_edges`)}
extra={formatTag(creatingNodesEdges.status)} extra={formatTag(creatingNodesEdges.status)}
@@ -306,7 +306,7 @@ const Result: FC<ResultProps> = ({ loading, handleSave }) => {
{t('memoryExtractionEngine.creating_nodes_edges_desc', {num: creatingNodesEdges.result.entity_entity_edges_count})} {t('memoryExtractionEngine.creating_nodes_edges_desc', {num: creatingNodesEdges.result.entity_entity_edges_count})}
</RbAlert>} </RbAlert>}
</RbCard> </RbCard>
{/* 去重消歧 */} {/* Deduplication and Disambiguation */}
<RbCard <RbCard
title={t(`memoryExtractionEngine.deduplication`)} title={t(`memoryExtractionEngine.deduplication`)}
extra={formatTag(deduplication.status)} extra={formatTag(deduplication.status)}

File diff suppressed because it is too large Load Diff

View File

@@ -29,7 +29,6 @@ const OntologyClassExtractModal = forwardRef<OntologyClassExtractModalRef, Ontol
const [targetKeys, setTargetKeys] = useState<TransferProps['targetKeys']>([]); const [targetKeys, setTargetKeys] = useState<TransferProps['targetKeys']>([]);
const [selectedKeys, setSelectedKeys] = useState<TransferProps['selectedKeys']>([]); const [selectedKeys, setSelectedKeys] = useState<TransferProps['selectedKeys']>([]);
// 封装取消方法,添加关闭弹窗逻辑
const handleClose = () => { const handleClose = () => {
setVisible(false); setVisible(false);
form.resetFields(); form.resetFields();
@@ -43,7 +42,6 @@ const OntologyClassExtractModal = forwardRef<OntologyClassExtractModalRef, Ontol
setVisible(true); setVisible(true);
setData(vo) setData(vo)
}; };
// 封装保存方法,添加提交逻辑
const handleSave = () => { const handleSave = () => {
if (!data?.scene_id) return; if (!data?.scene_id) return;
form form
@@ -104,7 +102,6 @@ const OntologyClassExtractModal = forwardRef<OntologyClassExtractModalRef, Ontol
setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys].filter(Boolean)); setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys].filter(Boolean));
}; };
// 暴露给父组件的方法
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
handleOpen, handleOpen,
})); }));

View File

@@ -22,7 +22,6 @@ const OntologyClassModal = forwardRef<OntologyClassModalRef, OntologyClassModalP
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [scene_id, setSceneId] = useState<string | null>(null) const [scene_id, setSceneId] = useState<string | null>(null)
// 封装取消方法,添加关闭弹窗逻辑
const handleClose = () => { const handleClose = () => {
setVisible(false); setVisible(false);
form.resetFields(); form.resetFields();
@@ -34,7 +33,6 @@ const OntologyClassModal = forwardRef<OntologyClassModalRef, OntologyClassModalP
setVisible(true); setVisible(true);
setSceneId(scene_id) setSceneId(scene_id)
}; };
// 封装保存方法,添加提交逻辑
const handleSave = () => { const handleSave = () => {
if (!scene_id) return; if (!scene_id) return;
form form
@@ -56,7 +54,6 @@ const OntologyClassModal = forwardRef<OntologyClassModalRef, OntologyClassModalP
}); });
} }
// 暴露给父组件的方法
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
handleOpen, handleOpen,
})); }));

View File

@@ -22,7 +22,6 @@ const OntologyModal = forwardRef<OntologyModalRef, OntologyModalProps>(({
const [form] = Form.useForm<OntologyModalData>(); const [form] = Form.useForm<OntologyModalData>();
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
// 封装取消方法,添加关闭弹窗逻辑
const handleClose = () => { const handleClose = () => {
setVisible(false); setVisible(false);
form.resetFields(); form.resetFields();
@@ -39,7 +38,6 @@ const OntologyModal = forwardRef<OntologyModalRef, OntologyModalProps>(({
} }
setVisible(true); setVisible(true);
}; };
// 封装保存方法,添加提交逻辑
const handleSave = () => { const handleSave = () => {
form form
.validateFields() .validateFields()
@@ -59,7 +57,6 @@ const OntologyModal = forwardRef<OntologyModalRef, OntologyModalProps>(({
}); });
} }
// 暴露给父组件的方法
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
handleOpen, handleOpen,
})); }));

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 17:37:31 * @Date: 2026-02-03 17:37:31
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 17:37:51 * @Last Modified time: 2026-02-04 10:16:42
*/ */
/** /**
* Order Payment Page * Order Payment Page
@@ -227,7 +227,7 @@ const OrderPayment: React.FC = () => {
return ( return (
<div className="rb:w-full rb:pb-20"> <div className="rb:w-full rb:pb-20">
{/* 订单信息 */} {/* Order Information */}
<div className="rb:mb-6"> <div className="rb:mb-6">
<h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.orderInformation')}</h2> <h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.orderInformation')}</h2>
@@ -238,9 +238,9 @@ const OrderPayment: React.FC = () => {
</div> </div>
</div> </div>
{/* 订单详情表格 */} {/* Order Details Table */}
<div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:overflow-hidden"> <div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:overflow-hidden">
{/* 桌面端表头 */} {/* Desktop Table Header */}
<div className="rb:flex rb:gap-4 rb:p-4 rb:bg-[rgba(255,255,255,0.03)] rb:border-b rb:border-b-[rgba(255,255,255,0.1)]"> <div className="rb:flex rb:gap-4 rb:p-4 rb:bg-[rgba(255,255,255,0.03)] rb:border-b rb:border-b-[rgba(255,255,255,0.1)]">
<div className="rb:flex-1">{t('pricing.comboName')}</div> <div className="rb:flex-1">{t('pricing.comboName')}</div>
<div className="rb:flex-2">{t('pricing.spAndTa')}</div> <div className="rb:flex-2">{t('pricing.spAndTa')}</div>
@@ -248,15 +248,15 @@ const OrderPayment: React.FC = () => {
<div className="rb:w-32">{t('pricing.orderCycle')}</div> <div className="rb:w-32">{t('pricing.orderCycle')}</div>
<div className="rb:w-32 rb:text-right">{t('pricing.orderAmount')}</div> <div className="rb:w-32 rb:text-right">{t('pricing.orderAmount')}</div>
</div> </div>
{/* 表格内容 */} {/* Table Content */}
<div className="rb:flex rb:p-4 rb:flex-row rb:gap-4"> <div className="rb:flex rb:p-4 rb:flex-row rb:gap-4">
{/* 套餐名称 */} {/* Package Name */}
<div className="rb:flex-1"> <div className="rb:flex-1">
<div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-1">{t('pricing.comboName')}</div> <div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-1">{t('pricing.comboName')}</div>
<div className="rb:text-[18px] rb:text-xl rb:font-bold rb:mb-1">{orderInfo.comboName}</div> <div className="rb:text-[18px] rb:text-xl rb:font-bold rb:mb-1">{orderInfo.comboName}</div>
<div className="rb:text-[12px] rb:text-[#5B6167]">{orderInfo.comboEdition}</div> <div className="rb:text-[12px] rb:text-[#5B6167]">{orderInfo.comboEdition}</div>
</div> </div>
{/* 解决方案和目标受众 */} {/* Solutions and Target Audience */}
<div className="rb:flex-2 rb:text-[12px] "> <div className="rb:flex-2 rb:text-[12px] ">
<div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-2">{t('pricing.spAndTa')}</div> <div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-2">{t('pricing.spAndTa')}</div>
<div className="rb:mb-4"> <div className="rb:mb-4">
@@ -268,7 +268,7 @@ const OrderPayment: React.FC = () => {
<div className="rb:text-[#5B6167]">{orderInfo.targetAudience}</div> <div className="rb:text-[#5B6167]">{orderInfo.targetAudience}</div>
</div> </div>
</div> </div>
{/* 版本信息 */} {/* Version Information */}
<div className="rb:flex-2 rb:text-[12px] rb:space-y-2"> <div className="rb:flex-2 rb:text-[12px] rb:space-y-2">
<div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-2">{t('pricing.versionInformation')}</div> <div className="rb:hidden rb:text-[12px] rb:text-[#5B6167] rb:mb-2">{t('pricing.versionInformation')}</div>
<div className="rb:flex rb:items-center rb:gap-2"> <div className="rb:flex rb:items-center rb:gap-2">
@@ -296,7 +296,7 @@ const OrderPayment: React.FC = () => {
</> </>
)} )}
</div> </div>
{/* 订购周期和金额 */} {/* Subscription Period and Amount */}
<div className="rb:w-32 rb:text-[12px] rb:text-[#5B6167]"> <div className="rb:w-32 rb:text-[12px] rb:text-[#5B6167]">
{orderInfo.orderingCycle} {orderInfo.orderingCycle}
</div> </div>
@@ -308,9 +308,9 @@ const OrderPayment: React.FC = () => {
</div> </div>
</div> </div>
{/* 支付方式和支付凭证 */} {/* Payment Method and Payment Voucher */}
<div className="rb:grid rb:grid-cols-2 rb:gap-6"> <div className="rb:grid rb:grid-cols-2 rb:gap-6">
{/* 支付方式 */} {/* Payment Method */}
<div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:p-4"> <div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:p-4">
<h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.paymentMethod')}</h2> <h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.paymentMethod')}</h2>
@@ -352,7 +352,7 @@ const OrderPayment: React.FC = () => {
</div> </div>
</div> </div>
{/* 支付凭证 */} {/* Payment Voucher */}
<div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:p-4"> <div className="rb:border rb:border-[#DFE4ED] rb:rounded-2xl rb:p-4">
<h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.paymentVoucher')}</h2> <h2 className="rb:text-[16px] rb:text-lg rb:font-semibold rb:mb-4">{t('pricing.paymentVoucher')}</h2>

View File

@@ -110,7 +110,7 @@ const Prompt: FC<{ editVo: HistoryItem | null; refresh: () => void; }> = ({ edit
break; break;
case 'end': case 'end':
setLoading(false) setLoading(false)
// 流结束时同步表单值 // Sync form values when stream ends
form.setFieldsValue({ current_prompt: currentPromptValueRef.current }) form.setFieldsValue({ current_prompt: currentPromptValueRef.current })
break break
} }

View File

@@ -27,19 +27,19 @@ import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
/** Configuration list */ /** Configuration list */
const configList = [ const configList = [
// 启用反思引擎 // Enable reflection engine
{ {
key: 'reflection_enabled', key: 'reflection_enabled',
type: 'switch', type: 'switch',
}, },
// 反思模型 // Reflection model
{ {
key: 'reflection_model_id', key: 'reflection_model_id',
type: 'customSelect', type: 'customSelect',
url: getModelListUrl, url: getModelListUrl,
params: { type: 'chat,llm', page: 1, pagesize: 100, is_active: true }, // chat,llm params: { type: 'chat,llm', page: 1, pagesize: 100, is_active: true }, // chat,llm
}, },
// 迭代周期 // Iteration period
{ {
key: 'reflection_period_in_hours', key: 'reflection_period_in_hours',
type: 'select', type: 'select',
@@ -51,7 +51,7 @@ const configList = [
{ label: 'daily', value: '24' }, { label: 'daily', value: '24' },
], ],
}, },
// 反思范围 // Reflection scope
{ {
key: 'reflexion_range', key: 'reflexion_range',
type: 'select', type: 'select',
@@ -61,7 +61,7 @@ const configList = [
{ label: 'all', value: 'all' }, { label: 'all', value: 'all' },
], ],
}, },
// 反思基线 // Reflection baseline
{ {
key: 'baseline', key: 'baseline',
type: 'select', type: 'select',
@@ -72,12 +72,12 @@ const configList = [
{ label: 'HYBRID', value: 'HYBRID' }, { label: 'HYBRID', value: 'HYBRID' },
], ],
}, },
// 质量评估 // Quality assessment
{ {
key: 'quality_assessment', key: 'quality_assessment',
type: 'switch', type: 'switch',
}, },
// 质量评估 // Quality assessment
{ {
key: 'memory_verify', key: 'memory_verify',
type: 'switch', type: 'switch',

View File

@@ -159,13 +159,13 @@ const Rag: FC = () => {
))} ))}
</div> </div>
{/* 记忆总量 */} {/* Total Memory */}
<div className="rb:font-regular rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:mb-6.25"> <div className="rb:font-regular rb:text-[12px] rb:text-[#5B6167] rb:leading-4 rb:mb-6.25">
{t('userMemory.totalNumOfMemories')} {t('userMemory.totalNumOfMemories')}
<div className="rb:font-extrabold rb:text-[24px] rb:text-[#212332] rb:leading-7.5 rb:mt-2">{memory || 0}</div> <div className="rb:font-extrabold rb:text-[24px] rb:text-[#212332] rb:leading-7.5 rb:mt-2">{memory || 0}</div>
</div> </div>
{/* 关于我 */} {/* About Me */}
<> <>
<Title <Title
type="aboutUs" type="aboutUs"
@@ -188,7 +188,7 @@ const Rag: FC = () => {
</> </>
)} )}
</> </>
{/* 记忆洞察 */} {/* Memory Insights */}
<> <>
<Title <Title
type="memoryInsight" type="memoryInsight"

View File

@@ -134,11 +134,10 @@ const EmotionTags: FC = () => {
<div ref={chartRef} className="rb:mt-6 rb:px-6" style={{ height: '320px', width: '100%' }} /> <div ref={chartRef} className="rb:mt-6 rb:px-6" style={{ height: '320px', width: '100%' }} />
<div className="rb:flex rb:flex-wrap rb:items-center rb:justify-center rb:gap-10 rb:text-sm rb:mt-3 rb:p-3 rb:bg-[#F0F3F8] rb:rounded-[0_0_8px_8px]"> <div className="rb:flex rb:flex-wrap rb:items-center rb:justify-center rb:gap-10 rb:text-sm rb:mt-3 rb:p-3 rb:bg-[#F0F3F8] rb:rounded-[0_0_8px_8px]">
{Object.entries(emotionStats).map(([type, count]) => { {Object.entries(emotionStats).map(([type, count]) => {
console.log(type)
return ( return (
<div key={type} className="rb:flex rb:items-center rb:gap-2"> <div key={type} className="rb:flex rb:items-center rb:gap-2">
<div className="rb:w-3 rb:h-3 rb:rounded-full" style={{ backgroundColor: getEmotionColor(type) }}></div> <div className="rb:w-3 rb:h-3 rb:rounded-full" style={{ backgroundColor: getEmotionColor(type) }}></div>
<span className="rb:leading-5">{t(`statementDetail.${type || 'neutral'}`)} ({count})</span> <span className="rb:leading-5">{t(`statementDetail.${type || 'neutral'}`)} ({count}{t('statementDetail.item')})</span>
</div> </div>
) )
})} })}

View File

@@ -69,7 +69,7 @@ const NodeStatistics: FC = () => {
getNodeStatistics(id).then((res) => { getNodeStatistics(id).then((res) => {
const response = res as NodeStatisticsItem[] const response = res as NodeStatisticsItem[]
setData(response) setData(response)
// 计算count总计 // Calculate total count
const totalCount = response.reduce((sum, item) => sum + (item.count || 0), 0) const totalCount = response.reduce((sum, item) => sum + (item.count || 0), 0)
setTotal(totalCount) setTotal(totalCount)
setLoading(false) setLoading(false)

View File

@@ -51,19 +51,19 @@ const RelationshipNetwork:FC = () => {
const curEdges: Edge[] = [] const curEdges: Edge[] = []
const curNodeTypes = Object.keys(statistics.node_types).filter(vo => vo !== 'Dialogue') const curNodeTypes = Object.keys(statistics.node_types).filter(vo => vo !== 'Dialogue')
// 计算每个节点的连接数 // Calculate connection count for each node
const connectionCount: Record<string, number> = {} const connectionCount: Record<string, number> = {}
edges.forEach(edge => { edges.forEach(edge => {
connectionCount[edge.source] = (connectionCount[edge.source] || 0) + 1 connectionCount[edge.source] = (connectionCount[edge.source] || 0) + 1
connectionCount[edge.target] = (connectionCount[edge.target] || 0) + 1 connectionCount[edge.target] = (connectionCount[edge.target] || 0) + 1
}) })
// 处理节点数据 // Process node data
nodes.filter(vo => vo.label !== 'Dialogue').forEach(node => { nodes.filter(vo => vo.label !== 'Dialogue').forEach(node => {
const connections = connectionCount[node.id] || 0 const connections = connectionCount[node.id] || 0
const categoryIndex = curNodeTypes.indexOf(node.label) const categoryIndex = curNodeTypes.indexOf(node.label)
// 根据节点类型获取显示名称 // Get display name based on node type
let displayName = '' let displayName = ''
switch (node.label) { switch (node.label) {
// case 'Statement': // case 'Statement':
@@ -93,16 +93,16 @@ const RelationshipNetwork:FC = () => {
...node, ...node,
name: displayName, name: displayName,
category: categoryIndex >= 0 ? categoryIndex : 0, category: categoryIndex >= 0 ? categoryIndex : 0,
symbolSize: symbolSize, // 根据连接数调整节点大小 symbolSize: symbolSize, // Adjust node size based on connection count
}) })
}) })
// 创建节点ID到标签的映射 // Create mapping from node ID to label
const nodeIdToLabel: Record<string, string> = {} const nodeIdToLabel: Record<string, string> = {}
nodes.forEach(node => { nodes.forEach(node => {
nodeIdToLabel[node.id] = node.label nodeIdToLabel[node.id] = node.label
}) })
// 处理边数据 // Process edge data
edges.forEach(edge => { edges.forEach(edge => {
curEdges.push({ curEdges.push({
...edge, ...edge,
@@ -112,7 +112,7 @@ const RelationshipNetwork:FC = () => {
}) })
}) })
// 设置分类 // Set categories
const curCategories = curNodeTypes.map(type => ({ name: type })) const curCategories = curNodeTypes.map(type => ({ name: type }))
setNodes(curNodes) setNodes(curNodes)
@@ -160,7 +160,7 @@ const RelationshipNetwork:FC = () => {
return ( return (
<Row gutter={16}> <Row gutter={16}>
{/* 关系网络 */} {/* Relationship Network */}
<Col span={16}> <Col span={16}>
<RbCard <RbCard
title={t('userMemory.relationshipNetwork')} title={t('userMemory.relationshipNetwork')}
@@ -211,22 +211,22 @@ const RelationshipNetwork:FC = () => {
}, },
force: { force: {
repulsion: 100, repulsion: 100,
// 启用类别聚合 // Enable category aggregation
edgeLength: 80, edgeLength: 80,
gravity: 0.3, gravity: 0.3,
// 同类别的节点相互吸引 // Nodes of the same category attract each other
layoutAnimation: true, layoutAnimation: true,
// 防止点击时重新计算布局 // Prevent layout recalculation on click
preventOverlap: true, preventOverlap: true,
// 点击节点后保持布局稳定 // Keep layout stable after node click
edgeSymbol: ['none', 'arrow'], edgeSymbol: ['none', 'arrow'],
edgeSymbolSize: [4, 10], edgeSymbolSize: [4, 10],
// 初始布局完成后关闭力导向 // Disable force-directed after initial layout
initLayout: 'force' initLayout: 'force'
}, },
selectedMode: 'single', selectedMode: 'single',
draggable: true, draggable: true,
// 防止数据更新时重新计算布局 // Prevent layout recalculation on data update
animationDurationUpdate: 0, animationDurationUpdate: 0,
select: { select: {
itemStyle: { itemStyle: {
@@ -242,12 +242,12 @@ const RelationshipNetwork:FC = () => {
notMerge={false} notMerge={false}
lazyUpdate={true} lazyUpdate={true}
onEvents={{ onEvents={{
// 节点点击事件处理 // Node click event handler
click: (params: { dataType: string; data: Node; name: string }) => { click: (params: { dataType: string; data: Node; name: string }) => {
if (params.dataType === 'node') { if (params.dataType === 'node') {
// 处理节点点击事件 // Handle node click event
console.log('Node clicked:', params.data); console.log('Node clicked:', params.data);
// 使用函数式更新避免状态依赖问题 // Use functional update to avoid state dependency issues
setSelectedNode(params.data) setSelectedNode(params.data)
} }
} }
@@ -257,7 +257,7 @@ const RelationshipNetwork:FC = () => {
</div> </div>
</RbCard> </RbCard>
</Col> </Col>
{/* 记忆详情 */} {/* Memory Details */}
<Col span={8}> <Col span={8}>
<RbCard <RbCard
title={t('userMemory.memoryDetails')} title={t('userMemory.memoryDetails')}

View File

@@ -79,7 +79,7 @@ const WordCloud: FC = () => {
const radarOption = useMemo(() => { const radarOption = useMemo(() => {
if (!wordCloud?.tags.length) return {} if (!wordCloud?.tags.length) return {}
// avg_intensity转换为1-100范围 // Convert avg_intensity to 1-100 range
const radarData = wordCloud.tags.map(item => ({ const radarData = wordCloud.tags.map(item => ({
name: item.emotion_type, name: item.emotion_type,
value: Math.round(item.avg_intensity * 100), value: Math.round(item.avg_intensity * 100),