From 22cbea563f7a2da23f0ca11c4267255ec24517e0 Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Wed, 7 Aug 2024 14:51:51 +0200 Subject: [PATCH 1/9] #1580 Improvement describe information about scada on top Added: - Custom text on top inside mainHeader, next to app logo - input area for text to be displayed in main header next to logo - input area for css style of that aforementioned custom text --- WebContent/WEB-INF/jsp/systemSettings.jsp | 19 +++++++++++++++++++ WebContent/WEB-INF/tags/logo.tag | 6 ++++++ .../mango/web/dwr/SystemSettingsDwr.java | 8 +++++++- src/org/scada_lts/config/ScadaVersion.java | 10 ++++++++++ src/org/scada_lts/dao/SystemSettingsDAO.java | 4 ++++ .../mango/service/SystemSettingsService.java | 5 +++++ .../web/mvc/api/json/JsonSettingsMisc.java | 18 ++++++++++++++++++ webapp-resources/messages_de.properties | 2 ++ webapp-resources/messages_en.properties | 2 ++ webapp-resources/messages_es.properties | 2 ++ webapp-resources/messages_fi.properties | 2 ++ webapp-resources/messages_fr.properties | 2 ++ webapp-resources/messages_lu.properties | 2 ++ webapp-resources/messages_nl.properties | 2 ++ webapp-resources/messages_pl.properties | 2 ++ webapp-resources/messages_pt.properties | 2 ++ webapp-resources/messages_ru.properties | 2 ++ webapp-resources/messages_zh.properties | 2 ++ 18 files changed, 91 insertions(+), 1 deletion(-) diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index 53d4de2016..2272640fa6 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -108,6 +108,8 @@ $set("", settings.); $set("", settings.); + $set("", settings.); + $set("", settings.); setDisabled($(""), !settings.); setDisabled($(""), !settings. || !settings.); @@ -310,6 +312,8 @@ $get(""), $get(""), $get(""), + $get(""), + $get(""), function(response) { stopImageFader("saveMiscSettingsImg"); if (response.hasMessages) @@ -317,6 +321,7 @@ else { setUserMessage("miscMessage", ""); } + location.reload(); }); setUserMessage("miscMessage"); startImageFader("saveMiscSettingsImg"); @@ -963,6 +968,20 @@ + + + + "/>" type="text" class="formShort" style="width: 300px;"/> + + + + + +
#custom-information {
+ "/>" type="text" class="formShort" style="width: 300px; height: 50px;"/> +
}
+ + diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index b9f8cccabb..116d4ac061 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -1,8 +1,14 @@ <%@include file="/WEB-INF/tags/decl.tagf" %>
+
+ ${scadaVersion.getCustomInformation()}
diff --git a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java index 6aa6f9a802..1d6cf1ab89 100644 --- a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java +++ b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java @@ -179,6 +179,10 @@ public Map getSettings() { systemSettingsService.getMiscSettings().getWebResourceUploadsPath()); settings.put(SystemSettingsDAO.EVENT_ASSIGN_ENABLED, systemSettingsService.getMiscSettings().isEventAssignEnabled()); + settings.put(SystemSettingsDAO.CUSTOM_INFORMATION, + systemSettingsService.getMiscSettings().getCustomInformation()); + settings.put(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, + systemSettingsService.getMiscSettings().getCustomInformationStylesheet()); return settings; } @@ -332,7 +336,7 @@ public DwrResponseI18n saveMiscSettings(int uiPerformance, String dataPointRtVal boolean workItemsReportingEnabled, boolean workItemsReportingItemsPerSecondEnabled, int workItemsReportingItemsPerSecondLimit, int threadsNameAdditionalLength, String webResourceGraphicsPath, String webResourceUploadsPath, - boolean eventAssignEnabled) { + boolean eventAssignEnabled, String customInformation, String customInformationStylesheet) { Permissions.ensureAdmin(); SystemSettingsDAO systemSettingsDAO = new SystemSettingsDAO(); DwrResponseI18n response = new DwrResponseI18n(); @@ -392,6 +396,8 @@ public DwrResponseI18n saveMiscSettings(int uiPerformance, String dataPointRtVal } SystemSettingsService systemSettingsService = new SystemSettingsService(); systemSettingsService.saveEventAssignEnabled(eventAssignEnabled); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, customInformation); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, customInformationStylesheet); return response; } diff --git a/src/org/scada_lts/config/ScadaVersion.java b/src/org/scada_lts/config/ScadaVersion.java index 47553e9956..ee0e980517 100644 --- a/src/org/scada_lts/config/ScadaVersion.java +++ b/src/org/scada_lts/config/ScadaVersion.java @@ -3,11 +3,15 @@ import com.serotonin.mango.Common; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.scada_lts.dao.SystemSettingsDAO; import java.io.FileInputStream; import java.util.Properties; +import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION; +import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET; + /** * Scada Version class * @@ -134,4 +138,10 @@ public String getCompanyName() { public String getPoweredBy() { return poweredBy; } + public String getCustomInformation() { + return SystemSettingsDAO.getValue(CUSTOM_INFORMATION); + } + public String getCustomStyles(){ + return SystemSettingsDAO.getValue(CUSTOM_INFORMATION_STYLESHEET); + } } diff --git a/src/org/scada_lts/dao/SystemSettingsDAO.java b/src/org/scada_lts/dao/SystemSettingsDAO.java index 8afb2748d8..3412b35be5 100644 --- a/src/org/scada_lts/dao/SystemSettingsDAO.java +++ b/src/org/scada_lts/dao/SystemSettingsDAO.java @@ -164,6 +164,8 @@ public class SystemSettingsDAO { public static final String WEB_RESOURCE_GRAPHICS_PATH = "webResourceGraphicsPath"; public static final String WEB_RESOURCE_UPLOADS_PATH = "webResourceUploadsPath"; public static final String EVENT_ASSIGN_ENABLED = "eventAssignEnabled"; + public static final String CUSTOM_INFORMATION = "customInformation"; + public static final String CUSTOM_INFORMATION_STYLESHEET = "customInformationStylesheet"; // @formatter:off private static final String SELECT_SETTING_VALUE_WHERE = "" @@ -414,6 +416,8 @@ public String getDatabaseSchemaVersion(String key, String defaultValue) { DEFAULT_VALUES.put(WEB_RESOURCE_GRAPHICS_PATH, SystemSettingsUtils.getWebResourceGraphicsPath()); DEFAULT_VALUES.put(WEB_RESOURCE_UPLOADS_PATH, SystemSettingsUtils.getWebResourceUploadsPath()); DEFAULT_VALUES.put(EVENT_ASSIGN_ENABLED, SystemSettingsUtils.isEventAssignEnabled()); + DEFAULT_VALUES.put(CUSTOM_INFORMATION, " "); + DEFAULT_VALUES.put(CUSTOM_INFORMATION_STYLESHEET, "color: green; font-size: 2em;"); } @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED, rollbackFor = SQLException.class) diff --git a/src/org/scada_lts/mango/service/SystemSettingsService.java b/src/org/scada_lts/mango/service/SystemSettingsService.java index ad1530bbc2..34ebdc7c44 100644 --- a/src/org/scada_lts/mango/service/SystemSettingsService.java +++ b/src/org/scada_lts/mango/service/SystemSettingsService.java @@ -145,6 +145,8 @@ public JsonSettingsMisc getMiscSettings() { json.setWebResourceGraphicsPath(SystemSettingsDAO.getValue(SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH)); json.setWebResourceUploadsPath(SystemSettingsDAO.getValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH)); json.setEventAssignEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.EVENT_ASSIGN_ENABLED)); + json.setCustomInformation(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION)); + json.setCustomInformationStylesheet(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET)); return json; } @@ -162,6 +164,9 @@ public void saveMiscSettings(JsonSettingsMisc json) { systemSettingsDAO.setValue(SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH, json.getWebResourceGraphicsPath()); systemSettingsDAO.setValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH, json.getWebResourceUploadsPath()); saveEventAssignEnabled(json.isEventAssignEnabled()); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, json.getCustomInformation()); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, json.getCustomInformationStylesheet()); + } public SettingsDataRetention getDataRetentionSettings() { diff --git a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java index ac53c2df44..1fc7f3af82 100644 --- a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java +++ b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java @@ -17,6 +17,8 @@ public class JsonSettingsMisc implements Serializable { public String webResourceGraphicsPath; public String webResourceUploadsPath; public boolean eventAssignEnabled; + public String customInformation; + public String customInformationStylesheet; public JsonSettingsMisc() {} @@ -123,4 +125,20 @@ public boolean isEventAssignEnabled() { public void setEventAssignEnabled(boolean eventAssignEnabled) { this.eventAssignEnabled = eventAssignEnabled; } + + public String getCustomInformation(){ + return customInformation; + } + + public void setCustomInformation(String customInformation){ + this.customInformation = customInformation; + } + + public String getCustomInformationStylesheet(){ + return customInformationStylesheet; + } + + public void setCustomInformationStylesheet(String customInformationStylesheet){ + this.customInformationStylesheet = customInformationStylesheet; + } } diff --git a/webapp-resources/messages_de.properties b/webapp-resources/messages_de.properties index 0a8baf304d..bcad018345 100644 --- a/webapp-resources/messages_de.properties +++ b/webapp-resources/messages_de.properties @@ -3346,6 +3346,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_en.properties b/webapp-resources/messages_en.properties index 839dfe29fb..254261fff3 100644 --- a/webapp-resources/messages_en.properties +++ b/webapp-resources/messages_en.properties @@ -3349,6 +3349,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information = Custom information to display +systemsettings.custom.information.stylesheet = Custom information stylesheet events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_es.properties b/webapp-resources/messages_es.properties index ec70aa6438..36b0189619 100644 --- a/webapp-resources/messages_es.properties +++ b/webapp-resources/messages_es.properties @@ -3389,6 +3389,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_fi.properties b/webapp-resources/messages_fi.properties index 998df6d812..1ba327e1f4 100644 --- a/webapp-resources/messages_fi.properties +++ b/webapp-resources/messages_fi.properties @@ -3474,6 +3474,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_fr.properties b/webapp-resources/messages_fr.properties index 639734ee6a..92ce3aa90a 100644 --- a/webapp-resources/messages_fr.properties +++ b/webapp-resources/messages_fr.properties @@ -3343,6 +3343,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_lu.properties b/webapp-resources/messages_lu.properties index bb090dfc2e..4865f3bd3e 100644 --- a/webapp-resources/messages_lu.properties +++ b/webapp-resources/messages_lu.properties @@ -3362,6 +3362,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_nl.properties b/webapp-resources/messages_nl.properties index 4e77d3a0ba..7f793f1737 100644 --- a/webapp-resources/messages_nl.properties +++ b/webapp-resources/messages_nl.properties @@ -3464,6 +3464,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_pl.properties b/webapp-resources/messages_pl.properties index 3d2ec0f914..c18e7d658c 100644 --- a/webapp-resources/messages_pl.properties +++ b/webapp-resources/messages_pl.properties @@ -3486,6 +3486,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_pt.properties b/webapp-resources/messages_pt.properties index ebeb0467a7..f13b8a04bc 100644 --- a/webapp-resources/messages_pt.properties +++ b/webapp-resources/messages_pt.properties @@ -3501,6 +3501,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_ru.properties b/webapp-resources/messages_ru.properties index 657574e998..e6938624e3 100644 --- a/webapp-resources/messages_ru.properties +++ b/webapp-resources/messages_ru.properties @@ -3497,6 +3497,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_zh.properties b/webapp-resources/messages_zh.properties index 764d5ae04b..96dec3f32c 100644 --- a/webapp-resources/messages_zh.properties +++ b/webapp-resources/messages_zh.properties @@ -3449,6 +3449,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored +systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign From 3b7fa9cfb76aa988872a438055215a6570701bd0 Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Wed, 7 Aug 2024 15:03:41 +0200 Subject: [PATCH 2/9] #1580 Improvement describe information about scada on top --- WebContent/WEB-INF/tags/logo.tag | 4 ++-- src/org/scada_lts/dao/SystemSettingsDAO.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index 116d4ac061..04ba32355a 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -3,12 +3,12 @@
- ${scadaVersion.getCustomInformation()} +
diff --git a/src/org/scada_lts/dao/SystemSettingsDAO.java b/src/org/scada_lts/dao/SystemSettingsDAO.java index 3412b35be5..2dcbfd2a6b 100644 --- a/src/org/scada_lts/dao/SystemSettingsDAO.java +++ b/src/org/scada_lts/dao/SystemSettingsDAO.java @@ -416,7 +416,7 @@ public String getDatabaseSchemaVersion(String key, String defaultValue) { DEFAULT_VALUES.put(WEB_RESOURCE_GRAPHICS_PATH, SystemSettingsUtils.getWebResourceGraphicsPath()); DEFAULT_VALUES.put(WEB_RESOURCE_UPLOADS_PATH, SystemSettingsUtils.getWebResourceUploadsPath()); DEFAULT_VALUES.put(EVENT_ASSIGN_ENABLED, SystemSettingsUtils.isEventAssignEnabled()); - DEFAULT_VALUES.put(CUSTOM_INFORMATION, " "); + DEFAULT_VALUES.put(CUSTOM_INFORMATION, ""); DEFAULT_VALUES.put(CUSTOM_INFORMATION_STYLESHEET, "color: green; font-size: 2em;"); } From eac7b37a4c87939aebd0d3fc63e1f068e20c6685 Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Tue, 13 Aug 2024 15:24:02 +0200 Subject: [PATCH 3/9] #1580 Improvement describe information about scada on top - Added custom information in system settings for new UI - Added prefix for custom information - Added css styles for custiom information se they are displayed properly - Moved stylesheet to common custom stylesheet instead of special one onyl for custom information - Added migration class V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java --- WebContent/WEB-INF/jsp/systemSettings.jsp | 56 ++++++++++++------- WebContent/WEB-INF/tags/logo.tag | 16 ++++-- WebContent/assets/user_styles.css | 20 ++++++- scadalts-ui/src/locales/en.json | 4 +- .../SystemSettings/MiscSettingsComponent.vue | 16 +++++- .../mango/web/dwr/SystemSettingsDwr.java | 12 ++-- src/org/scada_lts/config/ScadaVersion.java | 6 +- src/org/scada_lts/dao/SystemSettingsDAO.java | 4 +- ...tomInformationColumnsToSystemSettings.java | 54 ++++++++++++++++++ .../mango/service/SystemSettingsService.java | 5 +- .../web/mvc/api/json/JsonSettingsMisc.java | 10 ++-- webapp-resources/messages_de.properties | 2 +- webapp-resources/messages_en.properties | 2 +- webapp-resources/messages_es.properties | 2 +- webapp-resources/messages_fi.properties | 2 +- webapp-resources/messages_fr.properties | 2 +- webapp-resources/messages_lu.properties | 2 +- webapp-resources/messages_nl.properties | 2 +- webapp-resources/messages_pl.properties | 2 +- webapp-resources/messages_pt.properties | 2 +- webapp-resources/messages_ru.properties | 2 +- webapp-resources/messages_zh.properties | 2 +- 22 files changed, 167 insertions(+), 58 deletions(-) create mode 100644 src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index 2272640fa6..85a5af8ed6 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -108,8 +108,7 @@ $set("", settings.); $set("", settings.); - $set("", settings.); - $set("", settings.); + setDisabled($(""), !settings.); setDisabled($(""), !settings. || !settings.); @@ -120,6 +119,8 @@ sel.options[sel.options.length] = new Option("${lang.value}", "${lang.key}"); $set(sel, settings.); + $set("", settings.); + $set("", settings.); }); <%-- @@ -312,8 +313,6 @@ $get(""), $get(""), $get(""), - $get(""), - $get(""), function(response) { stopImageFader("saveMiscSettingsImg"); if (response.hasMessages) @@ -321,7 +320,6 @@ else { setUserMessage("miscMessage", ""); } - location.reload(); }); setUserMessage("miscMessage"); startImageFader("saveMiscSettingsImg"); @@ -355,12 +353,15 @@ SystemSettingsDwr.saveInfoSettings("0", //$get(""), $get(""), + $get(""), + $get(""), function() { stopImageFader("saveInfoSettingsImg"); setUserMessage("infoMessage", ""); }); setUserMessage("infoMessage"); startImageFader("saveInfoSettingsImg"); + location.reload(); } function newVersionCheck() { @@ -557,6 +558,22 @@ } $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'); + }); + } + }); +
@@ -566,6 +583,9 @@ + + + @@ -618,6 +638,18 @@ + + + + + + + + @@ -968,20 +1000,6 @@ - - - - - - - - - + - - + + diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index 4b06555ea0..4a19d7f244 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -4,12 +4,12 @@
-
- -   +
+ + - - + +
diff --git a/WebContent/assets/user_styles.css b/WebContent/assets/user_styles.css index 21e8a58dfa..e0734ef713 100644 --- a/WebContent/assets/user_styles.css +++ b/WebContent/assets/user_styles.css @@ -16,19 +16,26 @@ */ /* ----- Custom information stylesheet ----- */ -.custom-container { +.top-description-container { display: flex; - align-items: center; + align-items: flex-end; + justify-content: center; } -.custom-text { - margin: 0; +#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; } -#custom-information-prefix { - color: black; font-size: 1em; -} - -#custom-information { - color: green; font-size: 2em; +#top-description { + color: #39B54A; + font-size: 2em; + display: inline-block; + vertical-align: bottom; + line-height: 1; } \ No newline at end of file diff --git a/scadalts-ui/src/locales/en.json b/scadalts-ui/src/locales/en.json index c17cf302ca..8b0a30e7f2 100644 --- a/scadalts-ui/src/locales/en.json +++ b/scadalts-ui/src/locales/en.json @@ -1075,6 +1075,6 @@ "systemsettings.misc.webResourceGraphicsPath": "Graphics images path", "systemsettings.misc.webResourceUploadsPath.wrong":"Uploaded images save path must end with 'uploads' or 'uploads{0}' ", "systemsettings.misc.webResourceGraphicsPath.wrong": "Graphics images path must end with 'graphics' or 'graphics{0}' ", - "systemsettings.custom.information": "Custom information to display", - "systemsettings.custom.information.prefix": "Custom information prefix" + "systemsettings.top.description": "Custom information to display", + "systemsettings.top.description.prefix": "Custom information prefix" } diff --git a/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue b/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue index 1894b7da63..fd3984b033 100644 --- a/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue +++ b/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue @@ -118,15 +118,15 @@ diff --git a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java index 07859c3834..3a04ac6c2f 100644 --- a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java +++ b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java @@ -179,10 +179,10 @@ public Map getSettings() { systemSettingsService.getMiscSettings().getWebResourceUploadsPath()); settings.put(SystemSettingsDAO.EVENT_ASSIGN_ENABLED, systemSettingsService.getMiscSettings().isEventAssignEnabled()); - settings.put(SystemSettingsDAO.CUSTOM_INFORMATION, - systemSettingsService.getMiscSettings().getCustomInformation()); - settings.put(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, - systemSettingsService.getMiscSettings().getCustomInformationPrefix()); + settings.put(SystemSettingsDAO.TOP_DESCRIPTION, + systemSettingsService.getMiscSettings().getTopDescription()); + settings.put(SystemSettingsDAO.TOP_DESCRIPTION_PREFIX, + systemSettingsService.getMiscSettings().getTopDescriptionPrefix()); return settings; } @@ -475,7 +475,7 @@ public DwrResponseI18n saveColourSettings(String chartBackgroundColour, public void saveInfoSettings(String newVersionNotificationLevel, - String instanceDescription, String customInformation, String customInformationPrefix) { + String instanceDescription,String topDescriptionPrefix, String topDescription) { Permissions.ensureAdmin(); SystemSettingsDAO systemSettingsDAO = new SystemSettingsDAO(); systemSettingsDAO.setValue( @@ -483,8 +483,8 @@ public void saveInfoSettings(String newVersionNotificationLevel, newVersionNotificationLevel); systemSettingsDAO.setValue(SystemSettingsDAO.INSTANCE_DESCRIPTION, instanceDescription); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, customInformation); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, customInformationPrefix); + systemSettingsDAO.setValue(SystemSettingsDAO.TOP_DESCRIPTION_PREFIX, topDescriptionPrefix); + systemSettingsDAO.setValue(SystemSettingsDAO.TOP_DESCRIPTION, topDescription); } diff --git a/src/org/scada_lts/config/ScadaVersion.java b/src/org/scada_lts/config/ScadaVersion.java index 92ea4bce74..c1012c8831 100644 --- a/src/org/scada_lts/config/ScadaVersion.java +++ b/src/org/scada_lts/config/ScadaVersion.java @@ -9,8 +9,8 @@ import java.io.FileInputStream; import java.util.Properties; -import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION; -import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX; +import static org.scada_lts.dao.SystemSettingsDAO.TOP_DESCRIPTION; +import static org.scada_lts.dao.SystemSettingsDAO.TOP_DESCRIPTION_PREFIX; /** * Scada Version class @@ -138,10 +138,10 @@ public String getCompanyName() { public String getPoweredBy() { return poweredBy; } - public String getCustomInformation() { - return SystemSettingsDAO.getValue(CUSTOM_INFORMATION); + public String getTopDescription() { + return SystemSettingsDAO.getValue(TOP_DESCRIPTION); } - public String getCustomInformationPrefix(){ - return SystemSettingsDAO.getValue(CUSTOM_INFORMATION_PREFIX); + public String getTopDescriptionPrefix(){ + return SystemSettingsDAO.getValue(TOP_DESCRIPTION_PREFIX); } } diff --git a/src/org/scada_lts/dao/SystemSettingsDAO.java b/src/org/scada_lts/dao/SystemSettingsDAO.java index fd8aaa0820..12aa9edcce 100644 --- a/src/org/scada_lts/dao/SystemSettingsDAO.java +++ b/src/org/scada_lts/dao/SystemSettingsDAO.java @@ -164,8 +164,8 @@ public class SystemSettingsDAO { public static final String WEB_RESOURCE_GRAPHICS_PATH = "webResourceGraphicsPath"; public static final String WEB_RESOURCE_UPLOADS_PATH = "webResourceUploadsPath"; public static final String EVENT_ASSIGN_ENABLED = "eventAssignEnabled"; - public static final String CUSTOM_INFORMATION = "customInformation"; - public static final String CUSTOM_INFORMATION_PREFIX = "customInformationPrefix"; + public static final String TOP_DESCRIPTION_PREFIX = "topDescriptionPrefix"; + public static final String TOP_DESCRIPTION = "topDescription"; // @formatter:off private static final String SELECT_SETTING_VALUE_WHERE = "" @@ -416,8 +416,8 @@ public String getDatabaseSchemaVersion(String key, String defaultValue) { DEFAULT_VALUES.put(WEB_RESOURCE_GRAPHICS_PATH, SystemSettingsUtils.getWebResourceGraphicsPath()); DEFAULT_VALUES.put(WEB_RESOURCE_UPLOADS_PATH, SystemSettingsUtils.getWebResourceUploadsPath()); DEFAULT_VALUES.put(EVENT_ASSIGN_ENABLED, SystemSettingsUtils.isEventAssignEnabled()); - DEFAULT_VALUES.put(CUSTOM_INFORMATION, ""); - DEFAULT_VALUES.put(CUSTOM_INFORMATION_PREFIX, ""); + DEFAULT_VALUES.put(TOP_DESCRIPTION, ""); + DEFAULT_VALUES.put(TOP_DESCRIPTION_PREFIX, ""); } @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED, rollbackFor = SQLException.class) diff --git a/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java similarity index 56% rename from src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java rename to src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java index ff5421c7ca..02794bffbb 100644 --- a/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java +++ b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java @@ -7,48 +7,48 @@ import org.scada_lts.dao.DAO; import org.springframework.jdbc.core.JdbcTemplate; -public class V2_8_0_2_AddCustomInformationColumnsToSystemSettings extends BaseJavaMigration { +public class V2_8_0_2_AddTopDescriptionColumnsToSystemSettings extends BaseJavaMigration { - private static final Log LOG = LogFactory.getLog(V2_8_0_2_AddCustomInformationColumnsToSystemSettings.class); + private static final Log LOG = LogFactory.getLog(V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.class); @Override public void migrate(Context context) throws Exception { final JdbcTemplate jdbcTmp = DAO.getInstance().getJdbcTemp(); try { - addCustomInformationColumns(jdbcTmp); + addTopDescriptionColumns(jdbcTmp); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); throw ex; } } - private void addCustomInformationColumns(JdbcTemplate jdbcTmp) { - boolean existsCustomInformationColumn = jdbcTmp.queryForObject( - "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformation') IS NOT NULL;", + private void addTopDescriptionColumns(JdbcTemplate jdbcTmp) { + boolean existsTopDescriptionColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='topDescription') IS NOT NULL;", boolean.class ); - boolean existsCustomInformationPrefixColumn = jdbcTmp.queryForObject( - "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformationPrefix') IS NOT NULL;", + boolean existsTopDescriptionPrefixColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='topDescriptionPrefix') IS NOT NULL;", boolean.class ); - boolean existsCustomInformationStylesheetColumn = jdbcTmp.queryForObject( - "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformationStylesheet') IS NOT NULL;", + boolean existsTopDescriptionStylesheetColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='topDescriptionStylesheet') IS NOT NULL;", boolean.class ); - if (!existsCustomInformationColumn) { - jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformation VARCHAR(255) DEFAULT '';"); + if (!existsTopDescriptionColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescription VARCHAR(255) DEFAULT '';"); } - if (!existsCustomInformationPrefixColumn) { - jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformationPrefix VARCHAR(255) DEFAULT '';"); + if (!existsTopDescriptionPrefixColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescriptionPrefix VARCHAR(255) DEFAULT '';"); } - if (!existsCustomInformationStylesheetColumn) { - jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformationStylesheet VARCHAR(255) DEFAULT 'color: green; font-size: 2em;';"); + if (!existsTopDescriptionStylesheetColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescriptionStylesheet VARCHAR(255) DEFAULT 'color: green; font-size: 2em;';"); } } } diff --git a/src/org/scada_lts/mango/service/SystemSettingsService.java b/src/org/scada_lts/mango/service/SystemSettingsService.java index 86d27dfbbd..6baf390796 100644 --- a/src/org/scada_lts/mango/service/SystemSettingsService.java +++ b/src/org/scada_lts/mango/service/SystemSettingsService.java @@ -145,8 +145,8 @@ public JsonSettingsMisc getMiscSettings() { json.setWebResourceGraphicsPath(SystemSettingsDAO.getValue(SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH)); json.setWebResourceUploadsPath(SystemSettingsDAO.getValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH)); json.setEventAssignEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.EVENT_ASSIGN_ENABLED)); - json.setCustomInformation(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION)); - json.setCustomInformationPrefix(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX)); + json.setTopDescription(SystemSettingsDAO.getValue(SystemSettingsDAO.TOP_DESCRIPTION)); + json.setTopDescriptionPrefix(SystemSettingsDAO.getValue(SystemSettingsDAO.TOP_DESCRIPTION_PREFIX)); return json; } @@ -164,8 +164,8 @@ public void saveMiscSettings(JsonSettingsMisc json) { systemSettingsDAO.setValue(SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH, json.getWebResourceGraphicsPath()); systemSettingsDAO.setValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH, json.getWebResourceUploadsPath()); saveEventAssignEnabled(json.isEventAssignEnabled()); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, json.getCustomInformation()); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, json.getCustomInformationPrefix()); + systemSettingsDAO.setValue(SystemSettingsDAO.TOP_DESCRIPTION, json.getTopDescription()); + systemSettingsDAO.setValue(SystemSettingsDAO.TOP_DESCRIPTION_PREFIX, json.getTopDescriptionPrefix()); } public SettingsDataRetention getDataRetentionSettings() { diff --git a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java index 66ffaba076..ac4c33c59d 100644 --- a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java +++ b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java @@ -17,8 +17,8 @@ public class JsonSettingsMisc implements Serializable { public String webResourceGraphicsPath; public String webResourceUploadsPath; public boolean eventAssignEnabled; - public String customInformation; - public String customInformationPrefix; + public String topDescription; + public String topDescriptionPrefix; public JsonSettingsMisc() {} @@ -126,19 +126,19 @@ public void setEventAssignEnabled(boolean eventAssignEnabled) { this.eventAssignEnabled = eventAssignEnabled; } - public String getCustomInformation(){ - return customInformation; + public String getTopDescription(){ + return topDescription; } - public void setCustomInformation(String customInformation){ - this.customInformation = customInformation; + public void setTopDescription(String topDescription){ + this.topDescription = topDescription; } - public String getCustomInformationPrefix(){ - return customInformationPrefix; + public String getTopDescriptionPrefix(){ + return topDescriptionPrefix; } - public void setCustomInformationPrefix(String customInformationPrefix){ - this.customInformationPrefix = customInformationPrefix; + public void setTopDescriptionPrefix(String topDescriptionPrefix){ + this.topDescriptionPrefix = topDescriptionPrefix; } } diff --git a/webapp-resources/messages_de.properties b/webapp-resources/messages_de.properties index 57d80f8820..6ec2da80af 100644 --- a/webapp-resources/messages_de.properties +++ b/webapp-resources/messages_de.properties @@ -3346,8 +3346,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_en.properties b/webapp-resources/messages_en.properties index 1782df3abb..8e0e3ad8b8 100644 --- a/webapp-resources/messages_en.properties +++ b/webapp-resources/messages_en.properties @@ -3349,8 +3349,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information = Custom information to display -systemsettings.custom.information.prefix = Custom information prefix +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_es.properties b/webapp-resources/messages_es.properties index da29bd33f2..75c08320d7 100644 --- a/webapp-resources/messages_es.properties +++ b/webapp-resources/messages_es.properties @@ -3389,8 +3389,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_fi.properties b/webapp-resources/messages_fi.properties index 3657f638f9..7485350027 100644 --- a/webapp-resources/messages_fi.properties +++ b/webapp-resources/messages_fi.properties @@ -3474,8 +3474,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_fr.properties b/webapp-resources/messages_fr.properties index db9aefa63c..e8eca34dd7 100644 --- a/webapp-resources/messages_fr.properties +++ b/webapp-resources/messages_fr.properties @@ -3343,8 +3343,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_lu.properties b/webapp-resources/messages_lu.properties index 7070dd400d..c4be7ae608 100644 --- a/webapp-resources/messages_lu.properties +++ b/webapp-resources/messages_lu.properties @@ -3362,8 +3362,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_nl.properties b/webapp-resources/messages_nl.properties index d77e234ba2..5c22f9218f 100644 --- a/webapp-resources/messages_nl.properties +++ b/webapp-resources/messages_nl.properties @@ -3464,8 +3464,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_pl.properties b/webapp-resources/messages_pl.properties index ec4d28d867..f871fbf4a5 100644 --- a/webapp-resources/messages_pl.properties +++ b/webapp-resources/messages_pl.properties @@ -3486,8 +3486,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_pt.properties b/webapp-resources/messages_pt.properties index 08d773a250..b2f902ed66 100644 --- a/webapp-resources/messages_pt.properties +++ b/webapp-resources/messages_pt.properties @@ -3501,8 +3501,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_ru.properties b/webapp-resources/messages_ru.properties index 5f4202e0ce..7603e4b73f 100644 --- a/webapp-resources/messages_ru.properties +++ b/webapp-resources/messages_ru.properties @@ -3497,8 +3497,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_zh.properties b/webapp-resources/messages_zh.properties index dcc0411f72..7d4d79a40f 100644 --- a/webapp-resources/messages_zh.properties +++ b/webapp-resources/messages_zh.properties @@ -3449,8 +3449,8 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.prefix = Custom information prefix -systemsettings.custom.information = Custom information to display +systemsettings.top.description.prefix = Top information prefix +systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign From d5d0cdf2684e4b6412ba5b6e0534bee52045945f Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Mon, 26 Aug 2024 10:51:26 +0200 Subject: [PATCH 5/9] #1580 Improvement describe information about scada on top Removed: - creating a column for stylesheet in migration class (it should be implemented in different issue) --- ...2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java index 02794bffbb..c291576954 100644 --- a/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java +++ b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java @@ -34,11 +34,6 @@ private void addTopDescriptionColumns(JdbcTemplate jdbcTmp) { boolean.class ); - boolean existsTopDescriptionStylesheetColumn = jdbcTmp.queryForObject( - "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='topDescriptionStylesheet') IS NOT NULL;", - boolean.class - ); - if (!existsTopDescriptionColumn) { jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescription VARCHAR(255) DEFAULT '';"); } @@ -46,9 +41,5 @@ private void addTopDescriptionColumns(JdbcTemplate jdbcTmp) { if (!existsTopDescriptionPrefixColumn) { jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescriptionPrefix VARCHAR(255) DEFAULT '';"); } - - if (!existsTopDescriptionStylesheetColumn) { - jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN topDescriptionStylesheet VARCHAR(255) DEFAULT 'color: green; font-size: 2em;';"); - } } } From 3c106db750fbc605be4212ca5a29a12ace49c211 Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Mon, 26 Aug 2024 11:48:13 +0200 Subject: [PATCH 6/9] #1580 Improvement describe information about scada on top - Minor changes to css stylesheet --- WebContent/WEB-INF/tags/logo.tag | 2 +- WebContent/assets/user_styles.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index 4a19d7f244..69352f26d2 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -4,7 +4,7 @@
-
+
diff --git a/WebContent/assets/user_styles.css b/WebContent/assets/user_styles.css index e0734ef713..f8bd989d3b 100644 --- a/WebContent/assets/user_styles.css +++ b/WebContent/assets/user_styles.css @@ -16,7 +16,7 @@ */ /* ----- Custom information stylesheet ----- */ -.top-description-container { +#top-description-container { display: flex; align-items: flex-end; justify-content: center; From ec1e5dfbc08d3da87187f8aae489ebd0d64170eb Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Mon, 26 Aug 2024 13:45:37 +0200 Subject: [PATCH 7/9] #1580 Improvement describe information about scada on top - Changed way of top description being dynamically refreshed --- WebContent/WEB-INF/jsp/systemSettings.jsp | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index fd00d49ebc..98f444f0d0 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -348,20 +348,25 @@ else $set(type, ""); } - + function saveInfoSettings() { + var topDescriptionPrefix = $get(""); + var topDescription = $get(""); + SystemSettingsDwr.saveInfoSettings("0", - //$get(""), - $get(""), - $get(""), - $get(""), - function() { - stopImageFader("saveInfoSettingsImg"); - setUserMessage("infoMessage", ""); - }); + $get(""), + topDescriptionPrefix, + topDescription, + function() { + stopImageFader("saveInfoSettingsImg"); + document.getElementById('top-description-prefix').innerText = topDescriptionPrefix; + document.getElementById('top-description').innerText = topDescription; + setUserMessage("infoMessage", ""); + } + ); + setUserMessage("infoMessage"); startImageFader("saveInfoSettingsImg"); - location.reload(); } function newVersionCheck() { From af28d2dfca07630de297e38c4ae6984797205122 Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Mon, 26 Aug 2024 13:57:13 +0200 Subject: [PATCH 8/9] #1580 Improvement describe information about scada on top --- WebContent/WEB-INF/jsp/systemSettings.jsp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index 98f444f0d0..519bdb7606 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -564,21 +564,6 @@ $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'); - }); - } - }); -
From c6f3a4ce426cce8014c17e8558de841b296167d0 Mon Sep 17 00:00:00 2001 From: Kamil Jarmusik Date: Mon, 26 Aug 2024 18:49:20 +0200 Subject: [PATCH 9/9] #1580 Improvement describe information about scada on top: - corrected translation --- scadalts-ui/src/locales/en.json | 4 ++-- webapp-resources/messages_de.properties | 6 +++--- webapp-resources/messages_en.properties | 6 +++--- webapp-resources/messages_es.properties | 6 +++--- webapp-resources/messages_fi.properties | 6 +++--- webapp-resources/messages_fr.properties | 6 +++--- webapp-resources/messages_lu.properties | 6 +++--- webapp-resources/messages_nl.properties | 6 +++--- webapp-resources/messages_pl.properties | 6 +++--- webapp-resources/messages_pt.properties | 6 +++--- webapp-resources/messages_ru.properties | 6 +++--- webapp-resources/messages_zh.properties | 6 +++--- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/scadalts-ui/src/locales/en.json b/scadalts-ui/src/locales/en.json index 8b0a30e7f2..8e41f97b9e 100644 --- a/scadalts-ui/src/locales/en.json +++ b/scadalts-ui/src/locales/en.json @@ -1075,6 +1075,6 @@ "systemsettings.misc.webResourceGraphicsPath": "Graphics images path", "systemsettings.misc.webResourceUploadsPath.wrong":"Uploaded images save path must end with 'uploads' or 'uploads{0}' ", "systemsettings.misc.webResourceGraphicsPath.wrong": "Graphics images path must end with 'graphics' or 'graphics{0}' ", - "systemsettings.top.description": "Custom information to display", - "systemsettings.top.description.prefix": "Custom information prefix" + "systemsettings.top.description": "Top description", + "systemsettings.top.description.prefix": "Top description prefix" } diff --git a/webapp-resources/messages_de.properties b/webapp-resources/messages_de.properties index 6ec2da80af..f55c6d025c 100644 --- a/webapp-resources/messages_de.properties +++ b/webapp-resources/messages_de.properties @@ -3346,8 +3346,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3357,4 +3355,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_en.properties b/webapp-resources/messages_en.properties index 8e0e3ad8b8..a90aea84fe 100644 --- a/webapp-resources/messages_en.properties +++ b/webapp-resources/messages_en.properties @@ -3349,8 +3349,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3360,4 +3358,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_es.properties b/webapp-resources/messages_es.properties index 75c08320d7..16858e2245 100644 --- a/webapp-resources/messages_es.properties +++ b/webapp-resources/messages_es.properties @@ -3389,8 +3389,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3400,4 +3398,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_fi.properties b/webapp-resources/messages_fi.properties index 7485350027..a9b4aa4f36 100644 --- a/webapp-resources/messages_fi.properties +++ b/webapp-resources/messages_fi.properties @@ -3474,8 +3474,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3485,4 +3483,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_fr.properties b/webapp-resources/messages_fr.properties index e8eca34dd7..521befa47e 100644 --- a/webapp-resources/messages_fr.properties +++ b/webapp-resources/messages_fr.properties @@ -3343,8 +3343,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3354,4 +3352,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_lu.properties b/webapp-resources/messages_lu.properties index c4be7ae608..96c979db52 100644 --- a/webapp-resources/messages_lu.properties +++ b/webapp-resources/messages_lu.properties @@ -3362,8 +3362,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3373,4 +3371,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_nl.properties b/webapp-resources/messages_nl.properties index 5c22f9218f..62d11da959 100644 --- a/webapp-resources/messages_nl.properties +++ b/webapp-resources/messages_nl.properties @@ -3464,8 +3464,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3475,4 +3473,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_pl.properties b/webapp-resources/messages_pl.properties index f871fbf4a5..6012003c3f 100644 --- a/webapp-resources/messages_pl.properties +++ b/webapp-resources/messages_pl.properties @@ -3486,8 +3486,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3497,4 +3495,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_pt.properties b/webapp-resources/messages_pt.properties index b2f902ed66..43e66d1c3b 100644 --- a/webapp-resources/messages_pt.properties +++ b/webapp-resources/messages_pt.properties @@ -3501,8 +3501,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3512,4 +3510,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_ru.properties b/webapp-resources/messages_ru.properties index 7603e4b73f..fd9cc6d1bc 100644 --- a/webapp-resources/messages_ru.properties +++ b/webapp-resources/messages_ru.properties @@ -3497,8 +3497,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3508,4 +3506,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file diff --git a/webapp-resources/messages_zh.properties b/webapp-resources/messages_zh.properties index 7d4d79a40f..8a00ec0928 100644 --- a/webapp-resources/messages_zh.properties +++ b/webapp-resources/messages_zh.properties @@ -3449,8 +3449,6 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.top.description.prefix = Top information prefix -systemsettings.top.description = Top information events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign @@ -3460,4 +3458,6 @@ common.assignee=Assignee event.system.assigned=Assigned Event event.system.unassigned=Unassigned Event event.assign.enabled=Event Assign enabled -viewEdit.graphic.hideAssigneeColumn=Hide Assignee column \ No newline at end of file +viewEdit.graphic.hideAssigneeColumn=Hide Assignee column +systemsettings.top.description.prefix = Top description prefix +systemsettings.top.description = Top description \ No newline at end of file
+ "/>" type="text" class="formShort" style="width: 300px;"/> +
+ "/>" type="text" class="formShort" style="width: 300px;"/> +
- "/>" type="text" class="formShort" style="width: 300px;"/> -
-
#custom-information {
- "/>" type="text" class="formShort" style="width: 300px; height: 50px;"/> -
}
-
diff --git a/WebContent/WEB-INF/tags/logo.tag b/WebContent/WEB-INF/tags/logo.tag index 04ba32355a..4b06555ea0 100644 --- a/WebContent/WEB-INF/tags/logo.tag +++ b/WebContent/WEB-INF/tags/logo.tag @@ -1,14 +1,18 @@ <%@include file="/WEB-INF/tags/decl.tagf" %>
-
- + +
+ +   + + + + +
+
diff --git a/WebContent/assets/user_styles.css b/WebContent/assets/user_styles.css index eafa3b1363..21e8a58dfa 100644 --- a/WebContent/assets/user_styles.css +++ b/WebContent/assets/user_styles.css @@ -13,4 +13,22 @@ * #viewContainer > #viewContent .slts-btn { * font-size: 1.5em; * } - */ \ No newline at end of file + */ + +/* ----- Custom information stylesheet ----- */ +.custom-container { + display: flex; + align-items: center; +} + +.custom-text { + margin: 0; +} + +#custom-information-prefix { + color: black; font-size: 1em; +} + +#custom-information { + color: green; font-size: 2em; +} \ No newline at end of file diff --git a/scadalts-ui/src/locales/en.json b/scadalts-ui/src/locales/en.json index dc0451867f..c17cf302ca 100644 --- a/scadalts-ui/src/locales/en.json +++ b/scadalts-ui/src/locales/en.json @@ -1074,5 +1074,7 @@ "systemsettings.misc.webResourceUploadsPath": "Uploaded images save path", "systemsettings.misc.webResourceGraphicsPath": "Graphics images path", "systemsettings.misc.webResourceUploadsPath.wrong":"Uploaded images save path must end with 'uploads' or 'uploads{0}' ", - "systemsettings.misc.webResourceGraphicsPath.wrong": "Graphics images path must end with 'graphics' or 'graphics{0}' " + "systemsettings.misc.webResourceGraphicsPath.wrong": "Graphics images path must end with 'graphics' or 'graphics{0}' ", + "systemsettings.custom.information": "Custom information to display", + "systemsettings.custom.information.prefix": "Custom information prefix" } diff --git a/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue b/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue index c43e1f6321..1894b7da63 100644 --- a/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue +++ b/scadalts-ui/src/views/System/SystemSettings/MiscSettingsComponent.vue @@ -116,7 +116,21 @@ @change="watchDataChange()" > - + + + + + + + diff --git a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java index 1d6cf1ab89..07859c3834 100644 --- a/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java +++ b/src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java @@ -181,8 +181,8 @@ public Map getSettings() { systemSettingsService.getMiscSettings().isEventAssignEnabled()); settings.put(SystemSettingsDAO.CUSTOM_INFORMATION, systemSettingsService.getMiscSettings().getCustomInformation()); - settings.put(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, - systemSettingsService.getMiscSettings().getCustomInformationStylesheet()); + settings.put(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, + systemSettingsService.getMiscSettings().getCustomInformationPrefix()); return settings; } @@ -336,7 +336,7 @@ public DwrResponseI18n saveMiscSettings(int uiPerformance, String dataPointRtVal boolean workItemsReportingEnabled, boolean workItemsReportingItemsPerSecondEnabled, int workItemsReportingItemsPerSecondLimit, int threadsNameAdditionalLength, String webResourceGraphicsPath, String webResourceUploadsPath, - boolean eventAssignEnabled, String customInformation, String customInformationStylesheet) { + boolean eventAssignEnabled) { Permissions.ensureAdmin(); SystemSettingsDAO systemSettingsDAO = new SystemSettingsDAO(); DwrResponseI18n response = new DwrResponseI18n(); @@ -396,8 +396,6 @@ public DwrResponseI18n saveMiscSettings(int uiPerformance, String dataPointRtVal } SystemSettingsService systemSettingsService = new SystemSettingsService(); systemSettingsService.saveEventAssignEnabled(eventAssignEnabled); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, customInformation); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, customInformationStylesheet); return response; } @@ -477,7 +475,7 @@ public DwrResponseI18n saveColourSettings(String chartBackgroundColour, public void saveInfoSettings(String newVersionNotificationLevel, - String instanceDescription) { + String instanceDescription, String customInformation, String customInformationPrefix) { Permissions.ensureAdmin(); SystemSettingsDAO systemSettingsDAO = new SystemSettingsDAO(); systemSettingsDAO.setValue( @@ -485,6 +483,8 @@ public void saveInfoSettings(String newVersionNotificationLevel, newVersionNotificationLevel); systemSettingsDAO.setValue(SystemSettingsDAO.INSTANCE_DESCRIPTION, instanceDescription); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, customInformation); + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, customInformationPrefix); } diff --git a/src/org/scada_lts/config/ScadaVersion.java b/src/org/scada_lts/config/ScadaVersion.java index ee0e980517..92ea4bce74 100644 --- a/src/org/scada_lts/config/ScadaVersion.java +++ b/src/org/scada_lts/config/ScadaVersion.java @@ -10,7 +10,7 @@ import java.util.Properties; import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION; -import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET; +import static org.scada_lts.dao.SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX; /** * Scada Version class @@ -141,7 +141,7 @@ public String getPoweredBy() { public String getCustomInformation() { return SystemSettingsDAO.getValue(CUSTOM_INFORMATION); } - public String getCustomStyles(){ - return SystemSettingsDAO.getValue(CUSTOM_INFORMATION_STYLESHEET); + public String getCustomInformationPrefix(){ + return SystemSettingsDAO.getValue(CUSTOM_INFORMATION_PREFIX); } } diff --git a/src/org/scada_lts/dao/SystemSettingsDAO.java b/src/org/scada_lts/dao/SystemSettingsDAO.java index 2dcbfd2a6b..fd8aaa0820 100644 --- a/src/org/scada_lts/dao/SystemSettingsDAO.java +++ b/src/org/scada_lts/dao/SystemSettingsDAO.java @@ -165,7 +165,7 @@ public class SystemSettingsDAO { public static final String WEB_RESOURCE_UPLOADS_PATH = "webResourceUploadsPath"; public static final String EVENT_ASSIGN_ENABLED = "eventAssignEnabled"; public static final String CUSTOM_INFORMATION = "customInformation"; - public static final String CUSTOM_INFORMATION_STYLESHEET = "customInformationStylesheet"; + public static final String CUSTOM_INFORMATION_PREFIX = "customInformationPrefix"; // @formatter:off private static final String SELECT_SETTING_VALUE_WHERE = "" @@ -417,7 +417,7 @@ public String getDatabaseSchemaVersion(String key, String defaultValue) { DEFAULT_VALUES.put(WEB_RESOURCE_UPLOADS_PATH, SystemSettingsUtils.getWebResourceUploadsPath()); DEFAULT_VALUES.put(EVENT_ASSIGN_ENABLED, SystemSettingsUtils.isEventAssignEnabled()); DEFAULT_VALUES.put(CUSTOM_INFORMATION, ""); - DEFAULT_VALUES.put(CUSTOM_INFORMATION_STYLESHEET, "color: green; font-size: 2em;"); + DEFAULT_VALUES.put(CUSTOM_INFORMATION_PREFIX, ""); } @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED, rollbackFor = SQLException.class) diff --git a/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java new file mode 100644 index 0000000000..ff5421c7ca --- /dev/null +++ b/src/org/scada_lts/dao/migration/mysql/V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java @@ -0,0 +1,54 @@ +package org.scada_lts.dao.migration.mysql; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.flywaydb.core.api.migration.BaseJavaMigration; +import org.flywaydb.core.api.migration.Context; +import org.scada_lts.dao.DAO; +import org.springframework.jdbc.core.JdbcTemplate; + +public class V2_8_0_2_AddCustomInformationColumnsToSystemSettings extends BaseJavaMigration { + + private static final Log LOG = LogFactory.getLog(V2_8_0_2_AddCustomInformationColumnsToSystemSettings.class); + + @Override + public void migrate(Context context) throws Exception { + final JdbcTemplate jdbcTmp = DAO.getInstance().getJdbcTemp(); + + try { + addCustomInformationColumns(jdbcTmp); + } catch (Exception ex) { + LOG.error(ex.getMessage(), ex); + throw ex; + } + } + + private void addCustomInformationColumns(JdbcTemplate jdbcTmp) { + boolean existsCustomInformationColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformation') IS NOT NULL;", + boolean.class + ); + + boolean existsCustomInformationPrefixColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformationPrefix') IS NOT NULL;", + boolean.class + ); + + boolean existsCustomInformationStylesheetColumn = jdbcTmp.queryForObject( + "SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='systemSettings' AND `COLUMN_NAME`='customInformationStylesheet') IS NOT NULL;", + boolean.class + ); + + if (!existsCustomInformationColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformation VARCHAR(255) DEFAULT '';"); + } + + if (!existsCustomInformationPrefixColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformationPrefix VARCHAR(255) DEFAULT '';"); + } + + if (!existsCustomInformationStylesheetColumn) { + jdbcTmp.update("ALTER TABLE systemSettings ADD COLUMN customInformationStylesheet VARCHAR(255) DEFAULT 'color: green; font-size: 2em;';"); + } + } +} diff --git a/src/org/scada_lts/mango/service/SystemSettingsService.java b/src/org/scada_lts/mango/service/SystemSettingsService.java index 34ebdc7c44..86d27dfbbd 100644 --- a/src/org/scada_lts/mango/service/SystemSettingsService.java +++ b/src/org/scada_lts/mango/service/SystemSettingsService.java @@ -146,7 +146,7 @@ public JsonSettingsMisc getMiscSettings() { json.setWebResourceUploadsPath(SystemSettingsDAO.getValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH)); json.setEventAssignEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.EVENT_ASSIGN_ENABLED)); json.setCustomInformation(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION)); - json.setCustomInformationStylesheet(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET)); + json.setCustomInformationPrefix(SystemSettingsDAO.getValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX)); return json; } @@ -165,8 +165,7 @@ public void saveMiscSettings(JsonSettingsMisc json) { systemSettingsDAO.setValue(SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH, json.getWebResourceUploadsPath()); saveEventAssignEnabled(json.isEventAssignEnabled()); systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION, json.getCustomInformation()); - systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_STYLESHEET, json.getCustomInformationStylesheet()); - + systemSettingsDAO.setValue(SystemSettingsDAO.CUSTOM_INFORMATION_PREFIX, json.getCustomInformationPrefix()); } public SettingsDataRetention getDataRetentionSettings() { diff --git a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java index 1fc7f3af82..66ffaba076 100644 --- a/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java +++ b/src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java @@ -18,7 +18,7 @@ public class JsonSettingsMisc implements Serializable { public String webResourceUploadsPath; public boolean eventAssignEnabled; public String customInformation; - public String customInformationStylesheet; + public String customInformationPrefix; public JsonSettingsMisc() {} @@ -134,11 +134,11 @@ public void setCustomInformation(String customInformation){ this.customInformation = customInformation; } - public String getCustomInformationStylesheet(){ - return customInformationStylesheet; + public String getCustomInformationPrefix(){ + return customInformationPrefix; } - public void setCustomInformationStylesheet(String customInformationStylesheet){ - this.customInformationStylesheet = customInformationStylesheet; + public void setCustomInformationPrefix(String customInformationPrefix){ + this.customInformationPrefix = customInformationPrefix; } } diff --git a/webapp-resources/messages_de.properties b/webapp-resources/messages_de.properties index bcad018345..57d80f8820 100644 --- a/webapp-resources/messages_de.properties +++ b/webapp-resources/messages_de.properties @@ -3346,7 +3346,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_en.properties b/webapp-resources/messages_en.properties index 254261fff3..1782df3abb 100644 --- a/webapp-resources/messages_en.properties +++ b/webapp-resources/messages_en.properties @@ -3350,7 +3350,7 @@ event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored systemsettings.custom.information = Custom information to display -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix events.assigneeByUser=- {0} events.assign=Assign events.unassign=Unassign diff --git a/webapp-resources/messages_es.properties b/webapp-resources/messages_es.properties index 36b0189619..da29bd33f2 100644 --- a/webapp-resources/messages_es.properties +++ b/webapp-resources/messages_es.properties @@ -3389,7 +3389,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_fi.properties b/webapp-resources/messages_fi.properties index 1ba327e1f4..3657f638f9 100644 --- a/webapp-resources/messages_fi.properties +++ b/webapp-resources/messages_fi.properties @@ -3474,7 +3474,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_fr.properties b/webapp-resources/messages_fr.properties index 92ce3aa90a..db9aefa63c 100644 --- a/webapp-resources/messages_fr.properties +++ b/webapp-resources/messages_fr.properties @@ -3343,7 +3343,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_lu.properties b/webapp-resources/messages_lu.properties index 4865f3bd3e..7070dd400d 100644 --- a/webapp-resources/messages_lu.properties +++ b/webapp-resources/messages_lu.properties @@ -3362,7 +3362,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_nl.properties b/webapp-resources/messages_nl.properties index 7f793f1737..d77e234ba2 100644 --- a/webapp-resources/messages_nl.properties +++ b/webapp-resources/messages_nl.properties @@ -3464,7 +3464,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_pl.properties b/webapp-resources/messages_pl.properties index c18e7d658c..ec4d28d867 100644 --- a/webapp-resources/messages_pl.properties +++ b/webapp-resources/messages_pl.properties @@ -3486,7 +3486,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_pt.properties b/webapp-resources/messages_pt.properties index f13b8a04bc..08d773a250 100644 --- a/webapp-resources/messages_pt.properties +++ b/webapp-resources/messages_pt.properties @@ -3501,7 +3501,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_ru.properties b/webapp-resources/messages_ru.properties index e6938624e3..5f4202e0ce 100644 --- a/webapp-resources/messages_ru.properties +++ b/webapp-resources/messages_ru.properties @@ -3497,7 +3497,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign diff --git a/webapp-resources/messages_zh.properties b/webapp-resources/messages_zh.properties index 96dec3f32c..dcc0411f72 100644 --- a/webapp-resources/messages_zh.properties +++ b/webapp-resources/messages_zh.properties @@ -3449,7 +3449,7 @@ event.script.failure=Failed execute script: "{0}", Message: "{1}" event.system.sms=Sms send failure event.system.script=Script event handler failure validate.valueRestored=Previous value restored -systemsettings.custom.information.stylesheet = Custom information stylesheet +systemsettings.custom.information.prefix = Custom information prefix systemsettings.custom.information = Custom information to display events.assigneeByUser=- {0} events.assign=Assign From e63cfcbc056f624d179d413ff035f58ed4ad71f3 Mon Sep 17 00:00:00 2001 From: patrykb0802 Date: Thu, 22 Aug 2024 17:15:55 +0200 Subject: [PATCH 4/9] #1580 Improvement describe information about scada on top Improvements in css files --- WebContent/WEB-INF/jsp/systemSettings.jsp | 20 ++++++------ WebContent/WEB-INF/tags/logo.tag | 10 +++--- WebContent/assets/user_styles.css | 27 ++++++++++------ scadalts-ui/src/locales/en.json | 4 +-- .../SystemSettings/MiscSettingsComponent.vue | 8 ++--- .../mango/web/dwr/SystemSettingsDwr.java | 14 ++++---- src/org/scada_lts/config/ScadaVersion.java | 12 +++---- src/org/scada_lts/dao/SystemSettingsDAO.java | 8 ++--- ...opDescriptionColumnsToSystemSettings.java} | 32 +++++++++---------- .../mango/service/SystemSettingsService.java | 8 ++--- .../web/mvc/api/json/JsonSettingsMisc.java | 20 ++++++------ webapp-resources/messages_de.properties | 4 +-- webapp-resources/messages_en.properties | 4 +-- webapp-resources/messages_es.properties | 4 +-- webapp-resources/messages_fi.properties | 4 +-- webapp-resources/messages_fr.properties | 4 +-- webapp-resources/messages_lu.properties | 4 +-- webapp-resources/messages_nl.properties | 4 +-- webapp-resources/messages_pl.properties | 4 +-- webapp-resources/messages_pt.properties | 4 +-- webapp-resources/messages_ru.properties | 4 +-- webapp-resources/messages_zh.properties | 4 +-- 22 files changed, 107 insertions(+), 100 deletions(-) rename src/org/scada_lts/dao/migration/mysql/{V2_8_0_2_AddCustomInformationColumnsToSystemSettings.java => V2_8_0_2_AddTopDescriptionColumnsToSystemSettings.java} (56%) diff --git a/WebContent/WEB-INF/jsp/systemSettings.jsp b/WebContent/WEB-INF/jsp/systemSettings.jsp index 85a5af8ed6..fd00d49ebc 100644 --- a/WebContent/WEB-INF/jsp/systemSettings.jsp +++ b/WebContent/WEB-INF/jsp/systemSettings.jsp @@ -119,8 +119,8 @@ sel.options[sel.options.length] = new Option("${lang.value}", "${lang.key}"); $set(sel, settings.); - $set("", settings.); - $set("", settings.); + $set("", settings.); + $set("", settings.); }); <%-- @@ -353,8 +353,8 @@ SystemSettingsDwr.saveInfoSettings("0", //$get(""), $get(""), - $get(""), - $get(""), + $get(""), + $get(""), function() { stopImageFader("saveInfoSettingsImg"); setUserMessage("infoMessage", ""); @@ -639,16 +639,16 @@
- "/>" type="text" class="formShort" style="width: 300px;"/> + "/>" type="text" class="formShort" style="width: 300px;"/>
- "/>" type="text" class="formShort" style="width: 300px;"/> - + "/>" type="text" class="formShort" style="width: 300px;"/> +