Stabilisiere WhatsApp-Verbindung

This commit is contained in:
2026-08-04 13:00:06 +02:00
parent 125e62d4f8
commit fe86f77205
9 changed files with 3871 additions and 144 deletions
+10 -2
View File
@@ -47,12 +47,15 @@
};
async function update() {
const statusEl = document.getElementById('status');
const msgEl = document.getElementById('msg');
try {
const response = await fetch(getBaseUrl() + 'api/status');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
const statusEl = document.getElementById('status');
const qrSection = document.getElementById('qr-section');
msgEl.innerText = data.lastError || '';
if (data.isReady) {
statusEl.innerText = "VERBUNDEN ✅";
@@ -67,6 +70,10 @@
statusEl.innerText = "LADE CLIENT... ⏳";
statusEl.className = "status-badge loading";
qrSection.style.display = "none";
} else if (data.lastError) {
statusEl.innerText = `NEUVERBINDUNG (${data.reconnectAttempts}) ⏳`;
statusEl.className = "status-badge loading";
qrSection.style.display = "none";
} else {
statusEl.innerText = "INITIALISIERE...";
statusEl.className = "status-badge loading";
@@ -75,6 +82,7 @@
} catch (e) {
statusEl.innerText = "VERBINDUNG VERLOREN ❌";
statusEl.className = "status-badge disconnected";
msgEl.innerText = e.message;
}
}
@@ -99,4 +107,4 @@
update();
</script>
</body>
</html>
</html>