vue frontend update

This commit is contained in:
carodej
2020-04-20 09:01:54 +02:00
parent 506c39896a
commit 8740cc7685
21 changed files with 416 additions and 237 deletions
+37
View File
@@ -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
View File
@@ -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,
}