mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 11:15:58 +00:00
vue frontend update
This commit is contained in:
+37
@@ -70,6 +70,43 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
getShared: (context, back = false) => {
|
||||
events.$emit('show:content')
|
||||
|
||||
// Go to files view
|
||||
if (router.currentRoute.name !== 'Files') {
|
||||
router.push({name: 'Files'})
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create shared object for history
|
||||
let trash = {
|
||||
name: 'Shared',
|
||||
unique_id: undefined,
|
||||
location: 'shared',
|
||||
}
|
||||
|
||||
axios
|
||||
.get(context.getters.api + '/shared')
|
||||
.then(response => {
|
||||
context.commit('GET_DATA', response.data)
|
||||
context.commit('LOADING_STATE', false)
|
||||
context.commit('STORE_CURRENT_FOLDER', trash)
|
||||
context.commit('ADD_BROWSER_HISTORY', trash)
|
||||
|
||||
events.$emit('scrollTop')
|
||||
})
|
||||
.catch(() => {
|
||||
// Show error message
|
||||
events.$emit('alert:open', {
|
||||
title: i18n.t('popup_error.title'),
|
||||
message: i18n.t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
},
|
||||
getTrash: (context, back = false) => {
|
||||
events.$emit('show:content')
|
||||
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@ import router from '@/router'
|
||||
|
||||
const defaultState = {
|
||||
authorized: undefined,
|
||||
permission: 'master', // master | editor | visitor,
|
||||
app: undefined,
|
||||
}
|
||||
|
||||
@@ -138,8 +139,9 @@ const mutations = {
|
||||
}
|
||||
|
||||
const getters = {
|
||||
isLogged: state => state.authorized,
|
||||
permission: state => state.permission,
|
||||
isGuest: state => ! state.authorized,
|
||||
isLogged: state => state.authorized,
|
||||
app: state => state.app,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user