fbf8681df0
Introduces a new web interface to list cases and play back audio recordings. This includes: - A new `web` module in `routes` to handle web requests. - `handle_case_list` to scan and display available cases and their recordings. - `handle_audio` to serve audio files, with validation to prevent path traversal and ensure correct file types. - `AppError::NotFound` variant to handle missing resources gracefully. - Updates to `projektplan.md` to document the change in STT container and m4a preprocessing. - New tests in `server/tests/web_test.rs` to ensure the web interface functions correctly.
39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Doctate — Cases</title>
|
|
<style>
|
|
body { font-family: sans-serif; max-width: 900px; margin: 2em auto; padding: 0 1em; }
|
|
.case { border: 1px solid #ccc; margin: 1em 0; padding: 1em; border-radius: 4px; }
|
|
.case h2 { margin: 0 0 0.3em 0; font-size: 1.1em; }
|
|
.case small { color: #666; font-family: monospace; }
|
|
.status-open { border-left: 4px solid #4a90e2; }
|
|
.status-done { border-left: 4px solid #7ed321; }
|
|
.recording { margin: 0.5em 0; display: flex; align-items: center; gap: 1em; }
|
|
.recording span { font-family: monospace; font-size: 0.9em; min-width: 20em; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Cases</h1>
|
|
{% if cases.is_empty() %}
|
|
<p>No cases found.</p>
|
|
{% else %}
|
|
{% for case in cases %}
|
|
<div class="case status-{{ case.status }}">
|
|
<h2>{{ case.user_slug }} — {{ case.case_id_short }} ({{ case.status }})</h2>
|
|
<small>{{ case.case_id }}</small>
|
|
{% for rec in case.recordings %}
|
|
<div class="recording">
|
|
<span>{{ rec.filename }}</span>
|
|
<audio controls preload="none">
|
|
<source src="/web/audio/{{ case.user_slug }}/{{ case.case_id }}/{{ rec.filename }}" type="audio/mp4">
|
|
</audio>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</body>
|
|
</html>
|