feat: add delete button for recordings in web UI
Adds a DELETE /api/files/<name> endpoint that refuses to remove files currently being recorded (409). The UI shows a red '✕ Delete' button per row (disabled while REC), confirms before proceeding, and removes both the data row and the hidden player row from the DOM on success without a full page reload. README updated accordingly.
This commit is contained in:
@@ -157,6 +157,7 @@ Shows a table of all recordings sorted newest-first. Features:
|
||||
|
||||
- **Inline playback** — collapsible `▶ Play` button per row; audio loads lazily via a seekable `/stream/` endpoint with HTTP Range support.
|
||||
- **Waveform analysis** — on demand per file; computes RMS per 100 ms window and highlights loud sections. Supported for WAV and FLAC (FLAC requires `numpy` + `soundfile`). Pure-Python fallback for WAV when numpy is absent.
|
||||
- **Delete** — `✕ Delete` button per row with confirmation prompt; disabled for files currently being recorded; sends `DELETE /api/files/<name>` and removes the row without a full page reload.
|
||||
- **Live REC badge** — files currently being written by `isr.py` show an animated REC indicator, polled every 5 seconds via `/api/status`.
|
||||
- **WCAG-compliant** — skip link, `aria-expanded`/`aria-controls` on the player toggle, `aria-live` status, focus management, `role=img` on SVG waveforms.
|
||||
|
||||
@@ -203,7 +204,7 @@ docker compose down && docker compose up -d --build
|
||||
|
||||
**Log file in Docker:** The recorder always logs to stdout, so `docker compose logs -f` shows live output. To persist logs on the host, set `log_file = /app/recordings/recorder.log` in `config.ini` (the `recordings` directory is the bind mount).
|
||||
|
||||
**File retention:** ISR never deletes recordings. Add a cron job on the host if needed:
|
||||
**File retention:** Individual recordings can be deleted from the web UI. For bulk / automated cleanup, add a cron job on the host:
|
||||
```bash
|
||||
# Delete recordings older than 30 days
|
||||
find recordings/ -type f -mtime +30 -delete
|
||||
|
||||
Reference in New Issue
Block a user