Skip to content
File

Blob: ui/operator/types.ts

typescript65 lines
1export interface Identity {
2 id: string;
3 address: string;
4}
5 
6export interface VNode {
7 identity: Identity;
8 root: boolean;
9 state: string;
10 last_stabilized: string | null;
11 chord_requests: number;
12 kv_requests: number;
13 rpc_errors: number;
14 kv_stale: number;
15 predecessor_available: boolean;
16 predecessor: Identity | null;
17 successors_available: boolean;
18 successors: Identity[];
19}
20 
21export interface Overview {
22 observed_at: string;
23 identity: Identity;
24 provider: string;
25 vnodes: VNode[];
26}
27 
28export interface ClientList {
29 node: string;
30 observedAt: string;
31 clients: {
32 clientId: string;
33 identity: string;
34 address: string;
35 version: string;
36 url: string;
37 sessionMode?: 'ephemeral' | 'token';
38 hostname?: string;
39 ownerIdentity?: string;
40 ownerLabel?: string;
41 ownerUrl?: string;
42 }[];
43}
44 
45export type LookupState = 'Yes' | 'No' | 'Unknown';
46 
47export interface TunnelDetail {
48 identity: string;
49 address: string;
50 observedAt: string;
51 configurationError?: string;
52 registrationError?: string;
53 tunnels: {
54 hostname: string;
55 target: string;
56 configured: LookupState;
57 registered: LookupState;
58 }[];
59}
60 
61export type Snapshot =
62 | { kind: 'overview'; data: Overview }
63 | { kind: 'clients'; data: ClientList }
64 | { kind: 'tunnels'; data: TunnelDetail };