Skip to content

Commit

Permalink
#2996 Added top description in new UI:
Browse files Browse the repository at this point in the history
- moved customCss to systemSettings/index.js;
  • Loading branch information
Limraj committed Sep 6, 2024
1 parent de4fb0e commit bb9cb65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
9 changes: 2 additions & 7 deletions scadalts-ui/src/apps/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ export default {
4: {
image: "images/flag_red.png"
}
},
systemInfoSettings: {
topDescriptionPrefix: "",
topDescription: "",
}
}
};
},
Expand Down Expand Up @@ -185,7 +181,7 @@ export default {
methods: {
fetchCustomCss() {
let customCss = this.$store.getters.customCss;
let customCss = this.$store.state.systemSettings.customCss;
let unescapedContent = unescapeHtml(customCss.content);
this.applyCustomCss(unescapedContent);
},
Expand All @@ -203,7 +199,6 @@ export default {
styleElement.appendChild(document.createTextNode(cssContent));
},
subscribeForAlarms() {
this.wsConnectionRetires = 5;
let stompClient = this.$store.state.webSocketModule.webSocket;
Expand Down
17 changes: 2 additions & 15 deletions scadalts-ui/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export default new Vuex.Store({
{ id: 2, label: i18n.t('common.alarmlevels.urgent') },
{ id: 3, label: i18n.t('common.alarmlevels.critical') },
{ id: 4, label: i18n.t('common.alarmlevels.lifesafety') },
],
customCss: null
]
},
mutations: {
updateWebSocketUrl(state) {
Expand All @@ -108,9 +107,7 @@ export default new Vuex.Store({
updateRequestTimeout(state, timeout) {
state.requestConfig.timeout = timeout > 1000 ? timeout : 1000;
},
setCustomCss(state, customCss) {
state.customCss = customCss;
},

setLoggedUser(state, loggedUser) {
state.loggedUser = loggedUser;
}
Expand Down Expand Up @@ -170,13 +167,6 @@ export default new Vuex.Store({
});
},

getCustomCss({ dispatch, commit }) {
return dispatch('requestGet', '/customcss/').then((r) => {
commit('setCustomCss', r);
return r;
});
},

/**
* HTTP Request GET method to fetch data from the REST API
*
Expand Down Expand Up @@ -448,9 +438,6 @@ export default new Vuex.Store({
appPullRequestBranch: (state) => {
return state.scadaLtsPullRequestBranch;
},
customCss: (state) => {
return state.customCss;
},
loggedUser: (state) => {
return state.loggedUser;
}
Expand Down
11 changes: 11 additions & 0 deletions scadalts-ui/src/store/systemSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const storeSystemSettings = {
schemaVersion: undefined,
scadaConfig: undefined,
defaultLoggingType: undefined,
customCss: undefined
},
mutations: {
setDatabaseType(state, databaseType) {
Expand Down Expand Up @@ -71,6 +72,9 @@ const storeSystemSettings = {
setDefaultLoggingType(state, defaultLoggingType) {
state.defaultLoggingType = defaultLoggingType;
},
setCustomCss(state, customCss) {
state.customCss = customCss;
}
},
actions: {
getDatabaseType({ commit, dispatch }) {
Expand Down Expand Up @@ -272,6 +276,13 @@ const storeSystemSettings = {
});
},

getCustomCss({ dispatch, commit }) {
return dispatch('requestGet', '/customcss/').then((r) => {
commit('setCustomCss', r);
return r;
});
},

purgeData(context) {
return new Promise((resolve, reject) => {
axios
Expand Down

0 comments on commit bb9cb65

Please sign in to comment.