api2/admin/datastore/snapshos: show encrypted and size info per file

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-06-18 13:55:24 +02:00
committed by Dietmar Maurer
parent e181d2f6da
commit 1c090810f5
4 changed files with 47 additions and 28 deletions

View File

@ -445,7 +445,11 @@ async fn list_snapshots(param: Value) -> Result<Value, Error> {
let render_files = |_v: &Value, record: &Value| -> Result<String, Error> {
let item: SnapshotListItem = serde_json::from_value(record.to_owned())?;
Ok(tools::format::render_backup_file_list(&item.files))
let mut filenames = Vec::new();
for file in &item.files {
filenames.push(file.filename.to_string());
}
Ok(tools::format::render_backup_file_list(&filenames[..]))
};
let options = default_table_format_options()