aboutsummaryrefslogtreecommitdiff
path: root/src/site/store
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2021-01-10 02:04:35 +0200
committerZephyrrus <[email protected]>2021-01-10 02:04:35 +0200
commit46ef63fb9f3c2688118a9d1511293128cfdfe4c9 (patch)
tree5fc64b84464938f05470aeccd6066ac33922f590 /src/site/store
parentfeat: create settings schema (used for rendering and validating) (diff)
downloadhost.fuwn.me-46ef63fb9f3c2688118a9d1511293128cfdfe4c9.tar.xz
host.fuwn.me-46ef63fb9f3c2688118a9d1511293128cfdfe4c9.zip
feat: add dynamic settings page rendering based on the Joi object
Diffstat (limited to 'src/site/store')
-rw-r--r--src/site/store/admin.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/site/store/admin.js b/src/site/store/admin.js
index 0d0360b..e84a2b1 100644
--- a/src/site/store/admin.js
+++ b/src/site/store/admin.js
@@ -12,7 +12,8 @@ export const state = () => ({
},
file: {},
settings: {},
- statistics: {}
+ statistics: {},
+ settingsSchema: {}
});
export const actions = {
@@ -25,10 +26,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);
@@ -104,6 +111,9 @@ export const mutations = {
state.statistics = statistics;
}
},
+ setSettingsSchema(state, { schema }) {
+ state.settingsSchema = schema;
+ },
setUsers(state, { users }) {
state.users = users;
},