diff options
| author | Pitu <[email protected]> | 2021-03-23 22:24:11 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-03-23 22:24:11 +0900 |
| commit | b24c0175f5ef7ac3ac1f3689bc4f96c4d65d2a52 (patch) | |
| tree | 17c711a4fd949da681a19a21e044a6d7576cb301 /src/site/store/admin.js | |
| parent | chore: add screenshots to the readme (diff) | |
| parent | fix: sections not rendering (diff) | |
| download | host.fuwn.me-b24c0175f5ef7ac3ac1f3689bc4f96c4d65d2a52.tar.xz host.fuwn.me-b24c0175f5ef7ac3ac1f3689bc4f96c4d65d2a52.zip | |
Merge branch 'feature/database_based_settings' of https://github.com/Zephyrrus/huskysafe into Zephyrrus-feature/database_based_settings
Diffstat (limited to 'src/site/store/admin.js')
| -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; }, |