added status-anzeige
This commit is contained in:
@@ -2,6 +2,28 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const statusBadge = document.getElementById('connection-status');
|
||||
|
||||
function updateStatus(connected) {
|
||||
if (!statusBadge) return;
|
||||
if (connected) {
|
||||
statusBadge.className = 'badge bg-success px-3 py-2';
|
||||
statusBadge.innerHTML = '<i class="bi bi-circle-fill me-2"></i> Verbunden';
|
||||
reconnectSection.style.display = 'none';
|
||||
} else {
|
||||
statusBadge.className = 'badge bg-danger px-3 py-2';
|
||||
statusBadge.innerHTML = '<i class="bi bi-circle-fill me-2"></i> Getrennt';
|
||||
showReconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// Nach erfolgreichem Connect / Reconnect
|
||||
// in if (result.success) { ... }
|
||||
updateStatus(true);
|
||||
|
||||
// Nach Fehler in sendControl (z. B. am Ende von sendControl)
|
||||
updateStatus(false);
|
||||
|
||||
const config = window.mkConfig || {};
|
||||
console.log("app.js verwendet config:", config);
|
||||
console.log('MK Control Frontend geladen');
|
||||
|
||||
Reference in New Issue
Block a user