mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
b18147fa82
we also have added the necessary logic to auto prune ephemeral nodes because headscale doesn't seem to automatically remove them. this change made use of a database which is now stored in the persistent headplane directory.
57 lines
1.0 KiB
TypeScript
57 lines
1.0 KiB
TypeScript
declare function TsWasmNet(
|
|
options: TsWasmNetOptions,
|
|
callbacks: TsWasmNetCallbacks,
|
|
): TsWasmNet;
|
|
|
|
interface TsWasmNetOptions {
|
|
ControlURL: string;
|
|
PreAuthKey: string;
|
|
Hostname: string;
|
|
}
|
|
|
|
interface TsWasmNetCallbacks {
|
|
NotifyState: (state: IPNState) => void;
|
|
NotifyNetMap: (netmap: TsWasmNetMap) => void;
|
|
NotifyBrowseToURL: (url: string) => void;
|
|
NotifyPanicRecover: (err: string) => void;
|
|
}
|
|
|
|
interface TsWasmNetMap {
|
|
NodeKey: string;
|
|
}
|
|
|
|
interface TsWasmNet {
|
|
Start: () => void;
|
|
OpenSSH: (
|
|
hostname: string,
|
|
username: string,
|
|
options: XtermConfig,
|
|
) => SSHSession;
|
|
}
|
|
|
|
type IPNState =
|
|
| 'NoState'
|
|
| 'InUseOtherUser'
|
|
| 'NeedsLogin'
|
|
| 'NeedsMachineAuth'
|
|
| 'Stopped'
|
|
| 'Starting'
|
|
| 'Running';
|
|
|
|
interface XtermConfig {
|
|
Rows: number;
|
|
Cols: number;
|
|
|
|
OnStdout: (data: string) => void;
|
|
OnStderr: (data: string) => void;
|
|
OnStdin: (func: (input: string) => void) => void;
|
|
|
|
OnConnect: () => void;
|
|
OnDisconnect: () => void;
|
|
}
|
|
|
|
interface SSHSession {
|
|
Close(): boolean;
|
|
Resize(rows: number, cols: number): boolean;
|
|
}
|