调整节点
This commit is contained in:
@@ -36,78 +36,69 @@ pub struct NodeSpeedTestResult {
|
||||
/// 获取所有 PackyCode 节点
|
||||
pub fn get_all_nodes() -> Vec<PackycodeNode> {
|
||||
vec![
|
||||
// 直连节点
|
||||
// 公交车节点 (Bus Service)
|
||||
PackycodeNode {
|
||||
name: "直连1".to_string(),
|
||||
name: "公交车默认节点".to_string(),
|
||||
url: "https://api.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "默认直连节点".to_string(),
|
||||
description: "默认公交车直连节点".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "直连2 (HK-CN2)".to_string(),
|
||||
name: "公交车 HK-CN2".to_string(),
|
||||
url: "https://api-hk-cn2.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "香港 CN2 线路".to_string(),
|
||||
description: "香港 CN2 线路(公交车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "直连3 (US-CMIN2)".to_string(),
|
||||
url: "https://api-us-cmin2.packycode.com".to_string(),
|
||||
name: "公交车 HK-G".to_string(),
|
||||
url: "https://api-hk-g.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "美国 CMIN2 线路".to_string(),
|
||||
description: "香港 G 线路(公交车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "直连4 (US-4837)".to_string(),
|
||||
url: "https://api-us-4837.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "美国 4837 线路".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
// 备用节点
|
||||
PackycodeNode {
|
||||
name: "备用1 (US-CN2)".to_string(),
|
||||
url: "https://api-us-cn2.packycode.com".to_string(),
|
||||
node_type: NodeType::Backup,
|
||||
description: "美国 CN2 备用线路".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "备用2 (CF-Pro)".to_string(),
|
||||
name: "公交车 CF-Pro".to_string(),
|
||||
url: "https://api-cf-pro.packycode.com".to_string(),
|
||||
node_type: NodeType::Backup,
|
||||
description: "CloudFlare Pro 备用线路".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "CloudFlare Pro 线路(公交车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
// 紧急节点
|
||||
// 滴滴车节点 (Taxi Service)
|
||||
PackycodeNode {
|
||||
name: "测试节点1".to_string(),
|
||||
url: "https://api-test.packyme.com".to_string(),
|
||||
node_type: NodeType::Emergency,
|
||||
description: "测试节点(非紧急情况勿用)".to_string(),
|
||||
name: "滴滴车默认节点".to_string(),
|
||||
url: "https://share-api.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "默认滴滴车直连节点".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "测试节点2".to_string(),
|
||||
url: "https://api-test-custom.packycode.com".to_string(),
|
||||
node_type: NodeType::Emergency,
|
||||
description: "自定义测试节点(非紧急情况勿用)".to_string(),
|
||||
name: "滴滴车 HK-CN2".to_string(),
|
||||
url: "https://share-api-hk-cn2.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "香港 CN2 线路(滴滴车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "测试节点3".to_string(),
|
||||
url: "https://api-tmp-test.dzz.ai".to_string(),
|
||||
node_type: NodeType::Emergency,
|
||||
description: "临时测试节点(非紧急情况勿用)".to_string(),
|
||||
name: "滴滴车 HK-G".to_string(),
|
||||
url: "https://share-api-hk-g.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "香港 G 线路(滴滴车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
PackycodeNode {
|
||||
name: "滴滴车 CF-Pro".to_string(),
|
||||
url: "https://share-api-cf-pro.packycode.com".to_string(),
|
||||
node_type: NodeType::Direct,
|
||||
description: "CloudFlare Pro 线路(滴滴车)".to_string(),
|
||||
response_time: None,
|
||||
available: None,
|
||||
},
|
||||
|
@@ -18,7 +18,7 @@
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost blob: data:; style-src 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-elem 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-attr 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://*.assets.i.posthog.com; worker-src 'self' blob: asset: https://asset.localhost; font-src 'self' data: blob: asset: https://asset.localhost; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://api.packycode.com https://api-hk-cn2.packycode.com https://api-us-cmin2.packycode.com https://api-us-4837.packycode.com https://api-us-cn2.packycode.com https://api-cf-pro.packycode.com https://share-api.packycode.com https://share-api-cf-pro.packycode.com https://share-api-hk-cn2.packycode.com",
|
||||
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost blob: data:; style-src 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-elem 'self' 'unsafe-inline' blob: data: asset: https://asset.localhost; style-src-attr 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://*.assets.i.posthog.com; worker-src 'self' blob: asset: https://asset.localhost; font-src 'self' data: blob: asset: https://asset.localhost; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost https://app.posthog.com https://*.posthog.com https://*.i.posthog.com https://api.packycode.com https://api-hk-cn2.packycode.com https://api-hk-g.packycode.com https://api-cf-pro.packycode.com https://share-api.packycode.com https://share-api-hk-cn2.packycode.com https://share-api-hk-g.packycode.com https://share-api-cf-pro.packycode.com",
|
||||
"assetProtocol": {
|
||||
"enable": true,
|
||||
"scope": [
|
||||
|
@@ -1140,12 +1140,10 @@ const CreateStationDialog: React.FC<{
|
||||
if (packycodeService === 'bus') {
|
||||
// 公交车自动选择
|
||||
const busNodes = [
|
||||
{ url: "https://api.packycode.com", name: "🚌 直连1(默认公交车)" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 直连2 (HK-CN2)" },
|
||||
{ url: "https://api-us-cmin2.packycode.com", name: "🇺🇸 直连3 (US-CMIN2)" },
|
||||
{ url: "https://api-us-4837.packycode.com", name: "🇺🇸 直连4 (US-4837)" },
|
||||
{ url: "https://api-us-cn2.packycode.com", name: "🔄 备用1 (US-CN2)" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 备用2 (CF-Pro)" }
|
||||
{ url: "https://api.packycode.com", name: "🚌 公交车默认节点" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 公交车 HK-CN2" },
|
||||
{ url: "https://api-hk-g.packycode.com", name: "🇭🇰 公交车 HK-G" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 公交车 CF-Pro" }
|
||||
];
|
||||
|
||||
await performSpeedTest(busNodes, (bestNode) => {
|
||||
@@ -1155,9 +1153,10 @@ const CreateStationDialog: React.FC<{
|
||||
} else if (packycodeService === 'taxi') {
|
||||
// 滴滴车自动选择
|
||||
const taxiNodes = [
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 直连1(默认滴滴车)" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 备用1 (CF-Pro)" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 备用2 (HK-CN2)" }
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 滴滴车默认节点" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 滴滴车 HK-CN2" },
|
||||
{ url: "https://share-api-hk-g.packycode.com", name: "🇭🇰 滴滴车 HK-G" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 滴滴车 CF-Pro" }
|
||||
];
|
||||
|
||||
await performSpeedTest(taxiNodes, (bestNode) => {
|
||||
@@ -1421,31 +1420,16 @@ const CreateStationDialog: React.FC<{
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="https://api.packycode.com">
|
||||
🚌 直连1(默认公交车)
|
||||
🚌 公交车默认节点
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-hk-cn2.packycode.com">
|
||||
🇭🇰 直连2 (HK-CN2)
|
||||
🇭🇰 公交车 HK-CN2
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-us-cmin2.packycode.com">
|
||||
🇺🇸 直连3 (US-CMIN2)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-us-4837.packycode.com">
|
||||
🇺🇸 直连4 (US-4837)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-us-cn2.packycode.com">
|
||||
🔄 备用1 (US-CN2)
|
||||
<SelectItem value="https://api-hk-g.packycode.com">
|
||||
🇭🇰 公交车 HK-G
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-cf-pro.packycode.com">
|
||||
☁️ 备用2 (CF-Pro)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-test.packyme.com" disabled>
|
||||
⚠️ 测试1(非紧急勿用)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-test-custom.packycode.com" disabled>
|
||||
⚠️ 测试2(非紧急勿用)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://api-tmp-test.dzz.ai" disabled>
|
||||
⚠️ 测试3(非紧急勿用)
|
||||
☁️ 公交车 CF-Pro
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
@@ -1455,12 +1439,10 @@ const CreateStationDialog: React.FC<{
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
const busNodes = [
|
||||
{ url: "https://api.packycode.com", name: "🚌 直连1(默认公交车)" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 直连2 (HK-CN2)" },
|
||||
{ url: "https://api-us-cmin2.packycode.com", name: "🇺🇸 直连3 (US-CMIN2)" },
|
||||
{ url: "https://api-us-4837.packycode.com", name: "🇺🇸 直连4 (US-4837)" },
|
||||
{ url: "https://api-us-cn2.packycode.com", name: "🔄 备用1 (US-CN2)" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 备用2 (CF-Pro)" }
|
||||
{ url: "https://api.packycode.com", name: "🚌 公交车默认节点" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 公交车 HK-CN2" },
|
||||
{ url: "https://api-hk-g.packycode.com", name: "🇭🇰 公交车 HK-G" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 公交车 CF-Pro" }
|
||||
];
|
||||
|
||||
await performSpeedTest(busNodes, (bestNode) => {
|
||||
@@ -1497,13 +1479,16 @@ const CreateStationDialog: React.FC<{
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="https://share-api.packycode.com">
|
||||
🚗 直连1(默认滴滴车)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-cf-pro.packycode.com">
|
||||
☁️ 备用1 (CF-Pro)
|
||||
🚗 滴滴车默认节点
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-hk-cn2.packycode.com">
|
||||
🇭🇰 备用2 (HK-CN2)
|
||||
🇭🇰 滴滴车 HK-CN2
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-hk-g.packycode.com">
|
||||
🇭🇰 滴滴车 HK-G
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-cf-pro.packycode.com">
|
||||
☁️ 滴滴车 CF-Pro
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
@@ -1513,9 +1498,10 @@ const CreateStationDialog: React.FC<{
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
const taxiNodes = [
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 直连1(默认滴滴车)" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 备用1 (CF-Pro)" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 备用2 (HK-CN2)" }
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 滴滴车默认节点" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 滴滴车 HK-CN2" },
|
||||
{ url: "https://share-api-hk-g.packycode.com", name: "🇭🇰 滴滴车 HK-G" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 滴滴车 CF-Pro" }
|
||||
];
|
||||
|
||||
await performSpeedTest(taxiNodes, (bestNode) => {
|
||||
@@ -1924,12 +1910,10 @@ const EditStationDialog: React.FC<{
|
||||
if (packycodeService === 'bus') {
|
||||
// 公交车自动选择
|
||||
const busNodes = [
|
||||
{ url: "https://api.packycode.com", name: "🚌 直连1(默认公交车)" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 直连2 (HK-CN2)" },
|
||||
{ url: "https://api-us-cmin2.packycode.com", name: "🇺🇸 直连3 (US-CMIN2)" },
|
||||
{ url: "https://api-us-4837.packycode.com", name: "🇺🇸 直连4 (US-4837)" },
|
||||
{ url: "https://api-us-cn2.packycode.com", name: "🔄 备用1 (US-CN2)" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 备用2 (CF-Pro)" }
|
||||
{ url: "https://api.packycode.com", name: "🚌 公交车默认节点" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 公交车 HK-CN2" },
|
||||
{ url: "https://api-hk-g.packycode.com", name: "🇭🇰 公交车 HK-G" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 公交车 CF-Pro" }
|
||||
];
|
||||
|
||||
await new Promise<void>((resolve) => {
|
||||
@@ -1991,9 +1975,10 @@ const EditStationDialog: React.FC<{
|
||||
} else if (packycodeService === 'taxi') {
|
||||
// 滴滴车自动选择
|
||||
const taxiNodes = [
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 直连1(默认滴滴车)" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 备用1 (CF-Pro)" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 备用2 (HK-CN2)" }
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 滴滴车默认节点" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 滴滴车 HK-CN2" },
|
||||
{ url: "https://share-api-hk-g.packycode.com", name: "🇭🇰 滴滴车 HK-G" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 滴滴车 CF-Pro" }
|
||||
];
|
||||
|
||||
await new Promise<void>((resolve) => {
|
||||
@@ -2335,12 +2320,10 @@ const EditStationDialog: React.FC<{
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
const busNodes = [
|
||||
{ url: "https://api.packycode.com", name: "🚌 直连1(默认公交车)" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 直连2 (HK-CN2)" },
|
||||
{ url: "https://api-us-cmin2.packycode.com", name: "🇺🇸 直连3 (US-CMIN2)" },
|
||||
{ url: "https://api-us-4837.packycode.com", name: "🇺🇸 直连4 (US-4837)" },
|
||||
{ url: "https://api-us-cn2.packycode.com", name: "🔄 备用1 (US-CN2)" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 备用2 (CF-Pro)" }
|
||||
{ url: "https://api.packycode.com", name: "🚌 公交车默认节点" },
|
||||
{ url: "https://api-hk-cn2.packycode.com", name: "🇭🇰 公交车 HK-CN2" },
|
||||
{ url: "https://api-hk-g.packycode.com", name: "🇭🇰 公交车 HK-G" },
|
||||
{ url: "https://api-cf-pro.packycode.com", name: "☁️ 公交车 CF-Pro" }
|
||||
];
|
||||
|
||||
await performSpeedTest(busNodes, (bestNode) => {
|
||||
@@ -2377,13 +2360,16 @@ const EditStationDialog: React.FC<{
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="https://share-api.packycode.com">
|
||||
🚗 直连1(默认滴滴车)
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-cf-pro.packycode.com">
|
||||
☁️ 备用1 (CF-Pro)
|
||||
🚗 滴滴车默认节点
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-hk-cn2.packycode.com">
|
||||
🇭🇰 备用2 (HK-CN2)
|
||||
🇭🇰 滴滴车 HK-CN2
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-hk-g.packycode.com">
|
||||
🇭🇰 滴滴车 HK-G
|
||||
</SelectItem>
|
||||
<SelectItem value="https://share-api-cf-pro.packycode.com">
|
||||
☁️ 滴滴车 CF-Pro
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
@@ -2393,9 +2379,10 @@ const EditStationDialog: React.FC<{
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
const taxiNodes = [
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 直连1(默认滴滴车)" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 备用1 (CF-Pro)" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 备用2 (HK-CN2)" }
|
||||
{ url: "https://share-api.packycode.com", name: "🚗 滴滴车默认节点" },
|
||||
{ url: "https://share-api-hk-cn2.packycode.com", name: "🇭🇰 滴滴车 HK-CN2" },
|
||||
{ url: "https://share-api-hk-g.packycode.com", name: "🇭🇰 滴滴车 HK-G" },
|
||||
{ url: "https://share-api-cf-pro.packycode.com", name: "☁️ 滴滴车 CF-Pro" }
|
||||
];
|
||||
|
||||
// 复制 performSpeedTest 逻辑,因为它在这个作用域中不可用
|
||||
|
Reference in New Issue
Block a user