精修 WebUI 第二轮:数据表/表格/图表/预约卡

- workspaceHeader 加左侧 2px primary accent + uppercase eyebrow
- stats 卡片:tabular-nums + uppercase 标签 + 字号统一 text-xl
- table:sticky 表头 uppercase + zebra 奇偶行 + hover 高亮 + mono 列灰度
- timeline 图:4 等分水平网格虚线 + Y 轴 0/mid/max 三档 mono 标签
- 空状态:.hint 单独使用时升级为虚线圆框居中占位 + 圆形 dot
- 预约卡片:reservationIndex 加圆点 + reservationValue 改 uppercase pill;hover 去 transform,纯 box-shadow 反馈
- cache-bust v4 → v5
This commit is contained in:
Codex committed 2026-05-21 09:29:38 +08:00
1 parent b7d7f61a27
commit 299ced21c8
3 files changed
+170 -65

No files matched your search

+22 -3
View File
@@ -654,12 +654,26 @@ function renderTimeline(containerId, timeline) {
axis.setAttribute("fill", "none");
svg.appendChild(axis);
// 水平网格线(4 等分),淡色 dashed
const gridSteps = 4;
for (let i = 1; i <= gridSteps; i++) {
const gy = padT + ((H - padT - padB) * i / gridSteps);
const gline = document.createElementNS("http://www.w3.org/2000/svg", "path");
gline.setAttribute("d", `M ${padL} ${gy.toFixed(2)} L ${W - padR} ${gy.toFixed(2)}`);
gline.setAttribute("stroke", "var(--border)");
gline.setAttribute("stroke-opacity", "0.5");
gline.setAttribute("stroke-dasharray", "2 4");
gline.setAttribute("fill", "none");
svg.appendChild(gline);
}
const mkText = (x, y, txt, anchor = "start") => {
const el = document.createElementNS("http://www.w3.org/2000/svg", "text");
el.setAttribute("x", String(x));
el.setAttribute("y", String(y));
el.setAttribute("fill", "var(--muted)");
el.setAttribute("font-size", "11");
el.setAttribute("font-size", "10");
el.setAttribute("font-family", "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace");
el.setAttribute("text-anchor", anchor);
el.textContent = txt;
return el;
@@ -677,8 +691,13 @@ function renderTimeline(containerId, timeline) {
return (H - padB) - (vv / maxY) * h;
};
// y 轴 max 标记
svg.appendChild(mkText(padL, padT + 10, String(maxY), "start"));
// y 轴刻度(0 / mid / max)
const yMid = Math.round(maxY / 2);
svg.appendChild(mkText(padL - 6, padT + 4, String(maxY), "end"));
if (yMid > 0 && yMid < maxY) {
svg.appendChild(mkText(padL - 6, padT + (H - padT - padB) / 2 + 4, String(yMid), "end"));
}
svg.appendChild(mkText(padL - 6, H - padB + 4, "0", "end"));
// x 轴 3 个时间刻度
const fmtShort = (ts) => {
+2 -2
View File
@@ -15,7 +15,7 @@
} catch (e) {}
})();
</script>
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v4" />
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v5" />
</head>
<body>
<div class="app">
@@ -1222,6 +1222,6 @@
</main>
</div>
<script src="app.js?v=console-20260520-theme-v4"></script>
<script src="app.js?v=console-20260520-theme-v5"></script>
</body>
</html>
+146 -60
View File
@@ -746,38 +746,52 @@ svg {
}
.workspaceHeader {
position: relative;
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 16px;
gap: var(--space-4);
min-width: 0;
margin-bottom: 12px;
padding: 14px 16px;
margin-bottom: var(--space-3);
padding: var(--space-4) var(--space-5);
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface);
}
.workspaceHeader::before {
position: absolute;
left: 0;
top: var(--space-4);
bottom: var(--space-4);
width: 2px;
content: "";
border-radius: 0 2px 2px 0;
background: var(--primary);
}
.workspaceEyebrow {
color: var(--muted);
font-size: 11px;
font-weight: 500;
letter-spacing: 0.06em;
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.workspaceTitle {
margin: 4px 0 0;
color: var(--text-strong);
font-size: 20px;
line-height: 1.2;
font-size: var(--text-xl);
font-weight: 600;
line-height: var(--leading-tight);
letter-spacing: var(--tracking-tight);
}
.workspaceHint {
max-width: 360px;
color: var(--muted);
font-size: 12px;
line-height: 1.45;
font-size: var(--text-sm);
line-height: var(--leading-snug);
text-align: right;
}
@@ -1064,11 +1078,41 @@ select.input {
.hint {
min-width: 0;
color: var(--muted);
font-size: 12px;
line-height: 1.45;
font-size: var(--text-sm);
line-height: var(--leading-snug);
overflow-wrap: anywhere;
}
/* Empty-state hint inside table / chart / reservations: dashed framed placeholder */
.table > .hint:only-child,
.chart > .hint:only-child,
.reservationsContent > .hint:only-child {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 60px;
padding: 16px;
border: 1px dashed var(--border);
border-radius: var(--radius-md);
background: color-mix(in oklab, var(--surface-soft) 60%, transparent);
color: var(--muted-soft);
font-size: var(--text-sm);
text-align: center;
}
.table > .hint:only-child::before,
.chart > .hint:only-child::before,
.reservationsContent > .hint:only-child::before {
content: "";
width: 14px;
height: 14px;
border: 1.5px dashed currentColor;
border-radius: 50%;
opacity: 0.6;
flex: 0 0 14px;
}
.divider {
height: 1px;
margin: 16px 0;
@@ -1077,54 +1121,57 @@ select.input {
.statsGrid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 10px;
margin-top: 10px;
margin-top: 12px;
}
.stat {
min-width: 0;
padding: 12px;
padding: 14px;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface-soft);
box-shadow: 0 1px 0 var(--hairline) inset;
transition: border-color var(--motion-fast), transform var(--motion-fast), background var(--motion-fast);
border-radius: var(--radius-md);
background: var(--surface);
transition: border-color var(--motion-fast), background var(--motion-fast);
}
.stat:hover {
border-color: var(--hover-border);
background: var(--surface-elevated);
transform: translateY(-1px);
background: var(--surface-soft);
}
.statLabel {
color: var(--muted);
font-size: 12px;
font-weight: 500;
line-height: 1.35;
font-size: var(--text-xs);
font-weight: 600;
line-height: 1.3;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.statValue {
min-width: 0;
margin-top: 6px;
margin-top: 8px;
color: var(--text-strong);
font-size: 19px;
font-size: var(--text-xl);
font-weight: 600;
line-height: 1.25;
line-height: var(--leading-tight);
letter-spacing: var(--tracking-tight);
font-variant-numeric: tabular-nums;
overflow-wrap: anywhere;
}
.statTrace {
font-size: 14px;
font-size: var(--text-md);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.statHint {
min-width: 0;
margin-top: 5px;
margin-top: 6px;
color: var(--muted);
font-size: 12px;
line-height: 1.35;
font-size: var(--text-sm);
line-height: var(--leading-snug);
overflow-wrap: anywhere;
}
@@ -1227,22 +1274,35 @@ select.input {
.table {
min-width: 0;
overflow: hidden;
margin-top: 10px;
margin-top: 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface);
}
.tableRow {
display: grid;
grid-template-columns: minmax(92px, 0.65fr) minmax(0, 1.7fr) minmax(54px, 0.45fr);
gap: 10px;
gap: 12px;
min-width: 0;
padding: 9px 11px;
padding: 10px 14px;
border-top: 1px solid var(--border);
color: var(--text);
font-size: 12px;
line-height: 1.45;
font-size: var(--text-sm);
line-height: var(--leading-snug);
transition: background var(--motion-fast);
}
.tableRow:not(.tableHead):hover {
background: var(--surface-soft);
}
.tableRow:nth-child(odd):not(.tableHead) {
background: color-mix(in oklab, var(--surface-soft) 50%, transparent);
}
.tableRow:nth-child(odd):not(.tableHead):hover {
background: var(--surface-soft);
}
.tableRow:first-child {
@@ -1254,10 +1314,21 @@ select.input {
overflow-wrap: anywhere;
}
.tableHead {
.tableRow .mono {
font-variant-numeric: tabular-nums;
color: var(--muted);
background: var(--surface-soft);
font-weight: 550;
}
.tableHead {
position: sticky;
top: 0;
z-index: 1;
color: var(--muted);
background: var(--surface-muted);
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.mono {
@@ -1362,15 +1433,16 @@ select.input {
.reservationsInfo {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 6px 10px;
gap: 6px 14px;
min-width: 0;
padding: 9px;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface-soft);
color: var(--text);
font-size: 12px;
line-height: 1.45;
font-size: var(--text-sm);
line-height: var(--leading-snug);
font-variant-numeric: tabular-nums;
}
.reservationsInfo > div {
@@ -1381,7 +1453,7 @@ select.input {
.reservationsList {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 8px;
gap: 10px;
min-width: 0;
max-height: var(--queue-height-desktop);
overflow: auto;
@@ -1392,15 +1464,14 @@ select.input {
min-width: 0;
overflow: hidden;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface);
transition: border-color var(--motion-fast), box-shadow var(--motion), transform var(--motion);
transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.reservationItem:hover {
border-color: var(--hover-border);
box-shadow: var(--shadow-soft);
transform: translateY(-1px);
}
.reservationHeader {
@@ -1409,7 +1480,7 @@ select.input {
justify-content: space-between;
gap: 10px;
min-width: 0;
padding: 9px 10px;
padding: 10px 12px;
border-bottom: 1px solid var(--border);
background: var(--surface-soft);
}
@@ -1419,34 +1490,49 @@ select.input {
}
.reservationIndex {
color: var(--primary);
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--text);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
font-size: 12px;
font-size: var(--text-sm);
font-weight: 600;
}
.reservationIndex::before {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--primary);
content: "";
}
.reservationValue {
max-width: 68%;
padding: 3px 8px;
padding: 3px 9px;
overflow: hidden;
border: 1px solid var(--warning-border);
border-radius: 99px;
color: var(--warning);
background: var(--warning-soft);
font-size: 12px;
font-weight: 550;
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
text-overflow: ellipsis;
white-space: nowrap;
}
.reservationBody {
display: grid;
gap: 5px;
gap: 6px;
min-width: 0;
padding: 9px 10px;
padding: 10px 12px;
color: var(--text);
font-size: 12px;
line-height: 1.45;
font-size: var(--text-sm);
line-height: var(--leading-snug);
font-variant-numeric: tabular-nums;
}
.reservationBody > div {