From 0c5668838f63248f40b5fa32e56df54a3bc1480f Mon Sep 17 00:00:00 2001 From: fengfeng Date: Thu, 5 Feb 2026 13:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E6=95=B0=E6=8D=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/graph.ts | 50 +++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) 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