Get conf.yml on client side
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import axios from 'axios';
|
||||
import yaml from 'js-yaml';
|
||||
import Keys from '@/utils/StoreMutations';
|
||||
import ConfigAccumulator from '@/utils/ConfigAccumalator';
|
||||
import { componentVisibility } from '@/utils/ConfigHelpers';
|
||||
@@ -9,7 +10,6 @@ import { applyItemId } from '@/utils/SectionHelpers';
|
||||
import filterUserSections from '@/utils/CheckSectionVisibility';
|
||||
import { InfoHandler, InfoKeys } from '@/utils/ErrorHandler';
|
||||
import { isUserAdmin } from '@/utils/Auth';
|
||||
import { serviceEndpoints } from '@/utils/defaults';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
@@ -280,7 +280,7 @@ const store = new Vuex.Store({
|
||||
/* Called when app first loaded. Reads config and sets state */
|
||||
async [INITIALIZE_CONFIG]({ commit }) {
|
||||
// Get the config file from the server and store it for use by the accumulator
|
||||
commit(SET_REMOTE_CONFIG, (await axios.get(serviceEndpoints.getConf)).data);
|
||||
commit(SET_REMOTE_CONFIG, yaml.load((await axios.get('conf.yml')).data));
|
||||
const deepCopy = (json) => JSON.parse(JSON.stringify(json));
|
||||
const config = deepCopy(new ConfigAccumulator().config());
|
||||
commit(SET_CONFIG, config);
|
||||
|
||||
@@ -42,7 +42,6 @@ module.exports = {
|
||||
statusCheck: '/status-check',
|
||||
save: '/config-manager/save',
|
||||
rebuild: '/config-manager/rebuild',
|
||||
getConf: '/config-manager/get',
|
||||
systemInfo: '/system-info',
|
||||
corsProxy: '/cors-proxy',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user