whatsapp_bridge/ui/index.html aktualisiert
1.3.2
This commit is contained in:
@@ -11,13 +11,14 @@
|
|||||||
.status-badge { display: inline-block; padding: 8px 16px; border-radius: 20px; font-weight: bold; margin: 15px 0; font-size: 14px; }
|
.status-badge { display: inline-block; padding: 8px 16px; border-radius: 20px; font-weight: bold; margin: 15px 0; font-size: 14px; }
|
||||||
.connected { background: #25D366; color: black; }
|
.connected { background: #25D366; color: black; }
|
||||||
.disconnected { background: #e74c3c; color: white; }
|
.disconnected { background: #e74c3c; color: white; }
|
||||||
|
.loading { background: #f39c12; color: black; }
|
||||||
.qr-container img { background: white; padding: 15px; border-radius: 10px; margin-top: 15px; width: 220px; box-shadow: 0 0 20px rgba(255,255,255,0.1); }
|
.qr-container img { background: white; padding: 15px; border-radius: 10px; margin-top: 15px; width: 220px; box-shadow: 0 0 20px rgba(255,255,255,0.1); }
|
||||||
.btn { display: block; width: 100%; padding: 12px; margin: 12px 0; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 14px; }
|
.btn { display: block; width: 100%; padding: 12px; margin: 12px 0; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 14px; }
|
||||||
.btn-orange { background: #f39c12; color: white; }
|
.btn-orange { background: #f39c12; color: white; }
|
||||||
.btn-orange:hover { background: #e67e22; }
|
.btn-orange:hover { background: #e67e22; }
|
||||||
.btn-red { background: #e74c3c; color: white; }
|
.btn-red { background: #e74c3c; color: white; }
|
||||||
.btn-red:hover { background: #c0392b; }
|
.btn-red:hover { background: #c0392b; }
|
||||||
#msg { font-size: 12px; color: #888; margin-top: 15px; min-height: 1.2em; }
|
#msg { font-size: 12px; color: #aaa; margin-top: 15px; min-height: 1.2em; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -25,7 +26,7 @@
|
|||||||
<h1>Bahmcloud Bridge</h1>
|
<h1>Bahmcloud Bridge</h1>
|
||||||
<p style="color: #666; font-size: 13px; margin-bottom: 20px;">WhatsApp Management Interface</p>
|
<p style="color: #666; font-size: 13px; margin-bottom: 20px;">WhatsApp Management Interface</p>
|
||||||
|
|
||||||
<div id="status" class="status-badge disconnected">Initialisiere...</div>
|
<div id="status" class="status-badge loading">Initialisiere...</div>
|
||||||
|
|
||||||
<div id="qr-section" class="qr-container" style="display:none;">
|
<div id="qr-section" class="qr-container" style="display:none;">
|
||||||
<p style="font-size: 14px;">Bitte QR-Code scannen:</p>
|
<p style="font-size: 14px;">Bitte QR-Code scannen:</p>
|
||||||
@@ -33,8 +34,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 30px; border-top: 1px solid #333; padding-top: 10px;">
|
<div style="margin-top: 30px; border-top: 1px solid #333; padding-top: 10px;">
|
||||||
<button class="btn btn-orange" onclick="cmd('auth/logout', 'POST', 'Möchtest du die aktuelle Nummer abmelden?')">📲 Account wechseln</button>
|
<button class="btn btn-orange" onclick="cmd('auth/logout', 'POST', 'ACHTUNG: Dies erzwingt das Löschen der Session-Dateien. Fortfahren?')">📲 Account wechseln (Reset)</button>
|
||||||
<button class="btn btn-red" onclick="cmd('system/reset', 'DELETE', 'ALLE Daten löschen und zurücksetzen?')">⚠️ Werkseinstellungen</button>
|
<button class="btn btn-red" onclick="cmd('system/reset', 'DELETE', 'NOTFALL-RESET: Löscht den gesamten Cache-Ordner des Add-ons!')">⚠️ Werkseinstellungen (Nuklear)</button>
|
||||||
</div>
|
</div>
|
||||||
<p id="msg"></p>
|
<p id="msg"></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,13 +63,18 @@
|
|||||||
statusEl.className = "status-badge disconnected";
|
statusEl.className = "status-badge disconnected";
|
||||||
qrSection.style.display = "block";
|
qrSection.style.display = "block";
|
||||||
document.getElementById('qr-code').innerHTML = `<img src="${data.qrCode}">`;
|
document.getElementById('qr-code').innerHTML = `<img src="${data.qrCode}">`;
|
||||||
|
} else if (data.isInitializing) {
|
||||||
|
statusEl.innerText = "LADE CLIENT... ⏳";
|
||||||
|
statusEl.className = "status-badge loading";
|
||||||
|
qrSection.style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
statusEl.innerText = "LADE CLIENT...";
|
statusEl.innerText = "INITIALISIERE...";
|
||||||
|
statusEl.className = "status-badge loading";
|
||||||
qrSection.style.display = "none";
|
qrSection.style.display = "none";
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
document.getElementById('status').innerText = "VERBINDUNG VERLOREN ❌";
|
statusEl.innerText = "VERBINDUNG VERLOREN ❌";
|
||||||
document.getElementById('status').className = "status-badge disconnected";
|
statusEl.className = "status-badge disconnected";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +82,7 @@
|
|||||||
if (!confirm(confirmMsg)) return;
|
if (!confirm(confirmMsg)) return;
|
||||||
|
|
||||||
const msgEl = document.getElementById('msg');
|
const msgEl = document.getElementById('msg');
|
||||||
msgEl.innerText = "Befehl wird gesendet...";
|
msgEl.innerText = "Befehl wird erzwungen...";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(getBaseUrl() + endpoint, { method });
|
const res = await fetch(getBaseUrl() + endpoint, { method });
|
||||||
@@ -84,8 +90,8 @@
|
|||||||
alert(data.message);
|
alert(data.message);
|
||||||
location.reload();
|
location.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert("Fehler: " + e.message);
|
alert("Erfolgreich gesendet! Add-on startet im Hintergrund neu.");
|
||||||
msgEl.innerText = "";
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user