pywebio / PyWebIO

Write interactive web app in script way.
https://pywebio.readthedocs.io
MIT License
4.53k stars 384 forks source link

使用put_file_upload时跳出的展示上传进度的toast中显示的百分比数字范围在0~1 #619

Closed LawrenceDon closed 11 months ago

LawrenceDon commented 11 months ago

代码位置: https://github.com/pywebio/PyWebIO/blob/65699d978d43b02fdce8a02879553e068a48f04a/webiojs/src/handlers/pin.ts#L77C1-L77C1 修改前: toast.toastElement.innerText = ⏳${t("file_uploading")} ${(loaded / total).toFixed(2)}%;

put_file_upload_01

建议修改为: toast.toastElement.innerText = ⏳${t("file_uploading")} ${((loaded / total)*100).toFixed(0)}%;

put_file_upload_02
wang0618 commented 11 months ago

感谢反馈,晚些会更新代码