feat: add diarization section to settings page

Adds a "Diarisierung" section with an enabled/disabled toggle,
HuggingFace token input, and a help link to pyannote/speaker-diarization-3.1.
loadConfig() and the save handler now persist diarization settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 01:18:26 +02:00
parent 0eb85b98f1
commit 5f384af6cf
2 changed files with 26 additions and 0 deletions
+19
View File
@@ -94,6 +94,25 @@
<button class="btn primary" id="save-btn">Speichern</button> <button class="btn primary" id="save-btn">Speichern</button>
</div> </div>
</section> </section>
<section>
<h2>Diarisierung</h2>
<div class="field">
<label>
<input type="checkbox" id="diar-enabled" style="margin-right:6px;accent-color:var(--yellow);">
Sprecher-Erkennung aktivieren
</label>
</div>
<div class="field">
<label>HuggingFace Token</label>
<input type="text" id="diar-hf-token" placeholder="hf_...">
</div>
<p style="font-size:.78rem;color:var(--muted);margin-bottom:10px;">
Token benötigt Lesezugriff auf
<a href="https://huggingface.co/pyannote/speaker-diarization-3.1" target="_blank"
style="color:var(--yellow);text-decoration:none;">pyannote/speaker-diarization-3.1</a>.
</p>
</section>
</main> </main>
<div class="toast" id="toast"></div> <div class="toast" id="toast"></div>
<script src="/settings.js"></script> <script src="/settings.js"></script>
+7
View File
@@ -58,6 +58,9 @@ async function loadConfig() {
const ollamaUrl = (cfg.ollama && cfg.ollama.base_url) || 'http://localhost:11434'; const ollamaUrl = (cfg.ollama && cfg.ollama.base_url) || 'http://localhost:11434';
document.getElementById('ollama-url').value = ollamaUrl; document.getElementById('ollama-url').value = ollamaUrl;
await loadOllamaModels(ollamaUrl, cfg.ollama && cfg.ollama.model); await loadOllamaModels(ollamaUrl, cfg.ollama && cfg.ollama.model);
const diarCfg = cfg.diarization || {};
document.getElementById('diar-enabled').checked = !!diarCfg.enabled;
document.getElementById('diar-hf-token').value = diarCfg.hf_token || '';
} }
document.getElementById('refresh-devices-btn').addEventListener('click', loadDevices); document.getElementById('refresh-devices-btn').addEventListener('click', loadDevices);
@@ -98,6 +101,10 @@ document.getElementById('save-btn').addEventListener('click', async function() {
base_url: document.getElementById('ollama-url').value, base_url: document.getElementById('ollama-url').value,
model: document.getElementById('ollama-model').value, model: document.getElementById('ollama-model').value,
}, },
diarization: {
enabled: document.getElementById('diar-enabled').checked,
hf_token: document.getElementById('diar-hf-token').value.trim(),
},
}; };
const r = await apiFetch('/config', { method: 'PUT', body: JSON.stringify(body) }); const r = await apiFetch('/config', { method: 'PUT', body: JSON.stringify(body) });
if (r.ok) { showToast('Gespeichert'); } else { showToast('Fehler beim Speichern'); } if (r.ok) { showToast('Gespeichert'); } else { showToast('Fehler beim Speichern'); }