Add connected technician tracking to dashboard
- Add ViewerInfo struct to track viewer name and connection time - Update session manager to track viewers with names - Update API to return viewer list for each session - Update dashboard to display "Mike Connected (3 min)" on machine bars - Update viewer.html to pass viewer_name parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -174,6 +174,10 @@
|
||||
window.close();
|
||||
}
|
||||
|
||||
// Get viewer name from localStorage (same as dashboard)
|
||||
const user = JSON.parse(localStorage.getItem('user') || 'null');
|
||||
const viewerName = user?.name || user?.email || 'Technician';
|
||||
|
||||
// State
|
||||
let ws = null;
|
||||
let canvas = document.getElementById('viewer-canvas');
|
||||
@@ -593,7 +597,7 @@
|
||||
|
||||
function connect() {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
const wsUrl = `${protocol}//${window.location.host}/ws/viewer?session_id=${sessionId}`;
|
||||
const wsUrl = `${protocol}//${window.location.host}/ws/viewer?session_id=${sessionId}&viewer_name=${encodeURIComponent(viewerName)}`;
|
||||
|
||||
console.log('Connecting to:', wsUrl);
|
||||
updateStatus('connecting', 'Connecting...');
|
||||
|
||||
Reference in New Issue
Block a user