From 12a3664654dc0eb4a81eff0b1ef901442788b2f1 Mon Sep 17 00:00:00 2001 From: GMrrc <143954951+GMrrc@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:32:58 +0100 Subject: [PATCH] remove zip transfert --- src/App.vue | 11 +++------ src/components/FileTable.vue | 43 +++++++++--------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/src/App.vue b/src/App.vue index 1d57de8..23d7849 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,12 +5,12 @@
- +
- +
@@ -40,11 +40,10 @@ export default { data() { console.log('feur') let zipUrl = document.getElementById('archiveInfos').getAttribute('dataarchiveurl'); - console.log(zipUrl); + console.log(zipUrl) return { zipUrl, sharedFile: null, - zip: null, dragEnded: false, }; }, @@ -52,12 +51,8 @@ export default { handleFileUpload(file) { this.sharedFile = file; }, - handleZipUpload(zip) { - this.zip = zip; - }, toggleDragEnded(){ this.dragEnded = !this.dragEnded; - this.zip = null; this.sharedFile = null; }, translate(id) { diff --git a/src/components/FileTable.vue b/src/components/FileTable.vue index c641f56..a1662ff 100644 --- a/src/components/FileTable.vue +++ b/src/components/FileTable.vue @@ -190,10 +190,6 @@ export default { type: Object, default: null, }, - zip: { - type: Object, - default: null, - }, dragEnded: { type: Boolean, Required: true, @@ -411,39 +407,20 @@ export default { try { this.isTransfering = true; const file = this.file; - const zip = this.zip; - console.log(file); - console.log(zip); - if (!file && !zip) return; - - if (zip) { - const response = await fetch(zip.url); - this.transferProgress = 25; - if (!response.ok) { - throw new Error(`Erreur lors du téléchargement : ${response.statusText}`); - } - const zipFile = await response.arrayBuffer(); - this.transferProgress = 50; - - await this.moveFileToTarget({ - name: zip.name, - content: zipFile - }, ''); - this.transferProgress = 100; + if (!file) return; + if (file.isDirectory) { + await this.moveFilesOfFolder(file, ''); } else { - if (file.isDirectory) { - await this.moveFilesOfFolder(file, ''); - } else { - this.transferProgress = 25; - if (file.content && typeof file.content.arrayBuffer === 'function') { - file.content = await file.content.arrayBuffer(); - } - this.transferProgress = 50; - await this.moveFileToTarget(file, ''); - this.transferProgress = 100; + this.transferProgress = 25; + if (file.content && typeof file.content.arrayBuffer === 'function') { + file.content = await file.content.arrayBuffer(); } + this.transferProgress = 50; + await this.moveFileToTarget(file, ''); + this.transferProgress = 100; } + this.isTransfering = false; this.transferProgress = 0; this.cancelOperation = false;