From c9ce680a5ad9f1200726ce5cdea0de7ada467994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A1=E5=8F=A3=E6=B5=AA=E4=BA=BA?= Date: Sat, 17 Oct 2026 23:00:36 +0800 Subject: [PATCH] fix: release unified home card layout v1.6.7 --- RELEASE_NOTES.md | 8 +++----- SHA256SUMS | 6 ++++-- docs/HOME-CARD-ORDER-2026-10-17.md | 7 +++++++ plugin/manifest.json | 2 +- plugin/ui/overview.js | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 docs/HOME-CARD-ORDER-2026-10-17.md diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 14198de..6cc5772 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,5 @@ -# Raspberry Pi Console Adapter v1.6.1 +# pigway-console-adapter-raspberry-pi v1.6.7 -新增磁盘手动发现,设备卡片与配置页统一采用Console保存的排序、显示名称和隐藏设置。分区容量继续排列在公共指标网格,挂载路径放在提示中,避免孤立斜杠。 +统一首页卡片布局、管理入口及图标间距。详见 docs/HOME-CARD-ORDER-2026-10-17.md。 -沿用独立插件pigway-agent及原设备记录、服务/进程和硬件插件控制。支持Agent3.11.2提供的容量周更元数据,建议Console2.7.5。 - -验证:4项指标测试;三设备生产页面和中英文桌面/平板/手机遍历通过,原Pi插件1.6.1保持在线,无新增扫描或协议更改。 +验证:线上 1440/820/390px 卡片顺序、NAS 温度整合、管理链接、无横向溢出与 JS 错误。 diff --git a/SHA256SUMS b/SHA256SUMS index f8fe533..1637f38 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -1,15 +1,17 @@ 3cfd361f7663a9a9c93b507d17bb1c7e98003d61316826f0a4ba4a93594f72d4 .gitignore 1f960195978886b318953a6dbc7f13a551d9bb2bab44aa88b1599c69c8a9ced5 README.md d081c599d821149853368b1a8637c57a16995344406ff5ec9d7619b66e0479b3 package.py -cf40d1302a8398497e4d6724ec0a22b24420e32ed2697ba3f4d039d193cf38ea plugin/manifest.json e5c04001dbd8ed8bba614f7b341237fc6487a9a8fe2f28ccb6f59278725b0a69 plugin/ui/config.js c98f34119436e3020ef20b325f91617943aefe662119cf76738e0226c2e91cbb plugin/ui/device.js 89b9d7994e7477e18c3f43e6f0975e04d5106056ba581b2964db0f39183d6f8a plugin/ui/hardware.js af631694fcd7da21b77b554e6ee1bf2eaa93bd46a0b8b543e367f032d3236ecb plugin/ui/index.js -fadb6bf24d6fcf569fc4157847a3585a1008aad99ce5a0e2b87c9c0658f6d225 plugin/ui/overview.js 422e1f8323d29a4be757f39e8b60addd7764c436a1302673809e0c547fce5ff4 plugin/ui/schema.js 5d967b5d4e62eed7022bc04fe29e4ed670f2e288cf20adae0c25233f94a29079 plugin/ui/services.js 56e67d2839cbb865133e3b5f796a07f36595c0f6c30480f8e2fac79e7d51e03f plugin/ui/styles.css 0b79b9c5b5f23727164e05b127caca72255416309166ba200ccbd15a9667473c plugin/ui/translations.js 0c37e4604a30c13923b45316d21c841164c48e8b632c3a3f8febd778b434c2f8 plugin/worker.py 9ffd557bb01ccda24970af1cfc5ec395721d5b1e613bfc013feb27d074582b7e tests/test_metrics.py +c7c5733264f0f9b00fbd4d13d5891b477d0e1f477e766db29da23efe6626e610 plugin/ui/overview.js +5b1be269706fb8d0f269c99941d36017f1d451f62960443c7d5d14a30cda708a plugin/manifest.json +1eec71f194bfdd51b6ae5a9063a0760ccf24b46474901defdf19503a680b8fcd docs/HOME-CARD-ORDER-2026-10-17.md +ee80ad795c189f136bfa41ac235cf8d2951e8e362f7d12b3e47825982a9a9fe9 RELEASE_NOTES.md diff --git a/docs/HOME-CARD-ORDER-2026-10-17.md b/docs/HOME-CARD-ORDER-2026-10-17.md new file mode 100644 index 0000000..32ebaca --- /dev/null +++ b/docs/HOME-CARD-ORDER-2026-10-17.md @@ -0,0 +1,7 @@ +# 首页设备卡片统一约定 + +所有主机(包括 Server、Gateway、NAS 及后续新增设备)使用顺序:处理器负载 → 内存占用 → 主网络 → 存储分区,再显示设备专属信息。 + +NAS 系统温度放在处理器负载进度条下方,不单独占卡片;保留系统温度的原始含义。管理跳转图标紧跟设备名称,布局间距 2px,新标签页打开。Docker 管理入口使用 Server 的 DPanel 88 端口。 + +本次发布为增量更新,保留线上已有功能与配置。发布附件仅包含本次更新的运行时文件,不是可直接导入 Console 的完整适配器安装 ZIP。 diff --git a/plugin/manifest.json b/plugin/manifest.json index 483ff63..666e23a 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "pigway-agent", "name": "PIGWay Raspberry Pi Agent", - "version": "1.6.1", + "version": "1.6.7", "protocol_version": 1, "entrypoint": "worker.py", "runtime": "python3", diff --git a/plugin/ui/overview.js b/plugin/ui/overview.js index 2d1898f..16646fc 100644 --- a/plugin/ui/overview.js +++ b/plugin/ui/overview.js @@ -23,5 +23,5 @@ export function agentHostCard(entry) { diskTotal = y.disk_total_bytes; const percent = n => Number.isFinite(n) ? `${n.toFixed(1)}%` : "--"; const progress = n => Number.isFinite(n) ? meter(n) : ""; - return `

${esc(m.name || h.name || m.id)}

${esc(formatUptime(s.uptime_seconds))}
ID ${esc(m.id || h.id)}${appState.LANG === "zh" ? "主机名" : "Hostname"} ${esc(m.hostname || v.hostname || "--")}${esc(v.manufacturer || "")} ${esc(v.model || "--")}${appState.LANG === "zh" ? "序列号" : "Serial"} ${esc(v.serial || "--")}${appState.LANG === "zh" ? "硬件版本" : "Revision"} ${esc(v.revision || "--")}${esc(v.os || "--")}${appState.LANG === "zh" ? "内核" : "Kernel"} ${esc(v.kernel || "--")}${esc(v.architecture || "--")} · CPU ${esc(v.cpu_count || "--")}${appState.LANG === "zh" ? "程序版本" : "Agent"} ${esc(s.version || "--")}
${tr("在线")}
${tr("处理器负载")}
${percent(y.cpu_percent)}
${progress(y.cpu_percent)}
${appState.LANG === "zh" ? "频率" : "Frequency"} ${esc(y.cpu_freq_mhz)} MHz · ${esc(y.temperature_c)}°C${fanMetric(s.plugins || {})}
${tr("内存占用")}
${percent(y.memory_percent)}
${progress(y.memory_percent)}
${bytes(memUsed)} / ${bytes(memTotal)} · ${appState.LANG === "zh" ? "可用" : "Available"} ${bytes(y.memory_available_bytes)}
${Array.isArray(y.storage_inventory) ? storageCards(y,entry.snapshot?.resources) : `
${tr("磁盘占用")}
${percent(y.disk_percent)}
${progress(y.disk_percent)}
${bytes(diskUsed)} / ${bytes(diskTotal)} · ${appState.LANG === "zh" ? "剩余" : "Free"} ${bytes(y.disk_free_bytes)}
`}
${tr("主网络")}
↓ ${bytes(n.rx_bytes_per_second)}/s · ↑ ${bytes(n.tx_bytes_per_second)}/s
${esc(n.interface || "--")} · ${n.kind === "WIF" ? `${esc(n.metric)} dBm · ` : n.link_speed_mbps ? `${esc(n.link_speed_mbps)} Mbps · ` : ""}${esc(n.ip_label)} ${esc(n.ip)} · ${n.link === true ? (appState.LANG === "zh" ? "已连接" : "Connected") : n.link === false ? (appState.LANG === "zh" ? "已断开" : "Disconnected") : (appState.LANG === "zh" ? "状态未确认" : "Unconfirmed")}
${tr("显示状态")}
${esc(ownerName(d.owner))}
${appState.LANG === "zh" ? "告警状态独立于硬件插件" : "Alert state is independent of hardware plugins"}
${tr("当前告警")}
${(d.alerts || []).length}
${(d.alerts || []).map((a) => esc(ownerName(a.id))).join(" · ") || tr("无告警")}
${pluginSummary(s.plugins || {}, h.id)}

${tr("服务与进程监控")}

${(s.watches || []).map((w) => `
${esc(w.name)} · ${esc(w.target)}${tr(w.up ? "正常" : "停止")}
`).join("") || `
${tr("暂无数据")}
`}
`; + return `

${esc(m.name || h.name || m.id)}

${esc(formatUptime(s.uptime_seconds))}
ID ${esc(m.id || h.id)}${appState.LANG === "zh" ? "主机名" : "Hostname"} ${esc(m.hostname || v.hostname || "--")}${esc(v.manufacturer || "")} ${esc(v.model || "--")}${appState.LANG === "zh" ? "序列号" : "Serial"} ${esc(v.serial || "--")}${appState.LANG === "zh" ? "硬件版本" : "Revision"} ${esc(v.revision || "--")}${esc(v.os || "--")}${appState.LANG === "zh" ? "内核" : "Kernel"} ${esc(v.kernel || "--")}${esc(v.architecture || "--")} · CPU ${esc(v.cpu_count || "--")}${appState.LANG === "zh" ? "程序版本" : "Agent"} ${esc(s.version || "--")}
${tr("在线")}
${tr("处理器负载")}
${percent(y.cpu_percent)}
${progress(y.cpu_percent)}
${appState.LANG === "zh" ? "频率" : "Frequency"} ${esc(y.cpu_freq_mhz)} MHz · ${esc(y.temperature_c)}°C${fanMetric(s.plugins || {})}
${tr("内存占用")}
${percent(y.memory_percent)}
${progress(y.memory_percent)}
${bytes(memUsed)} / ${bytes(memTotal)} · ${appState.LANG === "zh" ? "可用" : "Available"} ${bytes(y.memory_available_bytes)}
${tr("主网络")}
↓ ${bytes(n.rx_bytes_per_second)}/s · ↑ ${bytes(n.tx_bytes_per_second)}/s
${esc(n.interface || "--")} · ${n.kind === "WIF" ? `${esc(n.metric)} dBm · ` : n.link_speed_mbps ? `${esc(n.link_speed_mbps)} Mbps · ` : ""}${esc(n.ip_label)} ${esc(n.ip)} · ${n.link === true ? (appState.LANG === "zh" ? "已连接" : "Connected") : n.link === false ? (appState.LANG === "zh" ? "已断开" : "Disconnected") : (appState.LANG === "zh" ? "状态未确认" : "Unconfirmed")}
${Array.isArray(y.storage_inventory) ? storageCards(y,entry.snapshot?.resources) : `
${tr("磁盘占用")}
${percent(y.disk_percent)}
${progress(y.disk_percent)}
${bytes(diskUsed)} / ${bytes(diskTotal)} · ${appState.LANG === "zh" ? "剩余" : "Free"} ${bytes(y.disk_free_bytes)}
`}
${tr("显示状态")}
${esc(ownerName(d.owner))}
${appState.LANG === "zh" ? "告警状态独立于硬件插件" : "Alert state is independent of hardware plugins"}
${tr("当前告警")}
${(d.alerts || []).length}
${(d.alerts || []).map((a) => esc(ownerName(a.id))).join(" · ") || tr("无告警")}
${pluginSummary(s.plugins || {}, h.id)}

${tr("服务与进程监控")}

${(s.watches || []).map((w) => `
${esc(w.name)} · ${esc(w.target)}${tr(w.up ? "正常" : "停止")}
`).join("") || `
${tr("暂无数据")}
`}
`; }