From a8fef2ee90bfba473ebaab1f8c10fd0de13c86aa Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Thu, 5 Sep 2024 14:30:10 +0200 Subject: [PATCH 1/7] Added top description in new UI #2996 - Added custom stylesheet to new UI --- WebContent/WEB-INF/jsp/systemSettings.jsp | 17 +++- .../WEB-INF/springDispatcher-servlet.xml | 7 ++ WebContent/WEB-INF/tags/logo.tag | 4 +- WebContent/assets/user_styles.css | 24 ++--- scadalts-ui/src/apps/App.vue | 92 ++++++++++++++++++- .../SystemSettings/MiscSettingsComponent.vue | 14 --- .../src/views/System/SystemSettings/index.vue | 21 ++++- .../tests/mocks/store/systemSettings/index.js | 2 + .../mango/web/dwr/SystemSettingsDwr.java | 4 +- .../interceptor/CommonDataInterceptor.java | 6 +- src/org/scada_lts/config/ScadaVersion.java | 6 -- .../mango/service/SystemSettingsService.java | 8 +- .../web/mvc/api/json/JsonSettingsMisc.java | 17 ---- .../mvc/api/json/JsonSettingsSystemInfo.java | 22 ++++- 14 files changed, 177 insertions(+), 67 deletions(-) diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index 3e516448b6..0545e92d01 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -565,6 +565,19 @@ $set("", uiPerformance); } + document.addEventListener('DOMContentLoaded', () => { + const cssEditor = document.getElementById('cssEditor'); + const cssHighlighting = document.getElementById('cssHighlighting'); + if (cssEditor && cssHighlighting) { + cssEditor.addEventListener('input', () => { + updateCodeText(cssEditor.value, '#cssHighlightingContent'); + }); + cssEditor.addEventListener('scroll', () => { + syncCodeScroll(cssEditor, '#cssHighlighting'); + }); + } + }); +
@@ -632,13 +645,13 @@ - "/>" type="text" class="formShort" style="width: 300px;"/> + "/>" type="text" class="formShort"/> - "/>" type="text" class="formShort" style="width: 300px;"/> + "/>" type="text" class="formShort"/> diff --git a/WebContent/WEB-INF/springDispatcher-servlet.xml b/WebContent/WEB-INF/springDispatcher-servlet.xml index 75e5c7f565..38bbea3af0 100644 --- a/WebContent/WEB-INF/springDispatcher-servlet.xml +++ b/WebContent/WEB-INF/springDispatcher-servlet.xml @@ -17,6 +17,13 @@ + + + + + + + org.springframework.web.servlet.view.JstlView diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index 69352f26d2..849ea2a9c3 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -6,10 +6,10 @@
- + - +
diff --git a/WebContent/assets/user_styles.css b/WebContent/assets/user_styles.css index f8bd989d3b..1aa62c78c6 100644 --- a/WebContent/assets/user_styles.css +++ b/WebContent/assets/user_styles.css @@ -23,19 +23,19 @@ } #top-description-prefix { - color: black; - font-size: 2em; - margin-left: 0.5em; - margin-right: 0.5em; - display: inline-block; - vertical-align: bottom; - line-height: 1; + color: black !important; + font-size: 2em !important; + margin-left: 0.5em !important; + margin-right: 0.5em !important; + display: inline-block !important; + vertical-align: bottom !important; + line-height: 1 !important; } #top-description { - color: #39B54A; - font-size: 2em; - display: inline-block; - vertical-align: bottom; - line-height: 1; + color: #39B54A !important; + font-size: 2em !important; + display: inline-block !important; + vertical-align: bottom !important; + line-height: 1 !important; } \ No newline at end of file diff --git a/scadalts-ui/src/apps/App.vue b/scadalts-ui/src/apps/App.vue index 1ae8b0b927..988b9a9b23 100644 --- a/scadalts-ui/src/apps/App.vue +++ b/scadalts-ui/src/apps/App.vue @@ -5,11 +5,29 @@ - Scada-LTS - mdi-access-point-network-off - - version {{ $store.getters.appMilestone }} - + + + Scada-LTS + mdi-access-point-network-off + + + version {{ $store.getters.appMilestone }} + + + + + +
+ + {{ this.systemInfoSettings.topDescriptionPrefix }} + + + {{ this.systemInfoSettings.topDescription }} + +
+
+
+
@@ -68,9 +86,11 @@
From ce8a5d4789744c194f86b5409161a5c5b895d4f9 Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Thu, 5 Sep 2024 16:34:28 +0200 Subject: [PATCH 4/7] Added top description in new UI #2996 --- scadalts-ui/src/apps/App.vue | 6 ++++-- scadalts-ui/src/store/index.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scadalts-ui/src/apps/App.vue b/scadalts-ui/src/apps/App.vue index a6532a1dae..10ef2d60e5 100644 --- a/scadalts-ui/src/apps/App.vue +++ b/scadalts-ui/src/apps/App.vue @@ -91,7 +91,6 @@ import NavigationBar from '../layout/NavigationBar.vue'; import internetMixin from '@/utils/connection-status-utils'; import NotificationAlert from '../layout/snackbars/NotificationAlert.vue'; import {unescapeHtml} from "@/utils/common"; -const CUSTOM_CSS_API = './api/customcss/'; export default { name: 'app', @@ -151,6 +150,9 @@ export default { isLoginPage() { return this.$route.name === 'login'; }, + customCssApi() { + return this.$store.getters.customCssApi; + } }, mounted() { @@ -176,7 +178,7 @@ export default { async loadCustomCss() { return new Promise(async (resolve, reject) => { await axios - .get(CUSTOM_CSS_API) + .get(this.customCssApi) .then(async (response) => { if (response.status === 200) { const customCss = response.data; diff --git a/scadalts-ui/src/store/index.js b/scadalts-ui/src/store/index.js index dffc1dd264..1a75d3e391 100644 --- a/scadalts-ui/src/store/index.js +++ b/scadalts-ui/src/store/index.js @@ -95,6 +95,7 @@ export default new Vuex.Store({ { id: 3, label: i18n.t('common.alarmlevels.critical') }, { id: 4, label: i18n.t('common.alarmlevels.lifesafety') }, ], + customCssApi: "./api/customcss/" }, mutations: { updateWebSocketUrl(state) { @@ -107,6 +108,10 @@ export default new Vuex.Store({ updateRequestTimeout(state, timeout) { state.requestConfig.timeout = timeout > 1000 ? timeout : 1000; }, + + setCustomCssApi(state, url) { + state.customCssApi = url; + } }, actions: { getUserRole() { @@ -395,6 +400,9 @@ export default new Vuex.Store({ }); }); }, + updateCustomCssApi({ commit }, url) { + commit('setCustomCssApi', url); + } }, getters: { appVersion: (state) => { @@ -432,6 +440,9 @@ export default new Vuex.Store({ appPullRequestBranch: (state) => { return state.scadaLtsPullRequestBranch; }, + customCssApi: (state) => { + return state.customCssApi; + }, }, plugins: [myLoggerForVuexMutation], }); From ae56dbf63a403884963b25d65ced434cb8905fc5 Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Thu, 29 Aug 2024 16:11:28 +0200 Subject: [PATCH 5/7] #2996 added top description in new ui - Added dynamic refresh of top description on new UI --- scadalts-ui/src/apps/App.vue | 48 +++++++------------ scadalts-ui/src/store/index.js | 25 +++++----- .../src/views/System/SystemSettings/index.vue | 1 + 3 files changed, 29 insertions(+), 45 deletions(-) diff --git a/scadalts-ui/src/apps/App.vue b/scadalts-ui/src/apps/App.vue index 10ef2d60e5..a8e14e268f 100644 --- a/scadalts-ui/src/apps/App.vue +++ b/scadalts-ui/src/apps/App.vue @@ -86,7 +86,6 @@