update for app.js
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user