增加测速

This commit is contained in:
2025-08-08 21:03:01 +08:00
parent 18c5d72634
commit f5e326bde7
3 changed files with 132 additions and 29 deletions

View File

@@ -2349,12 +2349,11 @@ export const api = {
/**
* Tests all PackyCode nodes and returns speed test results
* @param token - API token for authentication
* @returns Promise resolving to array of node speed test results
*/
async testAllPackycodeNodes(token: string): Promise<NodeSpeedTestResult[]> {
async testAllPackycodeNodes(): Promise<NodeSpeedTestResult[]> {
try {
return await invoke<NodeSpeedTestResult[]>("test_all_packycode_nodes", { token });
return await invoke<NodeSpeedTestResult[]>("test_all_packycode_nodes");
} catch (error) {
console.error("Failed to test PackyCode nodes:", error);
throw error;
@@ -2363,12 +2362,11 @@ export const api = {
/**
* Automatically selects the best PackyCode node based on speed
* @param token - API token for authentication
* @returns Promise resolving to the best node
*/
async autoSelectBestNode(token: string): Promise<PackycodeNode> {
async autoSelectBestNode(): Promise<PackycodeNode> {
try {
return await invoke<PackycodeNode>("auto_select_best_node", { token });
return await invoke<PackycodeNode>("auto_select_best_node");
} catch (error) {
console.error("Failed to auto-select best node:", error);
throw error;