add client info page

This commit is contained in:
2024-12-23 03:16:56 -08:00
parent d5b5f037ac
commit 32927dfd55
11 changed files with 208 additions and 20 deletions

11
src/lib/types/clients.ts Normal file
View File

@@ -0,0 +1,11 @@
export type ClientDetails = {
id: number;
name: string;
publicKey: string;
privateKey: string | null;
preSharedKey: string | null;
ips: string[];
vpnPublicKey: string;
vpnEndpoint: string;
vpnDns: string;
};

27
src/lib/types/index.ts Normal file
View File

@@ -0,0 +1,27 @@
class Ok<T> {
readonly _tag = 'ok';
value: T;
constructor(value: T) {
this.value = value;
}
}
class Err<E> {
readonly _tag = 'err';
error: E;
constructor(error: E) {
this.error = error;
}
}
export type Result<T, E> = Ok<T> | Err<E>;
export function err<E>(e: E): Err<E> {
return new Err(e);
}
export function ok<T>(t: T): Ok<T> {
return new Ok(t);
}