From 6f267bbf211a411418dc497cfa7562799a93d956 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 21 Jun 2026 11:08:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E4=B8=8E=E8=8A=82=E7=82=B9=E8=AF=A6=E6=83=85=E3=80=8C24=20?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E7=BD=91=E7=BB=9C=E8=B6=8B=E5=8A=BF=E3=80=8D?= =?UTF-8?q?=E8=AF=AF=E6=8C=89=E9=80=9F=E7=8E=87=E5=B1=95=E7=A4=BA=EF=BC=9A?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20OpenResty=20=E5=85=A5/=E5=87=BA=E7=AB=99?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E6=B5=81=E9=87=8F=E4=B8=8E=E8=BF=91=2024=20?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E6=80=BB=E9=87=8F=E6=91=98=E8=A6=81=EF=BC=8C?= =?UTF-8?q?Y=20=E8=BD=B4=E4=B8=8E=20tooltip=20=E8=87=AA=E5=8A=A8=E6=8D=A2?= =?UTF-8?q?=E7=AE=97=20B/KB/MB/GB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog/index.md | 2 ++ .../dashboard/network-disk-trend-chart.tsx | 21 ++++++++-------- .../components/dashboard/world-stage.tsx | 2 +- .../nodes/components/disk-io-trend-chart.tsx | 12 +++------ .../nodes/components/network-trend-chart.tsx | 25 +++++++------------ 5 files changed, 26 insertions(+), 36 deletions(-) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 3b81d44c..e4cbef13 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -22,6 +22,8 @@ sidebar: false ### 修复 +- 修复仪表盘与节点详情「24 小时网络趋势」误按速率展示:改为 OpenResty 入/出站小时流量与近 24 小时总量摘要,Y 轴与 tooltip 自动换算 B/KB/MB/GB。 + - 修复 Pages 上传或节点同步时报 `pages file size out of bounds`:允许 ZIP 包内的 0 字节文件,并兼容未声明解压大小的 ZIP 条目。 - 修复节点详情 OpenResty 连接数与吞吐显示为「—」:节点可观测 API 将 OpenResty 观测数据合并进 `metric_snapshots`;指标文案改为「请求/分钟」(近 60 秒窗口),连接数为 0 时正常显示 0。 diff --git a/frontend/app/(main)/components/dashboard/network-disk-trend-chart.tsx b/frontend/app/(main)/components/dashboard/network-disk-trend-chart.tsx index 6a6e2f9b..cf85cc52 100644 --- a/frontend/app/(main)/components/dashboard/network-disk-trend-chart.tsx +++ b/frontend/app/(main)/components/dashboard/network-disk-trend-chart.tsx @@ -1,15 +1,10 @@ 'use client'; import {TrendChart} from '@/components/data/trend-chart'; -import { - Card, - CardContent, - CardHeader, - CardTitle, -} from '@/components/ui/card'; +import {Card, CardContent, CardHeader, CardTitle,} from '@/components/ui/card'; import type {DiskIOTrendPoint, NetworkTrendPoint} from '@/lib/services/openflare'; -import {formatBytes, formatBytesPerSecond, formatTrendHour} from './dashboard-utils'; +import {formatBytes, formatTrendHour} from './dashboard-utils'; export function NetworkDiskTrendChart({ networkPoints, @@ -27,7 +22,9 @@ export function NetworkDiskTrendChart({ formatTrendHour(point.bucket_started_at))} height={180} - yAxisValueFormatter={(value) => formatBytesPerSecond(value, 3600)} + summaryScope="total" + summaryHint="近 24 小时" + yAxisValueFormatter={formatBytes} series={[ { label: 'OpenResty 入站', @@ -35,13 +32,13 @@ export function NetworkDiskTrendChart({ fillColor: 'rgba(34, 197, 94, 0.14)', variant: 'area', values: networkPoints.map((point) => point.openresty_rx_bytes), - valueFormatter: (value) => formatBytesPerSecond(value, 3600), + valueFormatter: formatBytes, }, { label: 'OpenResty 出站', color: '#38bdf8', values: networkPoints.map((point) => point.openresty_tx_bytes), - valueFormatter: (value) => formatBytesPerSecond(value, 3600), + valueFormatter: formatBytes, }, ]} /> @@ -49,6 +46,8 @@ export function NetworkDiskTrendChart({ formatTrendHour(point.bucket_started_at))} height={180} + summaryScope="total" + summaryHint="近 24 小时" yAxisValueFormatter={formatBytes} series={[ { @@ -70,4 +69,4 @@ export function NetworkDiskTrendChart({ ); -} \ No newline at end of file +} diff --git a/frontend/app/(main)/components/dashboard/world-stage.tsx b/frontend/app/(main)/components/dashboard/world-stage.tsx index 9a6b7868..2e62b21b 100644 --- a/frontend/app/(main)/components/dashboard/world-stage.tsx +++ b/frontend/app/(main)/components/dashboard/world-stage.tsx @@ -183,7 +183,7 @@ export function WorldStage({ progress: healthyRate, }, { - label: '最近窗口请求', + label: '24小时请求', value: formatCompactNumber(traffic.request_count), hint: `QPS ${traffic.estimated_qps.toFixed(1)} · ${traffic.reported_nodes} 个节点上报`, icon: Activity, diff --git a/frontend/app/(main)/nodes/components/disk-io-trend-chart.tsx b/frontend/app/(main)/nodes/components/disk-io-trend-chart.tsx index d417eda0..54aa4856 100644 --- a/frontend/app/(main)/nodes/components/disk-io-trend-chart.tsx +++ b/frontend/app/(main)/nodes/components/disk-io-trend-chart.tsx @@ -1,13 +1,7 @@ 'use client'; import {TrendChart} from '@/components/data/trend-chart'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; +import {Card, CardContent, CardDescription, CardHeader, CardTitle,} from '@/components/ui/card'; import type {DiskIOTrendPoint} from '@/lib/services/openflare'; import {formatBytes, formatTrendHour} from '../../components/dashboard/dashboard-utils'; @@ -30,6 +24,8 @@ export function DiskIOTrendChart({ formatTrendHour(point.bucket_started_at))} + summaryScope="total" + summaryHint="近 24 小时" yAxisValueFormatter={formatBytes} series={[ { @@ -51,4 +47,4 @@ export function DiskIOTrendChart({ ); -} \ No newline at end of file +} diff --git a/frontend/app/(main)/nodes/components/network-trend-chart.tsx b/frontend/app/(main)/nodes/components/network-trend-chart.tsx index 8a768ebc..097f60ae 100644 --- a/frontend/app/(main)/nodes/components/network-trend-chart.tsx +++ b/frontend/app/(main)/nodes/components/network-trend-chart.tsx @@ -1,24 +1,15 @@ 'use client'; import {TrendChart} from '@/components/data/trend-chart'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; +import {Card, CardContent, CardDescription, CardHeader, CardTitle,} from '@/components/ui/card'; import type {NetworkTrendPoint} from '@/lib/services/openflare'; -import { - formatBytesPerSecond, - formatTrendHour, -} from '../../components/dashboard/dashboard-utils'; +import {formatBytes, formatTrendHour} from '../../components/dashboard/dashboard-utils'; export function NetworkTrendChart({ points, title = '24 小时网络趋势', - description = '观察 OpenResty 入站/出站吞吐的变化,辅助识别回源压力、突发流量或出口异常。', + description = '按小时展示 OpenResty 入站/出站流量累计,摘要为近 24 小时总量。', }: { points: NetworkTrendPoint[]; title?: string; @@ -33,7 +24,9 @@ export function NetworkTrendChart({ formatTrendHour(point.bucket_started_at))} - yAxisValueFormatter={(value) => formatBytesPerSecond(value, 3600)} + summaryScope="total" + summaryHint="近 24 小时" + yAxisValueFormatter={formatBytes} series={[ { label: 'OpenResty 入站', @@ -41,17 +34,17 @@ export function NetworkTrendChart({ fillColor: 'rgba(34, 197, 94, 0.14)', variant: 'area', values: points.map((point) => point.openresty_rx_bytes), - valueFormatter: (value) => formatBytesPerSecond(value, 3600), + valueFormatter: formatBytes, }, { label: 'OpenResty 出站', color: '#38bdf8', values: points.map((point) => point.openresty_tx_bytes), - valueFormatter: (value) => formatBytesPerSecond(value, 3600), + valueFormatter: formatBytes, }, ]} /> ); -} \ No newline at end of file +}