Add kB unit support for backup repository sizes
All checks were successful
Build and Release / build-and-release (push) Successful in 1m24s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m24s
Extended size formatting to handle repositories smaller than 1MB by displaying in kB units. Size display logic now cascades: kB for < 1MB, MB for 1MB-1GB, GB for >= 1GB.
This commit is contained in:
parent
b1719a60fc
commit
d1b0e2c431
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.268"
|
||||
version = "0.1.269"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.268"
|
||||
version = "0.1.269"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -554,8 +554,10 @@ impl SystemWidget {
|
||||
for (idx, repo) in self.backup_repositories.iter().enumerate() {
|
||||
let tree_char = if idx == repo_count - 1 { "└─" } else { "├─" };
|
||||
|
||||
// Format size: use MB for < 1GB, otherwise GB
|
||||
let size_display = if repo.repo_size_gb < 1.0 {
|
||||
// Format size: use kB for < 1MB, MB for < 1GB, otherwise GB
|
||||
let size_display = if repo.repo_size_gb < 0.001 {
|
||||
format!("{:.0}kB", repo.repo_size_gb * 1024.0 * 1024.0)
|
||||
} else if repo.repo_size_gb < 1.0 {
|
||||
format!("{:.0}MB", repo.repo_size_gb * 1024.0)
|
||||
} else {
|
||||
format!("{:.1}GB", repo.repo_size_gb)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.268"
|
||||
version = "0.1.269"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user