diff --git a/web/lib/api.ts b/web/lib/api.ts index 9f8d8b8..cced293 100644 --- a/web/lib/api.ts +++ b/web/lib/api.ts @@ -19,6 +19,21 @@ export interface Server { created_at: string; available_updates?: PackageUpdate[]; updates_checked_at?: string; + console_protocols?: string[]; +} + +export interface ConsoleConnectRequest { + server_id: string; + protocol: string; + key_id?: string; + rdp_username?: string; + rdp_password?: string; +} + +export interface ConsoleConnectResponse { + session_id: string; + token: string; + ws_path: string; } export interface Key { @@ -290,4 +305,12 @@ export const api = { method: "DELETE", }); }, + + // Console + connectConsole(body: ConsoleConnectRequest): Promise { + return request("/console/connect", { + method: "POST", + body: JSON.stringify(body), + }); + }, };