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;