- 先选日期,再在连续 48 小时(或 24 小时)的丢包缩略图上拖选区;选区可以跨零点, 点轴或刻度时离得近的端点贴过去,悬停预览会动的端点;没有数据的时段画成斜纹 - 刻度下方的时长快捷档:30 分钟、1 小时、3 小时、6 小时、12 小时、整天 - 指标卡片平铺,丢包等标明 UDP/TCP;图表按 UDP、TCP、评分分组 - 图表数据刷新时原地更新(不再整张重建),毫秒到 1 秒以上显示成秒 - EWMA 平滑开关(关/轻/中/重),原始数据以淡线垫底 - 数据加载时卡片上显示进度条和占位;useQuery 区分定时刷新和用户触发的加载 - 前端可以在页面里指定后端地址和令牌(配合后端 Monitor__CorsOrigins)
760 lines
12 KiB
CSS
760 lines
12 KiB
CSS
/* 展示端:极简博客式的页面——顶栏、居中的内容列、大号标题、细分隔线 */
|
|
.topbar {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
background: color-mix(in srgb, var(--app-bg), transparent 8%);
|
|
backdrop-filter: blur(8px);
|
|
border-bottom: 1px solid var(--app-outline-soft);
|
|
}
|
|
|
|
.topbar .inner {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 0 24px;
|
|
height: 60px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 24px;
|
|
}
|
|
|
|
.brand {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--app-ink);
|
|
}
|
|
|
|
.brand:hover {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.topnav {
|
|
display: flex;
|
|
gap: 4px;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.topnav a {
|
|
padding: 6px 14px;
|
|
border-radius: var(--r-pill);
|
|
color: var(--app-ink-muted);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.topnav a:hover {
|
|
text-decoration: none;
|
|
background: var(--app-card-inset);
|
|
}
|
|
|
|
.topnav a.active {
|
|
background: var(--app-accent-container);
|
|
color: var(--app-on-accent-container);
|
|
}
|
|
|
|
.page {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 40px 24px 80px;
|
|
}
|
|
|
|
.hero h1 {
|
|
font-size: 40px;
|
|
font-weight: 800;
|
|
letter-spacing: -0.02em;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.hero .sub {
|
|
margin-top: 8px;
|
|
color: var(--app-ink-muted);
|
|
}
|
|
|
|
.section-label {
|
|
font-family: var(--font-mono);
|
|
font-size: 11px;
|
|
letter-spacing: 0.12em;
|
|
text-transform: uppercase;
|
|
color: var(--app-accent);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.section-head {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: 16px;
|
|
margin: 40px 0 16px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.section-head h2 {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.toolbar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.line-row td:first-child {
|
|
min-width: 200px;
|
|
}
|
|
|
|
.line-name {
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.line-meta {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.scores {
|
|
display: flex;
|
|
gap: 6px;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.score-chip {
|
|
display: inline-flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
min-width: 52px;
|
|
padding: 4px 10px;
|
|
border-radius: var(--r-control);
|
|
background: var(--app-card-inset);
|
|
line-height: 1.25;
|
|
}
|
|
|
|
.score-chip b {
|
|
font-size: 15px;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.score-chip small {
|
|
font-size: 10px;
|
|
color: var(--app-ink-muted);
|
|
}
|
|
|
|
.score-chip.ok {
|
|
background: var(--app-ok-container);
|
|
color: var(--app-ok);
|
|
}
|
|
|
|
.score-chip.warn {
|
|
background: var(--app-warn-container);
|
|
color: var(--app-warn);
|
|
}
|
|
|
|
.score-chip.bad {
|
|
background: var(--app-bad-container);
|
|
color: var(--app-bad);
|
|
}
|
|
|
|
.chart-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.chart-card h3 {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.crumbs {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: var(--app-ink-muted);
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.event-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.event-list > div {
|
|
display: flex;
|
|
gap: 16px;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid var(--app-outline-soft);
|
|
}
|
|
|
|
.event-list > div:last-child {
|
|
border-bottom: 0;
|
|
}
|
|
|
|
.pick-list {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
}
|
|
|
|
.pick {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 6px 14px;
|
|
border-radius: var(--r-pill);
|
|
background: var(--app-card-inset);
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.pick.on {
|
|
background: var(--app-accent-container);
|
|
color: var(--app-on-accent-container);
|
|
}
|
|
|
|
.pick input {
|
|
display: none;
|
|
}
|
|
|
|
@media (max-width: 700px) {
|
|
.hero h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.table .hide-sm {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* ── Agent 卡片 ── */
|
|
.cards {
|
|
margin-top: 24px;
|
|
display: grid;
|
|
gap: 16px;
|
|
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
|
|
}
|
|
|
|
.agent-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
padding: 20px;
|
|
}
|
|
|
|
.agent-card.offline {
|
|
opacity: 0.62;
|
|
}
|
|
|
|
.agent-head {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.agent-name {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.agent-head .chip {
|
|
margin-left: auto;
|
|
}
|
|
|
|
.agent-head .chip + .faint {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.lines {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.line-link {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 4px 8px;
|
|
min-width: 0;
|
|
padding: 6px 10px;
|
|
border-radius: var(--r-control);
|
|
background: var(--app-card-inset);
|
|
color: var(--app-ink);
|
|
}
|
|
|
|
.line-link > .muted {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.line-link > .scores {
|
|
flex-wrap: wrap;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.line-link:hover {
|
|
text-decoration: none;
|
|
background: var(--app-card-hover);
|
|
}
|
|
|
|
.scores.compact {
|
|
gap: 3px;
|
|
}
|
|
|
|
.scores.compact .score-chip {
|
|
min-width: 0;
|
|
padding: 1px 6px;
|
|
flex-direction: row;
|
|
gap: 4px;
|
|
align-items: baseline;
|
|
}
|
|
|
|
.scores.compact .score-chip b {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.scores.compact .score-chip small {
|
|
display: none;
|
|
}
|
|
|
|
.host {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid var(--app-outline-soft);
|
|
}
|
|
|
|
.host.stale .meter i {
|
|
background: var(--app-idle);
|
|
}
|
|
|
|
.meter-row {
|
|
display: grid;
|
|
grid-template-columns: 40px minmax(0, 1fr) 44px;
|
|
align-items: center;
|
|
column-gap: 10px;
|
|
}
|
|
|
|
.meter-row .meter-detail {
|
|
grid-column: 2 / 4;
|
|
font-size: 11px;
|
|
margin-top: -2px;
|
|
}
|
|
|
|
.meter-label {
|
|
color: var(--app-ink-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.meter {
|
|
height: 8px;
|
|
border-radius: var(--r-pill);
|
|
background: var(--app-card-inset);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.meter i {
|
|
display: block;
|
|
height: 100%;
|
|
border-radius: var(--r-pill);
|
|
background: var(--app-accent);
|
|
transition: width 0.4s;
|
|
}
|
|
|
|
.meter i.warn {
|
|
background: var(--app-warn);
|
|
}
|
|
|
|
.meter i.bad {
|
|
background: var(--app-bad);
|
|
}
|
|
|
|
.meter-value {
|
|
text-align: right;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.host-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr;
|
|
gap: 4px;
|
|
margin-top: 4px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.host-grid .stat {
|
|
flex-direction: row;
|
|
gap: 12px;
|
|
align-items: baseline;
|
|
}
|
|
|
|
.host-grid .stat .k {
|
|
min-width: 56px;
|
|
}
|
|
|
|
.live-dot {
|
|
display: inline-block;
|
|
width: 8px;
|
|
height: 8px;
|
|
margin-left: 10px;
|
|
border-radius: 50%;
|
|
background: var(--app-idle);
|
|
}
|
|
|
|
.live-dot.on {
|
|
background: var(--app-ok);
|
|
}
|
|
|
|
.line-link > * {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.range-picker {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.day-pick {
|
|
position: relative;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
height: 36px;
|
|
padding: 0 16px;
|
|
border: 0;
|
|
border-radius: var(--r-control);
|
|
background: var(--app-card-inset);
|
|
color: var(--app-ink);
|
|
font: inherit;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.day-pick:hover {
|
|
background: var(--app-card-hover);
|
|
}
|
|
|
|
.day-pick input {
|
|
position: absolute;
|
|
left: 0;
|
|
bottom: 0;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
border: 0;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* ── 对比:每个 Probe 的最佳线路 + 矩阵 ── */
|
|
.winners {
|
|
margin-top: 24px;
|
|
display: grid;
|
|
gap: 12px;
|
|
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|
}
|
|
|
|
.winner {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding: 14px 18px;
|
|
}
|
|
|
|
.winner-name {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: var(--app-ok);
|
|
}
|
|
|
|
.matrix td.r {
|
|
padding-top: 6px;
|
|
padding-bottom: 6px;
|
|
}
|
|
|
|
.cell {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 8px;
|
|
border: 0;
|
|
border-radius: var(--r-control);
|
|
background: transparent;
|
|
color: var(--app-ink);
|
|
cursor: pointer;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.cell:hover {
|
|
background: var(--app-card-hover);
|
|
}
|
|
|
|
.cell.on {
|
|
background: var(--app-accent-container);
|
|
}
|
|
|
|
.cell svg {
|
|
color: var(--app-ok);
|
|
}
|
|
|
|
/* ── 线路详情:指标平铺成一格一格 ── */
|
|
.tiles {
|
|
display: grid;
|
|
gap: 12px;
|
|
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
|
}
|
|
|
|
.tiles > .stat,
|
|
.tiles > .tile {
|
|
padding: 14px 16px;
|
|
border-radius: var(--r-card);
|
|
background: var(--app-card);
|
|
}
|
|
|
|
.tiles > .tile {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.tiles > .tile .k {
|
|
font-size: 12px;
|
|
color: var(--app-ink-faint);
|
|
}
|
|
|
|
.tiles .stat .v {
|
|
font-size: 22px;
|
|
}
|
|
|
|
.tiles > .tile .scores {
|
|
justify-content: flex-start;
|
|
}
|
|
|
|
/* ── 一天的缩略图和可拖动的选区 ── */
|
|
.minimap {
|
|
--pick: var(--chart-1);
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.minimap .track {
|
|
position: relative;
|
|
height: 60px;
|
|
margin-bottom: 18px;
|
|
border-radius: var(--r-control);
|
|
/* 没有数据的地方:灰色斜纹 */
|
|
background: repeating-linear-gradient(135deg, var(--app-card-inset) 0 5px, var(--app-card-hover) 5px 10px);
|
|
cursor: crosshair;
|
|
touch-action: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.minimap svg {
|
|
position: absolute;
|
|
inset: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: var(--r-control);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.minimap svg path {
|
|
fill: var(--app-bad);
|
|
opacity: 0.55;
|
|
}
|
|
|
|
.minimap svg rect.has {
|
|
fill: var(--app-card);
|
|
}
|
|
|
|
.minimap .sel {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
border: 2px solid var(--pick);
|
|
border-radius: var(--r-control);
|
|
background: color-mix(in srgb, var(--pick) 16%, transparent);
|
|
cursor: grab;
|
|
}
|
|
|
|
.minimap .sel .h {
|
|
position: absolute;
|
|
top: 12px;
|
|
bottom: 12px;
|
|
width: 6px;
|
|
border-radius: 3px;
|
|
background: var(--pick);
|
|
cursor: ew-resize;
|
|
}
|
|
|
|
.minimap .sel .h.l {
|
|
left: -4px;
|
|
}
|
|
|
|
.minimap .sel .h.r {
|
|
right: -4px;
|
|
}
|
|
|
|
.minimap .ticks {
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
top: 100%;
|
|
height: 18px;
|
|
}
|
|
|
|
.minimap .tick {
|
|
position: absolute;
|
|
top: 0;
|
|
min-width: 16px;
|
|
height: 18px;
|
|
padding: 7px 2px 0;
|
|
border: 0;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: var(--app-ink-faint);
|
|
font: inherit;
|
|
font-size: 11px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
/* 刻度线:每小时一根,标了钟点的更长 */
|
|
.minimap .tick::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 50%;
|
|
top: 0;
|
|
width: 1px;
|
|
height: 4px;
|
|
background: var(--app-ink-faint);
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.minimap .tick.minor::before {
|
|
height: 3px;
|
|
opacity: 0.35;
|
|
}
|
|
|
|
.minimap .tick:not(.minor)::before {
|
|
height: 6px;
|
|
}
|
|
|
|
.minimap .tick:hover:not(:disabled) {
|
|
background: var(--app-card-hover);
|
|
color: var(--app-ink);
|
|
}
|
|
|
|
.minimap .tick:disabled {
|
|
cursor: default;
|
|
}
|
|
|
|
.minimap .tick.date {
|
|
font-weight: 600;
|
|
color: var(--app-ink-muted);
|
|
}
|
|
|
|
.minimap .guide {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 1px;
|
|
background: var(--app-ink-muted);
|
|
opacity: 0.7;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.minimap .guide-label {
|
|
position: absolute;
|
|
top: 4px;
|
|
padding: 2px 6px;
|
|
border-radius: 6px;
|
|
background: var(--app-ink);
|
|
color: var(--app-card);
|
|
font-size: 11px;
|
|
white-space: nowrap;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.minimap .readout {
|
|
font-size: 12px;
|
|
color: var(--app-ink-muted);
|
|
}
|
|
|
|
.day-pick {
|
|
user-select: none;
|
|
}
|
|
|
|
.minimap .midnight {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 1px;
|
|
background: var(--app-ink-faint);
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
}
|
|
|
|
|
|
/* ── 线路详情的图表:按 UDP、TCP、评分分组,宽图占满一行 ── */
|
|
.chart-section {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.chart-section h2 {
|
|
margin: 8px 4px 0;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--app-ink-muted);
|
|
}
|
|
|
|
.chart-section .chart-card.wide {
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.minimap .loading-bar {
|
|
z-index: 2;
|
|
border-radius: var(--r-control) var(--r-control) 0 0;
|
|
}
|
|
|
|
/* 点下去会动的端点:它到目标位置之间染色(扩大 = 强调色,收缩 = 灰色),端点本身也变色 */
|
|
.minimap .sweep {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
pointer-events: none;
|
|
z-index: 1;
|
|
}
|
|
|
|
.minimap .sweep.grow {
|
|
background: color-mix(in srgb, var(--chart-2) 32%, transparent);
|
|
}
|
|
|
|
.minimap .sweep.cut {
|
|
background: color-mix(in srgb, var(--app-ink) 18%, transparent);
|
|
}
|
|
|
|
.minimap .sel .h {
|
|
transition: background-color 0.12s ease;
|
|
}
|
|
|
|
.minimap .sel .h.will.grow {
|
|
background: var(--chart-2);
|
|
}
|
|
|
|
.minimap .sel .h.will.cut {
|
|
background: var(--app-ink-muted);
|
|
}
|