clean c advanced

This commit is contained in:
Julian Freeman
2026-03-01 19:38:31 -04:00
parent ebef785f9a
commit a170e2a4bd
3 changed files with 280 additions and 199 deletions

View File

@@ -24,6 +24,23 @@ async fn get_tree_children(path: String, state: State<'_, cleaner::DiskState>) -
Ok(cleaner::get_children(path, &state))
}
// --- 高级清理命令 ---
#[tauri::command]
async fn clean_system_components() -> Result<String, String> {
cleaner::run_dism_cleanup().await
}
#[tauri::command]
async fn clean_thumbnails() -> Result<String, String> {
cleaner::clean_thumbnails().await
}
#[tauri::command]
async fn disable_hibernation() -> Result<String, String> {
cleaner::disable_hibernation().await
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
@@ -36,7 +53,10 @@ pub fn run() {
start_fast_scan,
start_fast_clean,
start_full_disk_scan,
get_tree_children
get_tree_children,
clean_system_components,
clean_thumbnails,
disable_hibernation
])
.run(tauri::generate_context!())
.expect("error while running tauri application");