diff options
| author | Pitu <[email protected]> | 2021-06-17 03:39:58 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-06-17 03:39:58 +0900 |
| commit | 30808a3574bec0c3c9c240833d2fa78715862422 (patch) | |
| tree | 8354df223e4088e43b85a6764300d080866ee38d /src/site | |
| parent | fix: upload size (diff) | |
| download | host.fuwn.me-30808a3574bec0c3c9c240833d2fa78715862422.tar.xz host.fuwn.me-30808a3574bec0c3c9c240833d2fa78715862422.zip | |
feat: fetch all settings if admin
Diffstat (limited to 'src/site')
| -rw-r--r-- | src/site/store/admin.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/site/store/admin.js b/src/site/store/admin.js index 51213b7..9399345 100644 --- a/src/site/store/admin.js +++ b/src/site/store/admin.js @@ -11,6 +11,7 @@ export const state = () => ({ files: [] }, file: {}, + settings: {}, statistics: {}, settingsSchema: { type: null, @@ -19,6 +20,12 @@ export const state = () => ({ }); export const actions = { + async fetchSettings({ commit }) { + const response = await this.$axios.$get('service/config/all'); + 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,6 +112,9 @@ export const mutations = { state.statistics = statistics; } }, + setSettings(state, { config }) { + state.settings = config; + }, setSettingsSchema(state, { schema }) { state.settingsSchema = schema; }, |