Skip to content

Commit f9a29d7

Browse files
committed
🐛 fix: update CameraMonitor props for consistency and add debug logging in EnvironmentPage
1 parent 8d51c35 commit f9a29d7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

web/src/app/dashboard/Desktop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export default function DashboardDesktop() {
418418
<div className="bg-black/40 p-2 text-white text-xs font-medium">
419419
Camera Feed
420420
</div>
421-
<CameraMonitor hostId="demo" cameraId="cam-1" />
421+
<CameraMonitor hostId="demo-host" cameraId="camera-1" />
422422
</div>
423423
</div>
424424
</div>

web/src/app/dashboard/environment/EnvironmentPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ export default function EnvironmentPage() {
227227
const lastConnectedAt =
228228
realtimeStatus?.last_connected_at ?? lab.last_connected_at;
229229

230+
// Debug log
231+
// console.log(`Lab ${lab.name} (${lab.uuid}): realtime=${realtimeStatus?.is_online}, static=${lab.is_online}, final=${isOnline}`);
232+
230233
return (
231234
<Card
232235
key={lab.uuid}

web/src/core/labStatusCore.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,20 @@ class LabStatusManager {
177177
}
178178

179179
// 处理状态更新通知
180-
if (action === 'status_update' && Array.isArray(responseData)) {
181-
this.handleStatusUpdate(responseData);
180+
if (action === 'status_update') {
181+
console.log('🔔 [LabStatusCore] Received status update action');
182+
if (Array.isArray(responseData)) {
183+
console.log(
184+
'🔔 [LabStatusCore] Processing status update array:',
185+
responseData
186+
);
187+
this.handleStatusUpdate(responseData);
188+
} else {
189+
console.warn(
190+
'⚠️ [LabStatusCore] Status update data is not an array:',
191+
responseData
192+
);
193+
}
182194
}
183195
} catch (error) {
184196
console.error('❌ [LabStatusCore] Failed to parse message:', error);

0 commit comments

Comments
 (0)