fix: 无异常时隐藏异常浮窗(display:none)——老莫反馈: 无异常不应显示红底感叹号,点开为空矛盾

This commit is contained in:
xxm
2026-08-13 02:12:51 +08:00
parent da24c77cde
commit 4240c80c58
+6 -2
View File
@@ -167,7 +167,7 @@ body { background: #0f0f13; color: #e2e8f0; }
</div>
<!-- 浮动异常区(右上角,任何板块可见,2026-08-12 老莫指示) -->
<div id="alertFloat" class="collapsed" onclick="toggleAlertFloat(event)">
<div id="alertFloat" class="collapsed" style="display:none" onclick="toggleAlertFloat(event)">
<div class="alert-head">
<span class="alert-title">⚠️ 异常 <span id="alertCount" class="alert-count" style="display:none">0</span></span>
<span class="alert-toggle"></span>
@@ -2694,15 +2694,19 @@ function renderAlerts(alerts) {
const keys = shown.map(a => a.ts + '_' + a.source + '_' + a.code).join('|');
if (!shown.length) {
// 无异常 → 整个浮窗隐藏(2026-08-13 老莫反馈:无异常不应显示红底感叹号)
el.style.display = 'none';
el.classList.add('collapsed');
body.style.display = 'none';
el.querySelector('.alert-toggle').textContent = '▾';
countEl.style.display = 'none';
countEl.textContent = '0';
lastAlertKeys = '';
return;
}
// 有异常 → 显示浮窗
el.style.display = '';
// 新异常 → 自动展开几秒后折叠
const isNew = keys !== lastAlertKeys;
lastAlertKeys = keys;