fix: workaround to display download status in gcode-viewer

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2022-01-16 20:37:33 +01:00
parent 5307412484
commit 06bf0acdc3
No known key found for this signature in database
GPG Key ID: 5D3A5823133D2246

View File

@ -161,11 +161,20 @@
</template>
</v-snackbar>
<v-snackbar v-model="downloadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
<div>
{{ $t('GCodeViewer.Downloading') }} - {{ Math.round(downloadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(downloadSnackbar.speed)) }}/s<br />
<strong>{{ downloadSnackbar.filename }}</strong>
</div>
<v-progress-linear class="mt-2" :value="downloadSnackbar.percent"></v-progress-linear>
<template v-if="downloadSnackbar.total > 0">
<div>
{{ $t('GCodeViewer.Downloading') }} - {{ Math.round(downloadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(downloadSnackbar.speed)) }}/s<br />
<strong>{{ downloadSnackbar.filename }}</strong>
</div>
<v-progress-linear class="mt-2" :value="downloadSnackbar.percent"></v-progress-linear>
</template>
<template v-else>
<div>
{{ $t('GCodeViewer.Downloading') }}<br />
<strong>{{ downloadSnackbar.filename }}</strong>
</div>
<v-progress-linear class="mt-2" indeterminate></v-progress-linear>
</template>
<template v-slot:action="{ attrs }">
<v-btn color="red" text v-bind="attrs" @click="cancelDownload" style="min-width: auto;" >
<v-icon class="0">mdi-close</v-icon>