aboutsummaryrefslogtreecommitdiff
path: root/src/site/store/admin.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-03-23 22:24:11 +0900
committerPitu <[email protected]>2021-03-23 22:24:11 +0900
commitb24c0175f5ef7ac3ac1f3689bc4f96c4d65d2a52 (patch)
tree17c711a4fd949da681a19a21e044a6d7576cb301 /src/site/store/admin.js
parentchore: add screenshots to the readme (diff)
parentfix: sections not rendering (diff)
downloadhost.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.js17
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;
},