2018-09-09 11:21:23 -07:00
|
|
|
import { set } from 'vue'
|
|
|
|
|
|
|
|
const defaultState = {
|
2018-09-09 11:51:40 -07:00
|
|
|
// Stuff from static/config.json and apiConfig
|
2018-09-09 11:21:23 -07:00
|
|
|
name: 'Pleroma FE',
|
|
|
|
registrationOpen: true,
|
|
|
|
textlimit: 5000,
|
|
|
|
server: 'http://localhost:4040/',
|
|
|
|
theme: 'pleroma-dark',
|
|
|
|
background: 'img.png',
|
|
|
|
logo: '/static/logo.png',
|
|
|
|
logoMask: true,
|
|
|
|
logoMargin: '.2em',
|
|
|
|
redirectRootNoLogin: '/main/all',
|
|
|
|
redirectRootLogin: '/main/friends',
|
|
|
|
showInstanceSpecificPanel: false,
|
|
|
|
scopeOptionsEnabled: true,
|
|
|
|
formattingOptionsEnabled: false,
|
|
|
|
collapseMessageWithSubject: false,
|
|
|
|
disableChat: false,
|
2018-09-09 11:51:40 -07:00
|
|
|
|
2018-09-09 11:21:23 -07:00
|
|
|
// Nasty stuff
|
|
|
|
pleromaBackend: true,
|
2018-09-09 11:51:40 -07:00
|
|
|
emoji: [],
|
2018-09-09 11:21:23 -07:00
|
|
|
customEmoji: [],
|
2018-09-09 11:51:40 -07:00
|
|
|
|
|
|
|
// Feature-set, apparently, not everything here is reported...
|
|
|
|
mediaProxyAvailable: false,
|
|
|
|
chatAvailable: false,
|
|
|
|
gopherAvailable: false,
|
|
|
|
suggestionsEnabled: false,
|
|
|
|
suggestionsWeb: '',
|
|
|
|
|
2018-09-09 11:21:23 -07:00
|
|
|
// Html stuff
|
|
|
|
instanceSpecificPanelContent: '',
|
|
|
|
tos: ''
|
|
|
|
}
|
|
|
|
|
|
|
|
const instance = {
|
|
|
|
state: defaultState,
|
|
|
|
mutations: {
|
|
|
|
setInstanceOption (state, { name, value }) {
|
|
|
|
set(state, name, value)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
setInstanceOption ({ commit, dispatch }, { name, value }) {
|
|
|
|
commit('setInstanceOption', {name, value})
|
|
|
|
switch (name) {
|
|
|
|
case 'name':
|
|
|
|
dispatch('setPageTitle')
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default instance
|