diff --git a/templates/soundboard.html b/templates/soundboard.html
index 739d264..4eded49 100644
--- a/templates/soundboard.html
+++ b/templates/soundboard.html
@@ -25,6 +25,11 @@
+
+
+
+ Wirkt global auf alle Soundboard-Kanäle.
+
@@ -44,6 +49,9 @@
const content = document.getElementById('sb-content');
let currentSB = null;
+ const statusBox = (msg, type='info') => {
+ console.log(msg);
+ };
async function loadSoundboard(filename) {
loadBtn.disabled = true;
@@ -107,7 +115,8 @@
function renderRandom(list) {
const container = document.getElementById('sb-random');
if (!list.length) { container.innerHTML=''; randBtn.disabled=true; return; }
- container.innerHTML = '
Zufallspool: ' + list.length + ' Dateien, max 2x pro Stunde je Datei.
';
+ const items = list.map(s => `
${s.name || s.id || s.file}`).join('');
+ container.innerHTML = '
Zufallspool
max 2x pro Stunde je Datei.
';
}
async function playSound(sound) {
@@ -122,7 +131,7 @@
body: JSON.stringify(payload)
});
const data = await res.json();
- if (!data.success) alert(data.message || 'Fehler beim Abspielen');
+ if (!data.success) statusBox(data.message || 'Fehler beim Abspielen', 'warn');
}
async function stopSound(channel) {
@@ -132,16 +141,29 @@
body: JSON.stringify({ channel })
});
const data = await res.json();
- if (!data.success) alert(data.message || 'Fehler beim Stoppen');
+ if (!data.success) statusBox(data.message || 'Fehler beim Stoppen', 'warn');
}
loadBtn.onclick = () => loadSoundboard(selectEl.value);
randBtn.onclick = async () => {
const res = await fetch('/api/soundboard/play_random', { method: 'POST' });
const data = await res.json();
- if (!data.success) alert(data.message || 'Random fehlgeschlagen');
+ if (!data.success) statusBox(data.message || 'Random fehlgeschlagen', 'warn');
};
+ // Lautstärke
+ const vol = document.getElementById('sb-volume');
+ if (vol) {
+ vol.addEventListener('input', async () => {
+ const v = parseInt(vol.value, 10) / 100;
+ await fetch('/api/set_volume', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ volume: v })
+ });
+ });
+ }
+
// Autoload erstes Thema (falls vorhanden)
if (selectEl && selectEl.value) {
loadSoundboard(selectEl.value);