diff --git a/src/client/components/uploader.vue b/src/client/components/uploader.vue index 14a4f845c..4ceb5e287 100644 --- a/src/client/components/uploader.vue +++ b/src/client/components/uploader.vue @@ -4,16 +4,16 @@
  • -

    {{ ctx.name }}

    +

    {{ ctx.name }}

    - {{ $t('waiting') }} - {{ String(Math.floor(ctx.progress.value / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }}KB / {{ String(Math.floor(ctx.progress.max / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }}KB - {{ Math.floor((ctx.progress.value / ctx.progress.max) * 100) }} + {{ $t('waiting') }} + {{ String(Math.floor(ctx.progressValue / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }}KB / {{ String(Math.floor(ctx.progressMax / 1024)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') }}KB + {{ Math.floor((ctx.progressValue / ctx.progressMax) * 100) }}

    - -
    -
    + +
    +
  • @@ -24,12 +24,14 @@ import Vue from 'vue'; import i18n from '../i18n'; import { apiUrl } from '../config'; //import getMD5 from '../../scripts/get-md5'; +import { faSpinner } from '@fortawesome/free-solid-svg-icons'; export default Vue.extend({ i18n, data() { return { - uploads: [] + uploads: [], + faSpinner }; }, methods: { @@ -56,7 +58,8 @@ export default Vue.extend({ const ctx = { id: id, name: name || file.name || 'untitled', - progress: undefined, + progressMax: undefined, + progressValue: undefined, img: window.URL.createObjectURL(file) }; @@ -84,9 +87,8 @@ export default Vue.extend({ xhr.upload.onprogress = e => { if (e.lengthComputable) { - if (ctx.progress == undefined) ctx.progress = {}; - ctx.progress.max = e.total; - ctx.progress.value = e.loaded; + ctx.progressMax = e.total; + ctx.progressValue = e.loaded; } };