refactor: 统一将日志中的“Sidecar”替换为“Server”

- 将日志和错误信息中的“Sidecar”统一替换为“Server”,以更准确地反映实际启动的组件。
This commit is contained in:
2026-01-16 23:14:06 +08:00
parent 9aa894ec8b
commit 720f68f51f

View File

@@ -54,12 +54,12 @@ pub fn spawn_sidecar(app_handle: tauri::AppHandle) {
while let Some(event) = rx.recv().await {
if let CommandEvent::Stdout(line) = event {
let output = String::from_utf8_lossy(&line);
println!("Sidecar: {}", output);
println!("Server: {}", output);
// 检测服务器启动成功的标志
if output.contains("Listening on:") || output.contains("localhost") {
server_ready = true;
println!("✓ Sidecar 启动成功!");
println!("✓ Server 启动成功!");
// 创建主窗口
let url = format!("http://localhost:{}", port);
@@ -80,13 +80,13 @@ pub fn spawn_sidecar(app_handle: tauri::AppHandle) {
// 超时检查
if start_time.elapsed() > timeout {
eprintln!("✗ 启动超时Sidecar 未能在 5 秒内启动");
eprintln!("✗ 启动超时Server 未能在 5 秒内启动");
break;
}
}
if !server_ready {
eprintln!("✗ Sidecar 启动失败");
eprintln!("✗ Server 启动失败");
std::process::exit(1);
}
});