Auto-refresh dashboard and show client info
- Support tab auto-refreshes every 3 seconds - Shows client hostname under code when connected - Changes Cancel button to Join button when connected - Added joinSession placeholder function 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -452,12 +452,18 @@
|
||||
const created = new Date(code.created_at).toLocaleString();
|
||||
const statusClass = code.status === "pending" ? "badge-warning" :
|
||||
code.status === "connected" ? "badge-success" : "badge-muted";
|
||||
const clientInfo = code.status === "connected" && code.client_name
|
||||
? '<div style="font-size: 12px; color: hsl(var(--muted-foreground));">' + code.client_name + '</div>'
|
||||
: '';
|
||||
const actionBtn = code.status === "connected"
|
||||
? '<button class="btn btn-primary" onclick="joinSession(\'' + code.session_id + '\')">Join</button>'
|
||||
: '<button class="btn btn-outline" onclick="cancelCode(\'' + code.code + '\')">Cancel</button>';
|
||||
return '<tr>' +
|
||||
'<td><strong>' + code.code + '</strong></td>' +
|
||||
'<td><strong>' + code.code + '</strong>' + clientInfo + '</td>' +
|
||||
'<td><span class="badge ' + statusClass + '">' + code.status + '</span></td>' +
|
||||
'<td>' + created + '</td>' +
|
||||
'<td>' + (code.created_by || "Unknown") + '</td>' +
|
||||
'<td><button class="btn btn-outline" onclick="cancelCode(\'' + code.code + '\')">Cancel</button></td>' +
|
||||
'<td>' + actionBtn + '</td>' +
|
||||
'</tr>';
|
||||
}).join("");
|
||||
} catch (err) {
|
||||
@@ -475,7 +481,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
function joinSession(sessionId) {
|
||||
// TODO: Open viewer in new window
|
||||
alert("Viewer not yet implemented.\\n\\nSession ID: " + sessionId + "\\n\\nWebSocket: wss://connect.azcomputerguru.com/ws/viewer?session_id=" + sessionId);
|
||||
}
|
||||
|
||||
// Initial load and auto-refresh every 3 seconds
|
||||
loadSessions();
|
||||
setInterval(loadSessions, 3000);
|
||||
|
||||
// Load connected machines (Access tab)
|
||||
let machines = [];
|
||||
|
||||
Reference in New Issue
Block a user