add web UI: search, download queue with progress, cancel

- ui/index.html, ui/styles.css, ui/scripts.js — minimal two-tab UI
- Search tab: big search bar, results with size/votes, add-to-queue button
- Queue tab: progress bar, speed, downloaded/total, status badges, cancel
- Switches to queue tab on load if downloads are active
- Backend: GET /api/search, POST /api/queue/add, GET /api/queue, POST /api/queue/cancel
- Speed tracking in streamToFile, abort tracking for immediate cancel
- No rounded corners, dark theme
This commit is contained in:
2026-08-07 10:44:41 +02:00
parent a840fee91a
commit 7b739607ff
7 changed files with 595 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ Official Webshare HTTP API documentation: [https://webshare.cz/apidoc/](https://
| **Stream** | `GET /stream/:ident` | Fresh Webshare `file_link` + HTTP 302 to CDN |
| **Fake qBittorrent** | `/api/v2/*` | Download client API; streams the HTTPS file to disk |
| **Debug** | `GET /resolve/:ident` | JSON with the resolved CDN URL |
| **Web UI** | `GET /` | Two-tab UI: search files and add to queue; queue view with progress, speed, and cancel |
| **MCP server** | `POST /mcp` (Streamable HTTP) | Tools for AI agents: search, resolve links, login check |
Webshare download links expire after roughly ten minutes, so the torrent never embeds a CDN URL—only a path on this service that resolves a fresh link at fetch time.
@@ -28,6 +29,7 @@ src/
mcp-server.js # MCP tool registration (shared)
mcp-http.js # Streamable HTTP transport mount for Express
mcp.js # Optional MCP-only HTTP process
ui/ # Web UI: search & queue management
__tests__/
compose.yaml
Dockerfile