diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 70e6193..1b107a1 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -29,3 +29,7 @@ ## 告警空态统一 2026-10-17:Frame Flow 沿用 NAS 的常驻折叠“已读取范围内的告警”区域及共享 summaryStatus/scopeAlertHealth;仅完整且当前的快照确认“正常 / 无告警”,采集过期或范围不完整则显示未确认。生产中英文三尺寸共 6 次检查通过。 + +## 隐藏正常告警空态 + +2026-10-17 按用户最终偏好统一树莓派、Ubuntu、NAS 与 Frame Flow:新鲜完整快照没有告警时隐藏告警区域;有告警显示,数据过期或采集范围不完整仍显示未确认提示。Docker 沿用现有容器异常与采集错误显示。仅更新四个插件 UI,无服务重启。旧 UI 备份于 `/srv/pigway/apps/pigway-device-console/backups/hide-empty-alerts-20261017-155017`。中英文三尺寸覆盖 4 插件×3状态共 72 项生产渲染检查通过,无脚本错误和横向溢出。 diff --git a/plugin/ui/index.js b/plugin/ui/index.js index 915df83..1e149f2 100644 --- a/plugin/ui/index.js +++ b/plugin/ui/index.js @@ -46,5 +46,5 @@ export function hostCard(entry) { }); }).join(''); const frames = resources.filter(resource => resource.type === 'device'); - return `

${esc(entry.host.name || 'Frame Flow')}

${frames.map(frame => `${esc(frame.name || text('画框', 'Frame'))}`).join('')}
${current ? text('在线', 'Online') : text('状态未确认', 'Unconfirmed')}
${!current ? `

${text('以下为上次采集数据', 'Showing the last collected data')}

` : ''}
${cards}
${text('已读取范围内的告警', 'Alerts within monitored scope')}${summaryStatus(scopeAlertHealth(snapshot.alerts, snapshot.alerts_complete, current), state.LANG)}
${alertRows || (current && snapshot.alerts_complete ? text('无告警', 'No alerts') : text('状态未确认', 'Unconfirmed'))}
`; + return `

${esc(entry.host.name || 'Frame Flow')}

${frames.map(frame => `${esc(frame.name || text('画框', 'Frame'))}`).join('')}
${current ? text('在线', 'Online') : text('状态未确认', 'Unconfirmed')}
${!current ? `

${text('以下为上次采集数据', 'Showing the last collected data')}

` : ''}
${cards}
${(snapshot.alerts || []).length || !current || snapshot.alerts_complete !== true ? `
${text('已读取范围内的告警', 'Alerts within monitored scope')}${summaryStatus(scopeAlertHealth(snapshot.alerts, snapshot.alerts_complete, current), state.LANG)}
${alertRows || (current && snapshot.alerts_complete ? text('无告警', 'No alerts') : text('状态未确认', 'Unconfirmed'))}
` : ""}
`; }