Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Aug 9, 2024
1 parent 559fd97 commit e474311
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/components/IpInfos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ watch(() => userPreferences.value.ipGeoSource, (newVal, oldVal) => {
watch(IPArray, () => {
store.updateGlobalIpDataCards(IPArray.value);
store.updateAllIPs(IPArray.value);
});
onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/WebRtcTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ onMounted(() => {
});
watch(IPArray, () => {
store.updateGlobalIpDataCards(IPArray.value);
store.updateAllIPs(IPArray.value);
}, { deep: true });
defineExpose({
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/advanced-tools/GlobalLatencyTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const isDarkMode = computed(() => store.isDarkMode);
const isMobile = computed(() => store.isMobile);
const lang = computed(() => store.lang);
let allIPs = computed(() => {
const _allIPs = store.Global_ipDataCards;
const _allIPs = store.allIPs;
return _allIPs.filter(ip => ip && !ip.includes(' '));
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/advanced-tools/MtrTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const isDarkMode = computed(() => store.isDarkMode);
const isMobile = computed(() => store.isMobile);
const lang = computed(() => store.lang);
let allIPs = computed(() => {
const _allIPs = store.Global_ipDataCards;
const _allIPs = store.allIPs;
return _allIPs.filter(ip => ip && !ip.includes(' '));
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/advanced-tools/RuleTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ onMounted(() => {
});
watch(IPArray, () => {
store.updateGlobalIpDataCards(IPArray.value);
store.updateAllIPs(IPArray.value);
}, { deep: true });
</script>

Expand Down
8 changes: 4 additions & 4 deletions frontend/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const useMainStore = defineStore('main', {
isDarkMode: false,
isMobile: false,
shouldRefreshEveryThing: false,
Global_ipDataCards: [],
allIPs: [],
configs: {},
userPreferences: {},
alert: {
Expand Down Expand Up @@ -70,9 +70,9 @@ export const useMainStore = defineStore('main', {
this.alert = { alertToShow, alertStyle, alertMessage, alertTitle };
},
// 从不同的组件收集合并 IP 数据
updateGlobalIpDataCards(payload) {
const uniqueIPs = new Set([...this.Global_ipDataCards, ...payload]);
this.Global_ipDataCards = Array.from(uniqueIPs);
updateAllIPs(payload) {
const uniqueIPs = new Set([...this.allIPs, ...payload]);
this.allIPs = Array.from(uniqueIPs);
},
// 设置移动模式
setIsMobile(payload) {
Expand Down

0 comments on commit e474311

Please sign in to comment.