To align "Summary" of "Resources" in "Datacenter" of the PVE web ui, this adds "CPU(s)" as the unit of the total number of CPUs displayed above to the right of the CPU utilization bar. In addition, this makes the involved strings translatable.
Signed-off-by: Dominik Rusovac <[email protected]> --- changes since v1: * make strings translatable src/pages/page_dashboard.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/page_dashboard.rs b/src/pages/page_dashboard.rs index ac8e3e7..f33f182 100644 --- a/src/pages/page_dashboard.rs +++ b/src/pages/page_dashboard.rs @@ -125,8 +125,8 @@ impl PvePageDashboard { tiles.push( icon_list_tile(Fa::new("cpu"), tr!("CPU"), (), ()).with_child(list_tile_usage( - format!("{:.2}", cpu_proportion * 100.0), - maxcpu.to_string(), + tr!("{0}%", format!("{:.2}", cpu_proportion * 100.0)), + tr!("{0} CPU(s)", maxcpu.to_string()), cpu_proportion, )), ); -- 2.47.3
