From cc25a2202506bc32f38de8d9ab0bb76614873d57 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 17 Nov 2025 22:00:56 +0100 Subject: [PATCH] new ui 9 --- apps/ui/templates/device.html | 4 +--- apps/ui/templates/room.html | 14 +++++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/ui/templates/device.html b/apps/ui/templates/device.html index 8e1fceb..2ef1b03 100644 --- a/apps/ui/templates/device.html +++ b/apps/ui/templates/device.html @@ -824,9 +824,7 @@ // Cleanup on page unload window.addEventListener('beforeunload', () => { - if (eventSource) { - eventSource.close(); - } + window.apiClient.disconnectRealtime(); }); // Load device on page load diff --git a/apps/ui/templates/room.html b/apps/ui/templates/room.html index fdbf41a..26193d1 100644 --- a/apps/ui/templates/room.html +++ b/apps/ui/templates/room.html @@ -240,12 +240,20 @@ const layoutData = await window.apiClient.getLayout(); const devicesData = await window.apiClient.getDevices(); + console.log('Room name from URL:', roomName); + console.log('Available rooms:', layoutData.rooms.map(r => r.name)); + console.log('Total devices:', devicesData.length); + // Find the room using API client helper const room = window.apiClient.findRoom(layoutData, roomName); if (!room) { + console.error('Room not found:', roomName); throw new Error(`Raum "${roomName}" nicht gefunden`); } + console.log('Found room:', room); + console.log('Room devices:', room.devices); + // Update header roomNameEl.textContent = room.name; roomInfoEl.textContent = `${room.devices.length} Gerät${room.devices.length !== 1 ? 'e' : ''}`; @@ -261,6 +269,8 @@ .map(deviceId => deviceMap[deviceId]) .filter(device => device != null); + console.log('Filtered room devices:', roomDevices); + loading.style.display = 'none'; if (roomDevices.length === 0) { @@ -437,9 +447,7 @@ // Cleanup on page unload window.addEventListener('beforeunload', () => { - if (eventSource) { - eventSource.close(); - } + window.apiClient.disconnectRealtime(); }); // Load room on page load