From 2e6d3f3fc9a844e54c1892a652fcdae77c29d415 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Thu, 24 Oct 2024 22:43:00 +0800 Subject: [PATCH] Update META.js --- META.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/META.js b/META.js index e7af529..a0a89af 100644 --- a/META.js +++ b/META.js @@ -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,