From 5744bf5585fc7e9b33ffc4d5a9fd30d919f410ee Mon Sep 17 00:00:00 2001 From: kory Date: Mon, 28 Sep 2026 10:23:39 +0800 Subject: [PATCH] fix(web): declare statusText and archOs before card template interpolation --- internal/web/static/app.js | 2 ++ web/static/app.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/web/static/app.js b/internal/web/static/app.js index 3617b13..e179161 100644 --- a/internal/web/static/app.js +++ b/internal/web/static/app.js @@ -38,6 +38,8 @@ async function loadDevices(){ const p = d.profile || {}; const role = p.role || "APPLICATION"; const isOnline = d.status === "online"; + const statusText = isOnline ? "在线" : "离线"; + const archOs = (d.arch || d.os) ? `${esc(d.arch||"")}/${esc(d.os||"")} · ` : ""; const cpuStr = p.cpu_cores ? `${p.cpu_cores}C · ${p.cpu_usage_percent ?? 0}%` : '-'; const loadStr = p.load_1m !== undefined ? p.load_1m.toFixed(2) : '-'; const memStr = p.mem_available ? `${p.mem_available} (${p.mem_percent}%)` : (p.mem_percent !== undefined ? `${p.mem_percent}%` : '-'); diff --git a/web/static/app.js b/web/static/app.js index 3617b13..e179161 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -38,6 +38,8 @@ async function loadDevices(){ const p = d.profile || {}; const role = p.role || "APPLICATION"; const isOnline = d.status === "online"; + const statusText = isOnline ? "在线" : "离线"; + const archOs = (d.arch || d.os) ? `${esc(d.arch||"")}/${esc(d.os||"")} · ` : ""; const cpuStr = p.cpu_cores ? `${p.cpu_cores}C · ${p.cpu_usage_percent ?? 0}%` : '-'; const loadStr = p.load_1m !== undefined ? p.load_1m.toFixed(2) : '-'; const memStr = p.mem_available ? `${p.mem_available} (${p.mem_percent}%)` : (p.mem_percent !== undefined ? `${p.mem_percent}%` : '-');