feat: 小文件增加上传进度展示 (#3133)

Refs https://github.com/1Panel-dev/1Panel/issues/3030
This commit is contained in:
zhengkunwang 2023-12-01 17:00:10 +08:00 committed by GitHub
parent 246115837e
commit 4daed1a3de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,7 +174,13 @@ const submit = async () => {
} else {
formData.append('path', path.value);
}
await UploadFileData(formData, {});
await UploadFileData(formData, {
onUploadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
uploadPrecent.value = progress;
},
timeout: 40000,
});
success++;
uploaderFiles.value[i].status = 'success';
} else {