mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
parent
4f5227782a
commit
455892b414
@ -134,43 +134,32 @@ export const getProxies = async () => {
|
|||||||
|
|
||||||
const { GLOBAL: global, DIRECT: direct, REJECT: reject } = proxyRecord;
|
const { GLOBAL: global, DIRECT: direct, REJECT: reject } = proxyRecord;
|
||||||
|
|
||||||
interface Group {
|
let groups: IProxyGroupItem[] = Object.values(proxyRecord).reduce<
|
||||||
all: IProxyItem[];
|
IProxyGroupItem[]
|
||||||
name: string;
|
>((acc, each) => {
|
||||||
type: string;
|
if (each.name !== "GLOBAL" && each.all) {
|
||||||
udp: boolean;
|
acc.push({
|
||||||
xudp: boolean;
|
...each,
|
||||||
tfo: boolean;
|
all: each.all!.map((item) => generateItem(item)),
|
||||||
history: {
|
});
|
||||||
time: string;
|
}
|
||||||
delay: number;
|
|
||||||
}[];
|
|
||||||
}
|
|
||||||
|
|
||||||
let groups: Group[] = Object.values(proxyRecord).reduce<Group[]>(
|
return acc;
|
||||||
(acc, each) => {
|
}, []);
|
||||||
if (each.name !== "GLOBAL" && each.all) {
|
|
||||||
acc.push({
|
|
||||||
...each,
|
|
||||||
all: each.all!.map((item) => generateItem(item)),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (global?.all) {
|
if (global?.all) {
|
||||||
let globalGroups: Group[] = global.all.reduce<Group[]>((acc, name) => {
|
let globalGroups: IProxyGroupItem[] = global.all.reduce<IProxyGroupItem[]>(
|
||||||
if (proxyRecord[name]?.all) {
|
(acc, name) => {
|
||||||
acc.push({
|
if (proxyRecord[name]?.all) {
|
||||||
...proxyRecord[name],
|
acc.push({
|
||||||
all: proxyRecord[name].all!.map((item) => generateItem(item)),
|
...proxyRecord[name],
|
||||||
});
|
all: proxyRecord[name].all!.map((item) => generateItem(item)),
|
||||||
}
|
});
|
||||||
return acc;
|
}
|
||||||
}, []);
|
return acc;
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
let globalNames = new Set(globalGroups.map((each) => each.name));
|
let globalNames = new Set(globalGroups.map((each) => each.name));
|
||||||
groups = groups
|
groups = groups
|
||||||
|
Loading…
x
Reference in New Issue
Block a user