确定数据结构
This commit is contained in:
parent
be36cefd4b
commit
0c5668838f
@ -4,52 +4,42 @@ export type AppNode = Node<NodeData>;
|
|||||||
|
|
||||||
export type AppEdge = Edge<EdgeData>;
|
export type AppEdge = Edge<EdgeData>;
|
||||||
|
|
||||||
export interface GroupAllowRule {
|
export class SubNetRouter {
|
||||||
kind: 'group'
|
private _nodes : Record<string, string | undefined> = {};
|
||||||
allowGroup: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface HostAllowRule {
|
constructor(
|
||||||
kind: 'host'
|
public subnet: string,
|
||||||
allowHost: number
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CustomAllowRule {
|
|
||||||
kind: 'custom'
|
|
||||||
allow: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type AllowRule = GroupAllowRule | HostAllowRule | CustomAllowRule
|
|
||||||
|
|
||||||
export type NodeData = {
|
export type NodeData = {
|
||||||
// basic
|
id: string;
|
||||||
label: string;
|
label: string;
|
||||||
privateKey: string;
|
privateKey: string;
|
||||||
groupId: number;
|
ipv4Address?: string;
|
||||||
hostId: number;
|
ipv6Address?: string;
|
||||||
|
disallowIPs?: string;
|
||||||
|
|
||||||
// host options
|
|
||||||
postUp?: string;
|
postUp?: string;
|
||||||
postDown?: string;
|
postDown?: string;
|
||||||
mtu?: number;
|
mtu?: number;
|
||||||
notes?: string;
|
|
||||||
listenPort?: number;
|
listenPort?: number;
|
||||||
dnsServers?: string;
|
dnsServers?: string;
|
||||||
|
notes?: string;
|
||||||
// peer options
|
|
||||||
// allowRules?: AllowRule[];
|
|
||||||
// persistentKeepalive?: string; todo: 加到边上
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Settings = {
|
export type Settings = {
|
||||||
v4SubNetPrefix: [number, number];
|
|
||||||
listenPort: number;
|
listenPort: number;
|
||||||
|
mtu: number;
|
||||||
|
|
||||||
// options
|
ipv4Subnet?: string;
|
||||||
v6SubNetPrefix?: [string, string, string, string];
|
ipv4SubnetRouter?: SubNetRouter;
|
||||||
mtu?: number;
|
|
||||||
|
ipv6Subnet?: string;
|
||||||
|
ipv6SubnetRouter?: SubNetRouter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EdgeData = {
|
export type EdgeData = {
|
||||||
isTwoWayEdge: boolean
|
isTwoWayEdge: boolean;
|
||||||
|
persistentKeepalive?: string;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user