mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-30 23:44:41 +00:00
upload fix
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
"/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js": "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js?id=2d5163fd2869304720da",
|
"/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js": "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js?id=2d5163fd2869304720da",
|
||||||
"/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js": "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js?id=25a8f2ba10196cc72353",
|
"/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js": "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js?id=25a8f2ba10196cc72353",
|
||||||
"/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js": "/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js?id=d39c8f198b09bb094e80",
|
"/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js": "/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js?id=d39c8f198b09bb094e80",
|
||||||
"/chunks/files~chunks/shared/file-browser.js": "/chunks/files~chunks/shared/file-browser.js?id=5e4f31eae3364c4e9976",
|
"/chunks/files~chunks/shared/file-browser.js": "/chunks/files~chunks/shared/file-browser.js?id=063267aa542a652378d2",
|
||||||
"/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js": "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js?id=7a6b6c8b23774249d5b2",
|
"/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js": "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js?id=7a6b6c8b23774249d5b2",
|
||||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=877a9289b77ac3885042",
|
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=877a9289b77ac3885042",
|
||||||
"/chunks/homepage.js": "/chunks/homepage.js?id=48e0e9b3c870c46218ce",
|
"/chunks/homepage.js": "/chunks/homepage.js?id=48e0e9b3c870c46218ce",
|
||||||
@@ -261,5 +261,10 @@
|
|||||||
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js?id=57c854adb91ed9a9d088",
|
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js?id=57c854adb91ed9a9d088",
|
||||||
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js?id=170765b4fd923b62195c",
|
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js?id=170765b4fd923b62195c",
|
||||||
"/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/shared/single-file.js": "/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/shared/single-file.js?id=ca01bfe1656f58710763",
|
"/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/shared/single-file.js": "/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/shared/single-file.js?id=ca01bfe1656f58710763",
|
||||||
"/vendors~chunks/platform~chunks/shared.js": "/vendors~chunks/platform~chunks/shared.js?id=eb141834bc24b72d8e92"
|
"/vendors~chunks/platform~chunks/shared.js": "/vendors~chunks/platform~chunks/shared.js?id=eb141834bc24b72d8e92",
|
||||||
|
"/js/main.cbf5194e183ab420137f.hot-update.js": "/js/main.cbf5194e183ab420137f.hot-update.js",
|
||||||
|
"/js/main.6644cc84ea25fa63f61c.hot-update.js": "/js/main.6644cc84ea25fa63f61c.hot-update.js",
|
||||||
|
"/chunks/files~chunks/shared/file-browser.3943bb43c1513dc42d9b.hot-update.js": "/chunks/files~chunks/shared/file-browser.3943bb43c1513dc42d9b.hot-update.js",
|
||||||
|
"/js/main.c7d922233b7f5838e35d.hot-update.js": "/js/main.c7d922233b7f5838e35d.hot-update.js",
|
||||||
|
"/js/main.d49da45e4e3c518ef2bb.hot-update.js": "/js/main.d49da45e4e3c518ef2bb.hot-update.js"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,7 +319,7 @@
|
|||||||
color: $dark_mode_text_primary;
|
color: $dark_mode_text_primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-go-back {
|
.location {
|
||||||
.location-title {
|
.location-title {
|
||||||
color: $dark_mode_text_primary;
|
color: $dark_mode_text_primary;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+9
-2
@@ -206,9 +206,16 @@ const Helpers = {
|
|||||||
// Set Data
|
// Set Data
|
||||||
let formData = new FormData(),
|
let formData = new FormData(),
|
||||||
uploadedSize = 0,
|
uploadedSize = 0,
|
||||||
|
|
||||||
isNotGeneralError = true,
|
isNotGeneralError = true,
|
||||||
striped_name = item.file.name.replace(/[^A-Za-z 0-9 \.,\?""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/g, ''),
|
|
||||||
filename = Array(16).fill(0).map(x => Math.random().toString(36).charAt(2)).join('') + '-' + striped_name + '.part'
|
striped_name = item.file.name
|
||||||
|
.replace(/[^A-Za-z 0-9 \.,\?""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/g, ''),
|
||||||
|
|
||||||
|
filename = Array(16)
|
||||||
|
.fill(0)
|
||||||
|
.map(x => Math.random().toString(36).charAt(2))
|
||||||
|
.join('') + '-' + striped_name + '.part'
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let isLast = chunks.length === 1,
|
let isLast = chunks.length === 1,
|
||||||
|
|||||||
+25
-22
@@ -183,7 +183,7 @@ const actions = {
|
|||||||
'Content-Type': 'application/octet-stream'
|
'Content-Type': 'application/octet-stream'
|
||||||
},
|
},
|
||||||
onUploadProgress: event => {
|
onUploadProgress: event => {
|
||||||
var percentCompleted = Math.floor(((totalUploadedSize + event.loaded) / fileSize) * 100)
|
let percentCompleted = Math.floor(((totalUploadedSize + event.loaded) / fileSize) * 100);
|
||||||
|
|
||||||
commit('UPLOADING_FILE_PROGRESS', percentCompleted >= 100 ? 100 : percentCompleted)
|
commit('UPLOADING_FILE_PROGRESS', percentCompleted >= 100 ? 100 : percentCompleted)
|
||||||
|
|
||||||
@@ -195,33 +195,36 @@ const actions = {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
resolve(response)
|
resolve(response)
|
||||||
|
|
||||||
commit('PROCESSING_FILE', false)
|
// Proceed if was returned database record
|
||||||
|
if (response.data.id) {
|
||||||
|
|
||||||
// Remove first file from file queue
|
commit('PROCESSING_FILE', false)
|
||||||
commit('SHIFT_FROM_FILE_QUEUE')
|
|
||||||
|
|
||||||
// Check if user is in uploading folder, if yes, than show new file
|
// Remove first file from file queue
|
||||||
if (response.data.folder_id == getters.currentFolder.id) {
|
commit('SHIFT_FROM_FILE_QUEUE')
|
||||||
|
|
||||||
// Add uploaded item into view
|
// Check if user is in uploading folder, if yes, than show new file
|
||||||
commit('ADD_NEW_ITEMS', response.data)
|
if (response.data.folder_id == getters.currentFolder.id) {
|
||||||
|
|
||||||
// Reset file progress
|
// Add uploaded item into view
|
||||||
commit('UPLOADING_FILE_PROGRESS', 0)
|
commit('ADD_NEW_ITEMS', response.data)
|
||||||
|
|
||||||
// Increase count in files in queue uploaded for 1
|
// Reset file progress
|
||||||
commit('INCREASE_FILES_IN_QUEUE_UPLOADED')
|
commit('UPLOADING_FILE_PROGRESS', 0)
|
||||||
|
|
||||||
|
// Increase count in files in queue uploaded for 1
|
||||||
|
commit('INCREASE_FILES_IN_QUEUE_UPLOADED')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 => {
|
.catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user