diff options
| author | Pitu <[email protected]> | 2021-06-17 00:51:09 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-06-17 00:51:09 +0900 |
| commit | 334c3d1c34ce9261401fd1ab62ad2de8d561cc06 (patch) | |
| tree | 1c81ec16b0d0c20292326716ae8b16c1d253e69f /src/site/store | |
| parent | chore: update db migration, seed and docker env (diff) | |
| download | host.fuwn.me-334c3d1c34ce9261401fd1ab62ad2de8d561cc06.tar.xz host.fuwn.me-334c3d1c34ce9261401fd1ab62ad2de8d561cc06.zip | |
feat: make frontend use database settings
Diffstat (limited to 'src/site/store')
| -rw-r--r-- | src/site/store/admin.js | 10 | ||||
| -rw-r--r-- | src/site/store/config.js | 25 |
2 files changed, 9 insertions, 26 deletions
diff --git a/src/site/store/admin.js b/src/site/store/admin.js index 4f814b5..51213b7 100644 --- a/src/site/store/admin.js +++ b/src/site/store/admin.js @@ -11,7 +11,6 @@ export const state = () => ({ files: [] }, file: {}, - settings: {}, statistics: {}, settingsSchema: { type: null, @@ -20,12 +19,6 @@ export const state = () => ({ }); export const actions = { - async fetchSettings({ commit }) { - const response = await this.$axios.$get('service/config'); - commit('setSettings', response); - - return response; - }, async fetchStatistics({ commit }, category) { const url = category ? `service/statistics/${category}` : 'service/statistics'; const response = await this.$axios.$get(url); @@ -105,9 +98,6 @@ export const actions = { }; export const mutations = { - setSettings(state, { config }) { - state.settings = config; - }, setStatistics(state, { statistics, category }) { if (category) { state.statistics[category] = statistics[category]; diff --git a/src/site/store/config.js b/src/site/store/config.js index c17632d..623e324 100644 --- a/src/site/store/config.js +++ b/src/site/store/config.js @@ -1,18 +1,11 @@ export const state = () => ({ - development: true, - version: '4.0.0', - URL: 'http://localhost:8080', - baseURL: 'http://localhost:8080/api', - serviceName: '', - maxFileSize: 100, - chunkSize: 90, - maxLinksPerAlbum: 5, - publicMode: false, - userAccounts: false + development: process.env.development, + version: process.env.version, + URL: process.env.development ? 'http://localhost:5000' : '/', + baseURL: `${process.env.development ? 'http://localhost:5000' : ''}/api`, + serviceName: process.env.serviceName, + maxFileSize: process.env.maxFilesize, + chunkSize: process.env.chunkSize, + publicMode: process.env.publicMode, + userAccounts: process.env.userAccounts }); - -export const mutations = { - set(state, config) { - Object.assign(state, config); - } -}; |