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:
dongchengjie
2024-04-09 13:15:45 +08:00
committed by GitHub
parent 2ec841eb61
commit 213d417481
8 changed files with 85 additions and 38 deletions

View File

@@ -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>;
};