From 96ef72d300082038a36674e9ce4fc7cd3c9b1062 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Fri, 29 Aug 2025 01:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(initialization):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=BA=90=E9=80=89=E6=8B=A9=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=92=8C=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E7=AB=AF=E5=8F=A3=E4=B8=BA36163?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将镜像源按类型分组展示,增加官方源和推荐标签 - 实现按速度和推荐程度排序镜像源的功能 - 添加镜像源描述信息,提高用户体验 - 优化后端服务和 WebSocket 连接端口 --- frontend/electron/services/pythonService.ts | 4 +- .../components/initialization/BackendStep.vue | 140 +++++++--- .../initialization/DependenciesStep.vue | 138 ++++++++-- .../components/initialization/PythonStep.vue | 141 +++++++--- frontend/src/composables/useWebSocket.ts | 2 +- frontend/src/config/mirrors.ts | 245 +++++++++++++++--- frontend/src/views/Scheduler.vue | 2 +- 7 files changed, 538 insertions(+), 134 deletions(-) diff --git a/frontend/electron/services/pythonService.ts b/frontend/electron/services/pythonService.ts index 0dd8991..e700959 100644 --- a/frontend/electron/services/pythonService.ts +++ b/frontend/electron/services/pythonService.ts @@ -507,7 +507,7 @@ export async function startBackend(appRoot: string): Promise<{ success: boolean; console.log('Backend output:', output) // 检查是否包含启动成功的标志 - if (output.includes('Uvicorn running') || output.includes('8000')) { + if (output.includes('Uvicorn running') || output.includes('36163')) { clearTimeout(timeout) resolve() } @@ -519,7 +519,7 @@ export async function startBackend(appRoot: string): Promise<{ success: boolean; console.error('Backend error:', output) // 保留原有日志 // ✅ 在 stderr 中也检查启动标志 - if (output.includes('Uvicorn running') || output.includes('8000')) { + if (output.includes('Uvicorn running') || output.includes('36163')) { clearTimeout(timeout) resolve() } diff --git a/frontend/src/components/initialization/BackendStep.vue b/frontend/src/components/initialization/BackendStep.vue index 86aaf07..514fbea 100644 --- a/frontend/src/components/initialization/BackendStep.vue +++ b/frontend/src/components/initialization/BackendStep.vue @@ -4,24 +4,66 @@

{{ backendExists ? '更新最新的后端代码' : '获取后端源代码' }}

-
-
-
-

{{ mirror.name }}

-
- 未测试 - 测试中... - 超时 - {{ mirror.speed }}ms + +
+
+

镜像源

+ 推荐使用 +
+
+
+
+
+

{{ mirror.name }}

+ 推荐 +
+
+ 未测试 + 测试中... + 超时 + {{ mirror.speed }}ms +
+
{{ mirror.description }}
+
{{ mirror.url }}
+
+
+
+ + +
+
+

官方源

+ 中国大陆连通性不佳 +
+
+
+
+
+

{{ mirror.name }}

+
+
+ 未测试 + 测试中... + 超时 + {{ mirror.speed }}ms +
+
+
{{ mirror.description }}
+
{{ mirror.url }}
-
{{ mirror.url }}
@@ -36,25 +78,31 @@