From 0758c8e25bd0dd84d2376e2491c615780966e74a Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 26 Sep 2023 18:25:05 +0300 Subject: [PATCH 01/87] Update ConfigBase.cs --- ScadaCommon/ScadaCommon/Config/ConfigBase.cs | 35 ++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/ScadaCommon/ScadaCommon/Config/ConfigBase.cs b/ScadaCommon/ScadaCommon/Config/ConfigBase.cs index ad6f98652..782675069 100644 --- a/ScadaCommon/ScadaCommon/Config/ConfigBase.cs +++ b/ScadaCommon/ScadaCommon/Config/ConfigBase.cs @@ -20,13 +20,14 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2022 + * Modified : 2023 */ using Scada.Lang; using Scada.Storages; using System; using System.IO; +using System.Text; namespace Scada.Config { @@ -134,7 +135,37 @@ public bool Load(string fileName, out string errMsg) return false; } } - + + /// + /// Saves the configuration to the specified storage. + /// + public bool Save(IStorage storage, string fileName, out string errMsg) + { + if (storage == null) + throw new ArgumentNullException(nameof(storage)); + + try + { + using (MemoryStream stream = new MemoryStream()) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + Save(writer); + string contents = Encoding.UTF8.GetString(stream.ToArray()); + storage.WriteText(DataCategory.Config, fileName, contents); + } + } + + errMsg = ""; + return true; + } + catch (Exception ex) + { + errMsg = BuildSaveErrorMessage(ex); + return false; + } + } + /// /// Saves the configuration to the specified file. /// From 22855b027c3a463ac1f68af864e39c3c344fec76 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 26 Sep 2023 19:13:13 +0300 Subject: [PATCH 02/87] Update ConnectionStringBuilder.cs --- .../ScadaCommon/Dbms/ConnectionStringBuilder.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs index e4463c2a6..450d0ae25 100644 --- a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs +++ b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs @@ -102,16 +102,25 @@ public static string Build(DbConnectionOptions options, KnownDBMS forceDBMS, boo } /// - /// Builds a connection string according to the database connection options, overwriting the DBMS. + /// Builds a connection string according to the database connection options. /// If a non-empty connection string is specified in the options, it is returned. /// public static string BuildConnectionString(this DbConnectionOptions options) + { + return BuildConnectionString(options, false); + } + + /// + /// Builds a connection string according to the database connection options. + /// If a non-empty connection string is specified in the options, it is returned. + /// + public static string BuildConnectionString(this DbConnectionOptions options, bool hidePassword) { if (options == null) return ""; return string.IsNullOrEmpty(options.ConnectionString) - ? Build(options, false) + ? Build(options, hidePassword) : options.ConnectionString; } From e0918841f280f3fe47d2dc0f545d307e7873e7d4 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 26 Sep 2023 19:20:49 +0300 Subject: [PATCH 03/87] Update ConnectionStringBuilder.cs --- .../ScadaCommon/Dbms/ConnectionStringBuilder.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs index 450d0ae25..139116947 100644 --- a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs +++ b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs @@ -116,10 +116,7 @@ public static string BuildConnectionString(this DbConnectionOptions options) /// public static string BuildConnectionString(this DbConnectionOptions options, bool hidePassword) { - if (options == null) - return ""; - - return string.IsNullOrEmpty(options.ConnectionString) + return string.IsNullOrEmpty(options?.ConnectionString) ? Build(options, hidePassword) : options.ConnectionString; } @@ -130,10 +127,7 @@ public static string BuildConnectionString(this DbConnectionOptions options, boo /// public static string BuildConnectionString(this DbConnectionOptions options, KnownDBMS forceDBMS) { - if (options == null) - return ""; - - return string.IsNullOrEmpty(options.ConnectionString) + return string.IsNullOrEmpty(options?.ConnectionString) ? Build(options, forceDBMS, false) : options.ConnectionString; } From 3e4b42564fe76b6cc35bbbfd92cc9c135b3afe5d Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 27 Sep 2023 11:55:12 +0300 Subject: [PATCH 04/87] ScadaWeb: update css --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 5 +++++ .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 5 +++++ ScadaWeb/ScadaWeb/ScadaWeb/ScadaWeb.csproj | 2 +- .../ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css | 3 ++- .../ScadaWeb/wwwroot/css/layouts/main-layout.min.css | 2 +- .../ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss | 3 ++- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 4e75c5269..b3606d9b6 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -28,6 +28,11 @@

Webstation History

Webstation Application

+
ScadaWeb 6.1.2.2 (In progress)
+
    +
  • Changes in CSS
  • +
+
ScadaWeb 6.1.2.1 (September 25, 2023)