-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession-model.ts
More file actions
113 lines (109 loc) · 3.15 KB
/
session-model.ts
File metadata and controls
113 lines (109 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import type { QuickSshSessionRequest } from "../types";
export type SavedSshSessionTab = {
id: string;
kind: "sshSaved";
hostAlias: string;
};
export type QuickSshSessionTab = {
id: string;
kind: "sshQuick";
label: string;
request: QuickSshSessionRequest;
};
export type LocalSessionTab = {
id: string;
kind: "local";
label: string;
};
/** In-app iframe pane for HTTPS URLs (e.g. Proxmox noVNC / web shell). No backend PTY session. */
export type WebSessionTab = {
id: string;
kind: "web";
label: string;
url: string;
/** Mirrors PROXMUX cluster "Allow insecure TLS" for in-app webview window (Linux/BSD WebKit). */
allowInsecureTls?: boolean;
/** PEM trusted for TLS (PROXMUX cluster). */
tlsTrustedCertPem?: string | null;
};
/** Pane-native QEMU noVNC using PROXMUX vncproxy ticket + API WebSocket (or local WS proxy if TLS is insecure). */
export type ProxmoxQemuVncSessionTab = {
id: string;
kind: "proxmoxQemuVnc";
label: string;
clusterId: string;
node: string;
vmid: string;
/** Cluster GUI base URL for "Open in app window" fallback (deep link). */
proxmoxBaseUrl: string;
allowInsecureTls?: boolean;
/** PEM trusted for TLS (PROXMUX cluster); used with the local WebSocket bridge. */
tlsTrustedCertPem?: string;
};
/** Pane-native LXC console using PROXMUX termproxy ticket + API WebSocket. */
export type ProxmoxLxcTermSessionTab = {
id: string;
kind: "proxmoxLxcTerm";
label: string;
clusterId: string;
node: string;
vmid: string;
proxmoxBaseUrl: string;
allowInsecureTls?: boolean;
tlsTrustedCertPem?: string;
};
/** Pane-native Proxmox node host shell (nodes/{node}/termproxy + vncwebsocket). */
export type ProxmoxNodeTermSessionTab = {
id: string;
kind: "proxmoxNodeTerm";
label: string;
clusterId: string;
node: string;
proxmoxBaseUrl: string;
allowInsecureTls?: boolean;
tlsTrustedCertPem?: string;
};
/** Pane-native Hetzner Cloud VNC console (request_console API + noVNC). */
export type HetznerVncSessionTab = {
id: string;
kind: "hetznerVnc";
label: string;
projectId: string;
serverId: string;
};
export type SessionTab =
| SavedSshSessionTab
| QuickSshSessionTab
| LocalSessionTab
| WebSessionTab
| ProxmoxQemuVncSessionTab
| ProxmoxLxcTermSessionTab
| ProxmoxNodeTermSessionTab
| HetznerVncSessionTab;
export type QuickConnectDraft = {
hostName: string;
user: string;
identityFile: string;
proxyJump: string;
proxyCommand: string;
};
export const createQuickConnectDraft = (defaultUser = ""): QuickConnectDraft => ({
hostName: "",
user: defaultUser.trim(),
identityFile: "",
proxyJump: "",
proxyCommand: "",
});
export type HostStatusFilter = "all" | "connected" | "disconnected";
export type QuickConnectWizardStep = 1 | 2;
export type AutoArrangeActiveMode = "a" | "b" | "c";
export type SidebarViewId = "builtin:all" | "builtin:favorites" | "builtin:proxmux" | "builtin:hetzner" | `custom:${string}`;
export type SplitMode = "duplicate" | "empty";
export type ContextMenuState = {
visible: boolean;
x: number;
y: number;
paneIndex: number | null;
splitMode: SplitMode;
};
export type TrustPromptRequest = { sessionId: string; hostLabel: string };