- uploading fix

This commit is contained in:
Peter Papp
2021-02-25 15:22:16 +01:00
parent b8790a964b
commit 56b7f30d47
6 changed files with 133 additions and 112 deletions

View File

@@ -29,7 +29,7 @@
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=374911110bca4e1b3f91",
"/chunks/files.js": "/chunks/files.js?id=d47d2964ef535ad5754c",
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js?id=e285e842f58178d681c4",
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=637281f8b08d57c4fb47",
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=cad83f4858c7bd58947f",
"/chunks/files~chunks/shared-page.js": "/chunks/files~chunks/shared-page.js?id=539a5b88c5f32511449e",
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=f430110273d76b28906f",
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=94c75dac20c4ccf7bde0",
@@ -75,75 +75,68 @@
"/chunks/user-storage.js": "/chunks/user-storage.js?id=2c5f4cdd17574255ea05",
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=d6683735de17fd8c55c8",
"/chunks/users.js": "/chunks/users.js?id=f2359ae7c0c166001c33",
"/chunks/files~chunks/shared-files~chunks/shared-page.21596ac653625c53ad23.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.21596ac653625c53ad23.hot-update.js",
"/js/main.b07a2dc4ba5ddd6ae8df.hot-update.js": "/js/main.b07a2dc4ba5ddd6ae8df.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.2ffaaa3c673654bfb9e6.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.2ffaaa3c673654bfb9e6.hot-update.js",
"/js/main.eec03a5d344758619370.hot-update.js": "/js/main.eec03a5d344758619370.hot-update.js",
"/js/main.00e4e4612c7fac79ad93.hot-update.js": "/js/main.00e4e4612c7fac79ad93.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.2d01e46c2fe3686f802f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.2d01e46c2fe3686f802f.hot-update.js",
"/js/main.90ab9481b2b91597c075.hot-update.js": "/js/main.90ab9481b2b91597c075.hot-update.js",
"/js/main.389208e28bf4c09cdc54.hot-update.js": "/js/main.389208e28bf4c09cdc54.hot-update.js",
"/js/main.656865c343269700dabf.hot-update.js": "/js/main.656865c343269700dabf.hot-update.js",
"/js/main.d0e2cf07267ffad35cfc.hot-update.js": "/js/main.d0e2cf07267ffad35cfc.hot-update.js",
"/js/main.743a8cdaf7a7c66e4515.hot-update.js": "/js/main.743a8cdaf7a7c66e4515.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.743a8cdaf7a7c66e4515.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.743a8cdaf7a7c66e4515.hot-update.js",
"/js/main.b0f0ca037a7ab4718dc8.hot-update.js": "/js/main.b0f0ca037a7ab4718dc8.hot-update.js",
"/js/main.45a557c01f9ece5f582b.hot-update.js": "/js/main.45a557c01f9ece5f582b.hot-update.js",
"/js/main.8cc9b19f20a558a3e8fa.hot-update.js": "/js/main.8cc9b19f20a558a3e8fa.hot-update.js",
"/js/main.8e3cf4b773061ae97d39.hot-update.js": "/js/main.8e3cf4b773061ae97d39.hot-update.js",
"/js/main.f0a945ede041681263f1.hot-update.js": "/js/main.f0a945ede041681263f1.hot-update.js",
"/js/main.c71e7975be557973766f.hot-update.js": "/js/main.c71e7975be557973766f.hot-update.js",
"/js/main.33e6b8ab24ef49496ec3.hot-update.js": "/js/main.33e6b8ab24ef49496ec3.hot-update.js",
"/js/main.cf7e3825116f1410c2f9.hot-update.js": "/js/main.cf7e3825116f1410c2f9.hot-update.js",
"/js/main.a69a160913611ae57da4.hot-update.js": "/js/main.a69a160913611ae57da4.hot-update.js",
"/js/main.88776cf5e677d2ce3635.hot-update.js": "/js/main.88776cf5e677d2ce3635.hot-update.js",
"/js/main.b955b0416797a3380d54.hot-update.js": "/js/main.b955b0416797a3380d54.hot-update.js",
"/js/main.a921dfb8a755fd8a6e29.hot-update.js": "/js/main.a921dfb8a755fd8a6e29.hot-update.js",
"/js/main.5a050d90cb312b4c8da8.hot-update.js": "/js/main.5a050d90cb312b4c8da8.hot-update.js",
"/js/main.0bdf4fbb91e6f1b6d993.hot-update.js": "/js/main.0bdf4fbb91e6f1b6d993.hot-update.js",
"/js/main.5bd6c93294999209ff1a.hot-update.js": "/js/main.5bd6c93294999209ff1a.hot-update.js",
"/js/main.01020a080137378144eb.hot-update.js": "/js/main.01020a080137378144eb.hot-update.js",
"/js/main.32c6a8f4be08c83a6898.hot-update.js": "/js/main.32c6a8f4be08c83a6898.hot-update.js",
"/js/main.e10014a04e58db91d075.hot-update.js": "/js/main.e10014a04e58db91d075.hot-update.js",
"/js/main.d906aa3d53429ce1da68.hot-update.js": "/js/main.d906aa3d53429ce1da68.hot-update.js",
"/js/main.be1f5635fa922d840783.hot-update.js": "/js/main.be1f5635fa922d840783.hot-update.js",
"/js/main.7ecd64cf37a2d973bc2d.hot-update.js": "/js/main.7ecd64cf37a2d973bc2d.hot-update.js",
"/js/main.20c6196ab327f183d544.hot-update.js": "/js/main.20c6196ab327f183d544.hot-update.js",
"/js/main.6bf1577af8b37620d3bf.hot-update.js": "/js/main.6bf1577af8b37620d3bf.hot-update.js",
"/js/main.868a62150e5434f91084.hot-update.js": "/js/main.868a62150e5434f91084.hot-update.js",
"/js/main.38515a75ca60a50d4864.hot-update.js": "/js/main.38515a75ca60a50d4864.hot-update.js",
"/js/main.e9faffb8b27a21c21c14.hot-update.js": "/js/main.e9faffb8b27a21c21c14.hot-update.js",
"/js/main.718c5ddfc4ff946da3ec.hot-update.js": "/js/main.718c5ddfc4ff946da3ec.hot-update.js",
"/js/main.91a44d1c2a9dfc30b367.hot-update.js": "/js/main.91a44d1c2a9dfc30b367.hot-update.js",
"/js/main.572d7f72d55d5a392715.hot-update.js": "/js/main.572d7f72d55d5a392715.hot-update.js",
"/js/main.4e46642c3f70a59521a2.hot-update.js": "/js/main.4e46642c3f70a59521a2.hot-update.js",
"/js/main.73feba56670e33d591ec.hot-update.js": "/js/main.73feba56670e33d591ec.hot-update.js",
"/js/main.ea5ff9b1d47e701e950e.hot-update.js": "/js/main.ea5ff9b1d47e701e950e.hot-update.js",
"/js/main.b58a8058a2f70a3c600b.hot-update.js": "/js/main.b58a8058a2f70a3c600b.hot-update.js",
"/js/main.13c98b8676aff2108a98.hot-update.js": "/js/main.13c98b8676aff2108a98.hot-update.js",
"/js/main.5f712998cb16baa63f7d.hot-update.js": "/js/main.5f712998cb16baa63f7d.hot-update.js",
"/js/main.749397f6dbfa957d3973.hot-update.js": "/js/main.749397f6dbfa957d3973.hot-update.js",
"/js/main.2398919ed5d91b81ac38.hot-update.js": "/js/main.2398919ed5d91b81ac38.hot-update.js",
"/js/main.71bdefb2b0bff99b0e3c.hot-update.js": "/js/main.71bdefb2b0bff99b0e3c.hot-update.js",
"/js/main.bb658aab751f90185e1a.hot-update.js": "/js/main.bb658aab751f90185e1a.hot-update.js",
"/js/main.8cae8a32defa01a0bd60.hot-update.js": "/js/main.8cae8a32defa01a0bd60.hot-update.js",
"/js/main.41e8e59c014d804db68c.hot-update.js": "/js/main.41e8e59c014d804db68c.hot-update.js",
"/js/main.7af795837161a68e9043.hot-update.js": "/js/main.7af795837161a68e9043.hot-update.js",
"/js/main.37f9308a4a85156219ce.hot-update.js": "/js/main.37f9308a4a85156219ce.hot-update.js",
"/js/main.9c7bb5439fccd809a3b5.hot-update.js": "/js/main.9c7bb5439fccd809a3b5.hot-update.js",
"/js/main.3b165bd752e10b3b4b8e.hot-update.js": "/js/main.3b165bd752e10b3b4b8e.hot-update.js",
"/js/main.047ed8cdb917cd0b23ed.hot-update.js": "/js/main.047ed8cdb917cd0b23ed.hot-update.js",
"/js/main.55e954110735add5f219.hot-update.js": "/js/main.55e954110735add5f219.hot-update.js",
"/js/main.bf69279f4bf272330a16.hot-update.js": "/js/main.bf69279f4bf272330a16.hot-update.js",
"/js/main.16e511166c5cf92869c3.hot-update.js": "/js/main.16e511166c5cf92869c3.hot-update.js",
"/js/main.1d44b164f0f366a0a67f.hot-update.js": "/js/main.1d44b164f0f366a0a67f.hot-update.js",
"/js/main.f01ea7ae675174c853a0.hot-update.js": "/js/main.f01ea7ae675174c853a0.hot-update.js",
"/js/main.19c67bb1e23b39f3e54a.hot-update.js": "/js/main.19c67bb1e23b39f3e54a.hot-update.js",
"/js/main.9cf915d8ec759a0dcbef.hot-update.js": "/js/main.9cf915d8ec759a0dcbef.hot-update.js",
"/js/main.d0d8d502b461a8771390.hot-update.js": "/js/main.d0d8d502b461a8771390.hot-update.js",
"/js/main.6ee30daeb1dced66463c.hot-update.js": "/js/main.6ee30daeb1dced66463c.hot-update.js",
"/js/main.3814b33b0e21c17cc0ff.hot-update.js": "/js/main.3814b33b0e21c17cc0ff.hot-update.js",
"/js/main.a7218b5f56bf8cd75f83.hot-update.js": "/js/main.a7218b5f56bf8cd75f83.hot-update.js",
"/js/main.e159d14089070a0412e1.hot-update.js": "/js/main.e159d14089070a0412e1.hot-update.js",
"/js/main.7705eb891272f8dbb31e.hot-update.js": "/js/main.7705eb891272f8dbb31e.hot-update.js"
"/chunks/files~chunks/shared-files~chunks/shared-page.0458929e5f56e46ba6bc.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.0458929e5f56e46ba6bc.hot-update.js",
"/js/main.0ab3c15907f3ceb1f58a.hot-update.js": "/js/main.0ab3c15907f3ceb1f58a.hot-update.js",
"/js/main.39fe4c147a896dd94f73.hot-update.js": "/js/main.39fe4c147a896dd94f73.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.39fe4c147a896dd94f73.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.39fe4c147a896dd94f73.hot-update.js",
"/js/main.72d4b6097ba1aee7702f.hot-update.js": "/js/main.72d4b6097ba1aee7702f.hot-update.js",
"/js/main.8bc79cfa0e1b127c70b4.hot-update.js": "/js/main.8bc79cfa0e1b127c70b4.hot-update.js",
"/js/main.86e6e147e6815c6341f4.hot-update.js": "/js/main.86e6e147e6815c6341f4.hot-update.js",
"/js/main.9917c2781cf90a643c0c.hot-update.js": "/js/main.9917c2781cf90a643c0c.hot-update.js",
"/js/main.e54790c6be90d0da82ab.hot-update.js": "/js/main.e54790c6be90d0da82ab.hot-update.js",
"/js/main.177bef9fd128d7904d4c.hot-update.js": "/js/main.177bef9fd128d7904d4c.hot-update.js",
"/js/main.39f1391d6c7bc8753b61.hot-update.js": "/js/main.39f1391d6c7bc8753b61.hot-update.js",
"/js/main.a474d1267263c391f11c.hot-update.js": "/js/main.a474d1267263c391f11c.hot-update.js",
"/js/main.5992ebc1ccca9dcd2515.hot-update.js": "/js/main.5992ebc1ccca9dcd2515.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.765cb344c9206ad77d63.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.765cb344c9206ad77d63.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.45a69d24844455588132.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.45a69d24844455588132.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.8c6fec530e4d85facfe5.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.8c6fec530e4d85facfe5.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.09ed4dbda1926d9c9138.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.09ed4dbda1926d9c9138.hot-update.js",
"/js/main.c3d516fb34d55b243c46.hot-update.js": "/js/main.c3d516fb34d55b243c46.hot-update.js",
"/js/main.f73825d78cfa4c55560d.hot-update.js": "/js/main.f73825d78cfa4c55560d.hot-update.js",
"/js/main.4a894940580f6ef3f5a4.hot-update.js": "/js/main.4a894940580f6ef3f5a4.hot-update.js",
"/js/main.36a44250869248cb5d3d.hot-update.js": "/js/main.36a44250869248cb5d3d.hot-update.js",
"/js/main.016fc66db3fccf7ab02c.hot-update.js": "/js/main.016fc66db3fccf7ab02c.hot-update.js",
"/js/main.dc53484466da1bbba22a.hot-update.js": "/js/main.dc53484466da1bbba22a.hot-update.js",
"/js/main.033d0158ff270ada6285.hot-update.js": "/js/main.033d0158ff270ada6285.hot-update.js",
"/js/main.b26ebf37b5a249326821.hot-update.js": "/js/main.b26ebf37b5a249326821.hot-update.js",
"/js/main.5c8b7c0759a6283400d5.hot-update.js": "/js/main.5c8b7c0759a6283400d5.hot-update.js",
"/js/main.c561521c779c3840e531.hot-update.js": "/js/main.c561521c779c3840e531.hot-update.js",
"/js/main.495d35cbdc423d374217.hot-update.js": "/js/main.495d35cbdc423d374217.hot-update.js",
"/js/main.94e9fdd79f335631b7ba.hot-update.js": "/js/main.94e9fdd79f335631b7ba.hot-update.js",
"/js/main.073f7877a365b2467042.hot-update.js": "/js/main.073f7877a365b2467042.hot-update.js",
"/js/main.863d41cb0e0b4fd6e6db.hot-update.js": "/js/main.863d41cb0e0b4fd6e6db.hot-update.js",
"/js/main.352b732435806ada420c.hot-update.js": "/js/main.352b732435806ada420c.hot-update.js",
"/js/main.02ee25607333aa87f887.hot-update.js": "/js/main.02ee25607333aa87f887.hot-update.js",
"/js/main.a67208a338397c9d4368.hot-update.js": "/js/main.a67208a338397c9d4368.hot-update.js",
"/js/main.8287972a430a1adbe3a5.hot-update.js": "/js/main.8287972a430a1adbe3a5.hot-update.js",
"/js/main.05a4059d5b2a45fbb1c3.hot-update.js": "/js/main.05a4059d5b2a45fbb1c3.hot-update.js",
"/js/main.aded789163fc1c5828f0.hot-update.js": "/js/main.aded789163fc1c5828f0.hot-update.js",
"/js/main.e5b6fb32f9165760a2f4.hot-update.js": "/js/main.e5b6fb32f9165760a2f4.hot-update.js",
"/js/main.8c94a83163875565b848.hot-update.js": "/js/main.8c94a83163875565b848.hot-update.js",
"/js/main.92f276131542382e134a.hot-update.js": "/js/main.92f276131542382e134a.hot-update.js",
"/js/main.038f80423c64be7d20e7.hot-update.js": "/js/main.038f80423c64be7d20e7.hot-update.js",
"/js/main.4f61b2d165f54996a4c0.hot-update.js": "/js/main.4f61b2d165f54996a4c0.hot-update.js",
"/js/main.2eed9a33045dcfc21af5.hot-update.js": "/js/main.2eed9a33045dcfc21af5.hot-update.js",
"/js/main.9f2524a070f062f1ead0.hot-update.js": "/js/main.9f2524a070f062f1ead0.hot-update.js",
"/js/main.406fdbaba18e7a37ba45.hot-update.js": "/js/main.406fdbaba18e7a37ba45.hot-update.js",
"/js/main.f25d381b827756ef0e12.hot-update.js": "/js/main.f25d381b827756ef0e12.hot-update.js",
"/js/main.94ae6ca3738e05eefef6.hot-update.js": "/js/main.94ae6ca3738e05eefef6.hot-update.js",
"/js/main.7b6f30c359e5251ef6d0.hot-update.js": "/js/main.7b6f30c359e5251ef6d0.hot-update.js",
"/js/main.3b168005fcda150e8be6.hot-update.js": "/js/main.3b168005fcda150e8be6.hot-update.js",
"/js/main.5056cf0f408a65bf5886.hot-update.js": "/js/main.5056cf0f408a65bf5886.hot-update.js",
"/js/main.52a5ba1b2eeec4590524.hot-update.js": "/js/main.52a5ba1b2eeec4590524.hot-update.js",
"/js/main.6267aee84a2872e91ef4.hot-update.js": "/js/main.6267aee84a2872e91ef4.hot-update.js",
"/js/main.b084c53c51bec69abeb6.hot-update.js": "/js/main.b084c53c51bec69abeb6.hot-update.js",
"/js/main.623f75384a87ac3e3a52.hot-update.js": "/js/main.623f75384a87ac3e3a52.hot-update.js",
"/js/main.c313645e367745eeaf57.hot-update.js": "/js/main.c313645e367745eeaf57.hot-update.js",
"/js/main.cedeaa5b3e87a48f176b.hot-update.js": "/js/main.cedeaa5b3e87a48f176b.hot-update.js",
"/js/main.6d3c1b7afb75eb61811a.hot-update.js": "/js/main.6d3c1b7afb75eb61811a.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.6d3c1b7afb75eb61811a.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.6d3c1b7afb75eb61811a.hot-update.js",
"/js/main.d62a09962ca82ce76f5d.hot-update.js": "/js/main.d62a09962ca82ce76f5d.hot-update.js",
"/js/main.349517a0be904b874323.hot-update.js": "/js/main.349517a0be904b874323.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.165d58c3d6ad8e7f90b9.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.165d58c3d6ad8e7f90b9.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.3f69a06a9ff09361e597.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.3f69a06a9ff09361e597.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.9952a80137ce68c50024.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.9952a80137ce68c50024.hot-update.js",
"/js/main.6693b3a582b9a2696b9f.hot-update.js": "/js/main.6693b3a582b9a2696b9f.hot-update.js"
}

View File

@@ -110,7 +110,7 @@ export default {
},
computed: {
...mapGetters([
'isLogged', 'isGuest', 'config', 'filesQueue'
'isLogged', 'isGuest', 'config', 'fileQueue'
]),
isGuestLayout() {
return (includes([
@@ -139,11 +139,6 @@ export default {
)
}
},
watch: {
filesQueue() {
//this.$handleUploading()
}
},
data() {
return {
isScaledDown: false

View File

@@ -1,5 +1,5 @@
<template>
<div class="file-content" id="file-content-id" :class="{ 'is-offset': filesQueue > 0, 'is-dragging': isDragging }"
<div class="file-content" id="file-content-id" :class="{ 'is-offset': filesInQueueTotal > 0, 'is-dragging': isDragging }"
@dragover.prevent
@drop.stop.prevent="dropUpload($event)"
@dragover="dragEnter"
@@ -119,7 +119,7 @@
},
computed: {
...mapGetters([
'filesQueue',
'filesInQueueTotal',
'fileInfoVisible',
'fileInfoDetail',
'currentFolder',

View File

@@ -1,7 +1,6 @@
<template>
<transition name="info-panel">
<!--<div v-if="filesQueue.length > 0" class="upload-progress">-->
<div class="upload-progress">
<div v-if="fileQueue.length > 0" class="upload-progress">
<div class="progress-title">
<!--Is processing-->
@@ -10,14 +9,9 @@
{{ $t('uploading.processing_file') }}
</span>
<!--Single file upload-->
<span v-if="!isProcessingFile && filesQueue.length === 1">
{{ $t('uploading.progress_single_upload', {progress: uploadingProgress}) }}
</span>
<!--Multi file upload-->
<span v-if="!isProcessingFile && filesQueue.length > 1">
{{ $t('uploading.progress', {current:'x', total: filesQueue.length, progress: uploadingProgress}) }}
<span v-if="!isProcessingFile && fileQueue.length > 0">
{{ $t('uploading.progress', {current:filesInQueueUploaded, total: filesInQueueTotal, progress: uploadingProgress}) }}
</span>
</div>
<div class="progress-wrapper">
@@ -45,9 +39,11 @@
},
computed: {
...mapGetters([
'filesInQueueUploaded',
'filesInQueueTotal',
'uploadingProgress',
'isProcessingFile',
'filesQueue',
'fileQueue',
])
},
methods: {

View File

@@ -78,11 +78,24 @@ const Helpers = {
Vue.prototype.$uploadFiles = async function (files) {
if (files.length == 0) return
if (files.length == 0) return
if (!this.$checkFileMimetype(files) || !this.$checkUploadLimit(files)) return
this.$handleUploading(files, undefined)
// Push items to file queue
[...files].map(item => {
this.$store.commit('ADD_FILES_TO_QUEUE', {
parent_id: store.getters.currentFolder.unique_id,
file: item,
})
});
// Start uploading if uploading process isn't running
if (this.$store.getters.filesInQueueTotal == 0)
this.$handleUploading(store.getters.fileQueue[0])
// Increase total files in upload bar
this.$store.commit('INCREASE_FILES_IN_QUEUES_TOTAL', files.length)
}
Vue.prototype.$uploadExternalFiles = async function (event, parent_id) {
@@ -90,7 +103,7 @@ const Helpers = {
// Prevent submit empty files
if (event.dataTransfer.items.length === 0) return
// Push files to queue
// Push items to file queue
[...event.dataTransfer.items].map(item => {
this.$store.commit('ADD_FILES_TO_QUEUE', {
parent_id: parent_id,
@@ -98,17 +111,18 @@ const Helpers = {
})
});
if (! this.$store.getters.uploadingProgress > 0) {
this.$handleUploading(
this.$store.getters.filesQueue.shift()
)
}
// Start uploading if uploading process isn't running
if (this.$store.getters.filesInQueueTotal == 0)
this.$handleUploading(this.$store.getters.fileQueue[0])
// Increase total files in upload bar
this.$store.commit('INCREASE_FILES_IN_QUEUES_TOTAL', [...event.dataTransfer.items].length)
}
Vue.prototype.$handleUploading = async function (item) {
// Create ceil
let size = 128000000, // todo: chunksize doriesit
let size = store.getters.config.chunkSize,
chunksCeil = Math.ceil(item.file.size / size),
chunks = []

View File

@@ -8,7 +8,9 @@ import store from '../index'
const defaultState = {
processingPopup: undefined,
filesQueue: [],
fileQueue: [],
filesInQueueTotal: 0,
filesInQueueUploaded: 0,
isProcessingFile: false,
uploadingProgress: 0
@@ -199,6 +201,9 @@ const actions = {
commit('PROCESSING_FILE', false)
// Remove first file from file queue
commit('SHIFT_FROM_FILE_QUEUE')
// Check if user is in uploading folder, if yes, than show new file
if (response.data.folder_id == getters.currentFolder.unique_id) {
@@ -207,15 +212,20 @@ const actions = {
// Reset file progress
commit('UPLOADING_FILE_PROGRESS', 0)
// Increase count in files in queue uploaded for 1
commit('INCREASE_FILES_IN_QUEUE_UPLOADED')
}
// TODO: handle new uploads if exist
if (getters.filesQueue.length > 0) {
Vue.prototype.$handleUploading(getters.filesQueue[0])
commit('SHIFT_FILE_FROM_QUEUE')
// todo: doriesit uploading ffile statistiky na frontende
// Start uploading next file if file queue is not empty
if (getters.fileQueue.length) {
Vue.prototype.$handleUploading(getters.fileQueue[0])
}
// Reset upload process
if (! getters.fileQueue.length)
commit('CLEAR_UPLOAD_PROGRESS')
})
.catch(error => {
reject(error)
@@ -242,7 +252,7 @@ const actions = {
})
commit('PROCESSING_FILE', false)
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
commit('CLEAR_UPLOAD_PROGRESS')
})
// Cancel the upload request
@@ -251,7 +261,7 @@ const actions = {
// Hide upload progress bar
commit('PROCESSING_FILE', false)
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
commit('CLEAR_UPLOAD_PROGRESS')
})
})
},
@@ -392,24 +402,37 @@ const mutations = {
state.processingPopup = status
},
ADD_FILES_TO_QUEUE(state, file) {
state.filesQueue.push(file)
state.fileQueue.push(file)
},
SHIFT_FILE_FROM_QUEUE(state) {
state.filesQueue.shift()
SHIFT_FROM_FILE_QUEUE(state) {
state.fileQueue.shift()
},
PROCESSING_FILE(state, status) {
state.isProcessingFile = status
},
UPLOADING_FILE_PROGRESS(state, percentage) {
state.uploadingProgress = percentage
},
INCREASE_FILES_IN_QUEUES_TOTAL(state, count) {
state.filesInQueueTotal += count
},
INCREASE_FILES_IN_QUEUE_UPLOADED(state) {
state.filesInQueueUploaded++
},
CLEAR_UPLOAD_PROGRESS(state) {
state.filesInQueueUploaded = 0
state.filesInQueueTotal = 0
state.fileQueue = []
}
}
const getters = {
filesInQueueUploaded: state => state.filesInQueueUploaded,
filesInQueueTotal: state => state.filesInQueueTotal,
uploadingProgress: state => state.uploadingProgress,
isProcessingFile: state => state.isProcessingFile,
processingPopup: state => state.processingPopup,
filesQueue: state => state.filesQueue
fileQueue: state => state.fileQueue
}
export default {