feat: 侧栏显示构建时间,便于确认版本
This commit is contained in:
1 parent
98478f5ebc
commit
623666875d
4 files changed
+13
No files matched your search
@@ -1,5 +1,10 @@
|
||||
# 更新日志
|
||||
|
||||
## 2026-10-26 → ✨ 侧栏显示构建时间(确认是否最新版)
|
||||
|
||||
- ✨ 侧栏底部显示「构建 10-26 18:01」,等于服务端当前版本时间;页面不是最新版时一眼可辨
|
||||
- ✅ 复查:「概览」为菜单首项且是默认打开页;标题、激活态一致;首屏 50 张应用卡片 + 优化建议面板
|
||||
|
||||
## 2026-10-26 → ✨ 服务端更新后页面自动刷新(解决"改了看不到")
|
||||
|
||||
- ✨ `/api/host` 返回 `build`(每次进程启动生成),前端发现 build 变化自动 `location.reload()`
|
||||
|
||||
@@ -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 = `<b>${esc(h.hostname)}</b><br/>${h.cpus} 核 · 内存 ${fmtBytes(h.memTotal)}<br/>运行 ${h.running} / 共 ${h.containers} 容器`;
|
||||
$('#navRunning').textContent = h.running;
|
||||
$('#navStopped').textContent = (h.stopped || 0) + (h.pending || 0);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</nav>
|
||||
<div class="nav-foot">
|
||||
<div id="hostMini" class="host-mini">连接中…</div>
|
||||
<div class="build-stamp" id="buildStamp">版本加载中…</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
|
||||
@@ -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}
|
||||
Reference in new issue
Block a user