Compare commits

...

3 Commits

2 changed files with 47 additions and 10 deletions

View File

@@ -124,6 +124,19 @@ async function loadBackendConfig() {
// 不加载默认启用的工具,所有工具默认未启用 // 不加载默认启用的工具,所有工具默认未启用
// 将后台系统配置赋值到 CONFIG
if (backendConfig.system) {
CONFIG.system = backendConfig.system;
}
// 将后台 LLM 配置赋值到 CONFIG
if (backendConfig.llm) {
CONFIG.apiUrl = backendConfig.llm.api_url;
CONFIG.apiKey = backendConfig.llm.api_key;
CONFIG.model = backendConfig.llm.model;
CONFIG.maxTokens = backendConfig.llm.max_tokens || 2048;
}
updateAgentsDisplay(); updateAgentsDisplay();
console.log('后台配置已加载', backendConfig); console.log('后台配置已加载', backendConfig);
} catch (e) { } catch (e) {
@@ -789,10 +802,10 @@ function renderAgentsPage() {
<div class="recent-agent-item" data-conv-id="${conv.id}"> <div class="recent-agent-item" data-conv-id="${conv.id}">
<div class="recent-agent-left"> <div class="recent-agent-left">
<span class="recent-agent-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span> <span class="recent-agent-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span>
<span class="recent-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span> <span class="recent-agent-title">${conv.title}</span>
</div> </div>
<div class="recent-agent-right"> <div class="recent-agent-right">
<span class="recent-agent-title">${conv.title}</span> <span class="recent-agent-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
<span class="recent-agent-time">${formatTime(conv.updatedAt)}</span> <span class="recent-agent-time">${formatTime(conv.updatedAt)}</span>
</div> </div>
</div> </div>
@@ -1324,6 +1337,7 @@ function filterDiscoverAgents(keyword) {
if (!keyword) { if (!keyword) {
// 显示所有 // 显示所有
showDiscoverSection('hot', systemAgents.filter(a => a.category === 'hot')); showDiscoverSection('hot', systemAgents.filter(a => a.category === 'hot'));
showDiscoverSection('basic', systemAgents.filter(a => a.category === 'basic'));
showDiscoverSection('work', systemAgents.filter(a => a.category === 'work')); showDiscoverSection('work', systemAgents.filter(a => a.category === 'work'));
showDiscoverSection('study', systemAgents.filter(a => a.category === 'study')); showDiscoverSection('study', systemAgents.filter(a => a.category === 'study'));
showDiscoverSection('life', systemAgents.filter(a => a.category === 'life')); showDiscoverSection('life', systemAgents.filter(a => a.category === 'life'));
@@ -1338,6 +1352,7 @@ function filterDiscoverAgents(keyword) {
// 显示搜索结果 // 显示搜索结果
showDiscoverSection('hot', filtered.filter(a => a.category === 'hot')); showDiscoverSection('hot', filtered.filter(a => a.category === 'hot'));
showDiscoverSection('basic', filtered.filter(a => a.category === 'basic'));
showDiscoverSection('work', filtered.filter(a => a.category === 'work')); showDiscoverSection('work', filtered.filter(a => a.category === 'work'));
showDiscoverSection('study', filtered.filter(a => a.category === 'study')); showDiscoverSection('study', filtered.filter(a => a.category === 'study'));
showDiscoverSection('life', filtered.filter(a => a.category === 'life')); showDiscoverSection('life', filtered.filter(a => a.category === 'life'));
@@ -2611,7 +2626,12 @@ function showAboutPage() {
const privacyPolicyBtn = document.getElementById('privacyPolicyBtn'); const privacyPolicyBtn = document.getElementById('privacyPolicyBtn');
if (privacyPolicyBtn) { if (privacyPolicyBtn) {
privacyPolicyBtn.addEventListener('click', () => { privacyPolicyBtn.addEventListener('click', () => {
showToast('隐私政策页面待完善'); const privacyUrl = CONFIG?.system?.privacyPolicyUrl;
if (privacyUrl) {
window.open(privacyUrl, '_blank');
} else {
showToast('隐私政策链接未配置');
}
}); });
} }
@@ -2619,7 +2639,12 @@ function showAboutPage() {
const userAgreementBtn = document.getElementById('userAgreementBtn'); const userAgreementBtn = document.getElementById('userAgreementBtn');
if (userAgreementBtn) { if (userAgreementBtn) {
userAgreementBtn.addEventListener('click', () => { userAgreementBtn.addEventListener('click', () => {
showToast('用户协议页面待完善'); const agreementUrl = CONFIG?.system?.userAgreementUrl;
if (agreementUrl) {
window.open(agreementUrl, '_blank');
} else {
showToast('用户协议链接未配置');
}
}); });
} }
} }
@@ -3003,10 +3028,10 @@ function showAgentHistoryPage() {
<div class="agent-history-item" data-conv-id="${conv.id}"> <div class="agent-history-item" data-conv-id="${conv.id}">
<div class="agent-history-left"> <div class="agent-history-left">
<span class="agent-history-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span> <span class="agent-history-avatar">${conv.agent ? conv.agent.avatar : '🤖'}</span>
<span class="agent-history-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span> <span class="agent-history-title">${conv.title}</span>
</div> </div>
<div class="agent-history-right"> <div class="agent-history-right">
<span class="agent-history-title">${conv.title}</span> <span class="agent-history-agent-name">${conv.agent ? conv.agent.name : '未知智能体'}</span>
<span class="agent-history-time">${formatTime(conv.updatedAt)}</span> <span class="agent-history-time">${formatTime(conv.updatedAt)}</span>
</div> </div>
</div> </div>

View File

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