chore: Optimize upload indicator display
This commit is contained in:
parent
be62f56782
commit
747b91d0ec
@ -8,13 +8,13 @@
|
|||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<h2>{{ $t("prompts.uploadFiles", { files: filesInUploadCount }) }}</h2>
|
<h2>{{ $t("prompts.uploadFiles", { files: filesInUploadCount }) }}</h2>
|
||||||
<div class="upload-info">
|
<div class="upload-info">
|
||||||
<div class="upload-speed">{{ uploadSpeed.toFixed(2) }} MB/s</div>
|
<div class="upload-speed">{{ getUploadSpeedText() }}</div>
|
||||||
<div class="upload-eta">{{ formattedETA }} remaining</div>
|
<div class="upload-eta">{{ getUploadEtaText() }}</div>
|
||||||
<div class="upload-percentage">
|
<div class="upload-percentage">
|
||||||
{{ getProgressDecimal }}% Completed
|
{{ getUploadPercentageText() }}
|
||||||
</div>
|
</div>
|
||||||
<div class="upload-fraction">
|
<div class="upload-fraction">
|
||||||
{{ getTotalProgressBytes }} / {{ getTotalSize }}
|
{{ getUploadFractionText() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@ -70,6 +70,8 @@ export default {
|
|||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
open: false,
|
open: false,
|
||||||
|
padMaxLen:19,
|
||||||
|
padChar:'\u00A0',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -105,6 +107,22 @@ export default {
|
|||||||
toggle: function () {
|
toggle: function () {
|
||||||
this.open = !this.open;
|
this.open = !this.open;
|
||||||
},
|
},
|
||||||
|
getUploadFractionText:function(){
|
||||||
|
let str = this.getTotalProgressBytes+'/'+this.getTotalSize
|
||||||
|
return str.padEnd(this.padMaxLen,this.padChar)
|
||||||
|
},
|
||||||
|
getUploadPercentageText:function(){
|
||||||
|
let str = this.getProgressDecimal +'% Completed'
|
||||||
|
return str.padEnd(this.padMaxLen,this.padChar)
|
||||||
|
},
|
||||||
|
getUploadEtaText:function(){
|
||||||
|
let str = this.formattedETA+ " remaining"
|
||||||
|
return str.padEnd(this.padMaxLen,this.padChar)
|
||||||
|
},
|
||||||
|
getUploadSpeedText:function(){
|
||||||
|
let str = this.uploadSpeed.toFixed(2)+ " MB/s"
|
||||||
|
return str.padEnd(this.padMaxLen,this.padChar)
|
||||||
|
},
|
||||||
abortAll() {
|
abortAll() {
|
||||||
if (confirm(this.$t("upload.abortUpload"))) {
|
if (confirm(this.$t("upload.abortUpload"))) {
|
||||||
abortAllUploads();
|
abortAllUploads();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user