- WebSocket relay service (FastAPI) bridges agents and viewers - Python agent with screen capture (mss), input control (pynput), script execution, and auto-reconnect - Windows service wrapper, PyInstaller spec, NSIS installer for silent mass deployment (RemoteLink-Setup.exe /S /SERVER= /ENROLL=) - Enrollment token system: admin generates tokens, agents self-register - Real WebSocket viewer replaces simulated canvas - Linux agent binary served from /downloads/remotelink-agent-linux - DB migration 0002: viewer_token on sessions, enrollment_tokens table - Sign-up pages cleaned up (invite-only redirect) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
'use client'
|
|
|
|
import { useState, useEffect } from 'react'
|
|
import { Signal, Clock, Gauge } from 'lucide-react'
|
|
|
|
interface ConnectionStatusProps {
|
|
quality: 'high' | 'medium' | 'low'
|
|
fps?: number
|
|
}
|
|
|
|
export function ConnectionStatus({ quality, fps: realFps }: ConnectionStatusProps) {
|
|
const [stats, setStats] = useState({
|
|
latency: 0,
|
|
fps: 0,
|
|
bitrate: 0,
|
|
})
|
|
|
|
useEffect(() => {
|
|
const interval = setInterval(() => {
|
|
setStats((prev) => ({
|
|
latency: Math.floor(35 + Math.random() * 20),
|
|
fps: realFps ?? prev.fps,
|
|
bitrate: quality === 'high' ? 8 + Math.random() * 2 : quality === 'medium' ? 4 + Math.random() : 1 + Math.random() * 0.5,
|
|
}))
|
|
}, 1000)
|
|
|
|
return () => clearInterval(interval)
|
|
}, [quality, realFps])
|
|
|
|
return (
|
|
<div className="flex items-center justify-center gap-6 h-8 bg-card/80 backdrop-blur border-t border-border/50 text-xs text-muted-foreground">
|
|
<div className="flex items-center gap-1.5">
|
|
<Clock className="h-3 w-3" />
|
|
<span>{stats.latency}ms</span>
|
|
</div>
|
|
<div className="flex items-center gap-1.5">
|
|
<Gauge className="h-3 w-3" />
|
|
<span>{stats.fps} FPS</span>
|
|
</div>
|
|
<div className="flex items-center gap-1.5">
|
|
<Signal className="h-3 w-3" />
|
|
<span>{stats.bitrate.toFixed(1)} Mbps</span>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|