mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-17 19:15:07 +00:00
fix #4521: api/tasks: replace upid as filename for task log downloads
previously the upid would just be used without a file extension when downloading a task log. this lead to rather strange filenames that appeared unfamiliar to users as the upid is not very prevalent in the gui. set a proper file name based on the node name, worker type and a time stamp instead. also add the ".log" file extension to indicate that these files contain logs. Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
This commit is contained in:
parent
e185407891
commit
7d2b0d6afd
@ -341,7 +341,12 @@ fn read_task_log(
|
||||
bail!("Parameter 'download' cannot be used with other parameters");
|
||||
}
|
||||
|
||||
let header_disp = format!("attachment; filename={}", &upid.to_string());
|
||||
let header_disp = format!(
|
||||
"attachment; filename=task-{}-{}-{}.log",
|
||||
upid.node,
|
||||
upid.worker_type,
|
||||
proxmox_time::epoch_to_rfc3339_utc(upid.starttime)?
|
||||
);
|
||||
let stream = AsyncReaderStream::new(tokio::fs::File::open(path).await?);
|
||||
|
||||
return Ok(Response::builder()
|
||||
|
Loading…
Reference in New Issue
Block a user