2017-06-30 09:25:35 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Vuex from 'vuex'
|
2017-06-30 11:43:43 +00:00
|
|
|
import mutations from './mutations'
|
2017-06-30 09:25:35 +00:00
|
|
|
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
|
|
|
const state = {
|
2017-06-30 11:43:43 +00:00
|
|
|
user: window.info.user,
|
|
|
|
req: window.info.req,
|
|
|
|
webDavURL: window.info.webdavURL,
|
|
|
|
baseURL: window.info.baseURL,
|
2017-06-30 09:25:35 +00:00
|
|
|
ssl: (window.location.protocol === 'https:'),
|
|
|
|
selected: [],
|
|
|
|
multiple: false,
|
|
|
|
showInfo: false,
|
|
|
|
showHelp: false,
|
|
|
|
showDelete: false,
|
|
|
|
showRename: false,
|
|
|
|
showMove: false,
|
|
|
|
showNewFile: false,
|
|
|
|
showNewDir: false
|
|
|
|
}
|
|
|
|
|
|
|
|
const getters = {
|
|
|
|
showOverlay: state => {
|
|
|
|
return state.showInfo ||
|
|
|
|
state.showHelp ||
|
|
|
|
state.showDelete ||
|
|
|
|
state.showRename ||
|
|
|
|
state.showMove ||
|
|
|
|
state.showNewFile ||
|
|
|
|
state.showNewDir
|
|
|
|
},
|
2017-06-30 11:43:43 +00:00
|
|
|
selectedCount: state => state.selected.length
|
2017-06-30 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new Vuex.Store({
|
|
|
|
strict: process.env.NODE_ENV !== 'production',
|
|
|
|
state,
|
|
|
|
getters,
|
|
|
|
mutations
|
|
|
|
})
|