-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
M-studen
committed
Feb 19, 2024
1 parent
a3e130d
commit aafaf22
Showing
19 changed files
with
311 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"list":[{"name":"阿里 IPv6 DNS (Alidns)","IP":"2400:3200::1","delay":"未测量"},{"name":"阿里 IPv6 DNS (Alidns)","IP":"2400:3200:baba::1","delay":"未测量"},{"name":"腾讯 DNSPod IPv6 DNS","IP":"2402:4e00::","delay":"未测量"},{"name":"百度 IPv6 DNS","IP":"2400:da00::6666","delay":"未测量"},{"name":"中国电信 IPv6 DNS","IP":"240e:4c:4008::1","delay":"未测量"},{"name":"中国电信 IPv6 DNS","IP":"240e:4c:4808::1","delay":"未测量"},{"name":"中国联通 IPv6 DNS","IP":"2408:8899::8","delay":"未测量"},{"name":"中国联通 IPv6 DNS","IP":"2408:8888::8","delay":"未测量"},{"name":"中国移动 IPv6 DNS","IP":"2409:8088::a","delay":"未测量"},{"name":"中国移动 IPv6 DNS","IP":"2409:8088::b","delay":"未测量"},{"name":"下一代互联网北京研究中心","IP":"240C::6666","delay":"未测量"},{"name":"下一代互联网北京研究中心","IP":"240C::6644","delay":"未测量"},{"name":"CNNIC IPv6 DNS 服务器","IP":"2001:dc7:1000::1","delay":"未测量"},{"name":"TWNIC IPv6 DNS Quad 101","IP":"2001:de4::101","delay":"未测量"},{"name":"TWNIC IPv6 DNS Quad 101","IP":"2001:de4::102","delay":"未测量"},{"name":"北京邮电大学 IPv6 DNS 服务器","IP":"2001:da8:202:10::36","delay":"未测量"},{"name":"北京邮电大学 IPv6 DNS 服务器","IP":"2001:da8:202:10::37","delay":"未测量"},{"name":"上海交通大学 IPv6 DNS 服务器","IP":"2001:da8:8000:1:202:120:2:100","delay":"未测量"},{"name":"上海交通大学 IPv6 DNS 服务器","IP":"2001:da8:8000:1:202:120:2:101","delay":"未测量"},{"IP":"中科院网络信息中心 IPv6 DNS 服务器","name":"2001:cc0:2fff:1::6666","delay":"未测量"},{"IP":"北京交通大学 IPv6 DNS 服务器","name":"2001:da8:205:2060::188","delay":"未测量"},{"IP":"清华大学 IPv6 DNS 服务器","name":"2001:da8:ff:305:20c:29ff:fe1f:a92a","delay":"未测量"},{"IP":"清华大学 TUNA 协会 IPv6 DNS 服务器","name":"2001:da8::666","delay":"未测量"},{"IP":"北京科技大学 IPv6 DNS 服务器","name":"2001:da8:208:10::6","delay":"未测量"},{"IP":"科技网 IPv6 DNS 服务器","name":"2001:cc0:2fff:2::6 ","delay":"未测量"},{"IP":"Google Public IPv6 DNS","name":"2001:4860:4860::8888","delay":"未测量"},{"IP":"Google Public IPv6 DNS","name":"2001:4860:4860::8844","delay":"未测量"},{"IP":"Cloudflare IPv6 DNS","name":"2606:4700:4700::1111","delay":"未测量"},{"IP":"Cloudflare IPv6 DNS","name":"2606:4700:4700::1001","delay":"未测量"},{"IP":"OpenDNS","name":"2620:0:ccc::2","delay":"未测量"},{"IP":"OpenDNS","name":"2620:0:ccd::2","delay":"未测量"},{"IP":"Quad9 IPv6 DNS","name":"2620:fe::fe","delay":"未测量"},{"IP":"Quad9 IPv6 DNS","name":"2620:fe::9","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(基础版)","name":"2620:74:1b::1:1","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(基础版)","name":"2620:74:1c::2:2","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(安全版)","name":"2610:a1:1018::2","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(安全版)","name":"2610:a1:1019::2","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(家庭版)","name":"2610:a1:1018::3","delay":"未测量"},{"IP":"Neustar UltraDNS IPv6(家庭版)","name":"2610:a1:1019::3","delay":"未测量"},{"IP":"DNS.SB","name":"2a09::","delay":"未测量"}]} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,46 @@ | ||
use tauri::command; | ||
use trust_dns_resolver::config::*; | ||
use trust_dns_resolver::Resolver; | ||
use trust_dns_resolver::lookup_ip::LookupIp; | ||
use trust_dns_resolver::Name; | ||
use std::str::FromStr; | ||
use serde::{Serialize, Deserialize}; | ||
use std::net::IpAddr; | ||
use tauri::InvokeError; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct DnsCheckResult { | ||
all_system_ips_not_in_public: bool, | ||
public_response: Vec<IpAddr>, | ||
system_response: Vec<IpAddr>, | ||
} | ||
|
||
type Result<T> = std::result::Result<T, InvokeError>; | ||
|
||
#[command] | ||
pub fn check_dns_pollution(domain: String) -> Result<bool, String> { | ||
pub fn check_dns_pollution(domain: String) -> Result<DnsCheckResult> { | ||
let public_resolver = Resolver::new(ResolverConfig::google(), ResolverOpts::default()) | ||
.map_err(|e| e.to_string())?; | ||
.map_err(|e| InvokeError::from(e.to_string()))?; | ||
let system_resolver = Resolver::from_system_conf() | ||
.map_err(|e| e.to_string())?; | ||
.map_err(|e| InvokeError::from(e.to_string()))?; | ||
|
||
let name = Name::from_str(&domain).map_err(|e| InvokeError::from(e.to_string()))?; | ||
|
||
let public_response: LookupIp = public_resolver.lookup_ip(name.clone()).map_err(|e| InvokeError::from(e.to_string()))?; | ||
let system_response: LookupIp = system_resolver.lookup_ip(name).map_err(|e| InvokeError::from(e.to_string()))?; | ||
|
||
let name = Name::from_str(&domain).map_err(|e| e.to_string())?; | ||
let public_response = public_resolver.lookup_ip(name.clone()).map_err(|e| e.to_string())?; | ||
let system_response = system_resolver.lookup_ip(name).map_err(|e| e.to_string())?; | ||
// 将LookupIp转换为Vec<IpAddr> | ||
let public_ips: Vec<IpAddr> = public_response.iter().map(|r| r).collect(); | ||
let system_ips: Vec<IpAddr> = system_response.iter().map(|r| r).collect(); | ||
|
||
// Check if all system resolver IPs are not in the public resolver IP list | ||
let all_system_ips_not_in_public = system_response.iter().all(|system_ip| { | ||
!public_response.iter().any(|public_ip| public_ip == system_ip) | ||
// 检查所有系统解析器的IP是否都不在公共解析器的IP列表中 | ||
let all_system_ips_not_in_public = system_ips.iter().all(|system_ip| { | ||
!public_ips.iter().any(|public_ip| public_ip == system_ip) | ||
}); | ||
|
||
Ok(all_system_ips_not_in_public) | ||
Ok(DnsCheckResult { | ||
all_system_ips_not_in_public, | ||
public_response: public_ips, | ||
system_response: system_ips, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,38 @@ | ||
|
||
<template> | ||
<n-layout has-sider> | ||
<n-layout-sider bordered > | ||
<NAffix :trigger-top="80" :top="0"> | ||
<n-layout has-sider> | ||
<n-layout-sider bordered> | ||
<NAffix :trigger-top="80" :top="0"> | ||
<Logo></Logo> | ||
<Menu></Menu> | ||
</NAffix> | ||
|
||
</NAffix> | ||
</n-layout-sider> | ||
<n-layout-content bordered > | ||
<div class="content" > | ||
<RouterView></RouterView> | ||
</div> | ||
<n-layout-content bordered> | ||
<div class="content"> | ||
<RouterView></RouterView> | ||
</div> | ||
</n-layout-content> | ||
</n-layout> | ||
|
||
</n-layout> | ||
</template> | ||
|
||
<script setup> | ||
import Menu from "@/components/menu/index.vue" | ||
import { NLayout,NLayoutContent,NLayoutSider,NAffix } from "naive-ui"; | ||
import Logo from "@/components/logo/index.vue" | ||
import Menu from "@/components/menu/index.vue"; | ||
import { NLayout, NLayoutContent, NLayoutSider, NAffix } from "naive-ui"; | ||
import Logo from "@/components/logo/index.vue"; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.n-menu{ | ||
.n-menu-item{ | ||
width: 10px; | ||
} | ||
.n-menu { | ||
.n-menu-item { | ||
width: 10px; | ||
} | ||
} | ||
.n-affix{ | ||
width: 270px; | ||
transition: top 10s; | ||
.n-affix { | ||
width: 270px; | ||
transition: top 10s; | ||
} | ||
.content{ | ||
margin-left: 2%; | ||
margin-right: 2%; | ||
margin-top: 2%; | ||
.content { | ||
margin-left: 2%; | ||
margin-right: 2%; | ||
margin-top: 2%; | ||
} | ||
</style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { defineStore } from 'pinia' | ||
|
||
export const usePulluteStore = defineStore('pullute', { | ||
state: () => ({ | ||
options:[{ | ||
type:"group", | ||
label:"蓝奏云", | ||
key:"蓝奏云", | ||
children:[ | ||
{label:"lanzoui.com",value:"lanzoui.com"}, | ||
{label:"lanzoul.com",value:"lanzoul.com"}, | ||
{label:"lanzoux.com",value:"lanzoux.com"}, | ||
{label:"lanzouw.com",value:"lanzouw.com"}, | ||
] | ||
}, | ||
{label:"推特",value:"twitter.com"}, | ||
{label:"谷歌",value:"google.com"}, | ||
{label:"Gmail",value:"gmail.com"}, | ||
{label:"FaceBook",value:"facebook.com"}, | ||
{label:"Instagram",value:"instagram.com"}, | ||
{label:"Netflix",value:"netflix.com"}, | ||
{ | ||
type:"group", | ||
label:"历史输入", | ||
value:"历史输入", | ||
children:[] | ||
} | ||
]}), | ||
persist:true, | ||
actions: { | ||
addHistoryInput(inputValue) { | ||
const isValueUnique = !this.options.some(option => { | ||
// 检查是否为 group 类型并搜索其 children | ||
if (option.type === 'group') { | ||
return option.children.some(child => child.value === inputValue); | ||
} | ||
// 不是 group 类型,直接比对 value | ||
return option.value === inputValue; | ||
}); | ||
|
||
if (isValueUnique) { | ||
const historyGroup = this.options.find(option => option.label === '历史输入'); | ||
if (historyGroup) { | ||
const newItem = { label: inputValue, value: inputValue }; | ||
historyGroup.children.push(newItem); | ||
} | ||
} | ||
} | ||
} | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.