Link support codes to agent sessions

- Server: Accept support_code param in WebSocket connection
- Server: Link code to session when agent connects, mark as connected
- Server: Mark code as completed when agent disconnects
- Agent: Accept support code from command line argument
- Agent: Send hostname and support_code in WebSocket params
- Portal: Trigger agent download with code in filename
- Portal: Show code reminder in download instructions
- Dashboard: Add machines list fetching (Access tab)
- Add TODO.md for feature tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 14:11:52 -07:00
parent 9af59158b2
commit 1d2ca47771
10 changed files with 447 additions and 21 deletions

View File

@@ -381,16 +381,26 @@
// Show instructions
showInstructions();
// For now, show a message that download will be available soon
// TODO: Implement actual download endpoint
setLoading(false);
connectBtn.querySelector('.btn-text').textContent = 'Download Starting...';
// Placeholder - in production this will download the agent
// Create a temporary link to download the agent
// The agent will be run with the code as argument
const downloadLink = document.createElement('a');
downloadLink.href = '/guruconnect-agent.exe';
downloadLink.download = 'GuruConnect-' + code + '.exe';
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
// Show instructions with the code reminder
setTimeout(() => {
alert('Agent download will be available once the agent is built.\n\nSession ID: ' + sessionId);
connectBtn.querySelector('.btn-text').textContent = 'Connect';
}, 1000);
connectBtn.querySelector('.btn-text').textContent = 'Run the Downloaded File';
// Update instructions to include the code
instructionsList.innerHTML = getBrowserInstructions(detectBrowser()).map(step => '<li>' + step + '</li>').join('') +
'<li><strong>Important:</strong> When prompted, enter code: <strong style="color: hsl(var(--primary)); font-size: 18px;">' + code + '</strong></li>';
}, 500);
}
function showError(message) {