diff --git a/frontend/src/components/GraphPanel.vue b/frontend/src/components/GraphPanel.vue index 314c966..632bbd4 100644 --- a/frontend/src/components/GraphPanel.vue +++ b/frontend/src/components/GraphPanel.vue @@ -4,11 +4,11 @@ Graph Relationship Visualization
- -
@@ -27,7 +27,7 @@ - {{ isSimulating ? 'GraphRAG长短期记忆实时更新中' : '实时更新中...' }} + {{ isSimulating ? 'GraphRAG memory updating in real time' : 'Updating in real time...' }} @@ -39,8 +39,8 @@ - 还有少量内容处理中,建议稍后手动刷新图谱 - @@ -337,7 +337,7 @@ const truncateText = (text, maxLength) => { // 从模拟需求生成标题(取前20字) const getSimulationTitle = (requirement) => { - if (!requirement) return '未命名模拟' + if (!requirement) return 'Untitled Simulation' const title = requirement.slice(0, 20) return requirement.length > 20 ? title + '...' : title } @@ -353,8 +353,8 @@ const formatSimulationId = (simulationId) => { const formatRounds = (simulation) => { const current = simulation.current_round || 0 const total = simulation.total_rounds || 0 - if (total === 0) return '未开始' - return `${current}/${total} 轮` + if (total === 0) return 'Not Started' + return `${current}/${total} rounds` } // 获取文件类型(用于样式) @@ -382,7 +382,7 @@ const getFileTypeLabel = (filename) => { // 截断文件名(保留扩展名) const truncateFilename = (filename, maxLength) => { - if (!filename) return '未知文件' + if (!filename) return 'Unknown file' if (filename.length <= maxLength) return filename const ext = filename.includes('.') ? '.' + filename.split('.').pop() : '' diff --git a/frontend/src/components/Step1GraphBuild.vue b/frontend/src/components/Step1GraphBuild.vue index de33a3f..4e2e35e 100644 --- a/frontend/src/components/Step1GraphBuild.vue +++ b/frontend/src/components/Step1GraphBuild.vue @@ -6,25 +6,25 @@
01 - 本体生成 + Ontology Generation
- 已完成 - 生成中 - 等待 + Done + Generating + Waiting

POST /api/graph/ontology/generate

- LLM分析文档内容与模拟需求,提取出现实种子,自动生成合适的本体结构 + LLM analyzes document content and simulation requirements, extracts reality seeds, and automatically generates a suitable ontology structure

- {{ ontologyProgress.message || '正在分析文档...' }} + {{ ontologyProgress.message || 'Analyzing documents...' }}
@@ -110,34 +110,34 @@
02 - GraphRAG构建 + GraphRAG Build
- 已完成 + Done {{ buildProgress?.progress || 0 }}% - 等待 + Waiting

POST /api/graph/build

- 基于生成的本体,将文档自动分块后调用 Zep 构建知识图谱,提取实体和关系,并形成时序记忆与社区摘要 + Based on the generated ontology, documents are automatically chunked and sent to Zep to build a knowledge graph, extracting entities and relations with temporal memory and community summaries

{{ graphStats.nodes }} - 实体节点 + Entity Nodes
{{ graphStats.edges }} - 关系边 + Relation Edges
{{ graphStats.types }} - SCHEMA类型 + Schema Types
@@ -148,23 +148,23 @@
03 - 构建完成 + Build Complete
- 进行中 + In Progress

POST /api/simulation/create

-

图谱构建已完成,请进入下一步进行模拟环境搭建

+

Graph build is complete. Proceed to the next step for simulation environment setup.

@@ -233,11 +233,11 @@ const handleEnterEnvSetup = async () => { }) } else { console.error('创建模拟失败:', res.error) - alert('创建模拟失败: ' + (res.error || '未知错误')) + alert('Failed to create simulation: ' + (res.error || 'Unknown error')) } } catch (err) { console.error('创建模拟异常:', err) - alert('创建模拟异常: ' + err.message) + alert('Simulation creation error: ' + err.message) } finally { creatingSimulation.value = false } diff --git a/frontend/src/components/Step2EnvSetup.vue b/frontend/src/components/Step2EnvSetup.vue index eae776a..fa214ab 100644 --- a/frontend/src/components/Step2EnvSetup.vue +++ b/frontend/src/components/Step2EnvSetup.vue @@ -6,18 +6,18 @@
01 - 模拟实例初始化 + Simulation Instance Init
- 已完成 - 初始化 + Complete + Initializing

POST /api/simulation/create

- 新建simulation实例,拉取模拟世界参数模版 + Create a new simulation instance and pull world parameter templates

@@ -35,7 +35,7 @@
Task ID - {{ taskId || '异步任务已完成' }} + {{ taskId || 'Async task complete' }}
@@ -46,41 +46,41 @@
02 - 生成 Agent 人设 + Generate Agent Personas
- 已完成 + Complete {{ prepareProgress }}% - 等待 + Waiting

POST /api/simulation/prepare

- 结合上下文,自动调用工具从知识图谱梳理实体与关系,初始化模拟个体,并基于现实种子赋予他们独特的行为与记忆 + Using context, automatically extract entities and relations from the knowledge graph, initialize simulation agents, and assign them unique behaviors and memories based on real-world seeds

{{ profiles.length }} - 当前Agent数 + Current Agents
{{ expectedTotal || '-' }} - 预期Agent总数 + Expected Total Agents
{{ totalTopicsCount }} - 现实种子当前关联话题数 + Related Topics from Seeds
- 已生成的 Agent 人设 + Generated Agent Personas
@{{ profile.name || `agent_${idx}` }}
- {{ profile.profession || '未知职业' }} + {{ profile.profession || 'Unknown' }}
-

{{ profile.bio || '暂无简介' }}

+

{{ profile.bio || 'No bio available' }}

03 - 生成双平台模拟配置 + Generate Dual-Platform Config
- 已完成 - 生成中 - 等待 + Complete + Generating + Waiting

POST /api/simulation/prepare

- LLM 根据模拟需求与现实种子,智能设置世界时间流速、推荐算法、每个个体的活跃时间段、发言频率、事件触发等参数 + LLM intelligently configures world time flow, recommendation algorithms, activity schedules, posting frequency, and event triggers based on simulation requirements and real-world seeds

@@ -139,40 +139,40 @@
- 模拟时长 - {{ simulationConfig.time_config?.total_simulation_hours || '-' }} 小时 + Duration + {{ simulationConfig.time_config?.total_simulation_hours || '-' }} hours
- 每轮时长 - {{ simulationConfig.time_config?.minutes_per_round || '-' }} 分钟 + Round Duration + {{ simulationConfig.time_config?.minutes_per_round || '-' }} min
- 总轮次 - {{ Math.floor((simulationConfig.time_config?.total_simulation_hours * 60 / simulationConfig.time_config?.minutes_per_round)) || '-' }} 轮 + Total Rounds + {{ Math.floor((simulationConfig.time_config?.total_simulation_hours * 60 / simulationConfig.time_config?.minutes_per_round)) || '-' }} rounds
- 每小时活跃 + Active per Hour {{ simulationConfig.time_config?.agents_per_hour_min }}-{{ simulationConfig.time_config?.agents_per_hour_max }}
- 高峰时段 + Peak Hours {{ simulationConfig.time_config?.peak_hours?.join(':00, ') }}:00 ×{{ simulationConfig.time_config?.peak_activity_multiplier }}
- 工作时段 + Work Hours {{ simulationConfig.time_config?.work_hours?.[0] }}:00-{{ simulationConfig.time_config?.work_hours?.slice(-1)[0] }}:00 ×{{ simulationConfig.time_config?.work_activity_multiplier }}
- 早间时段 + Morning Hours {{ simulationConfig.time_config?.morning_hours?.[0] }}:00-{{ simulationConfig.time_config?.morning_hours?.slice(-1)[0] }}:00 ×{{ simulationConfig.time_config?.morning_activity_multiplier }}
- 低谷时段 + Off-Peak Hours {{ simulationConfig.time_config?.off_peak_hours?.[0] }}:00-{{ simulationConfig.time_config?.off_peak_hours?.slice(-1)[0] }}:00 ×{{ simulationConfig.time_config?.off_peak_activity_multiplier }}
@@ -182,8 +182,8 @@
- Agent 配置 - {{ simulationConfig.agent_configs?.length || 0 }} 个 + Agent Configuration + {{ simulationConfig.agent_configs?.length || 0 }}
- 活跃时段 + Active Hours
- 发帖/时 + Posts/hr {{ agent.posts_per_hour }}
- 评论/时 + Comments/hr {{ agent.comments_per_hour }}
- 响应延迟 + Response Delay {{ agent.response_delay_min }}-{{ agent.response_delay_max }}min
- 活跃度 + Activity Level {{ (agent.activity_level * 100).toFixed(0) }}%
- 情感倾向 + Sentiment {{ agent.sentiment_bias > 0 ? '+' : '' }}{{ agent.sentiment_bias?.toFixed(1) }}
- 影响力 + Influence {{ agent.influence_weight?.toFixed(1) }}
@@ -267,59 +267,59 @@
- 推荐算法配置 + Recommendation Algorithm Config
- 平台 1:广场 / 信息流 + Platform 1: Feed / Timeline
- 时效权重 + Recency Weight {{ simulationConfig.twitter_config.recency_weight }}
- 热度权重 + Popularity Weight {{ simulationConfig.twitter_config.popularity_weight }}
- 相关性权重 + Relevance Weight {{ simulationConfig.twitter_config.relevance_weight }}
- 病毒阈值 + Viral Threshold {{ simulationConfig.twitter_config.viral_threshold }}
- 回音室强度 + Echo Chamber Intensity {{ simulationConfig.twitter_config.echo_chamber_strength }}
- 平台 2:话题 / 社区 + Platform 2: Topics / Community
- 时效权重 + Recency Weight {{ simulationConfig.reddit_config.recency_weight }}
- 热度权重 + Popularity Weight {{ simulationConfig.reddit_config.popularity_weight }}
- 相关性权重 + Relevance Weight {{ simulationConfig.reddit_config.relevance_weight }}
- 病毒阈值 + Viral Threshold {{ simulationConfig.reddit_config.viral_threshold }}
- 回音室强度 + Echo Chamber Intensity {{ simulationConfig.reddit_config.echo_chamber_strength }}
@@ -330,7 +330,7 @@
- LLM 配置推理 + LLM Config Reasoning
04 - 初始激活编排 + Initial Activation Orchestration
- 已完成 - 编排中 - 等待 + Complete + Orchestrating + Waiting

POST /api/simulation/prepare

- 基于叙事方向,自动生成初始激活事件与热点话题,引导模拟世界的初始状态 + Based on narrative direction, automatically generate initial activation events and trending topics to guide the simulation world's initial state

@@ -380,14 +380,14 @@ - 叙事引导方向 + Narrative Direction

{{ simulationConfig.event_config.narrative_direction }}

- 初始热点话题 + Initial Trending Topics
# {{ topic }} @@ -397,7 +397,7 @@
- 初始激活序列 ({{ simulationConfig.event_config.initial_posts.length }}) + Initial Activation Sequence ({{ simulationConfig.event_config.initial_posts.length }})
@@ -423,29 +423,29 @@
05 - 准备完成 + Setup Complete
- 进行中 - 等待 + In Progress + Waiting

POST /api/simulation/start

-

模拟环境已准备完成,可以开始运行模拟

+

Simulation environment is ready. You can now start the simulation

- 模拟轮数设定 - MiroFish 自动规划推演现实 {{ simulationConfig?.time_config?.total_simulation_hours || '-' }} 小时,每轮代表现实 {{ simulationConfig?.time_config?.minutes_per_round || '-' }} 分钟时间流逝 + Simulation Rounds Config + MiroFish auto-planned {{ simulationConfig?.time_config?.total_simulation_hours || '-' }} hours of real-time, each round representing {{ simulationConfig?.time_config?.minutes_per_round || '-' }} minutes of elapsed time
@@ -454,10 +454,10 @@
{{ customMaxRounds }} - + rounds
- 若Agent规模为100:预计耗时约 {{ Math.round(customMaxRounds * 0.6) }} 分钟 + For 100 agents: estimated time ~ {{ Math.round(customMaxRounds * 0.6) }} min
@@ -478,7 +478,7 @@ :class="{ active: customMaxRounds === 40 }" @click="customMaxRounds = 40" :style="{ position: 'absolute', left: `calc(${(40 - 10) / (autoGeneratedRounds - 10) * 100}% - 30px)` }" - >40 (推荐) + >40 (Recommended) {{ autoGeneratedRounds }}
@@ -488,7 +488,7 @@
{{ autoGeneratedRounds }} - + rounds
@@ -497,11 +497,11 @@ - 若Agent规模为100:预计耗时 {{ Math.round(autoGeneratedRounds * 0.6) }} 分钟 + For 100 agents: estimated time {{ Math.round(autoGeneratedRounds * 0.6) }} min
-

若首次运行,强烈建议切换至‘自定义模式’减少模拟轮数,以便快速预览效果并降低报错风险 ➝

+

For your first run, we strongly recommend switching to Custom mode with fewer rounds for a quick preview and to reduce error risk ➝

@@ -514,14 +514,14 @@ class="action-btn secondary" @click="$emit('go-back')" > - ← 返回图谱构建 + ← Back to Graph Build
@@ -547,32 +547,32 @@
@@ -129,7 +129,7 @@
- 正在生成{{ section.title }}... + Generating {{ section.title }}...
@@ -98,7 +98,7 @@ - 与Report Agent对话 + Chat with Report Agent
@@ -141,7 +141,7 @@ - 发送问卷调查到世界中 + Send Survey to Agents
@@ -155,7 +155,7 @@
R
Report Agent - Chat
-
报告生成智能体的快速对话版本,可调用 4 种专业工具,拥有MiroFish的完整记忆
+
Quick chat with the report agent. Has access to 4 specialized tools and MiroFish's full memory
-
InsightForge 深度归因
-
对齐现实世界种子数据与模拟环境状态,结合Global/Local Memory机制,提供跨时空的深度归因分析
+
InsightForge Deep Attribution
+
Aligns real-world seed data with simulation state using Global/Local Memory for cross-temporal deep attribution analysis
@@ -184,8 +184,8 @@
-
PanoramaSearch 全景追踪
-
基于图结构的广度遍历算法,重构事件传播路径,捕获全量信息流动的拓扑结构
+
PanoramaSearch Full Trace
+
Graph-based BFS algorithm that reconstructs event propagation paths and captures full information flow topology
@@ -195,8 +195,8 @@
-
QuickSearch 快速检索
-
基于 GraphRAG 的即时查询接口,优化索引效率,用于快速提取具体的节点属性与离散事实
+
QuickSearch Quick Lookup
+
GraphRAG-based instant query interface, optimized for quick extraction of node properties and discrete facts
@@ -208,8 +208,8 @@
-
InterviewSubAgent 虚拟访谈
-
自主式访谈,能够并行与模拟世界中个体进行多轮对话,采集非结构化的观点数据与心理状态
+
InterviewSubAgent Virtual Interview
+
Autonomous interview agent that conducts parallel multi-turn conversations with simulated agents, collecting unstructured opinion data and psychological states
@@ -224,7 +224,7 @@
{{ selectedAgent.username }}
@{{ selectedAgent.name }} - {{ selectedAgent.profession || '未知职业' }} + {{ selectedAgent.profession || 'Unknown' }}
-
简介
+
Bio

{{ selectedAgent.bio }}

@@ -250,7 +250,7 @@

- {{ chatTarget === 'report_agent' ? '与 Report Agent 对话,深入了解报告内容' : '与模拟个体对话,了解他们的观点' }} + {{ chatTarget === 'report_agent' ? 'Chat with the Report Agent to explore report details' : 'Chat with a simulated agent to learn their perspective' }}

- 选择调查对象 - 已选 {{ selectedAgents.size }} / {{ profiles.length }} + Select Survey Recipients + Selected {{ selectedAgents.size }} / {{ profiles.length }}
{{ agent.username }} - {{ agent.profession || '未知职业' }} + {{ agent.profession || 'Unknown' }}
@@ -345,20 +345,20 @@
- + | - +
- 问卷问题 + Survey Question
@@ -369,15 +369,15 @@ @click="submitSurvey" > - 发送问卷 + Send Survey
- 调查结果 - {{ surveyResults.length }} 条回复 + Survey Results + {{ surveyResults.length }} responses
{{ (result.agent_name || 'A')[0] }}
{{ result.agent_name }} - {{ result.profession || '未知职业' }} + {{ result.profession || 'Unknown' }}
@@ -535,7 +535,7 @@ const selectAgent = (agent, idx) => { // 恢复该 Agent 的对话记录 chatHistory.value = chatHistoryCache.value[`agent_${idx}`] || [] - addLog(`选择对话对象: ${agent.username}`) + addLog(`Selected chat partner: ${agent.username}`) } const formatTime = (timestamp) => { @@ -662,10 +662,10 @@ const sendMessage = async () => { await sendToAgent(message) } } catch (err) { - addLog(`发送失败: ${err.message}`) + addLog(`Send failed: ${err.message}`) chatHistory.value.push({ role: 'assistant', - content: `抱歉,发生了错误: ${err.message}`, + content: `Sorry, an error occurred: ${err.message}`, timestamp: new Date().toISOString() }) } finally { @@ -677,7 +677,7 @@ const sendMessage = async () => { } const sendToReportAgent = async (message) => { - addLog(`向 Report Agent 发送: ${message.substring(0, 50)}...`) + addLog(`Sent to Report Agent: ${message.substring(0, 50)}...`) // Build chat history for API const historyForApi = chatHistory.value @@ -697,21 +697,21 @@ const sendToReportAgent = async (message) => { if (res.success && res.data) { chatHistory.value.push({ role: 'assistant', - content: res.data.response || res.data.answer || '无响应', + content: res.data.response || res.data.answer || 'No response', timestamp: new Date().toISOString() }) - addLog('Report Agent 已回复') + addLog('Report Agent replied') } else { - throw new Error(res.error || '请求失败') + throw new Error(res.error || 'Request failed') } } const sendToAgent = async (message) => { if (!selectedAgent.value || selectedAgentIndex.value === null) { - throw new Error('请先选择一个模拟个体') + throw new Error('Please select a simulated agent first') } - addLog(`向 ${selectedAgent.value.username} 发送: ${message.substring(0, 50)}...`) + addLog(`Sent to ${selectedAgent.value.username}: ${message.substring(0, 50)}...`) // Build prompt with chat history let prompt = message @@ -719,9 +719,9 @@ const sendToAgent = async (message) => { const historyContext = chatHistory.value .filter(msg => msg.content !== message) .slice(-6) - .map(msg => `${msg.role === 'user' ? '提问者' : '你'}:${msg.content}`) + .map(msg => `${msg.role === 'user' ? 'User' : 'You'}: ${msg.content}`) .join('\n') - prompt = `以下是我们之前的对话:\n${historyContext}\n\n现在我的新问题是:${message}` + prompt = `Here is our previous conversation:\n${historyContext}\n\nMy new question is: ${message}` } const res = await interviewAgents({ @@ -761,12 +761,12 @@ const sendToAgent = async (message) => { content: responseContent, timestamp: new Date().toISOString() }) - addLog(`${selectedAgent.value.username} 已回复`) + addLog(`${selectedAgent.value.username} replied`) } else { - throw new Error('无响应数据') + throw new Error('No response data') } } else { - throw new Error(res.error || '请求失败') + throw new Error(res.error || 'Request failed') } } @@ -803,7 +803,7 @@ const submitSurvey = async () => { if (selectedAgents.value.size === 0 || !surveyQuestion.value.trim()) return isSurveying.value = true - addLog(`发送问卷给 ${selectedAgents.value.size} 个对象...`) + addLog(`Sending survey to ${selectedAgents.value.size} agents...`) try { const interviews = Array.from(selectedAgents.value).map(idx => ({ @@ -830,20 +830,20 @@ const submitSurvey = async () => { const agent = profiles.value[agentIdx] // 优先使用 reddit 平台回复,其次 twitter - let responseContent = '无响应' + let responseContent = 'No response' if (typeof resultsDict === 'object' && !Array.isArray(resultsDict)) { const redditKey = `reddit_${agentIdx}` const twitterKey = `twitter_${agentIdx}` const agentResult = resultsDict[redditKey] || resultsDict[twitterKey] if (agentResult) { - responseContent = agentResult.response || agentResult.answer || '无响应' + responseContent = agentResult.response || agentResult.answer || 'No response' } } else if (Array.isArray(resultsDict)) { // 兼容数组格式 const matchedResult = resultsDict.find(r => r.agent_id === agentIdx) if (matchedResult) { - responseContent = matchedResult.response || matchedResult.answer || '无响应' + responseContent = matchedResult.response || matchedResult.answer || 'No response' } } @@ -857,12 +857,12 @@ const submitSurvey = async () => { } surveyResults.value = surveyResultsList - addLog(`收到 ${surveyResults.value.length} 条回复`) + addLog(`Received ${surveyResults.value.length} responses`) } else { - throw new Error(res.error || '请求失败') + throw new Error(res.error || 'Request failed') } } catch (err) { - addLog(`问卷发送失败: ${err.message}`) + addLog(`Survey send failed: ${err.message}`) } finally { isSurveying.value = false } @@ -873,7 +873,7 @@ const loadReportData = async () => { if (!props.reportId) return try { - addLog(`加载报告数据: ${props.reportId}`) + addLog(`Loading report data: ${props.reportId}`) // Get report info const reportRes = await getReport(props.reportId) @@ -882,7 +882,7 @@ const loadReportData = async () => { await loadAgentLogs() } } catch (err) { - addLog(`加载报告失败: ${err.message}`) + addLog(`Failed to load report: ${err.message}`) } } @@ -904,10 +904,10 @@ const loadAgentLogs = async () => { } }) - addLog('报告数据加载完成') + addLog('Report data loaded') } } catch (err) { - addLog(`加载报告日志失败: ${err.message}`) + addLog(`Failed to load report logs: ${err.message}`) } } @@ -918,10 +918,10 @@ const loadProfiles = async () => { const res = await getSimulationProfilesRealtime(props.simulationId, 'reddit') if (res.success && res.data) { profiles.value = res.data.profiles || [] - addLog(`加载了 ${profiles.value.length} 个模拟个体`) + addLog(`Loaded ${profiles.value.length} simulated agents`) } } catch (err) { - addLog(`加载模拟个体失败: ${err.message}`) + addLog(`Failed to load simulated agents: ${err.message}`) } } @@ -935,7 +935,7 @@ const handleClickOutside = (e) => { // Lifecycle onMounted(() => { - addLog('Step5 深度互动初始化') + addLog('Step5 deep interaction initialized') loadReportData() loadProfiles() document.addEventListener('click', handleClickOutside) diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index afe01a0..3648936 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -5,7 +5,7 @@ @@ -15,21 +15,21 @@
- 简洁通用的群体智能引擎 - / v0.1-预览版 + A Versatile Collective Intelligence Engine + / v0.1-preview

- 上传任意报告
- 即刻推演未来 + Upload Any Report
+ Simulate the Future

- 即使只有一段文字,MiroFish 也能基于其中的现实种子,全自动生成与之对应的至多百万级Agent构成的平行世界。通过上帝视角注入变量,在复杂的群体交互中寻找动态环境下的“局部最优解” + Even from a single piece of text, MiroFish can extract reality seeds and automatically generate a parallel world with up to millions of Agents. Inject variables from a god's-eye view and find the "local optimum" in complex group interactions under dynamic conditions.

- 让未来在 Agent 群中预演,让决策在百战后胜出_ + Let the future rehearse among Agents. Let decisions win after a thousand battles._

@@ -53,65 +53,65 @@
- 系统状态 + System Status
-

准备就绪

+

Ready

- 预测引擎待命中,可上传多份非结构化数据以初始化模拟序列 + Prediction engine standing by. Upload unstructured data to initialize a simulation sequence.

-
低成本
-
常规模拟平均5$/次
+
Low Cost
+
~$5 per simulation on average
-
高可用
-
最多百万级Agent模拟
+
Scalable
+
Simulate millions of Agents
- 工作流序列 + Workflow Sequence
01
-
图谱构建
-
现实种子提取 & 个体与群体记忆注入 & GraphRAG构建
+
Graph Build
+
Reality seed extraction & individual/group memory injection & GraphRAG construction
02
-
环境搭建
-
实体关系抽取 & 人设生成 & 环境配置Agent注入仿真参数
+
Env Setup
+
Entity-relation extraction & persona generation & environment config with agent simulation parameters
03
-
开始模拟
-
双平台并行模拟 & 自动解析预测需求 & 动态更新时序记忆
+
Run Simulation
+
Dual-platform parallel simulation & auto-parse prediction needs & dynamic temporal memory updates
04
-
报告生成
-
ReportAgent拥有丰富的工具集与模拟后环境进行深度交互
+
Report Generation
+
ReportAgent uses a rich toolset to deeply interact with the post-simulation environment
05
-
深度互动
-
与模拟世界中的任意一位进行对话 & 与ReportAgent进行对话
+
Deep Interaction
+
Chat with any individual in the simulated world & converse with ReportAgent
@@ -124,8 +124,8 @@
- 01 / 现实种子 - 支持格式: PDF, MD, TXT + 01 / Reality Seeds + Supported: PDF, MD, TXT
-
拖拽文件上传
-
或点击浏览文件系统
+
Drag & drop files here
+
or click to browse
@@ -164,23 +164,23 @@
- 输入参数 + Input Parameters
- >_ 02 / 模拟提示词 + >_ 02 / Simulation Prompt
-
引擎: MiroFish-V1.0
+
Engine: MiroFish-V1.0
@@ -191,8 +191,8 @@ @click="startSimulation" :disabled="!canSubmit || loading" > - 启动引擎 - 初始化中... + Launch Engine + Initializing...
diff --git a/frontend/src/views/InteractionView.vue b/frontend/src/views/InteractionView.vue index b153590..4f99fce 100644 --- a/frontend/src/views/InteractionView.vue +++ b/frontend/src/views/InteractionView.vue @@ -15,7 +15,7 @@ :class="{ active: viewMode === mode }" @click="viewMode = mode" > - {{ { graph: '图谱', split: '双栏', workbench: '工作台' }[mode] }} + {{ { graph: 'Graph', split: 'Split', workbench: 'Workbench' }[mode] }}
@@ -23,7 +23,7 @@
Step 5/5 - 深度互动 + Deep Interaction
@@ -140,7 +140,7 @@ const toggleMaximize = (target) => { // --- Data Logic --- const loadReportData = async () => { try { - addLog(`加载报告数据: ${currentReportId.value}`) + addLog(`Loading report data: ${currentReportId.value}`) // 获取 report 信息以获取 simulation_id const reportRes = await getReport(currentReportId.value) @@ -159,7 +159,7 @@ const loadReportData = async () => { const projRes = await getProject(simData.project_id) if (projRes.success && projRes.data) { projectData.value = projRes.data - addLog(`项目加载成功: ${projRes.data.project_id}`) + addLog(`Project loaded: ${projRes.data.project_id}`) // 获取 graph 数据 if (projRes.data.graph_id) { @@ -170,10 +170,10 @@ const loadReportData = async () => { } } } else { - addLog(`获取报告信息失败: ${reportRes.error || '未知错误'}`) + addLog(`Failed to load report info: ${reportRes.error || 'Unknown error'}`) } } catch (err) { - addLog(`加载异常: ${err.message}`) + addLog(`Loading error: ${err.message}`) } } @@ -184,10 +184,10 @@ const loadGraph = async (graphId) => { const res = await getGraphData(graphId) if (res.success) { graphData.value = res.data - addLog('图谱数据加载成功') + addLog('Graph data loaded') } } catch (err) { - addLog(`图谱加载失败: ${err.message}`) + addLog(`Graph loading failed: ${err.message}`) } finally { graphLoading.value = false } @@ -208,7 +208,7 @@ watch(() => route.params.reportId, (newId) => { }, { immediate: true }) onMounted(() => { - addLog('InteractionView 初始化') + addLog('InteractionView initialized') loadReportData() }) diff --git a/frontend/src/views/MainView.vue b/frontend/src/views/MainView.vue index 6ff2991..74f8c23 100644 --- a/frontend/src/views/MainView.vue +++ b/frontend/src/views/MainView.vue @@ -15,7 +15,7 @@ :class="{ active: viewMode === mode }" @click="viewMode = mode" > - {{ { graph: '图谱', split: '双栏', workbench: '工作台' }[mode] }} + {{ { graph: 'Graph', split: 'Split', workbench: 'Workbench' }[mode] }}
@@ -91,7 +91,7 @@ const viewMode = ref('split') // graph | split | workbench // Step State const currentStep = ref(1) // 1: 图谱构建, 2: 环境搭建, 3: 开始模拟, 4: 报告生成, 5: 深度互动 -const stepNames = ['图谱构建', '环境搭建', '开始模拟', '报告生成', '深度互动'] +const stepNames = ['Graph Build', 'Env Setup', 'Run Simulation', 'Report Generation', 'Deep Interaction'] // Data State const currentProjectId = ref(route.params.projectId) @@ -159,11 +159,11 @@ const toggleMaximize = (target) => { const handleNextStep = (params = {}) => { if (currentStep.value < 5) { currentStep.value++ - addLog(`进入 Step ${currentStep.value}: ${stepNames[currentStep.value - 1]}`) + addLog(`Entering Step ${currentStep.value}: ${stepNames[currentStep.value - 1]}`) // 如果是从 Step 2 进入 Step 3,记录模拟轮数配置 if (currentStep.value === 3 && params.maxRounds) { - addLog(`自定义模拟轮数: ${params.maxRounds} 轮`) + addLog(`Custom simulation rounds: ${params.maxRounds}`) } } } @@ -171,7 +171,7 @@ const handleNextStep = (params = {}) => { const handleGoBack = () => { if (currentStep.value > 1) { currentStep.value-- - addLog(`返回 Step ${currentStep.value}: ${stepNames[currentStep.value - 1]}`) + addLog(`Returning to Step ${currentStep.value}: ${stepNames[currentStep.value - 1]}`) } } diff --git a/frontend/src/views/Process.vue b/frontend/src/views/Process.vue index 2d2d3cc..44ecae2 100644 --- a/frontend/src/views/Process.vue +++ b/frontend/src/views/Process.vue @@ -7,7 +7,7 @@ -

等待本体生成

-

生成完成后将自动开始构建图谱

+

Waiting for Ontology Generation

+

Graph construction will begin automatically after generation

@@ -200,8 +200,8 @@
-

图谱构建中

-

数据即将显示...

+

Building Graph

+

Data will appear shortly...

@@ -225,7 +225,7 @@
- 构建流程 + Build Process
@@ -234,7 +234,7 @@
01
-
本体生成
+
Ontology Generation
/api/graph/ontology/generate
@@ -244,15 +244,15 @@
-
接口说明
+
Description
- 上传文档后,LLM分析文档内容,自动生成适合舆论模拟的本体结构(实体类型 + 关系类型) + After uploading documents, the LLM analyzes content and generates an ontology structure (entity types + relation types) suitable for simulation
-
生成进度
+
Generation Progress
{{ ontologyProgress.message }} @@ -261,7 +261,7 @@
-
生成的实体类型 ({{ projectData.ontology.entity_types?.length || 0 }})
+
Entity Types ({{ projectData.ontology.entity_types?.length || 0 }})
-
生成的关系类型 ({{ projectData.ontology.relation_types?.length || 0 }})
+
Relation Types ({{ projectData.ontology.relation_types?.length || 0 }})
{{ rel.target_type }}
- +{{ projectData.ontology.relation_types.length - 5 }} 更多关系... + +{{ projectData.ontology.relation_types.length - 5 }} more relations...
-
等待本体生成...
+
Waiting for ontology generation...
@@ -305,7 +305,7 @@
02
-
图谱构建
+
Graph Build
/api/graph/build
@@ -315,20 +315,20 @@
-
接口说明
+
Description
- 基于生成的本体,将文档分块后调用 Zep API 构建知识图谱,提取实体和关系 + Based on the generated ontology, documents are chunked and processed via Zep API to build a knowledge graph, extracting entities and relations
-
等待本体生成完成...
+
Waiting for ontology generation to complete...
-
构建进度
+
Build Progress
@@ -339,19 +339,19 @@
-
构建结果
+
Build Results
{{ graphData.node_count }} - 实体节点 + Entity Nodes
{{ graphData.edge_count }} - 关系边 + Relation Edges
{{ entityTypes.length }} - 实体类型 + Entity Types
@@ -363,8 +363,8 @@
03
-
构建完成
-
准备进入下一步骤
+
Build Complete
+
Ready for next step
{{ getPhaseStatusText(2) }} @@ -375,7 +375,7 @@
@@ -385,23 +385,23 @@
- 项目信息 + Project Info
- 项目名称 + Project Name {{ projectData.name }}
- 项目ID + Project ID {{ projectData.project_id }}
- 图谱ID + Graph ID {{ projectData.graph_id }}
- 模拟需求 + Simulation Requirements {{ projectData.simulation_requirement || '-' }}
@@ -451,11 +451,11 @@ const statusClass = computed(() => { }) const statusText = computed(() => { - if (error.value) return '构建失败' - if (currentPhase.value >= 2) return '构建完成' - if (currentPhase.value === 1) return '图谱构建中' - if (currentPhase.value === 0) return '本体生成中' - return '初始化中' + if (error.value) return 'Build Failed' + if (currentPhase.value >= 2) return 'Build Complete' + if (currentPhase.value === 1) return 'Building Graph' + if (currentPhase.value === 0) return 'Generating Ontology' + return 'Initializing' }) const entityTypes = computed(() => { @@ -481,8 +481,8 @@ const goHome = () => { } const goToNextStep = () => { - // TODO: 进入环境搭建步骤 - alert('环境搭建功能开发中...') + // TODO: Proceed to Env Setup步骤 + alert('Environment setup feature is under development...') } const toggleFullScreen = () => { @@ -540,14 +540,14 @@ const getPhaseStatusClass = (phase) => { } const getPhaseStatusText = (phase) => { - if (currentPhase.value > phase) return '已完成' + if (currentPhase.value > phase) return 'Complete' if (currentPhase.value === phase) { if (phase === 1 && buildProgress.value) { return `${buildProgress.value.progress}%` } - return '进行中' + return 'In Progress' } - return '等待中' + return 'Waiting' } // 初始化 - 处理新建项目或加载已有项目 @@ -569,7 +569,7 @@ const handleNewProject = async () => { const pending = getPendingUpload() if (!pending.isPending || pending.files.length === 0) { - error.value = '没有待上传的文件,请返回首页重新操作' + error.value = 'No files to upload. Please return to the home page and try again' loading.value = false return } @@ -577,7 +577,7 @@ const handleNewProject = async () => { try { loading.value = true currentPhase.value = 0 // 本体生成阶段 - ontologyProgress.value = { message: '正在上传文件并分析文档...' } + ontologyProgress.value = { message: 'Uploading files and analyzing documents...' } // 构建 FormData const formDataObj = new FormData() @@ -608,11 +608,11 @@ const handleNewProject = async () => { // 自动开始图谱构建 await startBuildGraph() } else { - error.value = response.error || '本体生成失败' + error.value = response.error || 'Ontology generation failed' } } catch (err) { console.error('Handle new project error:', err) - error.value = '项目初始化失败: ' + (err.message || '未知错误') + error.value = 'Project initialization failed: ' + (err.message || 'Unknown error') } finally { loading.value = false } @@ -645,11 +645,11 @@ const loadProject = async () => { await loadGraph(response.data.graph_id) } } else { - error.value = response.error || '加载项目失败' + error.value = response.error || 'Failed to load project' } } catch (err) { console.error('Load project error:', err) - error.value = '加载项目失败: ' + (err.message || '未知错误') + error.value = 'Failed to load project: ' + (err.message || 'Unknown error') } finally { loading.value = false } @@ -668,7 +668,7 @@ const updatePhaseByStatus = (status) => { currentPhase.value = 2 break case 'failed': - error.value = projectData.value?.error || '处理失败' + error.value = projectData.value?.error || 'Processing failed' break } } @@ -680,13 +680,13 @@ const startBuildGraph = async () => { // 设置初始进度 buildProgress.value = { progress: 0, - message: '正在启动图谱构建...' + message: 'Starting graph construction...' } const response = await buildGraph({ project_id: currentProjectId.value }) if (response.success) { - buildProgress.value.message = '图谱构建任务已启动...' + buildProgress.value.message = 'Graph construction task started...' // 保存 task_id 用于轮询 const taskId = response.data.task_id @@ -697,12 +697,12 @@ const startBuildGraph = async () => { // 启动任务状态轮询 startPollingTask(taskId) } else { - error.value = response.error || '启动图谱构建失败' + error.value = response.error || 'Failed to start graph construction' buildProgress.value = null } } catch (err) { console.error('Build graph error:', err) - error.value = '启动图谱构建失败: ' + (err.message || '未知错误') + error.value = 'Failed to start graph construction: ' + (err.message || 'Unknown error') buildProgress.value = null } } @@ -791,7 +791,7 @@ const pollTaskStatus = async (taskId) => { // 更新进度显示 buildProgress.value = { progress: task.progress || 0, - message: task.message || '处理中...' + message: task.message || 'Processing...' } console.log('Task status:', task.status, 'Progress:', task.progress) @@ -806,7 +806,7 @@ const pollTaskStatus = async (taskId) => { // 更新进度显示为完成状态 buildProgress.value = { progress: 100, - message: '构建完成,正在加载图谱...' + message: 'Build complete, loading graph...' } // 重新加载项目数据获取 graph_id @@ -827,7 +827,7 @@ const pollTaskStatus = async (taskId) => { } else if (task.status === 'failed') { stopPolling() stopGraphPolling() - error.value = '图谱构建失败: ' + (task.error || '未知错误') + error.value = 'Graph construction failed: ' + (task.error || 'Unknown error') buildProgress.value = null } } @@ -905,7 +905,7 @@ const renderGraph = () => { .attr('y', height / 2) .attr('text-anchor', 'middle') .attr('fill', '#999') - .text('等待图谱数据...') + .text('Waiting for graph data...') return } @@ -917,7 +917,7 @@ const renderGraph = () => { const nodes = nodesData.map(n => ({ id: n.uuid, - name: n.name || '未命名', + name: n.name || 'Unnamed', type: n.labels?.find(l => l !== 'Entity' && l !== 'Node') || 'Entity', rawData: n // 保存原始数据 })) @@ -933,8 +933,8 @@ const renderGraph = () => { type: e.fact_type || e.name || 'RELATED_TO', rawData: { ...e, - source_name: nodeMap[e.source_node_uuid]?.name || '未知', - target_name: nodeMap[e.target_node_uuid]?.name || '未知' + source_name: nodeMap[e.source_node_uuid]?.name || 'Unknown', + target_name: nodeMap[e.target_node_uuid]?.name || 'Unknown' } })) diff --git a/frontend/src/views/ReportView.vue b/frontend/src/views/ReportView.vue index 84a3e2a..954cda0 100644 --- a/frontend/src/views/ReportView.vue +++ b/frontend/src/views/ReportView.vue @@ -15,7 +15,7 @@ :class="{ active: viewMode === mode }" @click="viewMode = mode" > - {{ { graph: '图谱', split: '双栏', workbench: '工作台' }[mode] }} + {{ { graph: 'Graph', split: 'Split', workbench: 'Workbench' }[mode] }}
@@ -23,7 +23,7 @@
Step 4/5 - 报告生成 + Report Generation
@@ -139,7 +139,7 @@ const toggleMaximize = (target) => { // --- Data Logic --- const loadReportData = async () => { try { - addLog(`加载报告数据: ${currentReportId.value}`) + addLog(`Loading report data: ${currentReportId.value}`) // 获取 report 信息以获取 simulation_id const reportRes = await getReport(currentReportId.value) @@ -158,7 +158,7 @@ const loadReportData = async () => { const projRes = await getProject(simData.project_id) if (projRes.success && projRes.data) { projectData.value = projRes.data - addLog(`项目加载成功: ${projRes.data.project_id}`) + addLog(`Project loaded: ${projRes.data.project_id}`) // 获取 graph 数据 if (projRes.data.graph_id) { @@ -169,10 +169,10 @@ const loadReportData = async () => { } } } else { - addLog(`获取报告信息失败: ${reportRes.error || '未知错误'}`) + addLog(`Failed to load report info: ${reportRes.error || 'Unknown error'}`) } } catch (err) { - addLog(`加载异常: ${err.message}`) + addLog(`Loading error: ${err.message}`) } } @@ -183,10 +183,10 @@ const loadGraph = async (graphId) => { const res = await getGraphData(graphId) if (res.success) { graphData.value = res.data - addLog('图谱数据加载成功') + addLog('Graph data loaded') } } catch (err) { - addLog(`图谱加载失败: ${err.message}`) + addLog(`Graph loading failed: ${err.message}`) } finally { graphLoading.value = false } @@ -207,7 +207,7 @@ watch(() => route.params.reportId, (newId) => { }, { immediate: true }) onMounted(() => { - addLog('ReportView 初始化') + addLog('ReportView initialized') loadReportData() }) diff --git a/frontend/src/views/SimulationRunView.vue b/frontend/src/views/SimulationRunView.vue index 14ebc5f..894487e 100644 --- a/frontend/src/views/SimulationRunView.vue +++ b/frontend/src/views/SimulationRunView.vue @@ -15,7 +15,7 @@ :class="{ active: viewMode === mode }" @click="viewMode = mode" > - {{ { graph: '图谱', split: '双栏', workbench: '工作台' }[mode] }} + {{ { graph: 'Graph', split: 'Split', workbench: 'Workbench' }[mode] }}
@@ -23,7 +23,7 @@
Step 3/5 - 开始模拟 + Run Simulation
@@ -146,7 +146,7 @@ const toggleMaximize = (target) => { const handleGoBack = async () => { // 在返回 Step 2 之前,先关闭正在运行的模拟 - addLog('准备返回 Step 2,正在关闭模拟...') + addLog('Preparing to return to Step 2, stopping simulation...') // 停止轮询 stopGraphRefresh() @@ -156,36 +156,36 @@ const handleGoBack = async () => { const envStatusRes = await getEnvStatus({ simulation_id: currentSimulationId.value }) if (envStatusRes.success && envStatusRes.data?.env_alive) { - addLog('正在关闭模拟环境...') + addLog('Shutting down simulation environment...') try { await closeSimulationEnv({ simulation_id: currentSimulationId.value, timeout: 10 }) - addLog('✓ 模拟环境已关闭') + addLog('✓ Simulation environment closed') } catch (closeErr) { - addLog(`关闭模拟环境失败,尝试强制停止...`) + addLog(`Failed to close environment, attempting force stop...`) try { await stopSimulation({ simulation_id: currentSimulationId.value }) - addLog('✓ 模拟已强制停止') + addLog('✓ Simulation force-stopped') } catch (stopErr) { - addLog(`强制停止失败: ${stopErr.message}`) + addLog(`Force stop failed: ${stopErr.message}`) } } } else { // 环境未运行,检查是否需要停止进程 if (isSimulating.value) { - addLog('正在停止模拟进程...') + addLog('Stopping simulation process...') try { await stopSimulation({ simulation_id: currentSimulationId.value }) - addLog('✓ 模拟已停止') + addLog('✓ Simulation stopped') } catch (err) { - addLog(`停止模拟失败: ${err.message}`) + addLog(`Failed to stop simulation: ${err.message}`) } } } } catch (err) { - addLog(`检查模拟状态失败: ${err.message}`) + addLog(`Failed to check simulation status: ${err.message}`) } // 返回到 Step 2 (环境搭建) @@ -195,13 +195,13 @@ const handleGoBack = async () => { const handleNextStep = () => { // Step3Simulation 组件会直接处理报告生成和路由跳转 // 这个方法仅作为备用 - addLog('进入 Step 4: 报告生成') + addLog('Entering Step 4: Report Generation') } // --- Data Logic --- const loadSimulationData = async () => { try { - addLog(`加载模拟数据: ${currentSimulationId.value}`) + addLog(`Loading simulation data: ${currentSimulationId.value}`) // 获取 simulation 信息 const simRes = await getSimulation(currentSimulationId.value) @@ -213,10 +213,10 @@ const loadSimulationData = async () => { const configRes = await getSimulationConfig(currentSimulationId.value) if (configRes.success && configRes.data?.time_config?.minutes_per_round) { minutesPerRound.value = configRes.data.time_config.minutes_per_round - addLog(`时间配置: 每轮 ${minutesPerRound.value} 分钟`) + addLog(`Time config: ${minutesPerRound.value} min/round`) } } catch (configErr) { - addLog(`获取时间配置失败,使用默认值: ${minutesPerRound.value}分钟/轮`) + addLog(`Failed to get time config, using default: ${minutesPerRound.value} min/round`) } // 获取 project 信息 @@ -224,7 +224,7 @@ const loadSimulationData = async () => { const projRes = await getProject(simData.project_id) if (projRes.success && projRes.data) { projectData.value = projRes.data - addLog(`项目加载成功: ${projRes.data.project_id}`) + addLog(`Project loaded: ${projRes.data.project_id}`) // 获取 graph 数据 if (projRes.data.graph_id) { @@ -233,10 +233,10 @@ const loadSimulationData = async () => { } } } else { - addLog(`加载模拟数据失败: ${simRes.error || '未知错误'}`) + addLog(`Failed to load simulation data: ${simRes.error || 'Unknown error'}`) } } catch (err) { - addLog(`加载异常: ${err.message}`) + addLog(`Loading error: ${err.message}`) } } @@ -252,11 +252,11 @@ const loadGraph = async (graphId) => { if (res.success) { graphData.value = res.data if (!isSimulating.value) { - addLog('图谱数据加载成功') + addLog('Graph data loaded') } } } catch (err) { - addLog(`图谱加载失败: ${err.message}`) + addLog(`Graph loading failed: ${err.message}`) } finally { graphLoading.value = false } @@ -273,7 +273,7 @@ let graphRefreshTimer = null const startGraphRefresh = () => { if (graphRefreshTimer) return - addLog('开启图谱实时刷新 (30s)') + addLog('Graph live refresh enabled (30s)') // 立即刷新一次,然后每30秒刷新 graphRefreshTimer = setInterval(refreshGraph, 30000) } @@ -282,7 +282,7 @@ const stopGraphRefresh = () => { if (graphRefreshTimer) { clearInterval(graphRefreshTimer) graphRefreshTimer = null - addLog('停止图谱实时刷新') + addLog('Graph live refresh stopped') } } @@ -295,11 +295,11 @@ watch(isSimulating, (newValue) => { }, { immediate: true }) onMounted(() => { - addLog('SimulationRunView 初始化') + addLog('SimulationRunView initialized') // 记录 maxRounds 配置(值已在初始化时从 query 参数获取) if (maxRounds.value) { - addLog(`自定义模拟轮数: ${maxRounds.value}`) + addLog(`Custom simulation rounds: ${maxRounds.value}`) } loadSimulationData() diff --git a/frontend/src/views/SimulationView.vue b/frontend/src/views/SimulationView.vue index 4b44b39..ec335a9 100644 --- a/frontend/src/views/SimulationView.vue +++ b/frontend/src/views/SimulationView.vue @@ -15,7 +15,7 @@ :class="{ active: viewMode === mode }" @click="viewMode = mode" > - {{ { graph: '图谱', split: '双栏', workbench: '工作台' }[mode] }} + {{ { graph: 'Graph', split: 'Split', workbench: 'Workbench' }[mode] }}
@@ -23,7 +23,7 @@
Step 2/5 - 环境搭建 + Env Setup
@@ -146,13 +146,13 @@ const handleGoBack = () => { } const handleNextStep = (params = {}) => { - addLog('进入 Step 3: 开始模拟') + addLog('Entering Step 3: Run Simulation') // 记录模拟轮数配置 if (params.maxRounds) { - addLog(`自定义模拟轮数: ${params.maxRounds} 轮`) + addLog(`Custom simulation rounds: ${params.maxRounds}`) } else { - addLog('使用自动配置的模拟轮数') + addLog('Using auto-configured simulation rounds') } // 构建路由参数 @@ -184,7 +184,7 @@ const checkAndStopRunningSimulation = async () => { const envStatusRes = await getEnvStatus({ simulation_id: currentSimulationId.value }) if (envStatusRes.success && envStatusRes.data?.env_alive) { - addLog('检测到模拟环境正在运行,正在关闭...') + addLog('Simulation environment detected running, shutting down...') // 尝试优雅关闭模拟环境 try { @@ -194,14 +194,14 @@ const checkAndStopRunningSimulation = async () => { }) if (closeRes.success) { - addLog('✓ 模拟环境已关闭') + addLog('✓ Simulation environment closed') } else { - addLog(`关闭模拟环境失败: ${closeRes.error || '未知错误'}`) + addLog(`Failed to close simulation environment: ${closeRes.error || 'Unknown error'}`) // 如果优雅关闭失败,尝试强制停止 await forceStopSimulation() } } catch (closeErr) { - addLog(`关闭模拟环境异常: ${closeErr.message}`) + addLog(`Error closing simulation environment: ${closeErr.message}`) // 如果优雅关闭异常,尝试强制停止 await forceStopSimulation() } @@ -209,7 +209,7 @@ const checkAndStopRunningSimulation = async () => { // 环境未运行,但可能进程还在,检查模拟状态 const simRes = await getSimulation(currentSimulationId.value) if (simRes.success && simRes.data?.status === 'running') { - addLog('检测到模拟状态为运行中,正在停止...') + addLog('Simulation detected running, stopping...') await forceStopSimulation() } } @@ -226,18 +226,18 @@ const forceStopSimulation = async () => { try { const stopRes = await stopSimulation({ simulation_id: currentSimulationId.value }) if (stopRes.success) { - addLog('✓ 模拟已强制停止') + addLog('✓ Simulation force-stopped') } else { - addLog(`强制停止模拟失败: ${stopRes.error || '未知错误'}`) + addLog(`Failed to force-stop simulation: ${stopRes.error || 'Unknown error'}`) } } catch (err) { - addLog(`强制停止模拟异常: ${err.message}`) + addLog(`Error force-stopping simulation: ${err.message}`) } } const loadSimulationData = async () => { try { - addLog(`加载模拟数据: ${currentSimulationId.value}`) + addLog(`Loading simulation data: ${currentSimulationId.value}`) // 获取 simulation 信息 const simRes = await getSimulation(currentSimulationId.value) @@ -249,7 +249,7 @@ const loadSimulationData = async () => { const projRes = await getProject(simData.project_id) if (projRes.success && projRes.data) { projectData.value = projRes.data - addLog(`项目加载成功: ${projRes.data.project_id}`) + addLog(`Project loaded: ${projRes.data.project_id}`) // 获取 graph 数据 if (projRes.data.graph_id) { @@ -258,10 +258,10 @@ const loadSimulationData = async () => { } } } else { - addLog(`加载模拟数据失败: ${simRes.error || '未知错误'}`) + addLog(`Failed to load simulation data: ${simRes.error || 'Unknown error'}`) } } catch (err) { - addLog(`加载异常: ${err.message}`) + addLog(`Loading error: ${err.message}`) } } @@ -271,10 +271,10 @@ const loadGraph = async (graphId) => { const res = await getGraphData(graphId) if (res.success) { graphData.value = res.data - addLog('图谱数据加载成功') + addLog('Graph data loaded') } } catch (err) { - addLog(`图谱加载失败: ${err.message}`) + addLog(`Graph loading failed: ${err.message}`) } finally { graphLoading.value = false } @@ -287,7 +287,7 @@ const refreshGraph = () => { } onMounted(async () => { - addLog('SimulationView 初始化') + addLog('SimulationView initialized') // 检查并关闭正在运行的模拟(用户从 Step 3 返回时) await checkAndStopRunningSimulation()