Split monolithic /session/start into two endpoints:
- POST /session/upload — phase 1: file acquisition only, returns JSON
- POST /session/analyze — phase 2: backend analysis, returns HTML
- GET /session/progress/{filename} — poll download progress
Uploads:
- Browser-native progress bar via XMLHttpRequest (real % + GiB)
Downloads:
- wget runs in background (Popen), frontend polls /session/progress
- HEAD request gets Content-Length before download starts
- Real-time speed (MB/s) and ETA displayed in the UI
- Smart timeout: after 30s, if ETA > 1 hour, kills download and
suggests manual download to laptop + File Upload instead
- Absolute safety net at 4 hours
UI: clear phase transitions — 'Downloading... 2.3 GiB (4.5 MB/s) ~12 min'
→ 'Step 2/2: Analysing source image...' → result
|
||
|---|---|---|
| .. | ||
| _analysis.html | ||
| base.html | ||
| index.html | ||
| polling.html | ||