new ui 9
This commit is contained in:
@@ -824,9 +824,7 @@
|
|||||||
|
|
||||||
// Cleanup on page unload
|
// Cleanup on page unload
|
||||||
window.addEventListener('beforeunload', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
if (eventSource) {
|
window.apiClient.disconnectRealtime();
|
||||||
eventSource.close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Load device on page load
|
// Load device on page load
|
||||||
|
|||||||
@@ -240,12 +240,20 @@
|
|||||||
const layoutData = await window.apiClient.getLayout();
|
const layoutData = await window.apiClient.getLayout();
|
||||||
const devicesData = await window.apiClient.getDevices();
|
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
|
// Find the room using API client helper
|
||||||
const room = window.apiClient.findRoom(layoutData, roomName);
|
const room = window.apiClient.findRoom(layoutData, roomName);
|
||||||
if (!room) {
|
if (!room) {
|
||||||
|
console.error('Room not found:', roomName);
|
||||||
throw new Error(`Raum "${roomName}" nicht gefunden`);
|
throw new Error(`Raum "${roomName}" nicht gefunden`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Found room:', room);
|
||||||
|
console.log('Room devices:', room.devices);
|
||||||
|
|
||||||
// Update header
|
// Update header
|
||||||
roomNameEl.textContent = room.name;
|
roomNameEl.textContent = room.name;
|
||||||
roomInfoEl.textContent = `${room.devices.length} Gerät${room.devices.length !== 1 ? 'e' : ''}`;
|
roomInfoEl.textContent = `${room.devices.length} Gerät${room.devices.length !== 1 ? 'e' : ''}`;
|
||||||
@@ -261,6 +269,8 @@
|
|||||||
.map(deviceId => deviceMap[deviceId])
|
.map(deviceId => deviceMap[deviceId])
|
||||||
.filter(device => device != null);
|
.filter(device => device != null);
|
||||||
|
|
||||||
|
console.log('Filtered room devices:', roomDevices);
|
||||||
|
|
||||||
loading.style.display = 'none';
|
loading.style.display = 'none';
|
||||||
|
|
||||||
if (roomDevices.length === 0) {
|
if (roomDevices.length === 0) {
|
||||||
@@ -437,9 +447,7 @@
|
|||||||
|
|
||||||
// Cleanup on page unload
|
// Cleanup on page unload
|
||||||
window.addEventListener('beforeunload', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
if (eventSource) {
|
window.apiClient.disconnectRealtime();
|
||||||
eventSource.close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Load room on page load
|
// Load room on page load
|
||||||
|
|||||||
Reference in New Issue
Block a user