From 9206c7642a80c388ae080e35947ed092ad8d24e8 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 29 Jan 2026 17:13:30 +0800 Subject: [PATCH] feat(web): memory management add scene --- .../components/MemoryForm.tsx | 19 +++++++++++++++++++ web/src/views/MemoryManagement/index.tsx | 13 +++++++++++-- web/src/views/MemoryManagement/types.ts | 3 +++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/web/src/views/MemoryManagement/components/MemoryForm.tsx b/web/src/views/MemoryManagement/components/MemoryForm.tsx index 7eb8f0c9..84b0d9c2 100644 --- a/web/src/views/MemoryManagement/components/MemoryForm.tsx +++ b/web/src/views/MemoryManagement/components/MemoryForm.tsx @@ -1,9 +1,12 @@ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, Input, App } from 'antd'; import { useTranslation } from 'react-i18next'; + import type { MemoryFormData, Memory, MemoryFormRef } from '../types'; import RbModal from '@/components/RbModal' import { createMemoryConfig, updateMemoryConfig } from '@/api/memory' +import { getOntologyScenesUrl } from '@/api/ontology' +import CustomSelect from '@/components/CustomSelect'; const FormItem = Form.Item; @@ -38,6 +41,7 @@ const MemoryForm = forwardRef(({ form.setFieldsValue({ config_name: memory.config_name, config_desc: memory.config_desc, + scene_id: memory.scene_id }); } else { form.resetFields(); @@ -102,6 +106,21 @@ const MemoryForm = forwardRef(({ > + + + + ); diff --git a/web/src/views/MemoryManagement/index.tsx b/web/src/views/MemoryManagement/index.tsx index 80d7af16..a81e53d6 100644 --- a/web/src/views/MemoryManagement/index.tsx +++ b/web/src/views/MemoryManagement/index.tsx @@ -10,6 +10,7 @@ import { getMemoryConfigList, deleteMemoryConfig } from '@/api/memory' import BodyWrapper from '@/components/Empty/BodyWrapper' import { formatDateTime } from '@/utils/format'; import clsx from 'clsx' +import RbAlert from '@/components/RbAlert' const MemoryManagement: React.FC = () => { const { t } = useTranslation(); @@ -98,10 +99,18 @@ const MemoryManagement: React.FC = () => {
{item.config_desc}
+ +
+ {t('memory.scene_id')}: + + {item.scene_name || '-'} + +
+
-
+
{['memoryExtractionEngine', 'forgottenEngine', 'emotionEngine', 'reflectionEngine'].map((key) => ( -
handleClick(item.config_id, key)} > {t(`memory.${key}`)} diff --git a/web/src/views/MemoryManagement/types.ts b/web/src/views/MemoryManagement/types.ts index f926c6c8..5fa84822 100644 --- a/web/src/views/MemoryManagement/types.ts +++ b/web/src/views/MemoryManagement/types.ts @@ -3,6 +3,7 @@ export interface MemoryFormData { config_id?: number; config_name: string; config_desc?: string; + scene_id?: string; } // 内存数据类型 @@ -30,6 +31,8 @@ export interface Memory { updated_at: string; config_desc: string; workspace_id: string; + scene_id: string; + scene_name: string; [key: string]: string | number | boolean; } // 定义组件暴露的方法接口