mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: finish the remote-desktop plugin (B14)
This commit is contained in:
1 parent
0af2c94983
commit
14eb558b85
215 files changed
+30029
-3921
No files matched your search
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* What core needs from the Remote Desktop plugin, resolved through the plugin
|
||||
* registry rather than an import: restarting its guacd WebSocket server after
|
||||
* an admin edits the guacd URL setting.
|
||||
*
|
||||
* The plugin publishes "remote-desktop.sessions" through ctx.registry on
|
||||
* activate and the registry revokes it on deactivate. A restart while it is
|
||||
* off does nothing, because resurrecting a server the plugin does not own
|
||||
* would be worse than doing nothing.
|
||||
*/
|
||||
|
||||
import { consume } from "../plugins/registry.js";
|
||||
|
||||
export const GUACAMOLE_SESSIONS_KEY = "remote-desktop.sessions";
|
||||
|
||||
export interface GuacamoleSessionProvider {
|
||||
restart: () => Promise<void>;
|
||||
}
|
||||
|
||||
/** Restarts the plugin's guacd WebSocket server. A no-op while it is off. */
|
||||
export async function restartGuacamoleService(): Promise<void> {
|
||||
await consume<GuacamoleSessionProvider>(GUACAMOLE_SESSIONS_KEY)?.restart();
|
||||
}
|
||||
Reference in new issue
Block a user