2020-05-08 20:43:51 +02:00
|
|
|
import {CONFIG} from '../mutation-types'
|
|
|
|
import {HTTP} from '../../http-common'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
namespaced: true,
|
|
|
|
state: () => ({
|
|
|
|
// These are the api defaults.
|
|
|
|
version: '',
|
|
|
|
frontendUrl: '',
|
|
|
|
motd: '',
|
|
|
|
linkSharingEnabled: true,
|
|
|
|
maxFileSize: '20MB',
|
|
|
|
registrationEnabled: true,
|
|
|
|
availableMigrators: [],
|
|
|
|
taskAttachmentsEnabled: true,
|
2020-05-29 18:49:50 +02:00
|
|
|
totpEnabled: true,
|
2020-05-31 21:17:10 +02:00
|
|
|
enabledBackgroundProviders: [],
|
2020-07-18 21:39:30 +02:00
|
|
|
legal: {
|
|
|
|
imprintUrl: '',
|
|
|
|
privacyPolicyUrl: '',
|
|
|
|
}
|
2020-05-08 20:43:51 +02:00
|
|
|
}),
|
|
|
|
mutations: {
|
|
|
|
[CONFIG](state, config) {
|
|
|
|
state.version = config.version
|
|
|
|
state.frontendUrl = config.frontend_url
|
|
|
|
state.motd = config.motd
|
|
|
|
state.linkSharingEnabled = config.link_sharing_enabled
|
|
|
|
state.maxFileSize = config.max_file_size
|
|
|
|
state.registrationEnabled = config.registration_enabled
|
|
|
|
state.availableMigrators = config.available_migrators
|
|
|
|
state.taskAttachmentsEnabled = config.task_attachments_enabled
|
2020-05-29 18:49:50 +02:00
|
|
|
state.totpEnabled = config.totp_enabled
|
2020-05-31 21:17:10 +02:00
|
|
|
state.enabledBackgroundProviders = config.enabled_background_providers
|
2020-07-18 21:39:30 +02:00
|
|
|
state.legal.imprintUrl = config.legal.imprint_url
|
|
|
|
state.legal.privacyPolicyUrl = config.legal.privacy_policy_url
|
2020-05-08 20:43:51 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
update(ctx) {
|
|
|
|
HTTP.get('info')
|
|
|
|
.then(r => {
|
|
|
|
ctx.commit(CONFIG, r.data)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|