mirror of https://github.com/Lissy93/dashy.git
🚧 Started working on itnitial state for widgets
This commit is contained in:
parent
1a58d85ccc
commit
cd3a304744
|
@ -51,12 +51,15 @@ const store = new Vuex.Store({
|
||||||
appConfig(state) {
|
appConfig(state) {
|
||||||
return state.config.appConfig || {};
|
return state.config.appConfig || {};
|
||||||
},
|
},
|
||||||
theme(state) {
|
|
||||||
return state.config.appConfig.theme;
|
|
||||||
},
|
|
||||||
sections(state) {
|
sections(state) {
|
||||||
return filterUserSections(state.config.sections || []);
|
return filterUserSections(state.config.sections || []);
|
||||||
},
|
},
|
||||||
|
widgets(state) {
|
||||||
|
return state.config.widgets || [];
|
||||||
|
},
|
||||||
|
theme(state) {
|
||||||
|
return state.config.appConfig.theme;
|
||||||
|
},
|
||||||
webSearch(state, getters) {
|
webSearch(state, getters) {
|
||||||
return getters.appConfig.webSearch || {};
|
return getters.appConfig.webSearch || {};
|
||||||
},
|
},
|
||||||
|
|
|
@ -78,12 +78,23 @@ export default class ConfigAccumulator {
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Widgets */
|
||||||
|
widgets() {
|
||||||
|
const localWidgets = localStorage[localStorageKeys.CONF_WIDGETS];
|
||||||
|
if (localWidgets) {
|
||||||
|
const json = JSON.parse(localWidgets);
|
||||||
|
if (json.length >= 1) return json;
|
||||||
|
}
|
||||||
|
return this.conf.widgets || [];
|
||||||
|
}
|
||||||
|
|
||||||
/* Complete config */
|
/* Complete config */
|
||||||
config() {
|
config() {
|
||||||
return {
|
return {
|
||||||
appConfig: this.appConfig(),
|
appConfig: this.appConfig(),
|
||||||
pageInfo: this.pageInfo(),
|
pageInfo: this.pageInfo(),
|
||||||
sections: this.sections(),
|
sections: this.sections(),
|
||||||
|
widgets: this.widgets(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue