-
-
-
-
-
「site.public」打开之后,展示页对匿名访客公开。
+ <>
+
+
+
+
+
+
+ 「site.public」打开之后,展示页对匿名访客公开。
+
-
+ >
)
}
diff --git a/web/display/src/pages/Line.tsx b/web/display/src/pages/Line.tsx
index 136f28b..c57fa6c 100644
--- a/web/display/src/pages/Line.tsx
+++ b/web/display/src/pages/Line.tsx
@@ -30,7 +30,7 @@ interface HostSeries {
}
/** 指标卡片:好坏的分界(越低越好)和显示格式。 */
-const TILES: { label: string; key: string; fmt: (v: number | null | undefined) => string; good?: number; poor?: number; unit?: string }[] = [
+const TILES: { label: string; key: string; fmt: (v: number | null | undefined) => string; good?: number; poor?: number; unit?: string; /** 这个线路没有数据时不显示(建连任务不是每条线路都开着)。 */ optional?: boolean }[] = [
{ label: 'UDP 延迟 p50', key: 'rtt.p50', fmt: fmtMs },
{ label: 'UDP 延迟 p95', key: 'rtt.p95', fmt: fmtMs },
{ label: 'UDP 丢包', key: 'loss.total', fmt: fmtPct, good: 0.5, poor: 3 },
@@ -43,6 +43,9 @@ const TILES: { label: string; key: string; fmt: (v: number | null | undefined) =
{ label: 'TCP RTT p99', key: 'tcp.rtt.p99', fmt: fmtMs },
{ label: 'TCP RTT 最大', key: 'tcp.rtt.max', fmt: fmtMs },
{ label: 'TCP 重传率', key: 'tcp.retrans', fmt: fmtPct, good: 0.5, poor: 3 },
+ { label: 'TCP 建连 p95', key: 'connect.tcp_ms.p95', fmt: fmtMs, optional: true },
+ { label: 'TLS 握手 p95', key: 'connect.tls_ms.p95', fmt: fmtMs, optional: true },
+ { label: '建连成功率', key: 'connect.success', fmt: fmtPct, optional: true },
]
interface ChartDef {
@@ -52,7 +55,7 @@ interface ChartDef {
zero?: boolean
fill?: boolean
series: { key: string; label: string; color: string; dash?: number[] }[]
- group: 'udp' | 'tcp' | 'score'
+ group: 'udp' | 'tcp' | 'connect' | 'score'
/** 占满一行。 */
wide?: boolean
}
@@ -60,6 +63,7 @@ interface ChartDef {
const GROUPS = [
{ id: 'udp', title: 'UDP(往返探测)' },
{ id: 'tcp', title: 'TCP' },
+ { id: 'connect', title: '建连(TCP 握手、TLS 握手)' },
{ id: 'score', title: '评分' },
] as const
@@ -69,6 +73,8 @@ const CHARTS: ChartDef[] = [
{ id: 'jitter', title: '抖动(p95)', group: 'udp', unit: 'ms', series: [{ key: 'jitter.up.p95', label: '上行', color: '--chart-2' }, { key: 'jitter.down.p95', label: '下行', color: '--chart-1' }] },
{ id: 'tcp', title: '往返时延(RTT)', group: 'tcp', unit: 'ms', series: [{ key: 'tcp.rtt.p50', label: 'p50', color: '--chart-1' }, { key: 'tcp.rtt.p95', label: 'p95', color: '--chart-2' }, { key: 'tcp.rtt.max', label: '最大', color: '--chart-3' }] },
{ id: 'retrans', title: '重传率', group: 'tcp', unit: '%', fill: true, series: [{ key: 'tcp.retrans', label: '重传率', color: '--chart-3' }] },
+ { id: 'connect-time', title: '建连耗时(p95)', group: 'connect', unit: 'ms', series: [{ key: 'connect.tcp_ms.p95', label: 'TCP 建连', color: '--chart-1' }, { key: 'connect.tls_ms.p95', label: 'TLS 握手', color: '--chart-2' }] },
+ { id: 'connect-ok', title: '建连成功率', group: 'connect', unit: '%', zero: false, series: [{ key: 'connect.success', label: '成功率', color: '--chart-3' }] },
{ id: 'score', title: '综合评分', group: 'score', wide: true, unit: '', series: [{ key: 'score.reality', label: 'REALITY', color: '--chart-1' }, { key: 'score.hy2', label: 'Hy2', color: '--chart-2' }, { key: 'score.mc', label: 'MC', color: '--chart-4' }, { key: 'score.base', label: '综合', color: '--chart-5', dash: [4, 3] }] },
]
@@ -347,7 +353,7 @@ export function Line() {
评分
- {TILES.map((t) => (
+ {TILES.filter((t) => !t.optional || m[t.key] != null).map((t) => (