feat: 全局代理支持连通性测试与出口 IP 显示

This commit is contained in:
shinypolaris committed 2026-10-27 00:01:23 +08:00
1 parent e740334b90
commit 5feddf296d
6 files changed
+967 -5

No files matched your search

+5
View File
@@ -33,6 +33,7 @@ import type {
DeleteTaskOptions,
DeleteTaskResult,
Edge,
EgressReport,
EvidenceBodyPreview,
ExplorationNodePage,
ExplorationNodeQuery,
@@ -952,6 +953,10 @@ export const api = {
tavily_search_api_key?: string;
}) => post<{ ok: boolean; error?: string; count?: number; backend?: string }>(`/settings/web-search/test`, patch),
// global_proxy 传空 = 测直连;probe_url 可覆盖默认探测地址(隔离网用)。
testEgressProxy: (patch: { global_proxy?: string; probe_url?: string }) =>
post<EgressReport>(`/settings/proxy/test`, patch),
// ---- 漏洞 IM 推送 ----
// 渠道是多实例资源(同一类型可配多个机器人、各有过滤规则),因此独立成组,
// 不塞进扁平的 settings 键值里。
+38
View File
@@ -1860,3 +1860,41 @@ export interface IntelligencePage {
counts: Record<IntelligenceKind, number>;
enabled: boolean;
}
// ---- 出口代理连通性测试(POST /api/settings/proxy/test)----
export interface EgressProbeResult {
ok: boolean;
exit_ip?: string;
via?: "direct" | "http" | "https" | "socks5";
via_label?: string;
latency_ms: number;
error?: string;
// 每个地址的明细:区分"连不上代理"和"代理通但出不了网"。
probes: {
url: string;
ok: boolean;
ip?: string;
latency_ms: number;
error?: string;
}[];
}
// 报告里的一行:① 直连 / ② 经全局代理。
export interface EgressCheck {
key: "direct" | "global";
label: string;
path?: string;
skipped?: boolean;
skip_reason?: string;
result: EgressProbeResult;
}
export interface EgressReport {
ok: boolean;
capture: boolean;
configured: string;
// agent_proxy 是 Agent 实际使用的代理地址:捕获开时是流量捕获的地址,不是输入框里的值。
agent_proxy: string;
checks: EgressCheck[];
warnings?: string[];
}