feat(ui): GPU + Live Agents dashboard, dark theme

- drop quota / repos / headless-task panels; page is now GPU board +
  Live Agents (frontend only, headless task API still available)
- Live Agents: grouped by tmux session, launch form (engine/session/cwd/
  window name), open-terminal link per agent
- compact GPU board: multi-column host cards, fixed 4-per-row GPU thumbs
  with status glow, expanded host spans full row
- permanent dark theme tuned for a monitoring dashboard; terminal-styled
  session group headers; refresh now polls three light endpoints instead
  of the full dashboard aggregate

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 21:20:52 +08:00
parent cd1e9e09e7
commit e5d9799018
3 changed files with 334 additions and 523 deletions

View File

@@ -1,61 +1,33 @@
:root {
color-scheme: light dark;
--bg: #f4f6fb;
--bg-elev: #ffffff;
--panel: #ffffff;
--panel-soft: #f8fafc;
--ink: #0f172a;
--ink-soft: #334155;
--muted: #64748b;
--line: #e2e8f0;
--line-strong: #cbd5e1;
--accent: #6366f1;
--accent-strong: #4f46e5;
--accent-soft: #eef2ff;
--accent-ink: #3730a3;
--good: #059669;
--good-soft: #d1fae5;
--warn: #d97706;
--warn-soft: #fef3c7;
--bad: #dc2626;
--bad-soft: #fee2e2;
--chip: #f1f5f9;
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
--shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
--shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08), 0 16px 48px rgba(15, 23, 42, 0.06);
color-scheme: dark;
--bg: #0a0e1a;
--bg-elev: #111827;
--panel: #101626;
--panel-soft: #151d31;
--ink: #e5eaf3;
--ink-soft: #c3cbdc;
--muted: #8b96ad;
--line: #1f2940;
--line-strong: #2c3854;
--accent: #7c8cf8;
--accent-strong: #a0adfc;
--accent-soft: rgba(124, 140, 248, 0.13);
--accent-ink: #c7d2fe;
--good: #34d399;
--good-soft: rgba(52, 211, 153, 0.14);
--warn: #fbbf24;
--warn-soft: rgba(251, 191, 36, 0.14);
--bad: #f87171;
--bad-soft: rgba(248, 113, 113, 0.14);
--chip: #1c2540;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
--shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.45);
--radius: 14px;
--radius-sm: 10px;
--radius-pill: 999px;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #0b1020;
--bg-elev: #131a2e;
--panel: #161e36;
--panel-soft: #1b2342;
--ink: #e2e8f0;
--ink-soft: #cbd5e1;
--muted: #94a3b8;
--line: #232c4a;
--line-strong: #2d3760;
--accent: #818cf8;
--accent-strong: #a5b4fc;
--accent-soft: rgba(129, 140, 248, 0.12);
--accent-ink: #c7d2fe;
--good: #34d399;
--good-soft: rgba(52, 211, 153, 0.14);
--warn: #fbbf24;
--warn-soft: rgba(251, 191, 36, 0.14);
--bad: #f87171;
--bad-soft: rgba(248, 113, 113, 0.14);
--chip: #1e2742;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
--shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.45);
}
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
@@ -77,13 +49,13 @@ body {
.bg-glow {
position: fixed;
inset: -10% -10% auto -10%;
height: 60vh;
height: 70vh;
pointer-events: none;
background:
radial-gradient(40% 60% at 15% 20%, rgba(99, 102, 241, 0.18), transparent 70%),
radial-gradient(35% 50% at 85% 10%, rgba(16, 185, 129, 0.14), transparent 70%),
radial-gradient(50% 60% at 50% 0%, rgba(56, 189, 248, 0.10), transparent 70%);
filter: blur(8px);
radial-gradient(45% 65% at 12% 15%, rgba(99, 102, 241, 0.14), transparent 70%),
radial-gradient(38% 55% at 88% 8%, rgba(16, 185, 129, 0.10), transparent 70%),
radial-gradient(55% 65% at 50% 0%, rgba(56, 189, 248, 0.07), transparent 70%);
filter: blur(10px);
z-index: 0;
}
@@ -227,7 +199,7 @@ h3 {
/* Panels */
.panel {
background: var(--panel);
background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, #2a3554), var(--panel) 120px);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 18px 18px 20px;
@@ -235,6 +207,8 @@ h3 {
box-shadow: var(--shadow-md);
}
.panel + .panel { margin-top: 18px; }
.panel-heading {
display: flex;
align-items: center;
@@ -329,7 +303,7 @@ h3 {
.gpu-thumbs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
grid-template-columns: repeat(4, 1fr);
gap: 4px;
}
@@ -721,7 +695,7 @@ select {
-webkit-appearance: none;
-moz-appearance: none;
padding-right: 36px;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4.75l3 3 3-3'/></svg>");
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4.75l3 3 3-3'/></svg>");
background-repeat: no-repeat;
background-position: right 12px center;
background-size: 14px;
@@ -741,11 +715,6 @@ select option {
color: var(--ink);
}
@media (prefers-color-scheme: dark) {
select {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4.75l3 3 3-3'/></svg>");
}
}
.select-field { position: relative; }
@@ -1216,3 +1185,185 @@ details.task-card[open] > summary .task-summary-chevron {
.inline-form button { justify-self: stretch; }
.agent-context { flex-wrap: wrap; }
}
.live-agent-panel { margin-top: 18px; }
/* status-dot glow for GPU thumbs */
.gpu-thumb.idle { box-shadow: 0 0 6px color-mix(in srgb, var(--good) 30%, transparent); }
.gpu-thumb.busy { box-shadow: 0 0 6px color-mix(in srgb, var(--bad) 30%, transparent); }
.gpu-thumb.abnormal { box-shadow: 0 0 6px color-mix(in srgb, var(--warn) 30%, transparent); }
/* Compact GPU board: hosts flow into columns, expanded host spans the row */
.gpu-board {
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 8px;
}
.gpu-board .host-card { padding: 8px 12px; }
.gpu-board .host-card.expanded { grid-column: 1 / -1; }
.gpu-board .host-summary {
grid-template-columns: minmax(110px, auto) minmax(80px, 1fr) auto;
gap: 10px;
}
.gpu-board .host-summary > span:first-child {
display: flex;
align-items: baseline;
gap: 8px;
white-space: nowrap;
}
.gpu-board .gpu-thumb { height: 12px; border-radius: 4px; }
.gpu-board .gpu-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 8px;
margin-top: 10px;
}
.live-agent-form {
display: grid;
grid-template-columns: minmax(110px, 0.6fr) minmax(150px, 0.9fr) minmax(240px, 1.8fr) minmax(150px, 1fr) auto;
gap: 12px;
align-items: end;
margin-bottom: 18px;
padding-bottom: 18px;
border-bottom: 1px solid var(--line);
}
.live-agent-form label {
display: grid;
gap: 6px;
}
.live-agent-form .primary-button { white-space: nowrap; }
.live-agent-board {
display: flex;
flex-direction: column;
gap: 10px;
}
.agent-card {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 16px;
border: 1px solid var(--line);
border-radius: var(--radius-sm);
background: var(--panel-soft);
transition: border-color 120ms ease, box-shadow 120ms ease;
}
.agent-card:hover {
border-color: var(--line-strong);
box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
}
.agent-chip {
display: inline-flex;
align-items: center;
padding: 2px 10px;
height: 24px;
border-radius: var(--radius-pill);
background: var(--chip);
color: var(--ink-soft);
font-size: 12px;
font-weight: 600;
text-transform: capitalize;
flex-shrink: 0;
}
.agent-chip.claude { color: #fbbf24; background: color-mix(in srgb, #f59e0b 14%, var(--chip)); }
.agent-chip.codex { color: #93c5fd; background: color-mix(in srgb, #3b82f6 14%, var(--chip)); }
.agent-card-main {
display: flex;
align-items: baseline;
gap: 8px;
min-width: 0;
flex-shrink: 0;
}
.agent-card-cwd {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 12px;
}
.agent-card .secondary-button {
flex-shrink: 0;
border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
color: var(--accent-ink);
}
.agent-card .secondary-button:hover {
background: var(--accent-soft);
border-color: var(--accent);
color: var(--accent-strong);
}
.agent-group {
border: 1px solid var(--line);
border-radius: var(--radius-sm);
background: var(--panel);
overflow: hidden;
}
.agent-group-heading {
display: flex;
align-items: center;
gap: 8px;
padding: 9px 16px;
background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel-soft)), var(--panel-soft));
border-bottom: 1px solid var(--line);
}
.agent-group-heading::before {
content: '';
color: var(--accent);
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-weight: 700;
font-size: 12px;
}
.agent-group-heading strong {
font-weight: 650;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
letter-spacing: 0.01em;
}
.agent-group-heading .muted { font-size: 12px; }
.agent-group-list { display: flex; flex-direction: column; }
.agent-group-list .agent-card {
border: 0;
border-radius: 0;
background: transparent;
}
.agent-group-list .agent-card + .agent-card { border-top: 1px solid var(--line); }
.agent-group-list .agent-card:hover {
box-shadow: none;
background: var(--panel-soft);
}
@media (max-width: 1024px) {
.live-agent-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
.live-agent-form { grid-template-columns: 1fr; }
.agent-card { flex-wrap: wrap; }
.agent-card-cwd { flex-basis: 100%; }
}