use indexedDB manager proxySwitch

This commit is contained in:
go0p
2025-03-04 16:07:14 +08:00
parent 1e25561fae
commit 6f82842c92
23 changed files with 1542 additions and 753 deletions
+5 -1
View File
@@ -14,7 +14,11 @@ 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"
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"
} as const;
export type ProxyActionType = typeof ProxyActionType[keyof typeof ProxyActionType];
+10
View File
@@ -0,0 +1,10 @@
declare namespace chrome.storage {
interface StorageChange {
oldValue?: any;
newValue?: any;
}
type StorageChanges = {
[key: string]: StorageChange;
};
}
+26 -1
View File
@@ -7,5 +7,30 @@ export interface ProxyConfig {
port?: number;
scheme?: "http" | "https" | "socks4" | "socks5";
pacScript?: string;
bypassList?: 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';
}