From ae04ffa9a0b9a17d3877fd1f644f3a8d658d63ba Mon Sep 17 00:00:00 2001 From: enzo Date: Wed, 22 Jul 2026 22:05:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Gateway=20trend=20bars=20missing=20heigh?= =?UTF-8?q?t=20=E2=80=94=20now=20render=2048=20visible=20bars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bars had no `height` property, making them invisible despite the legend showing correctly. Each bar now computes height proportional to anomaly count (max 36px), with a 3px minimum for normal intervals. Co-Authored-By: Claude --- frontend/src/pages/DashboardPage.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/pages/DashboardPage.tsx b/frontend/src/pages/DashboardPage.tsx index d1e96e7..8d194af 100644 --- a/frontend/src/pages/DashboardPage.tsx +++ b/frontend/src/pages/DashboardPage.tsx @@ -171,6 +171,10 @@ function barColor(item: GatewayTrendItem): string { } function GatewayTimeline({ trend }: { trend: GatewayTrendItem[] }) { + const maxIssues = Math.max(1, ...trend.map( + i => i.heartbeat_timeouts + i.feishu_disconnects + i.restarts, + )) + return (
{trend.map((item, i) => { const col = barColor(item) + const total = item.heartbeat_timeouts + item.feishu_disconnects + item.restarts + const pct = total / maxIssues + const height = total === 0 ? 3 : Math.max(3, Math.round(pct * 36)) const details: string[] = [] if (item.heartbeat_timeouts > 0) details.push('心跳超时 ' + item.heartbeat_timeouts) if (item.feishu_disconnects > 0) details.push('飞书断连 ' + item.feishu_disconnects) @@ -195,6 +202,7 @@ function GatewayTimeline({ trend }: { trend: GatewayTrendItem[] }) { title={item.hour + ': ' + tip} style={{ flex: 1, + height, borderRadius: '2px 2px 0 0', minWidth: 3, cursor: 'pointer',