feat(web): 线路详情页的时间轴、EWMA 平滑和加载进度
- 先选日期,再在连续 48 小时(或 24 小时)的丢包缩略图上拖选区;选区可以跨零点, 点轴或刻度时离得近的端点贴过去,悬停预览会动的端点;没有数据的时段画成斜纹 - 刻度下方的时长快捷档:30 分钟、1 小时、3 小时、6 小时、12 小时、整天 - 指标卡片平铺,丢包等标明 UDP/TCP;图表按 UDP、TCP、评分分组 - 图表数据刷新时原地更新(不再整张重建),毫秒到 1 秒以上显示成秒 - EWMA 平滑开关(关/轻/中/重),原始数据以淡线垫底 - 数据加载时卡片上显示进度条和占位;useQuery 区分定时刷新和用户触发的加载 - 前端可以在页面里指定后端地址和令牌(配合后端 Monitor__CorsOrigins)
This commit is contained in:
1 parent
5cb64d2436
commit
d1be70cda2
11 files changed
+1275
-294
No files matched your search
+298
-1
@@ -276,14 +276,28 @@
|
||||
|
||||
.line-link {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
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);
|
||||
@@ -407,6 +421,37 @@
|
||||
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;
|
||||
@@ -460,3 +505,255 @@
|
||||
.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);
|
||||
}
|
||||
Reference in new issue
Block a user