feat(cloud-console): task listing, attempt history, CORS, and console SPA

Implements the cloud-console OpenSpec change: adds GET /v1/tasks (filterable,
bounded pagination, tasks:read) and GET /v1/tasks/{id}/attempts (404 on unknown
task) to the platform SDK, with matching CloudClient methods and a closed-by-
default CLOUD_CONSOLE_CORS_ORIGINS allow-list wired through CloudControlConfig.
Ships an independent Vue 3 + Vite SPA at cloud-console/ that authenticates with
an operator-supplied bearer token held in sessionStorage, renders tasks with
attempt history, device pool, host registry, and the plugin registry with a
registration form.

Backend test suite: 438 passed (-m "not integration"); cloud-console typecheck
and production build both succeed. PostgreSQL-backed repository tests and
manual end-to-end verification remain pending external infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 14:00:23 +08:00
co-authored by Claude Opus 4.6
parent 62923b9285
commit 2169bb03d9
32 changed files with 3415 additions and 24 deletions
+350
View File
@@ -0,0 +1,350 @@
:root {
--bg: #0f172a;
--bg-elev: #1e293b;
--bg-elev-2: #273449;
--border: #334155;
--text: #e2e8f0;
--text-muted: #94a3b8;
--text-dim: #64748b;
--accent: #38bdf8;
--accent-hover: #7dd3fc;
--danger: #f87171;
--danger-bg: #7f1d1d;
--success: #4ade80;
--warning: #fbbf24;
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
color-scheme: dark;
}
* {
box-sizing: border-box;
}
html,
body,
#app {
height: 100%;
margin: 0;
}
body {
background: var(--bg);
color: var(--text);
font-size: 14px;
line-height: 1.5;
}
button {
font: inherit;
cursor: pointer;
background: var(--bg-elev-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 6px;
padding: 6px 12px;
transition: background 0.15s ease;
}
button:hover:not(:disabled) {
background: var(--border);
}
button:disabled {
opacity: 0.55;
cursor: not-allowed;
}
button.primary {
background: var(--accent);
color: #0b1220;
border-color: var(--accent);
}
button.primary:hover:not(:disabled) {
background: var(--accent-hover);
}
input,
select,
textarea {
font: inherit;
background: var(--bg);
color: var(--text);
border: 1px solid var(--border);
border-radius: 6px;
padding: 6px 10px;
}
input:focus,
select:focus,
textarea:focus {
outline: none;
border-color: var(--accent);
}
label {
color: var(--text-muted);
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.04em;
}
a {
color: var(--accent);
}
.app-shell {
display: flex;
height: 100%;
}
.app-nav {
width: 220px;
background: var(--bg-elev);
border-right: 1px solid var(--border);
padding: 16px 12px;
display: flex;
flex-direction: column;
gap: 4px;
}
.app-nav h1 {
font-size: 14px;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--text-muted);
margin: 0 0 12px;
}
.app-nav button {
text-align: left;
background: transparent;
border-color: transparent;
display: flex;
align-items: center;
gap: 8px;
}
.app-nav button:hover:not(:disabled) {
background: var(--bg-elev-2);
}
.app-nav button.active {
background: var(--bg-elev-2);
color: var(--accent);
border-color: var(--border);
}
.app-nav .spacer {
flex: 1;
}
.app-main {
flex: 1;
overflow: auto;
padding: 24px 32px;
}
.toolbar {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 16px;
flex-wrap: wrap;
}
.toolbar h2 {
margin: 0;
font-size: 20px;
}
.panel {
background: var(--bg-elev);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
}
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
padding: 8px 10px;
text-align: left;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
th {
color: var(--text-muted);
font-weight: 500;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.04em;
}
tr.row-selectable {
cursor: pointer;
}
tr.row-selectable:hover {
background: var(--bg-elev-2);
}
tr.row-selected {
background: var(--bg-elev-2);
}
.status-badge {
display: inline-block;
padding: 2px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
text-transform: lowercase;
}
.status-badge.queued,
.status-badge.assigned,
.status-badge.dispatched {
background: rgba(56, 189, 248, 0.18);
color: var(--accent);
}
.status-badge.done {
background: rgba(74, 222, 128, 0.18);
color: var(--success);
}
.status-badge.failed {
background: rgba(248, 113, 113, 0.18);
color: var(--danger);
}
.status-badge.unreachable {
background: rgba(248, 113, 113, 0.18);
color: var(--danger);
}
.status-badge.idle,
.status-badge.wired {
background: rgba(74, 222, 128, 0.18);
color: var(--success);
}
.status-badge.busy {
background: rgba(251, 191, 36, 0.18);
color: var(--warning);
}
.notice {
padding: 10px 12px;
border-radius: 6px;
background: var(--bg-elev-2);
border: 1px solid var(--border);
color: var(--text-muted);
}
.notice.error {
background: rgba(127, 29, 29, 0.4);
border-color: var(--danger);
color: var(--text);
}
.notice.success {
background: rgba(34, 197, 94, 0.18);
border-color: var(--success);
color: var(--text);
}
.token-screen {
max-width: 480px;
margin: 80px auto;
padding: 32px;
background: var(--bg-elev);
border: 1px solid var(--border);
border-radius: 12px;
}
.token-screen h1 {
margin: 0 0 8px;
font-size: 24px;
}
.token-screen p {
color: var(--text-muted);
margin: 0 0 24px;
}
.token-screen label {
display: block;
margin-bottom: 6px;
}
.token-screen textarea {
width: 100%;
min-height: 88px;
resize: vertical;
font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}
.token-screen .actions {
display: flex;
justify-content: flex-end;
margin-top: 16px;
}
.form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.form-grid label {
display: block;
margin-bottom: 4px;
}
.form-grid .field-full {
grid-column: 1 / -1;
}
.muted {
color: var(--text-muted);
}
.dim {
color: var(--text-dim);
font-size: 12px;
}
.attempt-result {
font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
font-size: 12px;
white-space: pre-wrap;
word-break: break-all;
}
.pagination {
display: flex;
align-items: center;
gap: 12px;
margin-top: 12px;
color: var(--text-muted);
}
.loader {
display: inline-block;
animation: spin 1.2s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}