Skip to content

Commit

Permalink
fix: add chunks progress in download dialog (#940)
Browse files Browse the repository at this point in the history
fix dialog
  • Loading branch information
RiXelanya authored Jan 9, 2024
1 parent 9bfdcc7 commit 8c4148c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/common/components/Dialog/DownloadingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

v-card-text
.dialog-uploading__title Download in progress...
.dialog-uploading__title {{ chunks }} of {{ totalChunks }} chunks

.dialog-uploading__card-loading
SpinnerLoader(
Expand Down Expand Up @@ -35,7 +36,9 @@ export default {
},
props: {
show: Boolean
show: Boolean,
chunks: Number,
totalChunks: Number
}
}
</script>
Expand Down
14 changes: 11 additions & 3 deletions src/views/Dashboard/Customer/Home/MyTest/TestResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ v-container
)
DownloadingDialog(
:show="resultLoading"
:chunks="chunks"
:totalChunks="totalChunks"
)

</template>
Expand Down Expand Up @@ -149,7 +151,9 @@ export default {
resultLoading: false,
showModal: false,
showModalRating: false,
files: []
files: [],
chunks:0,
totalChunks:0
}),
computed: {
Expand Down Expand Up @@ -284,6 +288,7 @@ export default {
if (/^\[/.test(path)) {
const links = JSON.parse(path);
this.totalChunks = links.length
for (let i = 0; i < links.length; i++) {
const { rows } = await getIpfsMetaData(links[i].split("/").pop())
const { type, data } = await downloadFile(links[i], true)
Expand All @@ -292,9 +297,12 @@ export default {
fileType = type
if (i === 0) {
name = rows
}
}
this.chunks +=1 ;
}
await downloadDocumentFile(fileChunks, name[0].metadata.name, fileType, true)
await downloadDocumentFile(fileChunks, name[0].metadata.name, fileType, true);
this.chunks = 0;
}
else {
Expand Down

0 comments on commit 8c4148c

Please sign in to comment.