Skip to content

Commit

Permalink
add item.protocol to showNodeList
Browse files Browse the repository at this point in the history
  • Loading branch information
whalechoi committed Sep 27, 2024
1 parent 6fcce11 commit 5e36c03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
14 changes: 8 additions & 6 deletions src/Manage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
<van-cell-group style="top: 46px;">
<van-cell v-for="(item, index) in showNodeList" :key="index" center>
<template #title>
<span class="custom-title">{{ item.remarks }}</span><br/>
<span class="custom-title">{{ item.remarks }}</span>
</template>
<template #label>
<van-space fill>
<van-tag type="primary">{{ item.type }}</van-tag>
<van-tag type="primary">{{ item.protocol }}</van-tag>
<van-tag :color="item.color" v-show="item.show">{{ item.ping }}</van-tag>
</van-space>
<span class="custom-title">{{ item.host }}:{{ item.port }}</span>
Expand Down Expand Up @@ -261,7 +262,6 @@ function startSpeedtest() {
//后端真实ID:显示的ID
paramIds.push({ 'index': "" + sIndex, 'sIndex': index })
}
let color = '#646566';
if (nowTest.length === 0) {
allowSpeedtest = true;
return;
Expand All @@ -272,18 +272,20 @@ function startSpeedtest() {
return { ...result, ...value.result[obj] }
});
for (let result of mergedArr) {
let ping = '-1';
let ping = -1;
let item = showNodeList.value[result.sIndex];
item.speedtestLoading = false;
ping = result.realping;
if (ping > -1 && ping < 500) {
let color;
if (ping === -1) {
color = '#646566';
} else if (ping < 500) {
color = '#07c160'
} else if (ping < 1000) {
color = '#d4b75c'
} else if (ping < 2000) {
color = '#e67f3c'
} else if (ping > 3000) {
} else {
color = '#ee0a24'
}
item.ping = `${ping} ms`;
Expand Down
8 changes: 4 additions & 4 deletions src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const manage = {
'route-manage': 'Routing',
'more-setting': 'Settings',
'load-balancing': 'Balancer',
'speedtest': 'Speedtest',
'speedtest': 'Test',
'switch': 'Switch',
'remarks': 'Remarks',
'search': 'Querying',
'placeholder-text': 'Please enter an Remarks.',
'speedtest-fail': 'The speed measurement failed and an exception occurred.',
'speedtest-reject': 'Wait patiently until the speed measurement of other nodes is completed before continuing.',
'speedtest-all-warn': 'All nodes will be speed tested soon to prevent the airport from being blocked! Use with caution. Confirm to continue?',
'speedtest-fail': 'The test failed and an exception occurred.',
'speedtest-reject': 'Wait patiently until the test of other nodes is completed before continuing.',
'speedtest-all-warn': 'All nodes will be tested soon to prevent the airport from being blocked! Use with caution. Confirm to continue?',
}
export const setting = {
'xrayhelper': 'Config - XrayHelper',
Expand Down
8 changes: 4 additions & 4 deletions src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const manage = {
'route-manage': '路由规则',
'more-setting': '更多设置',
'load-balancing': '负载均衡',
'speedtest': '测速',
'speedtest': '测试',
'switch': '切换',
'remarks': '别名',
'search': '查询中',
'placeholder-text': '请输入别名',
'speedtest-fail': '测速失败,发生异常。',
'speedtest-reject': '耐心等待其他节点测速结束后再继续。',
'speedtest-all-warn': '即将测速所有节点,以防机场封号!谨慎使用,确认继续?',
'speedtest-fail': '测试失败,发生异常。',
'speedtest-reject': '耐心等待其他节点测试结束后再继续。',
'speedtest-all-warn': '即将测试所有节点,以防机场封号!谨慎使用,确认继续?',
}
export const setting = {
'xrayhelper': '配置项 - XrayHelper',
Expand Down

0 comments on commit 5e36c03

Please sign in to comment.