From 2ffbba321a2573f0bfc966b260d290d97a1321e7 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Thu, 12 Sep 2024 18:19:06 +0800 Subject: [PATCH 1/5] Improvements --- README.md | 7 ++-- README_FR.md | 6 ++- README_ZH.md | 7 ++-- frontend/components/IpInfos.vue | 42 ++++++++++----------- frontend/components/widgets/Preferences.vue | 2 +- frontend/utils/getips/index.js | 8 ++-- frontend/utils/getips/ipchecking4.js | 36 ++++++++++++++++++ frontend/utils/getips/ipchecking6.js | 36 ++++++++++++++++++ frontend/utils/getips/ipchecking64.js | 36 ++++++++++++++++++ 9 files changed, 146 insertions(+), 34 deletions(-) create mode 100644 frontend/utils/getips/ipchecking4.js create mode 100644 frontend/utils/getips/ipchecking6.js create mode 100644 frontend/utils/getips/ipchecking64.js diff --git a/README.md b/README.md index acce7e7c..cd98790c 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,10 @@ If you're using a proxy for internet access, consider adding this rule to your p ```ini # IP Testing -IP-CIDR,1.0.0.1/32,DIRECT,no-resolve -IP-CIDR6,2606:4700:4700::1111/128,DIRECT,no-resolve -DOMAIN-SUFFIX,ipify.org,Proxy +IP-CIDR,1.0.0.1/32,Proxy,no-resolve +IP-CIDR6,2606:4700:4700::1111/128,Proxy,no-resolve +DOMAIN,4.ipcheck.ing,DIRECT +DOMAIN,6.ipcheck.ing,DIRECT # Rule Testing DOMAIN,ptest-1.ipcheck.ing,Proxy1 DOMAIN,ptest-2.ipcheck.ing,Proxy2 diff --git a/README_FR.md b/README_FR.md index 8c85a775..add16303 100644 --- a/README_FR.md +++ b/README_FR.md @@ -146,8 +146,10 @@ Si vous utilisez un proxy pour accéder à Internet, envisagez d'ajouter cette r ```ini # Test d'adresse IP -IP-CIDR,1.0.0.1/32,DIRECT,no-resolve -IP-CIDR6,2606:4700:4700::1111/128,DIRECT,no-resolve +IP-CIDR,1.0.0.1/32,Proxy,no-resolve +IP-CIDR6,2606:4700:4700::1111/128,Proxy,no-resolve +DOMAIN,4.ipcheck.ing,DIRECT +DOMAIN,6.ipcheck.ing,DIRECT # Rule Testing DOMAIN,ptest-1.ipcheck.ing,Proxy1 DOMAIN,ptest-2.ipcheck.ing,Proxy2 diff --git a/README_ZH.md b/README_ZH.md index 771774ae..5821f68d 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -146,9 +146,10 @@ docker run -d -p 18966:18966 \ ```ini # IP Testing -IP-CIDR,1.0.0.1/32,DIRECT,no-resolve -IP-CIDR6,2606:4700:4700::1111/128,DIRECT,no-resolve -DOMAIN-SUFFIX,ipify.org,Proxy +IP-CIDR,1.0.0.1/32,Proxy,no-resolve +IP-CIDR6,2606:4700:4700::1111/128,Proxy,no-resolve +DOMAIN,4.ipcheck.ing,DIRECT +DOMAIN,6.ipcheck.ing,DIRECT # Rule Testing DOMAIN,ptest-1.ipcheck.ing,Proxy1 DOMAIN,ptest-2.ipcheck.ing,Proxy2 diff --git a/frontend/components/IpInfos.vue b/frontend/components/IpInfos.vue index d4075a95..8c177ab7 100644 --- a/frontend/components/IpInfos.vue +++ b/frontend/components/IpInfos.vue @@ -196,7 +196,7 @@ import { useI18n } from 'vue-i18n'; import { trackEvent } from '@/utils/use-analytics'; import { isValidIP } from '@/utils/valid-ip.js'; import { transformDataFromIPapi } from '@/utils/transform-ip-data.js'; -import { getIPFromIPIP, getIPFromUpai, getIPFromCloudflare_V4, getIPFromCloudflare_V6, getIPFromGCR, getIPFromIpify_V4, getIPFromIpify_V6 } from '@/utils/getips'; +import { getIPFromIPIP, getIPFromCloudflare_V4, getIPFromCloudflare_V6, getIPFromIPChecking64, getIPFromIPChecking4, getIPFromIPChecking6 } from '@/utils/getips'; const { t } = useI18n(); @@ -247,11 +247,6 @@ const ipDataCards = reactive([ id: "cnsource", source: "CN Source", }, - { - ...createDefaultCard(), - id: "special", - source: "Special", - }, { ...createDefaultCard(), id: "cloudflare_v4", @@ -264,13 +259,18 @@ const ipDataCards = reactive([ }, { ...createDefaultCard(), - id: "ipify_v4", - source: "IPify IPv4", + id: "ipchecking_v64", + source: "IPCheck.ing IPv6/4", }, { ...createDefaultCard(), - id: "ipify_v6", - source: "IPify IPv6", + id: "ipchecking_v4", + source: "IPCheck.ing IPv4", + }, + { + ...createDefaultCard(), + id: "ipchecking_v6", + source: "IPCheck.ing IPv6", }, ]); @@ -332,11 +332,11 @@ const trackFetchStatus = (status) => { const checkAllIPs = async () => { const ipFunctions = [ () => fetchIP(0, getIPFromIPIP), - () => fetchIP(1, configs.value.originalSite ? getIPFromGCR : getIPFromUpai), - () => fetchIP(2, getIPFromCloudflare_V4), - () => fetchIP(3, getIPFromCloudflare_V6), - () => fetchIP(4, getIPFromIpify_V4), - () => fetchIP(5, getIPFromIpify_V6), + () => fetchIP(1, getIPFromCloudflare_V4), + () => fetchIP(2, getIPFromCloudflare_V6), + () => fetchIP(3, getIPFromIPChecking64), + () => fetchIP(4, getIPFromIPChecking4), + () => fetchIP(5, getIPFromIPChecking6), ]; // 限制执行的函数数量为 ipCardsToShow 的长度 @@ -463,19 +463,19 @@ const refreshCard = (card, index) => { fetchIP(0, getIPFromIPIP); break; case 1: - fetchIP(1, configs.value.originalSite ? getIPFromGCR : getIPFromUpai); + fetchIP(1, getIPFromCloudflare_V4); break; case 2: - fetchIP(2, getIPFromCloudflare_V4); + fetchIP(2, getIPFromCloudflare_V6); break; case 3: - fetchIP(3, getIPFromCloudflare_V6); - break; + fetchIP(3, getIPFromIPChecking64); + break; case 4: - fetchIP(4, getIPFromIpify_V4); + fetchIP(4, getIPFromIPChecking4); break; case 5: - fetchIP(5, getIPFromIpify_V6); + fetchIP(5, getIPFromIPChecking6); break; default: console.error("Undefind Source:"); diff --git a/frontend/components/widgets/Preferences.vue b/frontend/components/widgets/Preferences.vue index cc885b80..d1707f53 100644 --- a/frontend/components/widgets/Preferences.vue +++ b/frontend/components/widgets/Preferences.vue @@ -44,7 +44,7 @@ {{ t('nav.preferences.ipSourcesToCheck') }}
-