Update META.js

This commit is contained in:
xixu-me committed 2024-10-24 22:43:00 +08:00
1 parent cdb4aeac4a
commit 2e6d3f3fc9
1 file changed
+22 -22
+22 -22
View File
@@ -267,18 +267,18 @@ const proxyGroupDefaults = {
"max-failed-times": 5,
};
const locationPolicyProxyGroupDefaults = {
...proxyGroupDefaults,
proxies: ["REJECT"],
"include-all": true,
};
const serviceProxyGroupProxies = [
"PROXY",
"DIRECT",
...locations.map(({ name }) => name),
];
const locationPolicyProxyGroupDefaults = {
...proxyGroupDefaults,
proxies: ["REJECT"],
"include-all": true,
};
function generateServiceProxyGroups(items, defaultConfig) {
return items.map(({ name, icon }) => ({
...defaultConfig,
@@ -289,22 +289,6 @@ function generateServiceProxyGroups(items, defaultConfig) {
}));
}
function generateLocationSelectProxyGroups() {
return locations.map(({ name, icon }) => ({
...proxyGroupDefaults,
name,
type: "select",
icon,
proxies: [
`AUTO ${name.split(" ").pop()}`,
`FALLBACK ${name.split(" ").pop()}`,
`LOAD BALANCING (consistent hashing) ${name.split(" ").pop()}`,
`LOAD BALANCING (round-robin) ${name.split(" ").pop()}`,
`LOAD BALANCING (sticky sessions) ${name.split(" ").pop()}`,
],
}));
}
function generateLocationPolicyProxyGroups(
items,
defaultConfig,
@@ -348,6 +332,22 @@ function generateLocationPolicyProxyGroups(
});
}
function generateLocationSelectProxyGroups() {
return locations.map(({ name, icon }) => ({
...proxyGroupDefaults,
name,
type: "select",
icon,
proxies: [
`AUTO ${name.split(" ").pop()}`,
`FALLBACK ${name.split(" ").pop()}`,
`LOAD BALANCING (consistent hashing) ${name.split(" ").pop()}`,
`LOAD BALANCING (round-robin) ${name.split(" ").pop()}`,
`LOAD BALANCING (sticky sessions) ${name.split(" ").pop()}`,
],
}));
}
const proxyGroups = [
{
...proxyGroupDefaults,