From 5864d3400fed490713dbe5a997155fe09f47941c Mon Sep 17 00:00:00 2001
From: jason5ng32
Date: Mon, 14 Oct 2024 16:54:53 +0800
Subject: [PATCH 1/3] Improvement
---
frontend/components/WebRtcTest.vue | 5 ++++-
frontend/utils/transform-ip-data.js | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/frontend/components/WebRtcTest.vue b/frontend/components/WebRtcTest.vue
index a311d690..a7ac7a5c 100644
--- a/frontend/components/WebRtcTest.vue
+++ b/frontend/components/WebRtcTest.vue
@@ -203,7 +203,10 @@ const fetchCountryCode = async (ip) => {
if (ipData) {
let country_code = ipData.country_code.toLowerCase();
- let country = getCountryName(ipData.country_code, lang.value);
+ let country = ipData.country_code || 'N/A';
+ if (country !== 'N/A') {
+ country = getCountryName(ipData.country_code, lang.value);
+ }
return [country_code, country];
}
} catch (error) {
diff --git a/frontend/utils/transform-ip-data.js b/frontend/utils/transform-ip-data.js
index fbf7e4db..9b507201 100644
--- a/frontend/utils/transform-ip-data.js
+++ b/frontend/utils/transform-ip-data.js
@@ -6,7 +6,7 @@ function transformDataFromIPapi(data, ipGeoSource, t, bingMapLanguage) {
const baseData = {
country_name: data.country_name || "",
- country_code: data.country || "",
+ country_code: data.country === 'N/A' ? '' : data.country,
region: data.region || "",
city: data.city || "",
latitude: data.latitude || "",
From 59d226cd45b5f05f7d0627eadbcb4657f1fd24d5 Mon Sep 17 00:00:00 2001
From: jason5ng32
Date: Wed, 23 Oct 2024 13:36:55 +0800
Subject: [PATCH 2/3] Improvement
---
frontend/components/advanced-tools/RuleTest.vue | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/frontend/components/advanced-tools/RuleTest.vue b/frontend/components/advanced-tools/RuleTest.vue
index ee739527..32074bae 100644
--- a/frontend/components/advanced-tools/RuleTest.vue
+++ b/frontend/components/advanced-tools/RuleTest.vue
@@ -29,13 +29,14 @@
{{ test.ip }}
{{ t('ruletest.Country') }}: {{ test.country }}
-
@@ -76,7 +77,7 @@ const lang = computed(() => store.lang);
const createDefaultCard = () => ({
name: t('ruletest.Name'),
ip: t('ruletest.StatusWait'),
- country_code: t('ruletest.StatusWait'),
+ country_code: '',
country: t('ruletest.StatusWait'),
});
@@ -109,7 +110,7 @@ const fetchTrace = async (id, url) => {
}
} catch (error) {
ruleTests.value[id].ip = t('ruletest.StatusError');
- ruleTests.value[id].country_code = t('ruletest.StatusError');
+ ruleTests.value[id].country_code = '';
ruleTests.value[id].country = t('ruletest.StatusError');
console.error("Error fetching Data:", error);
}
@@ -121,7 +122,8 @@ const checkAllRuleTest = async (refresh = false) => {
if (refresh) {
ruleTests.value.forEach((test) => {
test.ip = t('ruletest.StatusWait');
- test.country_code = t('ruletest.StatusWait');
+ test.country = t('ruletest.StatusWait');
+ test.country_code = '';
});
}
From c1de9cd167752cfce46b2def165e69826ee7fb48 Mon Sep 17 00:00:00 2001
From: jason5ng32
Date: Wed, 23 Oct 2024 13:38:55 +0800
Subject: [PATCH 3/3] Improvements
---
package.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index d1f63e51..56d54ae4 100644
--- a/package.json
+++ b/package.json
@@ -14,17 +14,17 @@
"dependencies": {
"@analytics/google-analytics": "^1.0.7",
"@cloudflare/speedtest": "^1.3.0",
- "@khmyznikov/pwa-install": "^0.4.5",
+ "@khmyznikov/pwa-install": "^0.4.8",
"@thumbmarkjs/thumbmarkjs": "^0.16.0",
"analytics": "^0.8.14",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
- "code-inspector-plugin": "^0.16.1",
+ "code-inspector-plugin": "^0.17.3",
"concurrently": "^9.0.1",
"country-code-lookup": "^0.1.3",
- "detect-gpu": "^5.0.51",
+ "detect-gpu": "^5.0.53",
"dotenv": "^16.4.5",
- "express": "^4.21.0",
+ "express": "^4.21.1",
"express-rate-limit": "^7.4.1",
"express-slow-down": "^2.0.3",
"flag-icons": "^7.2.3",
@@ -34,14 +34,14 @@
"pinia": "^2.2.4",
"svgmap": "^2.11.1",
"ua-parser-js": "^1.0.39",
- "vue": "^3.5.11",
+ "vue": "^3.5.12",
"vue-i18n": "^10.0.4",
"vue-router": "^4.4.5",
"whoiser": "^1.18.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
- "vite": "^5.4.8",
+ "vite": "^5.4.10",
"vite-plugin-pwa": "^0.20.5"
}
}