change web ui v2 server side loading

This commit is contained in:
Chuck
2025-08-10 12:02:33 -05:00
parent 8b7ae3beed
commit a49feb2971
2 changed files with 45 additions and 28 deletions

View File

@@ -1779,7 +1779,7 @@
// Socket.IO connection
function initializeSocket() {
socket = io();
socket = io({ transports: ['websocket', 'polling'] });
socket.on('connect', function() {
updateConnectionStatus(true);
@@ -1789,6 +1789,17 @@
socket.on('disconnect', function() {
updateConnectionStatus(false);
showNotification('Disconnected from LED Matrix', 'error');
// Try to reconnect with exponential backoff
let attempt = 0;
const retry = () => {
attempt++;
const delay = Math.min(30000, 1000 * Math.pow(2, attempt));
setTimeout(() => {
if (socket.connected) return;
socket.connect();
}, delay);
};
retry();
});
socket.on('display_update', function(data) {