diff --git a/package-lock.json b/package-lock.json index a3e3259..055237b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,9 @@ "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.6.0", - "@fortawesome/free-regular-svg-icons": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@tauri-apps/api": "^2.0.3", "@tauri-apps/plugin-shell": "^2", - "lucide-svelte": "^0.454.0", "svelte-fa": "^4.0.3" }, "devDependencies": { @@ -453,18 +451,6 @@ "node": ">=6" } }, - "node_modules/@fortawesome/free-regular-svg-icons": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz", - "integrity": "sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==", - "license": "(CC-BY-4.0 AND MIT)", - "dependencies": { - "@fortawesome/fontawesome-common-types": "6.6.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.6.0", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz", @@ -1333,15 +1319,6 @@ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "license": "MIT" }, - "node_modules/lucide-svelte": { - "version": "0.454.0", - "resolved": "https://registry.npmjs.org/lucide-svelte/-/lucide-svelte-0.454.0.tgz", - "integrity": "sha512-TgW17HI7M8LeFZ3NpaDp1LwPGBGMVjx/x81TtK+AacEQvmJcqetqeJNeBT18NMEJP9+zi/Wt+Zc8mo44K5Uszw==", - "license": "ISC", - "peerDependencies": { - "svelte": "^3 || ^4 || ^5.0.0-next.42" - } - }, "node_modules/magic-string": { "version": "0.30.12", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", diff --git a/package.json b/package.json index d518b89..e12c1a4 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,9 @@ "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.6.0", - "@fortawesome/free-regular-svg-icons": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@tauri-apps/api": "^2.0.3", "@tauri-apps/plugin-shell": "^2", - "lucide-svelte": "^0.454.0", "svelte-fa": "^4.0.3" }, "devDependencies": { diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 1b9b4d1..1c8a85d 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -105,50 +105,6 @@ async fn kill_process(pid: u32, state: State<'_, AppState>) -> Result) -> Result { - let sys = state.sys.lock().map_err(|_| "Failed to lock system state")?; - if let Some(_process) = sys.process(sysinfo::Pid::from(pid as usize)) { - #[cfg(target_os = "macos")] - { - use std::process::Command; - Command::new("kill") - .args(["-STOP", &pid.to_string()]) - .status() - .map_err(|e| e.to_string())?; - Ok(true) - } - #[cfg(not(target_os = "macos"))] - { - Ok(false) - } - } else { - Ok(false) - } -} - -#[tauri::command] -async fn process_continue(pid: u32, state: State<'_, AppState>) -> Result { - let sys = state.sys.lock().map_err(|_| "Failed to lock system state")?; - if let Some(_process) = sys.process(sysinfo::Pid::from(pid as usize)) { - #[cfg(target_os = "macos")] - { - use std::process::Command; - Command::new("kill") - .args(["-CONT", &pid.to_string()]) - .status() - .map_err(|e| e.to_string())?; - Ok(true) - } - #[cfg(not(target_os = "macos"))] - { - Ok(false) - } - } else { - Ok(false) - } -} - fn main() { tauri::Builder::default() .manage(AppState { @@ -157,9 +113,7 @@ fn main() { .invoke_handler(tauri::generate_handler![ get_processes, get_system_stats, - kill_process, - process_stop, - process_continue + kill_process ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/App.svelte b/src/App.svelte index edbd681..e69de29 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,1832 +0,0 @@ - - -{#if isLoading} -
-
-
- Loading processes... -
-
-{:else} - -
-
- {#if systemStats} -
-
-
CPU Usage
-
- {#each systemStats.cpu_usage as usage, i} -
- CPU {i} -
-
-
- {usage.toFixed(1)}% -
- {/each} -
-
- -
-
Memory
-
-
-
-
-
- {formatMemorySize(systemStats.memory_used)} / {formatMemorySize( - systemStats.memory_total, - )} - ({formatMemoryPercentage()}) -
-
-
- -
-
System Info
-
-
Uptime: {formatUptime(systemStats.uptime)}
-
- Load Avg: {systemStats.load_avg - .map((l) => l.toFixed(2)) - .join(", ")} -
-
-
-
- {/if} -
- -
-
- -
-
- - -
-
- - - {#if showColumnMenu} -
(showColumnMenu = false)} - > - {#each columns as column} - - {/each} -
- {/if} -
-
-
- - {#if error} -
{error}
- {/if} - -
- - - - {#each columns.filter((col) => col.visible) as column} - - {/each} - - - - - {#each paginatedProcesses as process (process.pid)} - 50 || - (process.memory_usage / systemStats?.memory_total || 0) > 0.1} - class:pinned={pinnedProcesses.has(process.pid)} - > - {#each columns.filter((col) => col.visible) as column} - - {/each} - - - {/each} - -
toggleSort(column.id)}> -
- {column.label} - - {getSortIndicator(column.id)} - -
-
Actions
- {#if column.format} - {@html column.format(process[column.id])} - {:else} - {process[column.id]} - {/if} - -
- - - -
-
-
-
-{/if} - -{#if showConfirmModal && processToKill} - -{/if} - -{#if showInfoModal && selectedProcess} - -{/if} - - diff --git a/src/lib/components/AppInfo.svelte b/src/lib/components/AppInfo.svelte index cd57f4e..21733e2 100644 --- a/src/lib/components/AppInfo.svelte +++ b/src/lib/components/AppInfo.svelte @@ -42,6 +42,7 @@ {#if showInfo} +
(showInfo = false)}>
{ASCII_ART}
@@ -162,28 +163,8 @@ color: var(--text); } - .link { - color: var(--blue); - text-decoration: none; - transition: color 0.2s ease; - } - - .link:hover { - color: var(--sky); - text-decoration: underline; - } - .detail-row span { color: var(--text); font-weight: 500; } - - a { - color: var(--blue); - text-decoration: none; - } - - a:hover { - text-decoration: underline; - } diff --git a/src/lib/components/KillProcessModal.svelte b/src/lib/components/KillProcessModal.svelte index 3ca0934..6ca601c 100644 --- a/src/lib/components/KillProcessModal.svelte +++ b/src/lib/components/KillProcessModal.svelte @@ -27,7 +27,7 @@