From e749fe70e26b8887f2d66a51cf1b3c2b16c4a9c5 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 18 Jul 2024 15:04:55 +0800 Subject: [PATCH] fix: use group testUrl #1384 --- src/components/proxy/proxy-head.tsx | 8 ++++++-- src/components/proxy/proxy-render.tsx | 1 + src/services/types.d.ts | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/proxy/proxy-head.tsx b/src/components/proxy/proxy-head.tsx index 9015aed..c9ba125 100644 --- a/src/components/proxy/proxy-head.tsx +++ b/src/components/proxy/proxy-head.tsx @@ -21,6 +21,7 @@ import delayManager from "@/services/delay"; interface Props { sx?: SxProps; + url?: string; groupName: string; headState: HeadState; onLocation: () => void; @@ -29,7 +30,7 @@ interface Props { } export const ProxyHead = (props: Props) => { - const { sx = {}, groupName, headState, onHeadState } = props; + const { sx = {}, url, groupName, headState, onHeadState } = props; const { showType, sortType, filterText, textState, testUrl } = headState; @@ -45,7 +46,10 @@ export const ProxyHead = (props: Props) => { const { verge } = useVerge(); useEffect(() => { - delayManager.setUrl(groupName, testUrl || verge?.default_latency_test!); + delayManager.setUrl( + groupName, + testUrl || url || verge?.default_latency_test! + ); }, [groupName, testUrl, verge?.default_latency_test]); return ( diff --git a/src/components/proxy/proxy-render.tsx b/src/components/proxy/proxy-render.tsx index 68faaa1..18a7fbb 100644 --- a/src/components/proxy/proxy-render.tsx +++ b/src/components/proxy/proxy-render.tsx @@ -129,6 +129,7 @@ export const ProxyRender = (props: RenderProps) => { return ( onLocation(group)} diff --git a/src/services/types.d.ts b/src/services/types.d.ts index 459635a..df48e52 100644 --- a/src/services/types.d.ts +++ b/src/services/types.d.ts @@ -59,6 +59,7 @@ interface IProxyItem { time: string; delay: number; }[]; + testUrl?: string; all?: string[]; now?: string; hidden?: boolean;