blob: 124b77809912526d12acea07f0360d34f02d83ff (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
export const state = () => ({
development: process.env.development,
version: '',
URL: process.env.development ? 'http://localhost:5000' : '/',
baseURL: `${process.env.development ? 'http://localhost:5000' : ''}/api`,
serviceName: '',
maxUploadSize: 0,
chunkSize: 0,
publicMode: false,
userAccounts: false
});
export const actions = {
async fetchSettings({ commit }) {
const response = await this.$axios.$get('service/config');
commit('setSettings', response);
return response;
}
};
export const mutations = {
setSettings(state, { config }) {
state.version = `v${config.version}`;
state.serviceName = config.serviceName;
state.maxUploadSize = config.maxUploadSize;
state.filenameLength = config.filenameLength;
state.albumLinkLength = config.albumLinkLength;
state.chunkSize = config.chunkSize;
state.publicMode = config.publicMode;
state.userAccounts = config.userAccounts;
}
};
|