style(display): refine overview line layout [CI]
This commit is contained in:
1 parent
52059b04c1
commit
1145a53004
3 files changed
+35
-7
No files matched your search
@@ -62,9 +62,12 @@ export function LineStrips({ lineId, range, m }: Props) {
|
|||||||
const retransValue = m['tcp.retrans']
|
const retransValue = m['tcp.retrans']
|
||||||
const retransTone = levelOf(retransValue)
|
const retransTone = levelOf(retransValue)
|
||||||
const retransText = retransValue === null || retransValue === undefined ? '重传 —' : `${fmtPct(retransValue)} 重传`
|
const retransText = retransValue === null || retransValue === undefined ? '重传 —' : `${fmtPct(retransValue)} 重传`
|
||||||
|
const hasMeasurements = Object.values(s?.values ?? {}).some((values) => values.some((value) => value !== null && value !== undefined))
|
||||||
return (
|
return (
|
||||||
<div className="strips" ref={box} onMouseMove={onMove} onMouseLeave={() => setHover(null)}>
|
<div className="strips" ref={box} onMouseMove={onMove} onMouseLeave={() => setHover(null)}>
|
||||||
<div className="line-mini-stack">
|
{s && !hasMeasurements ? (
|
||||||
|
<div className="line-no-data">近 {info.hours} 小时暂无测量数据</div>
|
||||||
|
) : <div className="line-mini-stack">
|
||||||
<div className="line-mini-quic-head" title={`QUIC RTT p50 ${fmtMs(m['rtt.p50'])} · p95 ${fmtMs(m['rtt.p95'])} · p99 ${fmtMs(m['rtt.p99'])}`}>
|
<div className="line-mini-quic-head" title={`QUIC RTT p50 ${fmtMs(m['rtt.p50'])} · p95 ${fmtMs(m['rtt.p95'])} · p99 ${fmtMs(m['rtt.p99'])}`}>
|
||||||
<span>QUIC</span><strong className="num">{fmtMs(m['rtt.p50'])}</strong><small>悬停看 p95 / p99</small>
|
<span>QUIC</span><strong className="num">{fmtMs(m['rtt.p50'])}</strong><small>悬停看 p95 / p99</small>
|
||||||
</div>
|
</div>
|
||||||
@@ -101,7 +104,7 @@ export function LineStrips({ lineId, range, m }: Props) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>}
|
||||||
<div className={`pop num${hover !== null && at !== null ? ' open' : ''}`} role="tooltip" aria-hidden={hover === null}>
|
<div className={`pop num${hover !== null && at !== null ? ' open' : ''}`} role="tooltip" aria-hidden={hover === null}>
|
||||||
{at !== null ? (
|
{at !== null ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -70,6 +70,12 @@
|
|||||||
padding: 40px 24px 80px;
|
padding: 40px 24px 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 总览线路多,宽屏时使用可用横向空间,避免卡片挤在左侧。 */
|
||||||
|
.overview-page {
|
||||||
|
width: min(100%, 1640px);
|
||||||
|
max-width: 1640px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 线路页是数据工作区:宽屏充分利用空间,图表和辅助文字保持清晰对比。 */
|
/* 线路页是数据工作区:宽屏充分利用空间,图表和辅助文字保持清晰对比。 */
|
||||||
.line-page {
|
.line-page {
|
||||||
--line-secondary: color-mix(in srgb, var(--app-ink) 58%, var(--app-ink-muted));
|
--line-secondary: color-mix(in srgb, var(--app-ink) 58%, var(--app-ink-muted));
|
||||||
@@ -1983,8 +1989,8 @@ input {
|
|||||||
|
|
||||||
.line-grid {
|
.line-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 12px;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-card {
|
.line-card {
|
||||||
@@ -1992,14 +1998,33 @@ input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.line-card .line-name {
|
.line-card .line-name {
|
||||||
flex-wrap: wrap;
|
min-width: 0;
|
||||||
row-gap: 2px;
|
flex-wrap: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-card .line-name .name {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-card .line-name .arrow {
|
||||||
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-card .line-name .arrow {
|
.line-card .line-name .arrow {
|
||||||
color: var(--app-ink-faint);
|
color: var(--app-ink-faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.line-no-data {
|
||||||
|
padding: 8px 2px 2px;
|
||||||
|
color: var(--app-ink-faint);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 线路面板:按三网分组 */
|
/* 线路面板:按三网分组 */
|
||||||
.carrier-group + .carrier-group {
|
.carrier-group + .carrier-group {
|
||||||
margin-top: 18px;
|
margin-top: 18px;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ export function Overview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="page">
|
<main className="page overview-page">
|
||||||
<section className="hero">
|
<section className="hero">
|
||||||
<h1>总览</h1>
|
<h1>总览</h1>
|
||||||
<p className="sub">
|
<p className="sub">
|
||||||
|
|||||||
Reference in new issue
Block a user