mirror of
https://github.com/kunkunsh/kunkun-ext-neohtop.git
synced 2025-04-04 09:46:43 +00:00
fixes #14 disk space mismatch
This commit is contained in:
parent
21c19dfa05
commit
332bafbf1d
@ -130,7 +130,7 @@
|
||||
<h2>Download for macOS</h2>
|
||||
<p class="download-subtitle">Choose the version that matches your Mac</p>
|
||||
<div class="download-options">
|
||||
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.3/NeoHtop-intel.dmg"
|
||||
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.4/NeoHtop-intel.dmg"
|
||||
class="download-button intel">
|
||||
<span class="icon">💻</span>
|
||||
<div class="button-text">
|
||||
@ -138,7 +138,7 @@
|
||||
<span class="secondary">For Intel-based Macs</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.3/NeoHtop-silicon.dmg"
|
||||
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.4/NeoHtop-silicon.dmg"
|
||||
class="download-button silicon">
|
||||
<span class="icon">🍎</span>
|
||||
<div class="button-text">
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "macos-task-manager",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -2009,7 +2009,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "macos-task-manager"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "macos-task-manager"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
@ -121,14 +121,19 @@ async fn get_processes(state: State<'_, AppState>) -> Result<(Vec<ProcessInfo>,
|
||||
|
||||
*last_update = (current_time, current_rx, current_tx);
|
||||
|
||||
// Calculate total disk usage
|
||||
let disk_stats = sys.disks().iter().fold((0, 0, 0), |acc, disk| {
|
||||
(
|
||||
acc.0 + disk.total_space(),
|
||||
acc.1 + disk.total_space() - disk.available_space(),
|
||||
acc.2 + disk.available_space()
|
||||
)
|
||||
});
|
||||
// Calculate total disk usage - only for physical disks
|
||||
let disk_stats = sys.disks().iter()
|
||||
.filter(|disk| {
|
||||
// Filter for physical disks - typically those mounted at "/"
|
||||
disk.mount_point() == std::path::Path::new("/")
|
||||
})
|
||||
.fold((0, 0, 0), |acc, disk| {
|
||||
(
|
||||
acc.0 + disk.total_space(),
|
||||
acc.1 + disk.total_space() - disk.available_space(),
|
||||
acc.2 + disk.available_space()
|
||||
)
|
||||
});
|
||||
|
||||
system_stats = SystemStats {
|
||||
cpu_usage: sys.cpus().iter().map(|cpu| cpu.cpu_usage()).collect(),
|
||||
|
@ -8,7 +8,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "NeoHtop",
|
||||
"version": "1.0.3"
|
||||
"version": "1.0.4"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user