minimize log
This commit is contained in:
@@ -36,7 +36,6 @@ pub fn emit_log(handle: &AppHandle, id: &str, command: &str, output: &str, statu
|
||||
|
||||
#[tauri::command]
|
||||
async fn initialize_app(app: AppHandle) -> Result<bool, String> {
|
||||
// 统一由前端触发环境初始化
|
||||
tokio::task::spawn_blocking(move || {
|
||||
ensure_winget_dependencies(&app).map(|_| true)
|
||||
}).await.unwrap_or(Err("Initialization Task Panicked".to_string()))
|
||||
@@ -116,9 +115,6 @@ pub fn run() {
|
||||
let (tx, mut rx) = mpsc::channel::<String>(100);
|
||||
app.manage(AppState { install_tx: tx });
|
||||
|
||||
// 移除了 setup 钩子中的 redundancy initialize_app 调用
|
||||
|
||||
// 安装队列处理器
|
||||
tauri::async_runtime::spawn(async move {
|
||||
let perc_re = Regex::new(r"(\d+)\s*%").unwrap();
|
||||
let size_re = Regex::new(r"([\d\.]+)\s*[a-zA-Z]+\s*/\s*([\d\.]+)\s*[a-zA-Z]+").unwrap();
|
||||
@@ -183,7 +179,8 @@ pub fn run() {
|
||||
}
|
||||
}
|
||||
|
||||
if !is_progress {
|
||||
// 净化日志:过滤进度行、单字符动画行以及退格符
|
||||
if !is_progress && clean_line.chars().count() > 1 {
|
||||
emit_log(&h, &log_id, "", clean_line, "info");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user