UI: upload panel — POST /jobs with live status polling

Adds a "+ wgraj" control to the sidebar that uploads an ISO/ZIP/DLL to the
acquisition endpoint and tracks the job to completion, then refreshes the
version list so the new snapshot appears without a reload.

- index.html: upload form + #jobs panel in the sidebar
- app.js: submitUpload() (FormData → POST /jobs), pollJobs() (2.5s while any
  job is queued/started; finished → load(); failed → inline error)
- style.css: mini-btn / upload form / job rows + queued/started badges

Verified: node --check clean; uvicorn serves /ui assets 200 and GET /jobs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Patryk Gensch
2026-05-31 12:28:35 +02:00
parent f4aa7caaa9
commit 30b2b1011e
4 changed files with 133 additions and 2 deletions

View File

@@ -18,6 +18,35 @@ body { background: var(--bg); color: var(--fg); font: 13px/1.45 var(--mono); }
.panel-title { padding: 10px 14px; color: var(--dim); text-transform: uppercase; font-size: 11px;
letter-spacing: 1px; position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; justify-content: space-between; }
.mini-btn { background: #16202c; border: 1px solid var(--border); color: var(--accent);
border-radius: 5px; padding: 2px 8px; cursor: pointer; font-family: var(--mono); font-size: 11px;
letter-spacing: 0; text-transform: none; }
.mini-btn:hover { border-color: var(--accent); }
.upload { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px;
border-bottom: 1px solid var(--border); background: var(--panel2); }
.upload input[type=file] { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.upload input[type=file]::file-selector-button { background: #16202c; color: var(--fg);
border: 1px solid var(--border); border-radius: 5px; padding: 4px 8px; cursor: pointer;
font-family: var(--mono); margin-right: 8px; }
.upload .owner { width: auto; }
.upload .compare { margin-left: 0; }
.upload-msg { color: var(--dim); font-size: 11px; min-height: 14px; }
.upload-msg.err { color: var(--del); }
.jobs { padding: 6px 10px; }
.jobs:empty { padding: 0; }
.jobs-title { color: var(--dim); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; padding: 2px 2px 4px; }
.job { display: flex; align-items: center; gap: 6px; padding: 4px 6px; margin: 2px 0;
border: 1px solid var(--border); border-radius: 6px; background: var(--panel2); font-size: 11px; }
.job .jname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .jlink { color: var(--accent); cursor: pointer; }
.job .jlink:hover { text-decoration: underline; }
.job .jerr { color: var(--del); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.b-q { background: rgba(107,124,143,.18); color: var(--dim); }
.b-s { background: rgba(78,163,255,.16); color: var(--accent); }
.game { padding: 8px 10px 4px; }
.game-name { color: #eaf2fb; font-weight: 600; padding: 4px 4px; }
.snap { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 3px 0;