feat: Display Upload Progress as Percentage and File Size / Total File Size (#3111)

This commit is contained in:
Alex Yong
2024-04-28 14:40:24 -04:00
committed by GitHub
parent e2d72706cc
commit 236ca637f9
2 changed files with 47 additions and 3 deletions

View File

@@ -10,6 +10,12 @@
<div class="upload-info">
<div class="upload-speed">{{ uploadSpeed.toFixed(2) }} MB/s</div>
<div class="upload-eta">{{ formattedETA }} remaining</div>
<div class="upload-percentage">
{{ getProgressDecimal }}% Completed
</div>
<div class="upload-fraction">
{{ getTotalProgressBytes }} / {{ getTotalSize }}
</div>
</div>
<button
class="action"
@@ -72,6 +78,10 @@ export default {
"filesInUploadCount",
"uploadSpeed",
"getETA",
"getProgress",
"getProgressDecimal",
"getTotalProgressBytes",
"getTotalSize",
]),
...mapWritableState(useFileStore, ["reload"]),
formattedETA() {
@@ -91,7 +101,7 @@ export default {
},
},
methods: {
...mapActions(useUploadStore, ["reset"]), // Mapping reset action from upload store
...mapActions(useUploadStore, ["reset"]), // Mapping reset action from upload store
toggle: function () {
this.open = !this.open;
},
@@ -100,8 +110,8 @@ export default {
abortAllUploads();
buttons.done("upload");
this.open = false;
this.reset(); // Resetting the upload store state
this.reload = true; // Trigger reload in the file store
this.reset(); // Resetting the upload store state
this.reload = true; // Trigger reload in the file store
}
},
},