mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
UI Fixes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
{{ title }}
|
||||
|
||||
<input v-if="type === 'file'" @change="emmitFiles" v-show="false" id="file" type="file" name="files[]" multiple />
|
||||
<input v-if="type === 'folder'" @change="emmitFiles" v-show="false" id="folder" type="file" name="folders[]" webkitdirectory mozdirectory />
|
||||
<input v-if="type === 'folder'" @change="emmitFolder" v-show="false" id="folder" type="file" name="folders[]" webkitdirectory mozdirectory />
|
||||
</div>
|
||||
</label>
|
||||
</template>
|
||||
@@ -30,6 +30,11 @@ export default {
|
||||
emmitFiles(e) {
|
||||
this.$uploadFiles(e.target.files)
|
||||
},
|
||||
emmitFolder(e) {
|
||||
this.$store.commit('UPDATE_UPLOADING_FOLDER_STATE', true)
|
||||
|
||||
this.$uploadFiles(e.target.files)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
10
resources/js/store/modules/fileBrowser.js
vendored
10
resources/js/store/modules/fileBrowser.js
vendored
@@ -103,13 +103,9 @@ const actions = {
|
||||
getFolderTree: ({ commit, getters }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Get route
|
||||
let route = undefined
|
||||
|
||||
if (getters.sharedDetail) {
|
||||
route = `/api/browse/navigation/${router.currentRoute.params.token}`
|
||||
} else {
|
||||
route = '/api/browse/navigation'
|
||||
}
|
||||
let route = getters.sharedDetail
|
||||
? `/api/browse/navigation/${router.currentRoute.params.token}`
|
||||
: '/api/browse/navigation'
|
||||
|
||||
axios
|
||||
.get(route + getters.sorting.URI)
|
||||
|
||||
37
resources/js/store/modules/fileFunctions.js
vendored
37
resources/js/store/modules/fileFunctions.js
vendored
@@ -6,6 +6,7 @@ import Vue from 'vue'
|
||||
|
||||
const defaultState = {
|
||||
processingPopup: undefined,
|
||||
isUploadingFolder: false,
|
||||
isProcessingFile: false,
|
||||
filesInQueueUploaded: 0,
|
||||
filesInQueueTotal: 0,
|
||||
@@ -107,8 +108,8 @@ const actions = {
|
||||
}
|
||||
}, 10)
|
||||
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['Public'])) dispatch('getFolderTree')
|
||||
else dispatch('getAppData')
|
||||
// Refresh folder tree navigation
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
.catch((error) => {
|
||||
events.$emit('alert:open', {
|
||||
@@ -200,11 +201,17 @@ const actions = {
|
||||
if (!getters.fileQueue.length) {
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
|
||||
// Reload folder tree
|
||||
dispatch('getFolderTree')
|
||||
// Reload File data after folder uploading is finished
|
||||
if (getters.isUploadingFolder) {
|
||||
|
||||
// Reload files after upload is done
|
||||
Vue.prototype.$getDataByLocation()
|
||||
// Reload files after upload is done
|
||||
Vue.prototype.$getDataByLocation()
|
||||
|
||||
// Reload folder tree
|
||||
dispatch('getFolderTree')
|
||||
|
||||
commit('UPDATE_UPLOADING_FOLDER_STATE', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -323,19 +330,13 @@ const actions = {
|
||||
.then(() => {
|
||||
itemsToDelete.forEach((data) => {
|
||||
// If is folder, update app data
|
||||
if (data.type === 'folder') {
|
||||
if (data.id === getters.currentFolder.data.id) {
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['Public'])) {
|
||||
dispatch('browseShared')
|
||||
} else {
|
||||
dispatch('getFolder')
|
||||
}
|
||||
}
|
||||
if (data.type === 'folder' && (getters.currentFolder && data.id === getters.currentFolder.data.id)) {
|
||||
router.back()
|
||||
}
|
||||
})
|
||||
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['Public'])) dispatch('getFolderTree')
|
||||
else dispatch('getAppData')
|
||||
// Refresh folder tree navigation
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
//.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
@@ -375,6 +376,9 @@ const actions = {
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
UPDATE_UPLOADING_FOLDER_STATE(state, status) {
|
||||
state.isUploadingFolder = status
|
||||
},
|
||||
PROCESSING_POPUP(state, status) {
|
||||
state.processingPopup = status
|
||||
},
|
||||
@@ -407,6 +411,7 @@ const getters = {
|
||||
filesInQueueUploaded: (state) => state.filesInQueueUploaded,
|
||||
filesInQueueTotal: (state) => state.filesInQueueTotal,
|
||||
uploadingProgress: (state) => state.uploadingProgress,
|
||||
isUploadingFolder: (state) => state.isUploadingFolder,
|
||||
isProcessingFile: (state) => state.isProcessingFile,
|
||||
processingPopup: (state) => state.processingPopup,
|
||||
fileQueue: (state) => state.fileQueue,
|
||||
|
||||
Reference in New Issue
Block a user