Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8287be10ea | |||
| a56bad11f1 | |||
| 92c187d576 |
30
www/app.js
30
www/app.js
@@ -792,7 +792,7 @@ function renderAgentsPage() {
|
||||
<span class="recent-agent-name">${conv.title}</span>
|
||||
</div>
|
||||
<div class="recent-agent-right">
|
||||
<span class="recent-agent-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
|
||||
<span class="recent-agent-category">${conv.agent ? getCategoryLabel(conv.agent.category) : '未知'}</span>
|
||||
<span class="recent-agent-time">${formatTime(conv.updatedAt)}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3006,7 +3006,7 @@ function showAgentHistoryPage() {
|
||||
<span class="agent-history-name">${conv.title}</span>
|
||||
</div>
|
||||
<div class="agent-history-right">
|
||||
<span class="agent-history-agent">${conv.agent ? conv.agent.name : '未知智能体'}</span>
|
||||
<span class="agent-history-category">${conv.agent ? getCategoryLabel(conv.agent.category) : '未知'}</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(),
|
||||
@@ -3131,22 +3131,10 @@ function showAgentChatPage() {
|
||||
<div class="messages" id="messages"></div>
|
||||
</div>
|
||||
|
||||
<!-- 功能开关栏 -->
|
||||
<!-- 功能栏(智能体对话不需要工具选择,工具由后台配置) -->
|
||||
<div class="feature-bar" id="featureBar">
|
||||
<div class="feature-left">
|
||||
<button class="feature-btn thinking-btn" id="thinkingBtn">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>
|
||||
<span>深度思考</span>
|
||||
</button>
|
||||
<button class="feature-btn search-btn" id="searchBtn">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 7 9.5 7 14 9.01 14 9.5 11.99 14 9.5 14z"/></svg>
|
||||
<span>联网搜索</span>
|
||||
</button>
|
||||
<button class="feature-btn tools-btn" id="moreToolsBtn">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16"><path fill="currentColor" d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"/></svg>
|
||||
<span>更多工具</span>
|
||||
${enabledTools.length > 0 ? `<span class="tools-count">${enabledTools.length}</span>` : ''}
|
||||
</button>
|
||||
<!-- 智能体工具由后台配置,不显示选择按钮 -->
|
||||
</div>
|
||||
<div class="feature-right">
|
||||
<button class="feature-btn nav-btn" id="scrollTopBtn">
|
||||
@@ -4553,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 = '';
|
||||
@@ -4628,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}
|
||||
|
||||
@@ -1730,7 +1730,7 @@ body {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.recent-agent-agent-name {
|
||||
.recent-agent-category {
|
||||
font-size: 12px;
|
||||
color: var(--primary);
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
@@ -1807,7 +1807,7 @@ body {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.agent-history-agent {
|
||||
.agent-history-category {
|
||||
font-size: 12px;
|
||||
color: var(--primary);
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
|
||||
Reference in New Issue
Block a user