style(web): translate the comments in the src/views directory into English
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 16:56:54
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 16:57:17
|
||||
*/
|
||||
/**
|
||||
* Emotion Engine Configuration Page
|
||||
* Configures emotion analysis settings for memory system
|
||||
* Includes model selection, intensity threshold, and feature toggles
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Row, Col, Form, Slider, Button, Alert, message, Space } from 'antd';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import RbCard from '@/components/RbCard/Card';
|
||||
import strategyImpactSimulator from '@/assets/images/memory/strategyImpactSimulator.svg'
|
||||
import { getMemoryEmotionConfig, updateMemoryEmotionConfig } from '@/api/memory'
|
||||
@@ -11,6 +24,9 @@ import { getModelListUrl } from '@/api/models'
|
||||
import Tag from '@/components/Tag'
|
||||
import SwitchFormItem from '@/components/FormItem/SwitchFormItem'
|
||||
|
||||
/**
|
||||
* Configuration field definitions
|
||||
*/
|
||||
const configList = [
|
||||
{
|
||||
key: 'emotion_enabled',
|
||||
@@ -41,6 +57,9 @@ const configList = [
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
* Emotion engine configuration component
|
||||
*/
|
||||
const EmotionEngine: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const { id } = useParams();
|
||||
@@ -55,6 +74,7 @@ const EmotionEngine: React.FC = () => {
|
||||
getConfigData()
|
||||
}, [id])
|
||||
|
||||
/** Fetch emotion engine configuration */
|
||||
const getConfigData = () => {
|
||||
if (!id) {
|
||||
return
|
||||
@@ -72,9 +92,11 @@ const EmotionEngine: React.FC = () => {
|
||||
console.error('Failed to load data');
|
||||
})
|
||||
}
|
||||
/** Reset form to saved configuration */
|
||||
const handleReset = () => {
|
||||
form.setFieldsValue(configData);
|
||||
}
|
||||
/** Save emotion engine configuration */
|
||||
const handleSave = () => {
|
||||
if (!id) {
|
||||
return
|
||||
|
||||
@@ -1,48 +1,99 @@
|
||||
// 标签表单数据类型
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 16:57:37
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 16:57:37
|
||||
*/
|
||||
/**
|
||||
* Type definitions for Emotion Engine
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tag form data (legacy, not used in current implementation)
|
||||
*/
|
||||
export interface TagFormData {
|
||||
/** Tag name */
|
||||
tagName: string;
|
||||
/** Tag type */
|
||||
type: string;
|
||||
/** Tag color */
|
||||
color: string;
|
||||
/** Tag description */
|
||||
description?: string;
|
||||
/** Applicable scope */
|
||||
applicableScope?: string[];
|
||||
/** Semantic expansion */
|
||||
semanticExpansion?: string;
|
||||
/** Whether tag is active */
|
||||
isActive?: boolean;
|
||||
// 扩展字段用于区分编辑和新增操作
|
||||
/** Whether in editing mode */
|
||||
isEditing?: boolean;
|
||||
/** Tag ID */
|
||||
tagId?: string;
|
||||
}
|
||||
|
||||
// 记忆总览数据类型
|
||||
/**
|
||||
* Memory overview record (legacy, not used in current implementation)
|
||||
*/
|
||||
export interface MemoryOverviewRecord {
|
||||
/** Record ID */
|
||||
id: number;
|
||||
/** Memory ID */
|
||||
memoryID: string,
|
||||
/** Content summary */
|
||||
contentSummary: string;
|
||||
/** Memory type */
|
||||
type: string;
|
||||
/** Creation time */
|
||||
createTime: string;
|
||||
/** Last call time */
|
||||
lastCallTime: string;
|
||||
/** Retention degree */
|
||||
retentionDegree: string;
|
||||
/** Status */
|
||||
status: string;
|
||||
}
|
||||
// 定义组件暴露的方法接口
|
||||
|
||||
/**
|
||||
* Memory overview form ref interface (legacy)
|
||||
*/
|
||||
export interface MemoryOverviewFormRef {
|
||||
/** Open form with optional record */
|
||||
handleOpen: (memoryOverview?: MemoryOverviewRecord | null) => void;
|
||||
}
|
||||
|
||||
// 遗忘曲线数据类型
|
||||
/**
|
||||
* Forgetting curve record (legacy, not used in current implementation)
|
||||
*/
|
||||
export interface CurveRecord {
|
||||
/** Memory ID */
|
||||
memoryID: string;
|
||||
/** Memory type */
|
||||
type: string;
|
||||
/** Current retention rate */
|
||||
currentRetentionRate: string;
|
||||
/** Finally activated time */
|
||||
finallyActivated: string;
|
||||
/** Expected forgetting time */
|
||||
expectedForgettingTime: string;
|
||||
/** Reinforcement count */
|
||||
reinforcementCount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emotion engine configuration form
|
||||
*/
|
||||
export interface ConfigForm {
|
||||
/** Configuration ID */
|
||||
config_id: number | string;
|
||||
/** Whether emotion engine is enabled */
|
||||
emotion_enabled: boolean;
|
||||
/** Emotion analysis model ID */
|
||||
emotion_model_id: string;
|
||||
/** Whether to extract keywords */
|
||||
emotion_extract_keywords: boolean;
|
||||
/** Minimum emotion intensity threshold (0-1) */
|
||||
emotion_min_intensity: number;
|
||||
/** Whether to enable subject extraction */
|
||||
emotion_enable_subject: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user