From a699df0b1a1fcfe1beecb6d4febf266022bf83fe Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Mon, 30 Mar 2026 20:51:01 -0400 Subject: [PATCH] remove all software --- src-tauri/src/lib.rs | 8 +- src-tauri/src/winget.rs | 6 +- src/components/Sidebar.vue | 12 +-- src/router/index.ts | 4 - src/store/software.ts | 13 +-- src/views/AllSoftware.vue | 190 ------------------------------------- 6 files changed, 9 insertions(+), 224 deletions(-) delete mode 100644 src/views/AllSoftware.vue diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a5554e5..c1c0b4e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -8,7 +8,7 @@ use std::path::PathBuf; use tokio::sync::mpsc; use tauri::{AppHandle, Manager, State, Emitter}; use serde::{Serialize, Deserialize}; -use winget::{Software, list_all_software, list_updates, ensure_winget_dependencies}; +use winget::{Software, list_installed_software, list_updates, ensure_winget_dependencies}; use regex::Regex; #[derive(Clone, Serialize, Deserialize)] @@ -155,8 +155,8 @@ fn get_essentials(app: AppHandle) -> Option { } #[tauri::command] -async fn get_all_software(app: AppHandle) -> Vec { - tokio::task::spawn_blocking(move || list_all_software(&app)).await.unwrap_or_default() +async fn get_installed_software(app: AppHandle) -> Vec { + tokio::task::spawn_blocking(move || list_installed_software(&app)).await.unwrap_or_default() } #[tauri::command] @@ -308,7 +308,7 @@ pub fn run() { save_settings, sync_essentials, get_essentials, - get_all_software, + get_installed_software, get_updates, install_software, get_logs_history diff --git a/src-tauri/src/winget.rs b/src-tauri/src/winget.rs index dd793fe..db4731b 100644 --- a/src-tauri/src/winget.rs +++ b/src-tauri/src/winget.rs @@ -104,8 +104,8 @@ pub fn ensure_winget_dependencies(handle: &AppHandle) -> Result<(), String> { } } -pub fn list_all_software(handle: &AppHandle) -> Vec { - let log_id = format!("list-all-{}", chrono::Local::now().timestamp_millis()); +pub fn list_installed_software(handle: &AppHandle) -> Vec { + let log_id = format!("list-installed-{}", chrono::Local::now().timestamp_millis()); let script = r#" $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $ErrorActionPreference = 'SilentlyContinue' @@ -125,7 +125,7 @@ pub fn list_all_software(handle: &AppHandle) -> Vec { } "#; - execute_powershell(handle, &log_id, "Fetch All Software", script) + execute_powershell(handle, &log_id, "Fetch Installed Software", script) } pub fn list_updates(handle: &AppHandle) -> Vec { diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 54a4440..f37e857 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -14,7 +14,7 @@ - + @@ -23,16 +23,6 @@ 软件更新 - - - - - - - - - 全部软件 -