Update simulation components and descriptions for clarity and functionality

- Added a new method in simulation.js for retrieving detailed run status.
- Revised descriptions in Step1GraphBuild.vue and Step2EnvSetup.vue for improved clarity on simulation processes.
- Updated titles and labels in Step2EnvSetup.vue to better reflect the initialization and setup stages.
- Enhanced styling and layout in Step2EnvSetup.vue for a more cohesive user experience.
- Adjusted descriptions in Home.vue to accurately represent the simulation workflow.
This commit is contained in:
666ghj 2025-12-11 17:02:17 +08:00
parent fc95cc6595
commit 01d94f3d21
5 changed files with 88 additions and 55 deletions

View file

@ -98,3 +98,4 @@ export const getRunStatus = (simulationId) => {
export const getRunStatusDetail = (simulationId) => { export const getRunStatusDetail = (simulationId) => {
return service.get(`/api/simulation/${simulationId}/run-status/detail`) return service.get(`/api/simulation/${simulationId}/run-status/detail`)
} }

View file

@ -18,7 +18,7 @@
<div class="card-content"> <div class="card-content">
<p class="api-note">POST /api/graph/ontology/generate</p> <p class="api-note">POST /api/graph/ontology/generate</p>
<p class="description"> <p class="description">
LLM分析文档内容与模拟需求梳理出现实种子自动生成合适的本体结构 LLM分析文档内容与模拟需求提取出现实种子自动生成合适的本体结构
</p> </p>
<!-- Loading / Progress --> <!-- Loading / Progress -->

View file

@ -6,7 +6,7 @@
<div class="card-header"> <div class="card-header">
<div class="step-info"> <div class="step-info">
<span class="step-num">01</span> <span class="step-num">01</span>
<span class="step-title">模拟实例</span> <span class="step-title">模拟实例初始化</span>
</div> </div>
<div class="step-status"> <div class="step-status">
<span v-if="phase > 0" class="badge success">已完成</span> <span v-if="phase > 0" class="badge success">已完成</span>
@ -17,17 +17,25 @@
<div class="card-content"> <div class="card-content">
<p class="api-note">POST /api/simulation/create</p> <p class="api-note">POST /api/simulation/create</p>
<p class="description"> <p class="description">
基于已构建的知识图谱创建模拟实例初始化模拟环境 新建simulation实例拉取模拟世界参数模版
</p> </p>
<div v-if="simulationId" class="info-card"> <div v-if="simulationId" class="info-card">
<div class="info-row">
<span class="info-label">Project ID</span>
<span class="info-value mono">{{ projectData?.project_id }}</span>
</div>
<div class="info-row">
<span class="info-label">Graph ID</span>
<span class="info-value mono">{{ projectData?.graph_id }}</span>
</div>
<div class="info-row"> <div class="info-row">
<span class="info-label">Simulation ID</span> <span class="info-label">Simulation ID</span>
<span class="info-value mono">{{ simulationId }}</span> <span class="info-value mono">{{ simulationId }}</span>
</div> </div>
<div class="info-row"> <div class="info-row">
<span class="info-label">Graph ID</span> <span class="info-label">Task ID</span>
<span class="info-value mono">{{ projectData?.graph_id }}</span> <span class="info-value mono">{{ taskId || '异步任务已完成' }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -154,19 +162,19 @@
</div> </div>
<!-- Step 04: 准备完成 --> <!-- Step 04: 准备完成 -->
<div class="step-card" :class="{ 'active': phase === 3, 'completed': phase >= 3 }"> <div class="step-card" :class="{ 'active': phase === 3 }">
<div class="card-header"> <div class="card-header">
<div class="step-info"> <div class="step-info">
<span class="step-num">04</span> <span class="step-num">04</span>
<span class="step-title">准备完成</span> <span class="step-title">准备完成</span>
</div> </div>
<div class="step-status"> <div class="step-status">
<span v-if="phase >= 3" class="badge accent">就绪</span> <span v-if="phase >= 3" class="badge processing">进行中</span>
</div> </div>
</div> </div>
<div class="card-content"> <div class="card-content">
<p class="description">模拟环境已准备就绪可以开始运行模拟</p> <p class="description">模拟环境已准备完成可以开始运行模拟</p>
<div class="action-group"> <div class="action-group">
<button <button
class="action-btn secondary" class="action-btn secondary"
@ -265,7 +273,18 @@ const entityTypes = ref([])
const expectedTotal = ref(null) const expectedTotal = ref(null)
const simulationConfig = ref(null) const simulationConfig = ref(null)
const selectedProfile = ref(null) const selectedProfile = ref(null)
const showProfilesDetail = ref(false) const showProfilesDetail = ref(true)
// Watch stage to update phase
watch(currentStage, (newStage) => {
if (newStage === '生成Agent人设' || newStage === 'generating_profiles') {
phase.value = 1
} else if (newStage === '生成模拟配置' || newStage === 'generating_config') {
phase.value = 2
} else if (newStage === '准备模拟脚本' || newStage === 'copying_scripts') {
phase.value = 2 //
}
})
// Polling timer // Polling timer
let pollTimer = null let pollTimer = null
@ -496,28 +515,24 @@ onUnmounted(() => {
/* Step Card */ /* Step Card */
.step-card { .step-card {
background: #FFF; background: #FFF;
border: 1px solid #E5E5E5;
border-radius: 8px; border-radius: 8px;
overflow: hidden; padding: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
border: 1px solid #EAEAEA;
transition: all 0.3s ease; transition: all 0.3s ease;
position: relative;
} }
.step-card.active { .step-card.active {
border-color: #FF5722; border-color: #FF5722;
box-shadow: 0 2px 8px rgba(255, 87, 34, 0.1); box-shadow: 0 4px 12px rgba(255, 87, 34, 0.08);
}
.step-card.completed {
border-color: #4CAF50;
} }
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 16px 20px; margin-bottom: 16px;
background: #FAFAFA;
border-bottom: 1px solid #E5E5E5;
} }
.step-info { .step-info {
@ -528,9 +543,14 @@ onUnmounted(() => {
.step-num { .step-num {
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: 20px;
font-weight: 700; font-weight: 700;
font-size: 12px; color: #E0E0E0;
color: #999; }
.step-card.active .step-num,
.step-card.completed .step-num {
color: #000;
} }
.step-title { .step-title {
@ -540,11 +560,11 @@ onUnmounted(() => {
} }
.badge { .badge {
font-family: 'JetBrains Mono', monospace; font-size: 10px;
font-size: 11px; padding: 4px 8px;
font-weight: 600;
padding: 4px 10px;
border-radius: 4px; border-radius: 4px;
font-weight: 600;
text-transform: uppercase;
} }
.badge.success { background: #E8F5E9; color: #2E7D32; } .badge.success { background: #E8F5E9; color: #2E7D32; }
@ -553,20 +573,20 @@ onUnmounted(() => {
.badge.accent { background: #E3F2FD; color: #1565C0; } .badge.accent { background: #E3F2FD; color: #1565C0; }
.card-content { .card-content {
padding: 20px; /* No extra padding - uses step-card's padding */
} }
.api-note { .api-note {
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: 11px; font-size: 10px;
color: #999; color: #999;
margin-bottom: 8px; margin-bottom: 8px;
} }
.description { .description {
font-size: 13px; font-size: 12px;
color: #666; color: #666;
line-height: 1.6; line-height: 1.5;
margin-bottom: 16px; margin-bottom: 16px;
} }
@ -700,7 +720,7 @@ onUnmounted(() => {
.stats-grid { .stats-grid {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 12px; gap: 8px;
margin-top: 16px; margin-top: 16px;
} }
@ -708,16 +728,19 @@ onUnmounted(() => {
background: #FAFAFA; background: #FAFAFA;
border: 1px solid #E5E5E5; border: 1px solid #E5E5E5;
border-radius: 6px; border-radius: 6px;
padding: 16px; padding: 12px 8px;
text-align: center; text-align: center;
min-width: 0;
} }
.stat-value { .stat-value {
display: block; display: block;
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: 24px; font-size: 18px;
font-weight: 700; font-weight: 700;
color: #333; color: #333;
overflow: hidden;
text-overflow: ellipsis;
} }
.stat-label { .stat-label {
@ -759,7 +782,7 @@ onUnmounted(() => {
.profiles-list { .profiles-list {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 12px; gap: 12px;
max-height: 240px; max-height: 240px;
overflow: hidden; overflow: hidden;
@ -980,50 +1003,57 @@ onUnmounted(() => {
/* System Logs */ /* System Logs */
.system-logs { .system-logs {
border-top: 1px solid #E5E5E5; background: #000;
background: #1A1A1A; color: #DDD;
color: #CCC; padding: 16px;
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: 11px; border-top: 1px solid #222;
flex-shrink: 0;
} }
.log-header { .log-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: 8px 16px;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
} padding-bottom: 8px;
margin-bottom: 8px;
.log-title { font-size: 10px;
font-weight: 600; color: #888;
color: #FF5722;
}
.log-id {
color: #666;
} }
.log-content { .log-content {
height: 100px; display: flex;
flex-direction: column;
gap: 4px;
height: 80px; /* Approx 4 lines visible */
overflow-y: auto; overflow-y: auto;
padding: 8px 16px; padding-right: 4px;
}
.log-content::-webkit-scrollbar {
width: 4px;
}
.log-content::-webkit-scrollbar-thumb {
background: #333;
border-radius: 2px;
} }
.log-line { .log-line {
font-size: 11px;
display: flex; display: flex;
gap: 12px; gap: 12px;
padding: 4px 0; line-height: 1.5;
border-bottom: 1px solid #2A2A2A;
} }
.log-time { .log-time {
color: #666; color: #666;
flex-shrink: 0; min-width: 75px;
} }
.log-msg { .log-msg {
color: #CCC; color: #CCC;
word-break: break-all;
} }
/* Spinner */ /* Spinner */
@ -1040,3 +1070,4 @@ onUnmounted(() => {
to { transform: rotate(360deg); } to { transform: rotate(360deg); }
} }
</style> </style>

View file

@ -83,7 +83,7 @@
<span class="step-num">01</span> <span class="step-num">01</span>
<div class="step-info"> <div class="step-info">
<div class="step-title">图谱构建</div> <div class="step-title">图谱构建</div>
<div class="step-desc">事件梳理 & 体记忆注入 & GraphRAG构建</div> <div class="step-desc">现实种子提取 & 个体与群体记忆注入 & GraphRAG构建</div>
</div> </div>
</div> </div>
<div class="workflow-item"> <div class="workflow-item">

View file

@ -336,3 +336,4 @@ onMounted(() => {
border-right: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA;
} }
</style> </style>