From 39824c88e24391c079dc9526567db2164a3a88dc Mon Sep 17 00:00:00 2001 From: 666ghj <670939375@qq.com> Date: Thu, 11 Dec 2025 19:40:58 +0800 Subject: [PATCH] Enhance Step2EnvSetup.vue with agent username display and styling improvements - Added a new method to retrieve agent usernames based on their IDs, improving clarity in the timeline display. - Updated the layout to include both agent ID and username, enhancing user engagement. - Adjusted CSS for better alignment and visual consistency of agent information in the timeline. --- frontend/src/components/Step2EnvSetup.vue | 31 ++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Step2EnvSetup.vue b/frontend/src/components/Step2EnvSetup.vue index c804f0a..a91765e 100644 --- a/frontend/src/components/Step2EnvSetup.vue +++ b/frontend/src/components/Step2EnvSetup.vue @@ -206,7 +206,10 @@
{{ post.poster_type }} - Agent {{ post.poster_agent_id }} + + Agent {{ post.poster_agent_id }} + @{{ getAgentUsername(post.poster_agent_id) }} +

{{ post.content }}

@@ -412,6 +415,15 @@ const displayProfiles = computed(() => { return profiles.value.slice(0, 6) }) +// 根据agent_id获取对应的username +const getAgentUsername = (agentId) => { + if (profiles.value && profiles.value.length > agentId && agentId >= 0) { + const profile = profiles.value[agentId] + return profile?.username || `agent_${agentId}` + } + return `agent_${agentId}` +} + // 计算所有人设的关联话题总数 const totalTopicsCount = computed(() => { return profiles.value.reduce((sum, p) => { @@ -1478,10 +1490,23 @@ onUnmounted(() => { text-transform: uppercase; } -.post-id { +.post-agent-info { + display: flex; + align-items: center; + gap: 6px; +} + +.post-id, +.post-username { font-family: 'JetBrains Mono', monospace; font-size: 10px; - color: #999; + color: #666; + line-height: 1; + vertical-align: baseline; +} + +.post-username { + margin-right: 6px; } .post-text {