diff --git a/src/types/graph.ts b/src/types/graph.ts index b3fc3d5..6ebb738 100644 --- a/src/types/graph.ts +++ b/src/types/graph.ts @@ -4,52 +4,42 @@ export type AppNode = Node; export type AppEdge = Edge; -export interface GroupAllowRule { - kind: 'group' - allowGroup: number -} +export class SubNetRouter { + private _nodes : Record = {}; -export interface HostAllowRule { - kind: 'host' - allowHost: number + constructor( + public subnet: string, + ) {} } -export interface CustomAllowRule { - kind: 'custom' - allow: string -} - -export type AllowRule = GroupAllowRule | HostAllowRule | CustomAllowRule - export type NodeData = { - // basic + id: string; label: string; privateKey: string; - groupId: number; - hostId: number; - - // host options + ipv4Address?: string; + ipv6Address?: string; + disallowIPs?: string; + postUp?: string; postDown?: string; mtu?: number; - notes?: string; listenPort?: number; dnsServers?: string; - - // peer options - // allowRules?: AllowRule[]; - // persistentKeepalive?: string; todo: 加到边上 + notes?: string; } export type Settings = { - v4SubNetPrefix: [number, number]; listenPort: number; - - // options - v6SubNetPrefix?: [string, string, string, string]; - mtu?: number; + mtu: number; + + ipv4Subnet?: string; + ipv4SubnetRouter?: SubNetRouter; + + ipv6Subnet?: string; + ipv6SubnetRouter?: SubNetRouter; } export type EdgeData = { - isTwoWayEdge: boolean + isTwoWayEdge: boolean; + persistentKeepalive?: string; } \ No newline at end of file