]> git.proxmox.com Git - proxmox-backup.git/commitdiff
proxmox-backup-manager traffic: render data human readable
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 22 Nov 2021 08:06:07 +0000 (09:06 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 22 Nov 2021 08:07:05 +0000 (09:07 +0100)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/bin/proxmox_backup_manager/traffic_control.rs

index 992e7bb2d761d791ae052b98ab2567d1f95917bd..83d3dfff5816573e30a6cf0f9025e0a003ec98dc 100644 (file)
@@ -5,6 +5,7 @@ use proxmox_router::{cli::*, ApiHandler, RpcEnvironment};
 use proxmox_schema::api;
 
 use pbs_api_types::TRAFFIC_CONTROL_ID_SCHEMA;
+use pbs_tools::format::render_bytes_human_readable;
 
 use proxmox_backup::api2;
 use proxmox_backup::client_helpers::connect_to_localhost;
@@ -101,8 +102,8 @@ async fn show_current_traffic(param: Value) -> Result<Value, Error> {
 
     let options = default_table_format_options()
         .column(ColumnConfig::new("name"))
-        .column(ColumnConfig::new("cur-rate-in"))
-        .column(ColumnConfig::new("cur-rate-out"));
+        .column(ColumnConfig::new("cur-rate-in").renderer(render_bytes_human_readable))
+        .column(ColumnConfig::new("cur-rate-out").renderer(render_bytes_human_readable));
 
     format_and_print_result_full(&mut data, &info.returns, &output_format, &options);