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>;
|
||||
};
|
||||
|
||||
1
src/services/types.d.ts
vendored
1
src/services/types.d.ts
vendored
@@ -64,6 +64,7 @@ interface IProxyItem {
|
||||
hidden?: boolean;
|
||||
icon?: string;
|
||||
provider?: string; // 记录是否来自provider
|
||||
fixed?: string; // 记录固定(优先)的节点
|
||||
}
|
||||
|
||||
type IProxyGroupItem = Omit<IProxyItem, "all"> & {
|
||||
|
||||
Reference in New Issue
Block a user