Skip to content

Commit

Permalink
Merge pull request #231 from jason5ng32/dev
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
jason5ng32 authored Aug 8, 2024
2 parents 70ee698 + 364571c commit 4299044
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 83 deletions.
7 changes: 3 additions & 4 deletions frontend/components/ConnectivityTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="card jn-card keyboard-shortcut-card"
:class="{ 'dark-mode dark-mode-border': isDarkMode, 'jn-hover-card': !isMobile }">
<div class="card-body">
<p class="jn-con-title card-title"><i class="bi" :class="'bi-' + test.icon"></i> {{ test.name }}</p>
<p class="jn-con-title card-title" @click.prevent="checkConnectivityHandler(test, onTestComplete, true)" :title="t('connectivity.RefreshThisTest')"><i class="bi" :class="'bi-' + test.icon"></i> {{ test.name }}</p>
<p class="card-text" :class="{
'text-info': test.status === t('connectivity.StatusWait'),
'text-success': test.status.includes(t('connectivity.StatusAvailable')) && test.time < 200,
Expand Down Expand Up @@ -147,13 +147,13 @@ const connectivityTests = reactive([
]);
// 检查网络连通性
const checkConnectivityHandler = (test, onTestComplete, isManualRun) => {
const checkConnectivityHandler = (test, onTestComplete = () => {}, isManualRun) => {
const beginTime = +new Date();
manualRun.value = isManualRun;
let img = new Image();
let timeout = setTimeout(() => {
test.status = t('connectivity.StatusUnavailable');
onTestComplete(false);
onTestComplete(false);
}, 3 * 1200);
img.onload = () => {
Expand All @@ -172,7 +172,6 @@ const checkConnectivityHandler = (test, onTestComplete, isManualRun) => {
} else {
test.time = testTime;
}
onTestComplete(true);
};
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/WebRtcTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const stunServers = reactive([
natType: t('webrtc.StatusWait'),
},
{
id: "nextcloud",
name: "NextCloud (QUIC)",
url: "stun.nextcloud.com:443",
id: "blackberry",
name: "BlackBerry",
url: "stun.voip.blackberry.com:3478",
ip: t('webrtc.StatusWait'),
natType: t('webrtc.StatusWait'),
},
Expand Down
75 changes: 44 additions & 31 deletions frontend/components/advanced-tools/InvisibilityTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@
<i class="bi"
:class="(testResults.blocklist.proxy || testResults.blocklist.vpn) ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span
<td>
<span class="opacity-75"
v-if="(testResults.blocklist.proxy || testResults.blocklist.vpn)">{{
t('invisibilitytest.blocklist.proxy') }}</span>
<span v-else>{{ t('invisibilitytest.blocklist.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.blocklist.notProxy') }}</span>
</td>
</tr>

Expand All @@ -100,10 +101,11 @@
<i class="bi"
:class="testResults.headers.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.headers.proxy">{{
<td>
<span class="opacity-75" v-if="testResults.headers.proxy">{{
t('invisibilitytest.headers.proxy') }}</span>
<span v-else>{{ t('invisibilitytest.headers.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.headers.notProxy') }}</span>
</td>
</tr>

Expand All @@ -114,13 +116,14 @@
<i class="bi"
:class="(testResults.datacenter.proxy || testResults.datacenter.vpn) ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span
<td>
<span class="opacity-75"
v-if="(testResults.datacenter.proxy || testResults.datacenter.vpn)">
{{ t('invisibilitytest.datacenter.proxy') }}
<strong>{{ testResults.datacenter.hosting }}</strong>
</span>
<span v-else>{{ t('invisibilitytest.datacenter.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.datacenter.notProxy') }}</span>
</td>
</tr>

Expand All @@ -131,8 +134,8 @@
<i class="bi"
:class="testResults.tcp.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.tcp.proxy">
<td>
<span class="opacity-75" v-if="testResults.tcp.proxy">
{{ t('invisibilitytest.tcp.proxy') }}
<br />
{{ t('invisibilitytest.tcp.computer') }}
Expand All @@ -142,7 +145,8 @@
<strong>{{ testResults.tcp.ipos }}</strong>

</span>
<span v-else>{{ t('invisibilitytest.tcp.notProxy') }}</span>
<span class="opacity-75" v-else>{{ t('invisibilitytest.tcp.notProxy')
}}</span>
</td>
</tr>

Expand All @@ -153,16 +157,18 @@
<i class="bi"
:class="(testResults.timezone.proxy || testResults.timezone.vpn) ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="(testResults.timezone.proxy || testResults.timezone.vpn)">
<td>
<span class="opacity-75"
v-if="(testResults.timezone.proxy || testResults.timezone.vpn)">
{{ t('invisibilitytest.timezone.proxy') }}
<br />
{{ t('invisibilitytest.timezone.computer') }}
<strong>{{ testResults.timezone.clienttimezone }}</strong>.
{{ t('invisibilitytest.timezone.server') }}
<strong>{{ testResults.timezone.iptimezone }}</strong>
</span>
<span v-else>{{ t('invisibilitytest.timezone.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.timezone.notProxy') }}</span>
</td>
</tr>

Expand All @@ -173,10 +179,12 @@
<i class="bi"
:class="testResults.net.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.net.proxy">{{ t('invisibilitytest.net.proxy')
<td>
<span class="opacity-75" v-if="testResults.net.proxy">{{
t('invisibilitytest.net.proxy')
}}</span>
<span class="opacity-75" v-else>{{ t('invisibilitytest.net.notProxy')
}}</span>
<span v-else>{{ t('invisibilitytest.net.notProxy') }}</span>
</td>
</tr>

Expand All @@ -187,8 +195,8 @@
<i class="bi"
:class="testResults.webrtc.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.webrtc.proxy">
<td>
<span class="opacity-75" v-if="testResults.webrtc.proxy">
{{ t('invisibilitytest.webrtc.proxy') }}
<br />
{{ t('invisibilitytest.webrtc.ipsAre') }}
Expand All @@ -198,7 +206,8 @@
}}</strong>, </span>
<strong>{{ testResults.webrtc.ip }}</strong>
</span>
<span v-else>{{ t('invisibilitytest.webrtc.notProxy') }}</span>
<span class="opacity-75" v-else>{{ t('invisibilitytest.webrtc.notProxy')
}}</span>
</td>
</tr>

Expand All @@ -209,10 +218,12 @@
<i class="bi"
:class="testResults.flow.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.flow.proxy">{{ t('invisibilitytest.flow.proxy')
<td>
<span class="opacity-75" v-if="testResults.flow.proxy">{{
t('invisibilitytest.flow.proxy')
}}</span>
<span class="opacity-75" v-else>{{ t('invisibilitytest.flow.notProxy')
}}</span>
<span v-else>{{ t('invisibilitytest.flow.notProxy') }}</span>
</td>
</tr>

Expand All @@ -223,8 +234,8 @@
<i class="bi"
:class="testResults.latency.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.latency.proxy">
<td>
<span class="opacity-75" v-if="testResults.latency.proxy">
{{ t('invisibilitytest.latency.proxy') }}
<br />
{{ t('invisibilitytest.latency.fromTCP') }}
Expand All @@ -233,7 +244,8 @@
{{ t('invisibilitytest.latency.fromWS') }}
<strong>{{ testResults.latency.wsTime }}ms</strong>
</span>
<span v-else>{{ t('invisibilitytest.latency.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.latency.notProxy') }}</span>
</td>
</tr>

Expand All @@ -244,10 +256,11 @@
<i class="bi"
:class="testResults.highlatency.proxy ? 'bi-x-circle-fill text-danger' : 'bi-check-circle-fill text-success'"></i>
</td>
<td class="opacity-75">
<span v-if="testResults.highlatency.proxy">{{
<td>
<span class="opacity-75" v-if="testResults.highlatency.proxy">{{
t('invisibilitytest.highlatency.proxy') }}</span>
<span v-else>{{ t('invisibilitytest.highlatency.notProxy') }}</span>
<span class="opacity-75" v-else>{{
t('invisibilitytest.highlatency.notProxy') }}</span>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -338,7 +351,7 @@ const getResult = async () => {
if (data.message === "Data not found" && retryCount.value < 3) {
setTimeout(() => {
getResult();
}, 4000, retryCount.value++ );
}, 4000, retryCount.value++);
return;
}
testResults.value = data;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/advanced-tools/MacChecker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
{{ t('macchecker.country') }}
</span>
<span class="jn-con-title card-title mt-1">
{{ getCountryName(macCheckResult.country, lang) }}
<span
:class="'jn-fl fi fi-' + macCheckResult.country.toLowerCase()"></span>
{{ getCountryName(macCheckResult.country, lang) }}
</span>
</div>
<div class="jn-detail">
Expand Down
3 changes: 2 additions & 1 deletion frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@
"StatusUnavailable": "Unavailable",
"StatusTimeout": "Timeout or Unavailable",
"checking": "Checking...",
"minTestTime": "Min Test Time: "
"minTestTime": "Min Test Time: ",
"RefreshThisTest": "Refresh This Test"
},
"webrtc": {
"id": "webrtc",
Expand Down
3 changes: 2 additions & 1 deletion frontend/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@
"StatusUnavailable": "Non disponible",
"StatusTimeout": "Délai dépassé",
"checking": "Vérification en cours...",
"minTestTime": "Minimal: "
"minTestTime": "Minimal: ",
"RefreshThisTest": "Rafraîchir ce test"
},
"webrtc": {
"id": "webrtc",
Expand Down
3 changes: 2 additions & 1 deletion frontend/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@
"StatusUnavailable": "不可用",
"StatusTimeout": "超时或不可用",
"checking": "检查中...",
"minTestTime": "最小测试时间:"
"minTestTime": "最小测试时间:",
"RefreshThisTest": "刷新此测试"
},
"webrtc": {
"id": "webrtc",
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@
"dependencies": {
"@analytics/google-analytics": "^1.0.7",
"@cloudflare/speedtest": "^1.3.0",
"@khmyznikov/pwa-install": "^0.3.9",
"analytics": "^0.8.13",
"@khmyznikov/pwa-install": "^0.4.3",
"analytics": "^0.8.14",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"code-inspector-plugin": "^0.14.2",
"code-inspector-plugin": "^0.15.2",
"concurrently": "^8.2.2",
"country-code-lookup": "^0.1.3",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-rate-limit": "^7.3.1",
"express-rate-limit": "^7.4.0",
"express-slow-down": "^2.0.3",
"flag-icons": "^7.2.3",
"http-proxy-middleware": "^3.0.0",
"maxmind": "^4.3.20",
"maxmind": "^4.3.21",
"nodemon": "^3.1.4",
"pinia": "^2.1.7",
"svgmap": "^2.10.1",
"vue": "^3.4.31",
"pinia": "^2.2.1",
"svgmap": "^2.11.1",
"vue": "^3.4.36",
"vue-i18n": "^9.13.1",
"vue-router": "^4.4.0",
"whoiser": "^1.17.3"
"vue-router": "^4.4.3",
"whoiser": "^1.18.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"vite": "^5.3.3",
"vite-plugin-pwa": "^0.20.0"
"@vitejs/plugin-vue": "^5.1.2",
"vite": "^5.4.0",
"vite-plugin-pwa": "^0.20.1"
}
}
27 changes: 0 additions & 27 deletions vercel.json

This file was deleted.

Loading

0 comments on commit 4299044

Please sign in to comment.