Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add chunks progress in download dialog #940

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix dialog
RiXelanya committed Jan 9, 2024
commit ab9423843b8ecc28f429f4a85fafbd7d18d36527
5 changes: 4 additions & 1 deletion src/common/components/Dialog/DownloadingDialog.vue
Original file line number Diff line number Diff line change
@@ -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(
@@ -35,7 +36,9 @@ export default {
},

props: {
show: Boolean
show: Boolean,
chunks: Number,
totalChunks: Number
}
}
</script>
14 changes: 11 additions & 3 deletions src/views/Dashboard/Customer/Home/MyTest/TestResult.vue
Original file line number Diff line number Diff line change
@@ -98,6 +98,8 @@ v-container
)
DownloadingDialog(
:show="resultLoading"
:chunks="chunks"
:totalChunks="totalChunks"
)

</template>
@@ -149,7 +151,9 @@ export default {
resultLoading: false,
showModal: false,
showModalRating: false,
files: []
files: [],
chunks:0,
totalChunks:0
}),

computed: {
@@ -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)
@@ -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 {
Loading