Refactor Chinese Mainland location handling

Moved 'Chinese Mainland 🇨🇳' from a dedicated proxy group to the general locations array. Updated proxy group definitions to use the unified locations list, simplifying configuration and reducing redundancy.
This commit is contained in:
xixu-me committed 2025-11-21 20:11:56 +08:00
1 parent cdf537fb8a
commit dc0e041463
1 file changed
+8 -14
+8 -14
View File
@@ -49,6 +49,12 @@ const services = [
const LOCATION_ICON_SET_URL = "https://img.icons8.com/color/144/";
const locations = [
{
name: "Chinese Mainland 🇨🇳",
icon: `${LOCATION_ICON_SET_URL}china`,
filter:
"(?i)\u5927\u9646|\u4e2d\u56fd|\u7535\u4fe1|\u79fb\u52a8|\u8054\u901a|Mainland|China|CN|mainland|china|cn|🇨🇳",
},
{
name: "Argentina 🇦🇷",
icon: `${LOCATION_ICON_SET_URL}argentina`,
@@ -266,7 +272,6 @@ const serviceProxyGroupProxies = [
...staticProxyNames,
"AUTO",
"DIRECT",
"Chinese Mainland 🇨🇳",
...locations.map(({ name }) => name),
];
@@ -385,7 +390,6 @@ const proxyGroups = [
proxies: [
...staticProxyNames,
"AUTO",
"Chinese Mainland 🇨🇳",
...locations.map(({ name }) => name),
],
icon: `${BASE_ICON_SET_URL}Proxy.png`,
@@ -406,11 +410,11 @@ const proxyGroups = [
name: "Domestic",
type: "select",
proxies: [
"Chinese Mainland 🇨🇳",
"DIRECT",
...locations.map(({ name }) => name),
"PROXY",
...staticProxyNames,
"AUTO",
...locations.map(({ name }) => name),
],
icon: `${BASE_ICON_SET_URL}Domestic.png`,
},
@@ -428,16 +432,6 @@ const proxyGroups = [
proxies: ["REJECT", "DIRECT", ...staticProxyNames],
icon: `${BASE_ICON_SET_URL}Advertising.png`,
},
{
...locationPolicyProxyGroupDefaults,
name: "Chinese Mainland 🇨🇳",
type: "select",
icon: `${LOCATION_ICON_SET_URL}china`,
proxies: ["DIRECT"],
"include-all": true,
filter:
"(?i)\u5927\u9646|\u4e2d\u56fd|\u7535\u4fe1|\u79fb\u52a8|\u8054\u901a|Mainland|China|CN|mainland|china|cn|🇨🇳",
},
...generateLocationPolicyProxyGroups(
locations,
locationPolicyProxyGroupDefaults,