增加了代理平台和日志
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import api from './client';
|
||||
import type { ProxyConfig, ProxyTestResult } from './types';
|
||||
import type { ProxyConfig, ProxyTestResult, PlatformInfo } from './types';
|
||||
|
||||
export const proxyApi = {
|
||||
get: () => api.get<ProxyConfig, ProxyConfig>('/proxy'),
|
||||
update: (data: ProxyConfig) => api.put<ProxyConfig, ProxyConfig>('/proxy', data),
|
||||
test: () => api.post<ProxyTestResult, ProxyTestResult>('/proxy/test'),
|
||||
testWhitelist: () => api.post<ProxyTestResult, ProxyTestResult>('/proxy/whitelist/test'),
|
||||
getPlatforms: () => api.get<PlatformInfo[], PlatformInfo[]>('/proxy/platforms'),
|
||||
};
|
||||
|
||||
@@ -112,6 +112,9 @@ export interface ProxyConfig {
|
||||
http: string;
|
||||
https: string;
|
||||
whitelist_enabled: boolean;
|
||||
whitelist_platform: string;
|
||||
whitelist_credentials: Record<string, string> | null;
|
||||
// 旧字段保留(向后兼容)
|
||||
whitelist_uid: string;
|
||||
whitelist_ukey: string;
|
||||
}
|
||||
@@ -121,6 +124,18 @@ export interface ProxyTestResult {
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export interface PlatformFieldDef {
|
||||
key: string;
|
||||
label: string;
|
||||
placeholder: string;
|
||||
}
|
||||
|
||||
export interface PlatformInfo {
|
||||
name: string;
|
||||
label: string;
|
||||
credential_fields: PlatformFieldDef[];
|
||||
}
|
||||
|
||||
// ==================== Permissions ====================
|
||||
|
||||
export interface PermissionsListResult {
|
||||
|
||||
Reference in New Issue
Block a user