diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ff1e3..b44a41f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 更新日志 +## 2026-10-26 → ✨ 侧栏显示构建时间(确认是否最新版) + +- ✨ 侧栏底部显示「构建 10-26 18:01」,等于服务端当前版本时间;页面不是最新版时一眼可辨 +- ✅ 复查:「概览」为菜单首项且是默认打开页;标题、激活态一致;首屏 50 张应用卡片 + 优化建议面板 + ## 2026-10-26 → ✨ 服务端更新后页面自动刷新(解决"改了看不到") - ✨ `/api/host` 返回 `build`(每次进程启动生成),前端发现 build 变化自动 `location.reload()` diff --git a/public/app.js b/public/app.js index 5d13b13..2e7f8a2 100644 --- a/public/app.js +++ b/public/app.js @@ -121,6 +121,12 @@ async function refreshHost() { serverBuild = h.build; } const navCl = $('#navContainersLabel'); if (navCl && navCl.textContent !== '运行的容器') navCl.textContent = '运行的容器'; + const stamp = $('#buildStamp'); + if (stamp && h.build) { + const d = new Date(Number(h.build)); + const txt = `构建 ${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`; + if (stamp.textContent !== txt) stamp.textContent = txt; + } $('#hostMini').innerHTML = `${esc(h.hostname)}
${h.cpus} 核 · 内存 ${fmtBytes(h.memTotal)}
运行 ${h.running} / 共 ${h.containers} 容器`; $('#navRunning').textContent = h.running; $('#navStopped').textContent = (h.stopped || 0) + (h.pending || 0); diff --git a/public/index.html b/public/index.html index 61d41bc..d00af6f 100644 --- a/public/index.html +++ b/public/index.html @@ -26,6 +26,7 @@ diff --git a/public/style.css b/public/style.css index 45597ce..2507edc 100644 --- a/public/style.css +++ b/public/style.css @@ -268,3 +268,4 @@ table.tb th.num{text-align:right} .warn-txt{color:#b57209} .ok-txt{color:#12a15f} .pend-acts{display:flex;gap:6px;margin-top:2px} +.build-stamp{font-size:10.5px;color:#9aa4b5;margin-top:6px;letter-spacing:.2px}