diff --git a/Dockerfile b/Dockerfile index 33a9dae..7fcc4de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -COPY isr.py web.py ./ +COPY isr.py web.py webui.html ./ RUN mkdir -p /recordings diff --git a/README.md b/README.md index 7c81123..0bb6ec4 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ format = wav # wav | flac | Value | Behaviour | |-------|-----------| | `default` | System default input | -| `monitor` | First loopback/monitor source (capture system audio) | | `` | Case-insensitive substring match against device name | | `hw:X,Y` | Exact ALSA hardware ID | +| `` | Any ALSA PCM defined in `asound.conf` (e.g. the `shared_mic` dsnoop device), even if it doesn't appear in `arecord -l` | Run `python isr.py --list-devices` (or `arecord -l`) to see available devices and their IDs. @@ -155,6 +155,8 @@ python web.py --min-gap 15 # grace period in seconds for merging python web.py --analyses-dir /path/to/dir # where to store analysis cache files (default: /analyses) ``` +The browser UI (HTML/CSS/JS) lives in `webui.html`, which `web.py` loads at startup — keep the two files together. + Shows recordings grouped by day with collapsible sections. Features: - **Day groups** — recordings are grouped under a collapsible day heading showing date, file count, total duration, and total size. The most recent day is expanded by default; older days start collapsed. Expanded state is preserved across filter changes. diff --git a/web.py b/web.py index 20f7a33..fad7e06 100644 --- a/web.py +++ b/web.py @@ -627,973 +627,10 @@ class _Handler(BaseHTTPRequestHandler): # --------------------------------------------------------------------------- -# Embedded HTML / CSS / JS +# UI page — single-page HTML/CSS/JS, loaded once at startup # --------------------------------------------------------------------------- -_HTML = r""" - - - - -ISR Archive - - - -
- -
-

ISR Archive

- Loading… - - -
-
- - - RMS amplitude 0–1 (linear; 0.05 ≈ −26 dBFS) · sections above this are marked loud - - - seconds to rewind before section start - - - seconds — merge loud sections closer than this -
- -
-
- -
- - -""" +_HTML = (Path(__file__).resolve().parent / 'webui.html').read_text(encoding='utf-8') # --------------------------------------------------------------------------- @@ -1633,10 +670,10 @@ def main(): server = ThreadingHTTPServer((args.host, args.port), Handler) - print(f"ISR Web running → http://{args.host}:{args.port}/") - print(f"Recordings dir → {rec_dir}") - print(f"Analyses dir → {analyses_dir}") - print(f"Loud threshold → {args.threshold}") + print(f"ISR Web running on http://{args.host}:{args.port}/") + print(f"Recordings dir: {rec_dir}") + print(f"Analyses dir: {analyses_dir}") + print(f"Loud threshold: {args.threshold}") if not NUMPY_AVAILABLE: print("Note: numpy not installed — WAV RMS uses pure Python (slower); FLAC analysis unavailable") elif not SOUNDFILE_AVAILABLE: diff --git a/webui.html b/webui.html new file mode 100644 index 0000000..266bbbf --- /dev/null +++ b/webui.html @@ -0,0 +1,964 @@ + + + + + +ISR Archive + + + +
+ +
+

ISR Archive

+ Loading… + + +
+
+ + + RMS amplitude 0–1 (linear; 0.05 ≈ −26 dBFS) · sections above this are marked loud + + + seconds to rewind before section start + + + seconds — merge loud sections closer than this +
+ +
+
+ +
+ + + \ No newline at end of file