From 3284e14e4b644ae5e0ccbded63063a59260e7b77 Mon Sep 17 00:00:00 2001 From: hmo Date: Mon, 27 Jul 2026 09:45:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20price=5Fmonitor=20=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E2=80=94=E2=80=94=E5=BC=80=E7=9B=98=E6=9C=9F?= =?UTF-8?q?=E9=97=B4=E6=95=B0=E6=8D=AE>5=E5=88=86=E9=92=9F=E6=9C=AA?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=99=E7=BA=A2=E8=89=B2=E9=97=AA=E7=83=81?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/index.html | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index bdf9424f..4f0c647d 100644 --- a/static/index.html +++ b/static/index.html @@ -35,6 +35,11 @@ body { background: #0f0f13; color: #e2e8f0; } ::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #0f0f13; } ::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; } +@keyframes pulse-warn { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.3; } +} +.pulse-warn { animation: pulse-warn 1.2s ease-in-out infinite; } @@ -280,8 +285,30 @@ async function refreshAll() { if (watchData && watchData.data_time) { const dt = watchData.data_time.slice(5,16); timeParts.unshift('📡价格 ' + dt); + // 开盘期间检测 price_monitor 是否存(数据>5分钟=可能挂了) + const now = new Date(); + const h = now.getHours(), m = now.getMinutes(), d = now.getDay(); + const isMarketHours = d >= 1 && d <= 5 && ((h === 9 && m >= 30) || (h >= 10 && h < 15) || (h === 15 && m === 0)); + if (isMarketHours) { + const dataDate = new Date(watchData.data_time); + const ageMin = (now - dataDate) / 60000; + if (ageMin > 5) { + timeParts[0] = '🚨价格 ' + dt + '(' + Math.round(ageMin) + '分钟未更新)'; + } + } + } + document.getElementById('updateTime').innerHTML = timeParts.join(' | '); + // 如果有告警、整行变红闪烁 + if (timeParts[0].startsWith('🚨')) { + const el = document.getElementById('updateTime'); + el.style.color = '#e53935'; + el.style.fontWeight = 'bold'; + el.className = 'pulse-warn'; + } else { + document.getElementById('updateTime').style.color = ''; + document.getElementById('updateTime').style.fontWeight = ''; + document.getElementById('updateTime').className = ''; } - document.getElementById('updateTime').textContent = timeParts.join(' | '); document.getElementById('tab-overview').classList.remove('loading'); renderTab(document.querySelector('.tab-btn.active')?.dataset?.tab || 'overview'); }