fix(ui): 表格行高统一 + 事件区块改为与表格同一套样式
1) 行高不一致(「狼的评论系统」明显矮一截) 实测在线行 58px / 离线行 43px。根因是可用率列的 90 格 mini 条: 它是 inline-flex,参与行内布局时基线把行盒抬高约 15px,于是「有可用率 数据的行」比不带条的行高出一截。 修复:单元格内容统一 vertical-align: middle + mini 条容器改 flex; 实测 6 行全部 43px。 2) 「最近事件」与表格样式不统一 去掉独立的时间线卡片风格,改为与监控表格同构的表格(相同容器圆角、 表头、行分隔、hover、状态底色);故障行淡红、证书行淡琥珀、恢复行不染。 刻意不共用 .monitor-table 类名 —— 共用时面板条目统计被多算 1~8 个 (测试当场抓到),改为独立 .events-table 并显式声明所需样式。 说明:内容长度相当时保证等高;名称/地址特别长时允许换行(上一版按用户 要求做的「完整显示」),此时行更高属于数据本身需要,不再用截断换整齐。 测试:verify-views 新增「内容等长时各行等高」「事件表与监控表同构」 「事件行复用状态底色」断言(并修正了断言脚本改错文件的问题 —— 名称来自 monitors.json 而非 status.json)。六套 171 项全通过。
This commit is contained in:
+46
-58
@@ -390,7 +390,12 @@ body[data-view="table"] .grid { display: block; }
|
||||
background: var(--bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.monitor-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; }
|
||||
.monitor-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; line-height: 1.4; }
|
||||
/* 所有行统一基线:可用率的 mini 条是 inline-flex,其基线会把行盒撑高十几像素,
|
||||
导致带条的行比不带的行高出一截(实测 58px vs 43px) */
|
||||
.monitor-table td > * { vertical-align: middle; }
|
||||
.u-mini { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
|
||||
.monitor-table tbody tr[data-status="pending"] { background: color-mix(in srgb, var(--pending) 6%, transparent); }
|
||||
.monitor-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.monitor-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
|
||||
.monitor-table tbody tr[data-status="down"] { background: color-mix(in srgb, var(--down) 6%, transparent); }
|
||||
@@ -432,7 +437,7 @@ tr[data-status="pending"] .t-state { color: var(--pending-text); }
|
||||
.t-hb svg { display: block; width: 100%; max-width: 150px; height: 24px; }
|
||||
.t-uptime { white-space: normal; }
|
||||
/* 可用率条随视口伸缩;极窄时只留百分比,避免挤压其他列 */
|
||||
.uptime-bar-mini { display: inline-flex; width: clamp(32px, 6vw, 84px); height: 8px; margin-right: 6px; vertical-align: middle; }
|
||||
.uptime-bar-mini { display: flex; flex: none; width: clamp(32px, 6vw, 84px); height: 8px; margin-right: 0; vertical-align: middle; }
|
||||
.t-pct { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
|
||||
@media (max-width: 640px) {
|
||||
.uptime-bar-mini { display: none; }
|
||||
@@ -459,69 +464,52 @@ tr[data-status="pending"] .t-state { color: var(--pending-text); }
|
||||
}
|
||||
.events-more:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
|
||||
|
||||
/* 左侧竖线 + 每行圆点,构成时间线;行本身仍是浅色卡片 */
|
||||
.events-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 2px 0 2px 16px;
|
||||
position: relative;
|
||||
}
|
||||
.events-list::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 8px;
|
||||
bottom: 8px;
|
||||
width: 1px;
|
||||
background: var(--border);
|
||||
}
|
||||
.ev {
|
||||
position: relative;
|
||||
display: grid;
|
||||
/* 名称列按内容自适应,详情列吃掉剩余宽度 —— 避免短名称后面拖出一大片空白 */
|
||||
grid-template-columns: 62px 46px auto minmax(0, 1fr);
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
border-radius: 9px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
/* 事件表:直接复用监控表格的外观(圆角、边框、行分隔、hover、状态底色),
|
||||
只额外定义列宽与类型徽标,保证两处视觉完全一致 */
|
||||
/* 事件表:显式声明与监控表格相同的观感(不共用 .monitor-table 类,
|
||||
避免被其他按类名统计/定位的逻辑误算),列宽与类型徽标单独定义 */
|
||||
.events-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
|
||||
.events-table th {
|
||||
padding: 10px 12px;
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
min-width: 0;
|
||||
font-weight: 600;
|
||||
color: var(--text-2);
|
||||
background: var(--bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
white-space: normal;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.ev + .ev { margin-top: 4px; }
|
||||
.ev::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: -14px;
|
||||
top: 50%;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin-top: -3.5px;
|
||||
border-radius: 50%;
|
||||
background: var(--text-2);
|
||||
box-shadow: 0 0 0 3px var(--bg);
|
||||
}
|
||||
.ev-down { border-left: 3px solid var(--down); }
|
||||
.ev-up { border-left: 3px solid var(--up); }
|
||||
.ev-tls { border-left: 3px solid var(--pending); }
|
||||
.ev-down::before { background: var(--down); }
|
||||
.ev-up::before { background: var(--up); }
|
||||
.ev-tls::before { background: var(--pending); }
|
||||
.events-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.4; overflow: hidden; }
|
||||
.events-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.events-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
|
||||
.events-table tbody tr[data-status="down"] { background: color-mix(in srgb, var(--down) 6%, transparent); }
|
||||
.events-table tbody tr[data-status="pending"] { background: color-mix(in srgb, var(--pending) 6%, transparent); }
|
||||
.events-wrap { margin-top: 0; }
|
||||
.events-table th:nth-child(1) { width: 11%; }
|
||||
.events-table th:nth-child(2) { width: 9%; }
|
||||
.events-table th:nth-child(3) { width: 26%; }
|
||||
.events-table th:nth-child(4) { width: 54%; }
|
||||
.ev-time { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
.ev-type { font-weight: 650; text-align: center; border-radius: 999px; padding: 2px 0; font-size: 11px; }
|
||||
.ev-down .ev-type { background: var(--down-bg); color: var(--down-text); }
|
||||
.ev-up .ev-type { background: var(--up-bg); color: var(--up-text); }
|
||||
.ev-tls .ev-type { background: var(--pending-bg); color: var(--pending-text); }
|
||||
.ev-badge {
|
||||
display: inline-block;
|
||||
padding: 1px 8px;
|
||||
border-radius: 999px;
|
||||
font-size: 11px;
|
||||
font-weight: 650;
|
||||
}
|
||||
tr[data-status="down"] .ev-badge { background: var(--down-bg); color: var(--down-text); }
|
||||
tr[data-status="up"] .ev-badge { background: var(--up-bg); color: var(--up-text); }
|
||||
tr[data-status="pending"] .ev-badge { background: var(--pending-bg); color: var(--pending-text); }
|
||||
.ev-maint { margin-left: 6px; border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 650; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
|
||||
.ev-name { font-weight: 600; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||
.ev-detail { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||
.events-empty { margin: 0; padding: 12px; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; }
|
||||
.ev-name { font-weight: 600; }
|
||||
.ev-detail { color: var(--text-2); }
|
||||
.events-empty { margin: 0; padding: 12px; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.ev { grid-template-columns: 56px 44px minmax(0, 1fr); gap: 8px; }
|
||||
.ev-detail { display: none; }
|
||||
.events { padding: 0 14px; }
|
||||
.events-table th:nth-child(4), .ev-detail { display: none; }
|
||||
}
|
||||
|
||||
/* ---------- 卡片:90 天日均延迟趋势 ---------- */
|
||||
|
||||
Reference in New Issue
Block a user