update for app.js

This commit is contained in:
2026-02-16 11:24:23 +01:00
parent b8b2aec67d
commit d081477d63
11 changed files with 432 additions and 449 deletions
+30
View File
@@ -0,0 +1,30 @@
// static/js/ui-status.js – Status-Badge & Reconnect
function updateStatus(connected, message = '') {
const badge = document.getElementById('connection-status');
const reconnect = document.getElementById('reconnect-section');
if (!badge) return;
if (connected) {
badge.className = 'badge bg-success px-3 py-2 fs-6';
badge.innerHTML = '<i class="bi bi-circle-fill me-2"></i> Verbunden' + (message ? ` – ${message}` : '');
if (reconnect) reconnect.style.display = 'none';
} else {
badge.className = 'badge bg-danger px-3 py-2 fs-6';
badge.innerHTML = '<i class="bi bi-circle-fill me-2"></i> Getrennt' + (message ? ` – ${message}` : '');
if (reconnect) reconnect.style.display = 'block';
}
}
function showReconnect() {
const control = document.getElementById('control-section');
const reconnect = document.getElementById('reconnect-section');
if (control && reconnect) {
control.style.display = 'none';
reconnect.style.display = 'block';
}
}
window.updateStatus = updateStatus;
window.showReconnect = showReconnect;