src/bin/proxmox-backup-client.rs - status: improve alignment

This commit is contained in:
Dietmar Maurer 2020-02-27 11:38:09 +01:00
parent be2425ff85
commit e23f586344
1 changed files with 3 additions and 2 deletions

View File

@ -1481,13 +1481,14 @@ async fn status(param: Value) -> Result<Value, Error> {
let total = record["total"].as_u64().unwrap();
let roundup = total/200;
let per = ((v+roundup)*100)/total;
Ok(format!("{} ({} %)", v, per))
let info = format!(" ({} %)", per);
Ok(format!("{} {:>8}", v, info))
};
let options = TableFormatOptions::new()
.noborder(false)
.noheader(true)
.column(ColumnConfig::new("total"))
.column(ColumnConfig::new("total").renderer(render_total_percentage))
.column(ColumnConfig::new("used").renderer(render_total_percentage))
.column(ColumnConfig::new("avail").renderer(render_total_percentage));