export enum SourceType {
  GROUP = 1, // 分组
  DOMAIN = 2 // 具体域名
}

export enum IpType {
  WHITE = 1,
  BLACK = 2
}

export enum IpMode {
  IP = 1, // 单个IP
  IPRange = 2 // IP段
}

export interface DomainItem {
  id?: string;
  domain: string;
  sourceType: SourceType; // 1:分组 2:具体域名
  groupId: string;
  groupName: string;
  modify: boolean; // 是否被修改/新增
  domains: {
    domain: string;
    id: string;
  }[];
}

export interface IpItem {
  id?: string;
  ipMode: IpMode;
  ipType: IpType; // 1: 白名单, 2: 黑名单
  sourceType: SourceType;
  startIp: string;
  endIp: string;
  groupId: string;
  groupName: string;
  list: string[] | {
		id: number;
		value: string;
	}[];
  modify?: boolean;
  ip: string; 
}

export interface AppData {
  id?: string;
  appId?: string;
  appName?: string;
  appImg?: string;
  appUrl?: string;
  backUpUrl?: string;
  domainType?: string;
  domainLimit: boolean;
  launch: boolean;
  triggerRule: number;
  triggerNum: string;
  triggerNumFormat: string;
  remark: string;
  ips?: IpItem[];
  domains?: DomainItem[];
  delDomains?: string[];
  delIps?: string[];
}