auto-save 2026-05-11 16:03 (~5)

This commit is contained in:
2026-05-11 16:03:46 +08:00
parent 8f80417462
commit 0b4d811b2f
5 changed files with 37 additions and 24 deletions

View File

@@ -1,12 +1,5 @@
{
"entries": [
{
"files_changed": 1,
"hash": "2d39ee4",
"message": "auto-save 2026-05-10 07:39 (~1)",
"ts": "2026-05-10T07:39:49+08:00",
"type": "commit"
},
{
"files_changed": 1,
"hash": "ee2e220",
@@ -3260,6 +3253,13 @@
"type": "session-heartbeat",
"message": "Codex 会话活跃 · 最近命令codex · 分支 master · 4 项未提交变更 · 最近提交auto-save 2026-05-11 15:52 (~5)",
"files_changed": 4
},
{
"ts": "2026-05-11T15:58:12+08:00",
"type": "commit",
"message": "auto-save 2026-05-11 15:58 (~4)",
"hash": "8f80417",
"files_changed": 4
}
]
}

View File

@@ -20,7 +20,7 @@
- 爱马仕前端「仪表盘」活动热力图已重做为带摘要、月份标尺、紧凑格子和细分色阶的活动卡片
- 爱马仕前端「设置 → 连接」可自助维护 API 地址 / API Key 并测试连接;「对话 → 存周报」和「设置 → 周报记录」会在本地保存任务描述、上下文片段和最终周报
- 爱马仕前端「设置 → AI 模型接入」和「设置 → MCP 工具接入」可分别维护 LXC 内 `/opt/hermes-agent/config.yaml``model``mcp_servers` 块,保存后重启 Docker `hermes-agent`
- 当前前端静态壳缓存版本:`hermes-ui-v29`
- 当前前端静态壳缓存版本:`hermes-ui-v30`
- 文档 / 解析https://styles.kang-kang.com
- 管理后台:待定
- 代码仓https://git.kang-kang.com/kangwan/hermes-glass-ui-personal

View File

@@ -144,16 +144,28 @@ function ensureModelChoice(modelValue, labelValue = "") {
}
}
function syncModelPick(modelValue) {
function updateModelDisplay(modelValue, providerValue = "") {
const model = (modelValue || state.model || DEFAULT_MODEL_ID).trim();
const provider = (providerValue || "").trim();
const pick = document.getElementById("modelPick");
const option = pick ? Array.from(pick.options).find(item => item.value === model) : null;
const label = option?.textContent || model;
const stat = document.getElementById("statModel");
const statSub = document.getElementById("statModelSub");
const aboutModel = document.getElementById("aboutModelValue");
if (stat) stat.textContent = label;
if (statSub) statSub.textContent = provider ? "Provider: " + provider : "Provider 以设置为准";
if (aboutModel) aboutModel.textContent = provider ? model + " · " + provider : model;
}
function syncModelPick(modelValue, providerValue = "") {
const model = (modelValue || state.model || "").trim();
const pick = document.getElementById("modelPick");
if (!pick || !model) return;
ensureModelChoice(model);
let option = Array.from(pick.options).find(item => item.value === model);
pick.value = model;
state.model = model;
const stat = document.getElementById("statModel");
if (stat) stat.textContent = option.textContent || model;
updateModelDisplay(model, providerValue);
}
// ---------- 会话持久化 ----------
@@ -657,7 +669,8 @@ async function refreshHermesConfig(force = false) {
},
mcp_servers_yaml: config.mcp_servers_yaml || "",
};
if (model.default) syncModelPick(model.default);
if (model.default) syncModelPick(model.default, model.provider || "");
else updateModelDisplay(state.model, model.provider || "");
_hermesConfigLoaded = true;
const suffix = config.lxc ? " · " + config.lxc : "";
setHermesModelStatus("已读取模型配置" + suffix);
@@ -721,7 +734,7 @@ async function saveModelConfig() {
restart: true,
});
const savedModel = saved.model || {};
if (savedModel.default) syncModelPick(savedModel.default);
if (savedModel.default) syncModelPick(savedModel.default, savedModel.provider || model.provider || "");
_hermesConfigSnapshot = {
model: {
default: savedModel.default || model.default,
@@ -770,7 +783,7 @@ async function saveMcpConfig() {
restart: true,
});
const savedModel = saved.model || model;
if (savedModel.default) syncModelPick(savedModel.default);
if (savedModel.default) syncModelPick(savedModel.default, savedModel.provider || model.provider || "");
document.getElementById("mcpServersYaml").value = saved.mcp_servers_yaml || "";
_hermesConfigSnapshot = {
model: {
@@ -1041,7 +1054,7 @@ function renderChat(streaming = false) {
<span class="wh-mid">PARIS</span>
</div>
<div class="welcome-title">${greet},今天想聊点什么?</div>
<div class="welcome-sub">由 Gemini 3 Pro 驱动 · 你的私人 AI 助手</div>
<div class="welcome-sub">由当前 AI 模型驱动 · 你的私人 AI 助手</div>
<div class="welcome-chips">
<span class="chip" data-p="帮我规划今晚三道菜的晚餐">🍽 今晚吃什么</span>
<span class="chip" data-p="用通俗语言解释 MCP 协议">💡 解释一个概念</span>

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-v29">
<link rel="stylesheet" href="./styles.css?v=20260511-settings-v30">
</head>
<body>
@@ -952,8 +952,8 @@ git push # Gitea kangwan/hermes-glass-ui-personal
</div>
<div class="stat-body">
<div class="stat-label">当前模型</div>
<div class="stat-value" id="statModel">Gemini 3 Pro</div>
<div class="stat-sub">Google AI Studio</div>
<div class="stat-value" id="statModel">google/gemini-3.1-pro-preview</div>
<div class="stat-sub" id="statModelSub">Provider 以设置为准</div>
</div>
</div>
<div class="stat stat-lg">
@@ -1385,7 +1385,7 @@ git push # Gitea kangwan/hermes-glass-ui-personal
</div>
<div class="about-item">
<div class="about-lbl">模型</div>
<div class="about-val">Gemini 3 Pro · Google AI Studio</div>
<div class="about-val" id="aboutModelValue">AI 模型接入配置为准</div>
</div>
<div class="about-item">
<div class="about-lbl">代理</div>
@@ -1408,6 +1408,6 @@ git push # Gitea kangwan/hermes-glass-ui-personal
</main>
</div>
<script src="./app.js?v=20260511-settings-v29"></script>
<script src="./app.js?v=20260511-settings-v30"></script>
</body>
</html>

View File

@@ -1,11 +1,11 @@
// 爱马仕 Hermes · 轻量 Service Worker
// 静态壳走 network-first拿不到再回退缓存API 直通
const CACHE = "hermes-ui-v29";
const CACHE = "hermes-ui-v30";
const ASSETS = [
"./",
"./index.html",
"./styles.css?v=20260511-settings-v29",
"./app.js?v=20260511-settings-v29",
"./styles.css?v=20260511-settings-v30",
"./app.js?v=20260511-settings-v30",
"./manifest.webmanifest",
"./icon.svg",
];