Compare commits

..

3 Commits

2 changed files with 30 additions and 18 deletions

View File

@@ -789,10 +789,10 @@ function renderAgentsPage() {
<div class="recent-agent-item" data-conv-id="${conv.id}">
<div class="recent-agent-left">
<span class="recent-agent-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span>
<span class="recent-agent-name">${conv.title}</span>
<span class="recent-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
</div>
<div class="recent-agent-right">
<span class="recent-agent-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
<span class="recent-agent-title">${conv.title}</span>
<span class="recent-agent-time">${formatTime(conv.updatedAt)}</span>
</div>
</div>
@@ -3003,10 +3003,10 @@ function showAgentHistoryPage() {
<div class="agent-history-item" data-conv-id="${conv.id}">
<div class="agent-history-left">
<span class="agent-history-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span>
<span class="agent-history-name">${conv.title}</span>
<span class="agent-history-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
</div>
<div class="agent-history-right">
<span class="agent-history-agent">${conv.agent ? conv.agent.name : '未知智能体'}</span>
<span class="agent-history-title">${conv.title}</span>
<span class="agent-history-time">${formatTime(conv.updatedAt)}</span>
</div>
</div>
@@ -3087,7 +3087,7 @@ async function openAgent(agentId) {
// 创建新对话并设置智能体
const newConv = {
id: backendId || Date.now().toString(),
title: currentAgent.name,
title: '新对话', // 和普通对话一样,初始标题为"新对话",后续自动生成
messages: [],
agentId: agentId,
createdAt: Date.now(),
@@ -4541,7 +4541,11 @@ function renderMessages() {
messagesDiv.innerHTML = currentConversation.messages.map((msg, index) => {
const isUser = msg.role === 'user';
const avatar = isUser ? '👤' : '🤖';
// 用户头像使用实际头像AI头像使用智能体头像或默认
const avatar = isUser
? (currentUser?.avatar || '👤')
: (currentAgent?.avatar || '🤖');
const avatarHtml = isUser ? renderAvatar(avatar) : avatar;
// 处理消息内容(支持图片)
let contentHtml = '';
@@ -4616,7 +4620,7 @@ function renderMessages() {
return `
<div class="message ${msg.role}" data-index="${index}">
<div class="message-avatar">${avatar}</div>
<div class="message-avatar">${avatarHtml}</div>
<div class="message-body">
${searchHtml}
${thinkingHtml}

View File

@@ -1730,12 +1730,13 @@ body {
color: var(--primary);
}
.recent-agent-agent-name {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
.recent-agent-title {
font-size: 13px;
color: #333;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 智能体历史页面 */
@@ -1807,12 +1808,19 @@ body {
color: var(--primary);
}
.agent-history-agent {
font-size: 12px;
.agent-history-title {
font-size: 13px;
color: #333;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.agent-history-agent-name {
font-size: 13px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
font-weight: 500;
}
/* ==================== 我的页面 ==================== */