Phase 1 — multi-user auth: - server/auth.py: bcrypt passwords, itsdangerous signed-cookie sessions, sha256 bearer tokens, FastAPI current_user/require_owner deps, login rate limit - users + api_tokens tables + jobs/assets.user_id (additive migrations) - HARD RULE enforced server-side: guests are local-only — /api/operators filters out requires_env operators, POST /api/jobs 403s cloud ops for non-owners (proven via direct POST in smoke.sh, not just UI). Settings owner-only. auth_secret hidden from the settings API. Per-user active-job cap (owner exempt). Own-asset/ own-job checks. WS auth via cookie or ?token=. Owner bootstrap prints pw once. - mb-ready: bearer MB_TOKEN; scripts/users.py for out-of-band management - Frontend: Login gate, header user chip + logout, guest note, username on jobs, Users panel in Settings (owner) Phase 2 — dashboard: - server/sysinfo.py: psutil CPU/RAM/disk + macmon Apple GPU (util/power/temp, no sudo), computed lane occupancy, 24h job summary, recent jobs w/ output thumbs; all cached (5s stats, 5min du). /api/system + /api/jobs/recent. - Dashboard.jsx: snapshot-on-refresh (no polling) — stat cards, per-core strip, lane strip, running/queued, recent grid. tests/smoke.sh rewritten for auth: 28 checks passing incl. all guest-security rules. Browser-verified owner + guest + dashboard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
172 lines
9.8 KiB
CSS
172 lines
9.8 KiB
CSS
* { box-sizing: border-box; margin: 0; }
|
|
:root {
|
|
--bg: #0b0b0f; --panel: #14141b; --panel2: #1b1b25; --edge: #26263a;
|
|
--text: #e6e6f0; --dim: #8a8aa0; --accent: #7c5cff; --good: #3ddc84; --bad: #ff5c7a;
|
|
}
|
|
html, body, #root { height: 100%; }
|
|
body {
|
|
background: var(--bg); color: var(--text);
|
|
font: 14px/1.45 -apple-system, "SF Pro Text", Helvetica, sans-serif;
|
|
}
|
|
.layout {
|
|
display: grid; height: 100vh;
|
|
grid-template: "header header header" 52px "assets main workbench" 1fr / 280px 1fr 340px;
|
|
}
|
|
header {
|
|
grid-area: header; display: flex; align-items: center; gap: 14px;
|
|
padding: 0 16px; border-bottom: 1px solid var(--edge); background: var(--panel);
|
|
}
|
|
h1 { font-size: 18px; letter-spacing: 2px; }
|
|
h1 span { color: var(--accent); }
|
|
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--dim); margin: 14px 0 8px; }
|
|
header button { margin-left: auto; }
|
|
button {
|
|
background: var(--panel2); color: var(--text); border: 1px solid var(--edge);
|
|
border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px;
|
|
}
|
|
button:hover { border-color: var(--accent); }
|
|
button.go {
|
|
width: 100%; background: var(--accent); border: none; font-weight: 600;
|
|
padding: 10px; margin-top: 12px;
|
|
}
|
|
button.go:disabled { opacity: 0.35; cursor: default; }
|
|
.assets { grid-area: assets; overflow-y: auto; padding: 4px 12px; border-right: 1px solid var(--edge); }
|
|
.workbench { grid-area: workbench; overflow-y: auto; padding: 4px 14px; border-left: 1px solid var(--edge); }
|
|
main { grid-area: main; display: flex; min-width: 0; min-height: 0; }
|
|
.dim { color: var(--dim); font-size: 12px; }
|
|
.asset {
|
|
display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px;
|
|
cursor: pointer; border: 1px solid transparent;
|
|
}
|
|
.asset:hover { background: var(--panel); }
|
|
.asset.sel { background: var(--panel2); border-color: var(--accent); }
|
|
.asset .icon { font-size: 20px; }
|
|
.asset .meta { min-width: 0; flex: 1; }
|
|
.asset .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
|
|
.asset .x { padding: 2px 8px; border: none; background: none; color: var(--dim); }
|
|
.asset .x:hover { color: var(--bad); }
|
|
.viewer, .preview { flex: 1; min-width: 0; }
|
|
.preview { display: flex; align-items: center; justify-content: center; overflow: auto; padding: 16px; }
|
|
.preview.empty { color: var(--dim); }
|
|
.preview img, .preview video { max-width: 100%; max-height: 100%; border-radius: 8px; }
|
|
.preview.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; align-content: start; }
|
|
.preview.grid img { width: 100%; border-radius: 4px; }
|
|
.preview.json { font: 12px/1.5 "SF Mono", Menlo, monospace; color: #b8ffcf; align-self: stretch; text-align: left; white-space: pre-wrap; }
|
|
.params label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 7px 0; }
|
|
.params span { font-size: 12.5px; color: var(--dim); }
|
|
.params input[type="text"], .params input[type="number"], .params select, .workbench > select {
|
|
background: var(--panel2); border: 1px solid var(--edge); color: var(--text);
|
|
border-radius: 6px; padding: 6px 8px; width: 150px;
|
|
}
|
|
.workbench > select { width: 100%; }
|
|
.jobs .job {
|
|
border-radius: 8px; margin-bottom: 6px; background: var(--panel);
|
|
border-left: 3px solid var(--edge); font-size: 13px; overflow: hidden;
|
|
}
|
|
.job-row { display: flex; gap: 8px; align-items: center; padding: 8px; cursor: pointer; }
|
|
.job.running { border-left-color: var(--accent); }
|
|
.job.done { border-left-color: var(--good); }
|
|
.job.error { border-left-color: var(--bad); }
|
|
.job.cancelled { border-left-color: var(--dim); }
|
|
.job .jop { font-weight: 500; }
|
|
.job .jid { flex: 1; overflow: hidden; text-overflow: ellipsis; }
|
|
.job-actions { display: flex; gap: 4px; }
|
|
.job-actions button { padding: 2px 8px; font-size: 11px; border-radius: 6px; }
|
|
.job .log {
|
|
font: 11px/1.5 "SF Mono", Menlo, monospace; color: var(--dim);
|
|
max-height: 300px; overflow: auto; white-space: pre-wrap; background: var(--bg);
|
|
padding: 8px; margin: 0 8px 8px;
|
|
}
|
|
|
|
/* header */
|
|
.spacer { flex: 1; }
|
|
header button.active { border-color: var(--accent); color: var(--accent); }
|
|
|
|
/* asset extras */
|
|
.asset input[type="checkbox"] { margin: 0; }
|
|
.asset.checked { background: var(--panel2); border-color: var(--good); }
|
|
.asset .dl { color: var(--dim); text-decoration: none; padding: 2px 6px; font-size: 15px; }
|
|
.asset .dl:hover { color: var(--accent); }
|
|
|
|
/* run panel */
|
|
.warn { color: #ffcf6b; font-size: 12.5px; background: rgba(255,207,107,0.08);
|
|
padding: 7px 9px; border-radius: 8px; border: 1px solid rgba(255,207,107,0.25); }
|
|
|
|
/* compare grid */
|
|
.compare-grid { flex: 1; display: grid; gap: 6px; padding: 6px; min-width: 0;
|
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-content: stretch; }
|
|
.compare-cell { position: relative; background: #101014; border-radius: 8px; overflow: hidden;
|
|
display: flex; min-height: 300px; }
|
|
.compare-cap { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: 6px 10px;
|
|
font-size: 11.5px; color: var(--text); background: linear-gradient(#000a, #0000);
|
|
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
|
|
/* settings modal */
|
|
.modal-backdrop { position: fixed; inset: 0; background: #000a; display: flex;
|
|
align-items: center; justify-content: center; z-index: 100; }
|
|
.modal { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px;
|
|
padding: 22px 24px; width: 520px; max-width: 92vw; max-height: 86vh; overflow-y: auto; }
|
|
.modal h2 { margin-top: 0; }
|
|
.setting { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 10px 0; }
|
|
.setting span { font-size: 13px; color: var(--dim); flex: 1; }
|
|
.setting input { background: var(--panel2); border: 1px solid var(--edge); color: var(--text);
|
|
border-radius: 6px; padding: 7px 9px; width: 240px; }
|
|
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
|
|
.modal-actions .go { width: auto; padding: 8px 18px; margin: 0; }
|
|
|
|
/* ---- auth / login ---- */
|
|
.login-screen { position: fixed; inset: 0; display: flex; align-items: center;
|
|
justify-content: center; background: var(--bg); }
|
|
.login-card { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px;
|
|
padding: 34px 36px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
|
|
.login-card h1 { font-size: 24px; letter-spacing: 2px; text-align: center; }
|
|
.login-card h1 span { color: var(--accent); }
|
|
.login-card p { text-align: center; margin-top: -6px; }
|
|
.login-card input { background: var(--panel2); border: 1px solid var(--edge); color: var(--text);
|
|
border-radius: 8px; padding: 11px 12px; font-size: 14px; }
|
|
.login-card .go { width: 100%; margin-top: 6px; }
|
|
.login-err { color: var(--bad); font-size: 13px; text-align: center; }
|
|
|
|
.user-chip { font-size: 12.5px; color: var(--text); background: var(--panel2);
|
|
border: 1px solid var(--edge); border-radius: 20px; padding: 4px 12px; }
|
|
.guest-note { margin-top: 8px; font-style: italic; opacity: 0.8; }
|
|
|
|
/* ---- dashboard ---- */
|
|
.dash { flex: 1; overflow-y: auto; padding: 16px 20px; min-width: 0; }
|
|
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
|
|
.dash h2 { margin: 18px 0 8px; }
|
|
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
|
|
.stat { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 14px; }
|
|
.stat-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
|
|
.stat-top span { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
|
|
.stat-top b { font-size: 18px; }
|
|
.bar { height: 8px; background: var(--panel2); border-radius: 6px; overflow: hidden; margin: 6px 0; }
|
|
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }
|
|
.core-strip { display: flex; align-items: flex-end; gap: 2px; height: 40px; margin: 6px 0; }
|
|
.core { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 3px; align-self: flex-end; opacity: 0.85; }
|
|
.lane-strip { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
|
|
.lane-card { background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--edge);
|
|
border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
|
|
.lane-card.busy { border-left-color: var(--accent); }
|
|
.lane-card b { font-size: 12px; letter-spacing: 1px; }
|
|
.lane-card span { font-size: 13px; color: var(--dim); }
|
|
.dash-table { width: 100%; border-collapse: collapse; }
|
|
.dash-table td { padding: 6px 10px 6px 0; font-size: 13px; border-bottom: 1px solid var(--edge); }
|
|
.dash-table button { padding: 2px 10px; font-size: 11px; }
|
|
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
|
|
.recent-cell { background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; }
|
|
.recent-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
|
|
.recent-icon { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--panel2); }
|
|
.recent-cap { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
|
|
/* ---- users panel in settings ---- */
|
|
.users { margin-top: 22px; border-top: 1px solid var(--edge); padding-top: 14px; }
|
|
.users-table { width: 100%; border-collapse: collapse; }
|
|
.users-table td { padding: 5px 8px 5px 0; font-size: 13px; }
|
|
.users-table button { padding: 2px 9px; font-size: 11px; margin-left: 4px; }
|
|
.user-add { display: flex; gap: 8px; margin-top: 10px; }
|
|
.user-add input { flex: 1; background: var(--panel2); border: 1px solid var(--edge); color: var(--text);
|
|
border-radius: 6px; padding: 7px 9px; }
|
|
.user-msg { word-break: break-all; margin-top: 8px; background: var(--panel2); padding: 8px; border-radius: 6px;
|
|
font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; }
|