From 4a231a8d4cd1c4d8c6e5ab2b53784f3d2f715ee5 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Sun, 27 Sep 2026 06:44:49 +0800 Subject: [PATCH] =?UTF-8?q?style(webui):=20dashboard.js=20=E4=B8=A4?= =?UTF-8?q?=E5=A4=84=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=90=88=E5=B9=B6=E4=B8=BA?= =?UTF-8?q?=E5=8D=95=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 纯格式化,无语义变化: - state.startedAt 的三元表达式(563 行附近) - renderAll 里 Promise.all 的实参(624 行附近) 两处的表达式与参数列表逐字符相同,只是原先的换行被收拢。 已随二进制部署并验证上线:现网 `/` 返回的 HTML 里单行写法命中 1 处、 旧多行写法 0 残留。 --- internal/plugins/webui/dashboard.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/plugins/webui/dashboard.js b/internal/plugins/webui/dashboard.js index 60b5dc8..6823691 100644 --- a/internal/plugins/webui/dashboard.js +++ b/internal/plugins/webui/dashboard.js @@ -563,9 +563,7 @@ async function starmapFetchBlock(name) { try { var s = await api("/status"); state.status = s; - state.startedAt = s.startedAt - ? new Date(s.startedAt).getTime() - : null; + state.startedAt = s.startedAt ? new Date(s.startedAt).getTime() : null; } catch (e) {} break; case "runtime": @@ -624,9 +622,7 @@ async function renderAll(force) { if (force) _loadedOnce = {}; // 1) 只拉当前页签需要的数据(并发的别串行等) var needs = spec.fetch || []; - await Promise.all( - needs.map((n) => starmapFetchBlock(n)), - ); + await Promise.all(needs.map((n) => starmapFetchBlock(n))); // 2) 只渲染当前页签(+ 星图在多处出现,单独处理) try { spec.render.forEach((fn) => {