diff options
Diffstat (limited to 'src/site/store')
| -rw-r--r-- | src/site/store/admin.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/site/store/admin.js b/src/site/store/admin.js index cac1cca..4f814b5 100644 --- a/src/site/store/admin.js +++ b/src/site/store/admin.js @@ -12,7 +12,11 @@ export const state = () => ({ }, file: {}, settings: {}, - statistics: {} + statistics: {}, + settingsSchema: { + type: null, + keys: {} + } }); export const actions = { @@ -25,10 +29,16 @@ export const actions = { async fetchStatistics({ commit }, category) { const url = category ? `service/statistics/${category}` : 'service/statistics'; const response = await this.$axios.$get(url); - commit('setStatistics', { statistics: response.statistics, category: category }); + commit('setStatistics', { statistics: response.statistics, category }); return response; }, + async getSettingsSchema({ commit }) { + // XXX: Maybe move to the config store? + const response = await this.$axios.$get('service/config/schema'); + + commit('setSettingsSchema', response); + }, async fetchUsers({ commit }) { const response = await this.$axios.$get('admin/users'); commit('setUsers', response); @@ -105,6 +115,9 @@ export const mutations = { state.statistics = statistics; } }, + setSettingsSchema(state, { schema }) { + state.settingsSchema = schema; + }, setUsers(state, { users }) { state.users = users; }, |