mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: url-test支持手动选择、节点组fixed节点使用角标展示 (#840)
* feat: allow manual selection of url-test group * feat: fixed proxy indicator * fix: try to fix traffic websocket no longer updating * fixup: group delay test use defined url
This commit is contained in:
@@ -75,9 +75,13 @@ export const getRules = async () => {
|
||||
};
|
||||
|
||||
/// Get Proxy delay
|
||||
export const getProxyDelay = async (name: string, url?: string) => {
|
||||
export const getProxyDelay = async (
|
||||
name: string,
|
||||
url?: string,
|
||||
timeout?: number
|
||||
) => {
|
||||
const params = {
|
||||
timeout: 10000,
|
||||
timeout: timeout || 10000,
|
||||
url: url || "http://1.1.1.1",
|
||||
};
|
||||
const instance = await getAxios();
|
||||
@@ -237,3 +241,21 @@ export const closeAllConnections = async () => {
|
||||
const instance = await getAxios();
|
||||
await instance.delete<any, any>(`/connections`);
|
||||
};
|
||||
|
||||
// Get Group Proxy Delays
|
||||
export const getGroupProxyDelays = async (
|
||||
groupName: string,
|
||||
url?: string,
|
||||
timeout?: number
|
||||
) => {
|
||||
const params = {
|
||||
timeout: timeout || 10000,
|
||||
url: url || "http://1.1.1.1",
|
||||
};
|
||||
const instance = await getAxios();
|
||||
const result = await instance.get(
|
||||
`/group/${encodeURIComponent(groupName)}/delay`,
|
||||
{ params }
|
||||
);
|
||||
return result as any as Record<string, number>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user