mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 11:00:39 +00:00
Merge remote-tracking branch 'origin/master' into oasis
# Conflicts: # public/chunks/admin-account.js # public/chunks/admin.js # public/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~8cc7d96f.js # public/chunks/app-language.js # public/chunks/app-settings.js # public/chunks/app-setup.js # public/chunks/billings-detail.js # public/chunks/dashboard.js # public/chunks/database.js # public/chunks/environment-setup.js # public/chunks/files.js # public/chunks/files~chunks/shared-files~chunks/shared/file-browser.js # public/chunks/files~chunks/shared-files~chunks/shared/file-browser~chunks/shared/single-file.js # public/chunks/homepage.js # public/chunks/installation-disclaimer.js # public/chunks/invoices.js # public/chunks/page-edit.js # public/chunks/pages.js # public/chunks/plan-create.js # public/chunks/plan-settings.js # public/chunks/plan-subscribers.js # public/chunks/plan.js # public/chunks/plans.js # public/chunks/platform.js # public/chunks/profile.js # public/chunks/profile~chunks/settings-password.js # public/chunks/purchase-code.js # public/chunks/settings-create-payment-methods.js # public/chunks/settings-invoices.js # public/chunks/settings-payment-methods.js # public/chunks/settings-storage.js # public/chunks/settings-subscription.js # public/chunks/settings.js # public/chunks/shared-files.js # public/chunks/shared.js # public/chunks/shared/file-browser.js # public/chunks/stripe-credentials.js # public/chunks/subscription-plans.js # public/chunks/subscription-service.js # public/chunks/upgrade-billing.js # public/chunks/upgrade-plan.js # public/chunks/user-create.js # public/chunks/user-delete.js # public/chunks/user-detail.js # public/chunks/user-invoices.js # public/chunks/user-storage.js # public/chunks/user-subscription.js # public/chunks/user.js # public/chunks/users.js # public/js/main.js # public/mix-manifest.json # public/vendors~chunks/platform~chunks/shared.js
This commit is contained in:
Vendored
+4
-4
@@ -3,7 +3,7 @@ import axios from "axios";
|
||||
import Vue from "vue";
|
||||
|
||||
const defaultState = {
|
||||
fileInfoPanelVisible: localStorage.getItem('file_info_visibility') === 'true' || false,
|
||||
isVisibleSidebar: localStorage.getItem('file_info_visibility') === 'true' || false,
|
||||
FilePreviewType: localStorage.getItem('preview_type') || 'list',
|
||||
config: undefined,
|
||||
index: undefined,
|
||||
@@ -982,7 +982,7 @@ const actions = {
|
||||
},
|
||||
fileInfoToggle: (context, visibility = undefined) => {
|
||||
if (!visibility) {
|
||||
if (context.state.fileInfoPanelVisible) {
|
||||
if (context.state.isVisibleSidebar) {
|
||||
context.commit('FILE_INFO_TOGGLE', false)
|
||||
} else {
|
||||
context.commit('FILE_INFO_TOGGLE', true)
|
||||
@@ -1025,7 +1025,7 @@ const mutations = {
|
||||
state.config.stripe_public_key = data
|
||||
},
|
||||
FILE_INFO_TOGGLE(state, isVisible) {
|
||||
state.fileInfoPanelVisible = isVisible
|
||||
state.isVisibleSidebar = isVisible
|
||||
|
||||
localStorage.setItem('file_info_visibility', isVisible)
|
||||
},
|
||||
@@ -1044,7 +1044,7 @@ const mutations = {
|
||||
}
|
||||
|
||||
const getters = {
|
||||
fileInfoVisible: state => state.fileInfoPanelVisible,
|
||||
isVisibleSidebar: state => state.isVisibleSidebar,
|
||||
FilePreviewType: state => state.FilePreviewType,
|
||||
expirationList: state => state.expirationList,
|
||||
homeDirectory: state => state.homeDirectory,
|
||||
|
||||
+41
-42
@@ -5,13 +5,15 @@ import router from '@/router'
|
||||
import i18n from '@/i18n/index'
|
||||
|
||||
const defaultState = {
|
||||
fileInfoDetail: [],
|
||||
currentFolder: undefined,
|
||||
navigation: undefined,
|
||||
|
||||
isSearching: false,
|
||||
browseHistory: [],
|
||||
isLoading: true,
|
||||
data: [],
|
||||
|
||||
browseHistory: [],
|
||||
clipboard: [],
|
||||
entries: [],
|
||||
}
|
||||
|
||||
const actions = {
|
||||
@@ -30,7 +32,7 @@ const actions = {
|
||||
// Set folder location
|
||||
payload.folder.location = payload.folder.deleted_at || payload.folder.location === 'trash' ? 'trash' : 'base'
|
||||
|
||||
if (! payload.back && !payload.sorting)
|
||||
if (!payload.back && !payload.sorting)
|
||||
commit('STORE_PREVIOUS_FOLDER', getters.currentFolder)
|
||||
|
||||
let url = payload.folder.location === 'trash'
|
||||
@@ -77,7 +79,7 @@ const actions = {
|
||||
})
|
||||
|
||||
axios
|
||||
.get(getters.api + '/browse/latest' )
|
||||
.get(getters.api + '/browse/latest')
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
events.$emit('scrollTop')
|
||||
@@ -175,7 +177,6 @@ const actions = {
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
getFolderTree: ({commit, getters}) => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Get route
|
||||
@@ -204,19 +205,19 @@ const actions = {
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
LOADING_STATE(state, payload) {
|
||||
state.clipboard = []
|
||||
state.entries = payload.data
|
||||
state.isLoading = payload.loading
|
||||
},
|
||||
UPDATE_FOLDER_TREE(state, tree) {
|
||||
state.navigation = tree
|
||||
},
|
||||
LOADING_STATE(state, payload) {
|
||||
state.fileInfoDetail= []
|
||||
state.data = payload.data
|
||||
state.isLoading = payload.loading
|
||||
},
|
||||
FLUSH_FOLDER_HISTORY(state) {
|
||||
state.browseHistory = []
|
||||
},
|
||||
FLUSH_SHARED(state, id) {
|
||||
state.data.find(item => {
|
||||
state.entries.find(item => {
|
||||
if (item.id === id) item.shared = undefined
|
||||
})
|
||||
},
|
||||
@@ -227,13 +228,14 @@ const mutations = {
|
||||
state.browseHistory.pop()
|
||||
},
|
||||
CHANGE_ITEM_NAME(state, updatedFile) {
|
||||
// Rename filename in file info detail
|
||||
if (state.fileInfoDetail && state.fileInfoDetail.id === updatedFile.id) {
|
||||
state.fileInfoDetail = updatedFile
|
||||
|
||||
// Rename filename in clipboard
|
||||
if (state.clipboard && state.clipboard.id === updatedFile.id) {
|
||||
state.clipboard = updatedFile
|
||||
}
|
||||
|
||||
// Rename item name in data view
|
||||
state.data.find(item => {
|
||||
state.entries.find(item => {
|
||||
if (item.id === updatedFile.id) {
|
||||
item.name = updatedFile.name
|
||||
item.color = updatedFile.color ? updatedFile.color : null
|
||||
@@ -241,60 +243,57 @@ const mutations = {
|
||||
}
|
||||
})
|
||||
},
|
||||
REMOVE_ITEM_FILEINFO_DETAIL(state,item) {
|
||||
state.fileInfoDetail = state.fileInfoDetail.filter(element => element.id !== item.id)
|
||||
},
|
||||
CLEAR_FILEINFO_DETAIL(state) {
|
||||
state.fileInfoDetail = []
|
||||
},
|
||||
LOAD_FILEINFO_DETAIL(state, item) {
|
||||
state.fileInfoDetail = []
|
||||
state.fileInfoDetail.push(item)
|
||||
},
|
||||
GET_FILEINFO_DETAIL(state, item) {
|
||||
let checkData = state.data.find(el => el.id === item.id)
|
||||
if(state.fileInfoDetail.includes(checkData)) return
|
||||
|
||||
state.fileInfoDetail.push(checkData ? checkData : state.currentFolder)
|
||||
},
|
||||
SELECT_ALL_FILES(state){
|
||||
state.fileInfoDetail = state.data
|
||||
},
|
||||
CHANGE_SEARCHING_STATE(state, searchState) {
|
||||
state.isSearching = searchState
|
||||
},
|
||||
UPDATE_SHARED_ITEM(state, data) {
|
||||
state.data.find(item => {
|
||||
state.entries.find(item => {
|
||||
if (item.id === data.item_id) item.shared = data
|
||||
})
|
||||
},
|
||||
ADD_NEW_FOLDER(state, folder) {
|
||||
state.data.unshift(folder)
|
||||
state.entries.unshift(folder)
|
||||
},
|
||||
ADD_NEW_ITEMS(state, items) {
|
||||
state.data = state.data.concat(items)
|
||||
state.entries = state.entries.concat(items)
|
||||
},
|
||||
REMOVE_ITEM(state, id) {
|
||||
state.data = state.data.filter(el => el.id !== id)
|
||||
state.entries = state.entries.filter(el => el.id !== id)
|
||||
},
|
||||
INCREASE_FOLDER_ITEM(state, id) {
|
||||
state.data.map(el => {
|
||||
state.entries.map(el => {
|
||||
if (el.id && el.id === id) el.items++
|
||||
})
|
||||
},
|
||||
STORE_CURRENT_FOLDER(state, folder) {
|
||||
state.currentFolder = folder
|
||||
},
|
||||
REMOVE_ITEM_FROM_CLIPBOARD(state, item) {
|
||||
state.clipboard = state.clipboard.filter(element => element.id !== item.id)
|
||||
},
|
||||
ADD_ALL_ITEMS_TO_CLIPBOARD(state) {
|
||||
state.clipboard = state.entries
|
||||
},
|
||||
ADD_ITEM_TO_CLIPBOARD(state, item) {
|
||||
let selectedItem = state.entries.find(el => el.id === item.id)
|
||||
|
||||
if (state.clipboard.includes(selectedItem)) return
|
||||
|
||||
state.clipboard.push(selectedItem ? selectedItem : state.currentFolder)
|
||||
},
|
||||
CLIPBOARD_CLEAR(state) {
|
||||
state.clipboard = []
|
||||
},
|
||||
}
|
||||
|
||||
const getters = {
|
||||
fileInfoDetail: state => state.fileInfoDetail,
|
||||
clipboard: state => state.clipboard,
|
||||
currentFolder: state => state.currentFolder,
|
||||
browseHistory: state => state.browseHistory,
|
||||
isSearching: state => state.isSearching,
|
||||
navigation: state => state.navigation,
|
||||
isLoading: state => state.isLoading,
|
||||
data: state => state.data,
|
||||
entries: state => state.entries,
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
+11
-13
@@ -41,7 +41,7 @@ const actions = {
|
||||
let files = []
|
||||
|
||||
// get ids of selected files
|
||||
getters.fileInfoDetail.forEach(file => files.push(file.id))
|
||||
getters.clipboard.forEach(file => files.push(file.id))
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail
|
||||
@@ -71,9 +71,9 @@ const actions = {
|
||||
let itemsToMove = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
// If coming no selected item dont get items to move from clipboard
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
items = getters.clipboard
|
||||
|
||||
items.forEach(data => itemsToMove.push({
|
||||
'id': data.id,
|
||||
@@ -82,15 +82,13 @@ const actions = {
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem)
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail
|
||||
? `/api/editor/move/${router.currentRoute.params.token}`
|
||||
: '/api/move'
|
||||
|
||||
console.log(to_item);
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
to_id: to_item.id ? to_item.id : null,
|
||||
@@ -269,9 +267,9 @@ const actions = {
|
||||
let items = [item]
|
||||
let restoreToHome = false
|
||||
|
||||
// If coming no selected item dont get items to restore from fileInfoDetail
|
||||
// If coming no selected item dont get items to restore from clipboard
|
||||
if (!item)
|
||||
items = getters.fileInfoDetail
|
||||
items = getters.clipboard
|
||||
|
||||
// Check if file can be restored to home directory
|
||||
if (getters.currentFolder.location === 'trash')
|
||||
@@ -283,7 +281,7 @@ const actions = {
|
||||
}))
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
|
||||
axios
|
||||
.post(getters.api + '/trash/restore', {
|
||||
@@ -301,9 +299,9 @@ const actions = {
|
||||
let itemsToDelete = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
// If coming no selected item dont get items to move from clipboard
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
items = getters.clipboard
|
||||
|
||||
items.forEach(data => {
|
||||
itemsToDelete.push({
|
||||
@@ -335,7 +333,7 @@ const actions = {
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem) {
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
}
|
||||
|
||||
// Get route
|
||||
@@ -387,7 +385,7 @@ const actions = {
|
||||
commit('LOADING_STATE', {loading: false, data: []})
|
||||
events.$emit('scrollTop')
|
||||
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
}
|
||||
|
||||
+2
-2
@@ -95,7 +95,7 @@ const actions = {
|
||||
let items = [singleItem]
|
||||
|
||||
if(!singleItem) {
|
||||
items = getters.fileInfoDetail
|
||||
items = getters.clipboard
|
||||
}
|
||||
|
||||
items.forEach(data => {
|
||||
@@ -119,7 +119,7 @@ const actions = {
|
||||
// Flush shared data
|
||||
commit('FLUSH_SHARED', item.id)
|
||||
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
})
|
||||
resolve(true)
|
||||
|
||||
|
||||
+4
-4
@@ -56,9 +56,9 @@ const actions = {
|
||||
let addFavourites = []
|
||||
let items = [folder]
|
||||
|
||||
// If dont coming single folder get folders to add to favourites from fileInfoDetail
|
||||
// If dont coming single folder get folders to add to favourites from clipboard
|
||||
if (!folder)
|
||||
items = context.getters.fileInfoDetail
|
||||
items = context.getters.clipboard
|
||||
|
||||
items.forEach((data) => {
|
||||
if (data.type === 'folder') {
|
||||
@@ -71,9 +71,9 @@ const actions = {
|
||||
}
|
||||
})
|
||||
|
||||
// If dont coming single folder clear the selected folders in fileInfoDetail
|
||||
// If dont coming single folder clear the selected folders in clipboard
|
||||
if (!folder) {
|
||||
context.commit('CLEAR_FILEINFO_DETAIL')
|
||||
context.commit('CLIPBOARD_CLEAR')
|
||||
}
|
||||
|
||||
let pushToFavorites = []
|
||||
|
||||
Reference in New Issue
Block a user