more fixes for plugins
This commit is contained in:
@@ -530,6 +530,7 @@ async function startServer() {
|
|||||||
sendHVNCCommand,
|
sendHVNCCommand,
|
||||||
notifyConsoleClosed,
|
notifyConsoleClosed,
|
||||||
clearPendingNotificationScreenshots: notificationPluginHandlers.clearPendingNotificationScreenshots,
|
clearPendingNotificationScreenshots: notificationPluginHandlers.clearPendingNotificationScreenshots,
|
||||||
|
clearClientPluginState: notificationPluginHandlers.clearClientPluginState,
|
||||||
notifyRemoteDesktopStatus,
|
notifyRemoteDesktopStatus,
|
||||||
handleBuildTagConnection,
|
handleBuildTagConnection,
|
||||||
notifyDashboard: sessionManager.notifyDashboardViewers,
|
notifyDashboard: sessionManager.notifyDashboardViewers,
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ type WsLifecycleDeps = {
|
|||||||
sendHVNCCommand: (target: ClientInfo, commandType: string, payload: Record<string, unknown>) => void;
|
sendHVNCCommand: (target: ClientInfo, commandType: string, payload: Record<string, unknown>) => void;
|
||||||
notifyConsoleClosed: (clientId: string, reason: string) => void;
|
notifyConsoleClosed: (clientId: string, reason: string) => void;
|
||||||
clearPendingNotificationScreenshots: (clientId: string) => void;
|
clearPendingNotificationScreenshots: (clientId: string) => void;
|
||||||
|
clearClientPluginState: (clientId: string) => void;
|
||||||
notifyRemoteDesktopStatus: (clientId: string, status: string, reason?: string) => void;
|
notifyRemoteDesktopStatus: (clientId: string, status: string, reason?: string) => void;
|
||||||
handleBuildTagConnection: (clientId: string, buildTag: string) => void;
|
handleBuildTagConnection: (clientId: string, buildTag: string) => void;
|
||||||
notifyDashboard: () => void;
|
notifyDashboard: () => void;
|
||||||
@@ -714,6 +715,7 @@ export function handleWebSocketClose(
|
|||||||
deps.notifyConsoleClosed(clientId, "Client disconnected");
|
deps.notifyConsoleClosed(clientId, "Client disconnected");
|
||||||
setOnlineState(clientId, false);
|
setOnlineState(clientId, false);
|
||||||
deps.clearPendingNotificationScreenshots(clientId);
|
deps.clearPendingNotificationScreenshots(clientId);
|
||||||
|
deps.clearClientPluginState(clientId);
|
||||||
deps.notifyDashboard();
|
deps.notifyDashboard();
|
||||||
logger.info(`[close] ${clientId} code=${code} reason=${reason}`);
|
logger.info(`[close] ${clientId} code=${code} reason=${reason}`);
|
||||||
|
|
||||||
|
|||||||
@@ -358,6 +358,11 @@ export function createNotificationPluginHandlers(deps: CreateDeps) {
|
|||||||
|
|
||||||
markPluginLoaded,
|
markPluginLoaded,
|
||||||
|
|
||||||
|
clearClientPluginState(clientId: string) {
|
||||||
|
deps.pluginLoadedByClient.delete(clientId);
|
||||||
|
deps.pluginLoadingByClient.delete(clientId);
|
||||||
|
},
|
||||||
|
|
||||||
isPluginLoaded(clientId: string, pluginId: string): boolean {
|
isPluginLoaded(clientId: string, pluginId: string): boolean {
|
||||||
return deps.pluginLoadedByClient.get(clientId)?.has(pluginId) ?? false;
|
return deps.pluginLoadedByClient.get(clientId)?.has(pluginId) ?? false;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user