auto-save 2026-05-11 15:46 (~6)

This commit is contained in:
2026-05-11 15:47:02 +08:00
parent a3cc734902
commit 3bb30ae1d0
6 changed files with 215 additions and 70 deletions

View File

@@ -11,7 +11,7 @@
<link rel="icon" type="image/svg+xml" href="./icon.svg">
<link rel="apple-touch-icon" href="./icon.svg">
<title>爱马仕 · AI</title>
<link rel="stylesheet" href="./styles.css?v=20260511-settings-v26">
<link rel="stylesheet" href="./styles.css?v=20260511-settings-v27">
</head>
<body>
@@ -308,10 +308,17 @@
</button>
<div class="chat-model-pick">
<select id="modelPick">
<option value="google/gemini-3.1-pro-preview">Gemini 3.1 Pro · OpenRouter</option>
<option value="gemini-3-pro-preview">Gemini 3 Pro</option>
<option value="gemini-2.5-pro">Gemini 2.5 Pro</option>
<option value="gemini-2.5-flash">Gemini 2.5 Flash</option>
</select>
<datalist id="modelOptions">
<option value="google/gemini-3.1-pro-preview" label="Gemini 3.1 Pro · OpenRouter"></option>
<option value="gemini-3-pro-preview" label="Gemini 3 Pro"></option>
<option value="gemini-2.5-pro" label="Gemini 2.5 Pro"></option>
<option value="gemini-2.5-flash" label="Gemini 2.5 Flash"></option>
</datalist>
</div>
<button class="chat-clear" onclick="saveWeeklyReportFromChat()" title="保存最近一条回答为周报记录">存周报</button>
<button class="chat-clear" id="clearBtn" title="清空对话">清空</button>
@@ -386,12 +393,8 @@
<input type="text" id="agentDesc" placeholder="一句话说明这个智能体擅长什么" maxlength="80">
</div>
<div class="setting-row">
<label>模型</label>
<select id="agentModel">
<option value="gemini-3-pro-preview">Gemini 3 Pro</option>
<option value="gemini-2.5-pro">Gemini 2.5 Pro</option>
<option value="gemini-2.5-flash">Gemini 2.5 Flash</option>
</select>
<label>模型 ID</label>
<input type="text" id="agentModel" list="modelOptions" placeholder="google/gemini-3.1-pro-preview" autocomplete="off">
</div>
<div class="setting-row setting-row-full">
<label>角色设定 (System Prompt)</label>
@@ -1189,21 +1192,21 @@ git push # Gitea kangwan/hermes-glass-ui-personal
</div>
</div>
<!-- 模型与 MCP -->
<!-- AI 模型接入 -->
<div class="settings-group wide">
<div class="settings-group-head">
<div class="settings-group-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v20"/><path d="M2 12h20"/><path d="M4.93 4.93 19.07 19.07"/><path d="M19.07 4.93 4.93 19.07"/></svg>
</div>
<div>
<div class="settings-group-title">模型与 MCP</div>
<div class="settings-group-desc">线上 Hermes agent 的默认模型和 MCP server 配置</div>
<div class="settings-group-title">AI 模型接入</div>
<div class="settings-group-desc">线上 Hermes agent 的默认模型、Provider 和模型网关地址</div>
</div>
</div>
<div class="settings-group-body">
<div class="settings-grid-3">
<div class="settings-field">
<label for="hermesModelDefault">默认模型</label>
<label for="hermesModelDefault">默认模型 ID</label>
<input type="text" id="hermesModelDefault" placeholder="google/gemini-3.1-pro-preview" autocomplete="off">
</div>
<div class="settings-field">
@@ -1215,6 +1218,35 @@ git push # Gitea kangwan/hermes-glass-ui-personal
<input type="text" id="hermesModelBaseUrl" placeholder="https://openrouter.ai/api/v1" autocomplete="off">
</div>
</div>
<div class="settings-grid-3">
<div class="settings-field">
<label for="hermesModelApiKeyRef">AI API Key</label>
<input type="password" id="hermesModelApiKeyRef" placeholder="服务器环境变量,不在浏览器显示" disabled>
</div>
</div>
<div class="settings-actions">
<button class="glass-btn-sm" onclick="refreshHermesConfig(true)">读取模型配置</button>
<button class="glass-btn-sm primary" id="hermesModelSaveBtn" onclick="saveModelConfig()">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><path d="M17 21v-8H7v8"/><path d="M7 3v5h8"/></svg>
保存模型并重启
</button>
<div class="settings-help" id="hermesModelStatus">打开设置页后自动读取。</div>
</div>
</div>
</div>
<!-- MCP 工具接入 -->
<div class="settings-group wide">
<div class="settings-group-head">
<div class="settings-group-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><path d="M3.3 7 12 12l8.7-5"/><path d="M12 22V12"/></svg>
</div>
<div>
<div class="settings-group-title">MCP 工具接入</div>
<div class="settings-group-desc">外部工具、知识库和服务调用配置</div>
</div>
</div>
<div class="settings-group-body">
<div class="settings-field">
<label for="mcpServersYaml">MCP Servers YAML</label>
<textarea id="mcpServersYaml" rows="8" spellcheck="false" placeholder='mcp_servers:
@@ -1224,12 +1256,12 @@ git push # Gitea kangwan/hermes-glass-ui-personal
<div class="settings-help">留空会移除 <code>mcp_servers</code>;保存会备份配置并重启 <code>hermes-agent</code></div>
</div>
<div class="settings-actions">
<button class="glass-btn-sm" onclick="refreshHermesConfig(true)">读取线上配置</button>
<button class="glass-btn-sm primary" id="hermesConfigSaveBtn" onclick="saveHermesConfig()">
<button class="glass-btn-sm" onclick="refreshHermesConfig(true)">读取 MCP 配置</button>
<button class="glass-btn-sm primary" id="hermesMcpSaveBtn" onclick="saveMcpConfig()">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><path d="M17 21v-8H7v8"/><path d="M7 3v5h8"/></svg>
保存并重启
保存 MCP 并重启
</button>
<div class="settings-help" id="hermesConfigStatus">打开设置页后自动读取。</div>
<div class="settings-help" id="hermesMcpStatus">打开设置页后自动读取。</div>
</div>
</div>
</div>
@@ -1376,6 +1408,6 @@ git push # Gitea kangwan/hermes-glass-ui-personal
</main>
</div>
<script src="./app.js?v=20260511-settings-v26"></script>
<script src="./app.js?v=20260511-settings-v27"></script>
</body>
</html>