init wxt framework

This commit is contained in:
go0p
2025-04-14 17:10:10 +08:00
parent 273ea4878f
commit dde16515ec
34 changed files with 8126 additions and 20 deletions
+19
View File
@@ -0,0 +1,19 @@
export const ProxyActionType = {
SET_PROXY_CONFIG: "SET_PROXY_CONFIG",
CLEAR_PROXY_CONFIG: "CLEAR_PROXY_CONFIG",
GET_PROXY_STATUS: "GET_PROXY_STATUS",
CLEAR_PROXY_LOGS: "CLEAR_PROXY_LOGS",
GET_PROXY_LOGS: "GET_PROXY_LOGS",
GET_PROXY_CONFIGS: "GET_PROXY_CONFIGS",
ADD_PROXY_CONFIG: "ADD_PROXY_CONFIG",
UPDATE_PROXY_CONFIG: "UPDATE_PROXY_CONFIG",
SWITCH_PROXY: "SWITCH_PROXY",
} as const;
export const ContentActionType = {
PROXY_CONFIGS_UPDATED: "PROXY_CONFIGS_UPDATED",
PROXY_STATUS_CHANGED: "PROXY_STATUS_CHANGED",
TRIGGER_ADD_PROXY: "TRIGGER_ADD_PROXY",
}
export type ProxyActionType = typeof ProxyActionType[keyof typeof ProxyActionType];
+45
View File
@@ -0,0 +1,45 @@
export interface PacScript {
data?: string;
url?: string;
mandatory?: boolean;
}
export interface ProxyConfig {
id: string;
name: string;
enabled: boolean;
proxyType: "direct" | "system" | "fixed_servers" | "pac_script" | "auto_detect";
mode?: string;
host?: string;
port?: number;
scheme?: "http" | "https" | "socks4" | "socks5";
pacScript?: PacScript;
bypassList?: string[];
matchList?: string[];
}
export interface ProxyLog {
id: string;
timestamp: number;
url: string;
proxyId: string;
proxyName: string;
status: 'success' | 'error';
errorMessage?: string;
method?: string;
requestHeaders?: Record<string, string>;
requestBody?: string;
responseHeaders?: Record<string, string>;
responseBody?: string;
timing?: {
startTime: number;
endTime: number;
duration: number;
};
protocol?: string;
ip?: string;
fromCache?: boolean;
host?: string;
port?: number;
resourceType?: 'xhr' | 'fetch' | 'script' | 'stylesheet' | 'image' | 'other';
}