From f964790d80d66776e3171e37f4d0bf75dbac25e0 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 16 May 2023 19:03:02 +0300 Subject: [PATCH 001/184] ScadaDoc: update history --- .../Version61/VersionHistory/WebstationHistory.cshtml | 11 +++++++++++ .../Version61/VersionHistory/WebstationHistory.cshtml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index cba4b0270..2345d7005 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -11,6 +11,7 @@
  • Webstation Application
  • Chart
  • Chart Pro
  • +
  • Elastic Report
  • Guard
  • Main Plugin
  • Schemes
  • @@ -85,6 +86,16 @@
  • Option to display trend color according to channel status
  • +

    Elastic Report

    +
    PlgElasticReport 6.0.0.0 (May 15, 2023)
    + +

    Guard

    PlgGuard 6.0.0.0 (December 03, 2022)
    +

    Гибкий отчёт

    +
    PlgElasticReport 6.0.0.0 (15.05.2023)
    + +

    Защитник

    PlgGuard 6.0.0.0 (03.12.2022)

    Communicator Configurator

    +
    ExtCommConfig 6.0.1.2 (In development)
    + +
    ExtCommConfig 6.0.1.1 (April 02, 2023)

    Конфигуратор Коммуникатора

    +
    ExtCommConfig 6.0.1.2 (В разработке)
    + +
    ExtCommConfig 6.0.1.1 (02.04.2023)

    Chart

    +
    PlgChart 6.0.1.0 (In development)
    + +
    PlgChart 6.0.0.1 (January 17, 2023)

    Chart Pro

    -
    PlgChartPro 6.0.0.4 (In development)
    +
    PlgChartPro 6.0.1.0 (In development)
    @@ -119,7 +124,7 @@

    Main Plugin

    -
    PlgMain 6.0.1.2 (In development)
    +
    PlgMain 6.0.2.0 (In development)

    Графики

    +
    PlgChart 6.0.1.0 (В разработке)
    + +
    PlgChart 6.0.0.1 (17.01.2023)

    Графики Про

    -
    PlgChartPro 6.0.0.4 (В разработке)
    +
    PlgChartPro 6.0.1.0 (В разработке)
    @@ -119,7 +124,7 @@

    Основной плагин

    -
    PlgMain 6.0.1.2 (В разработке)
    +
    PlgMain 6.0.2.0 (В разработке)

    Elastic Report

    -
    PlgElasticReport 6.0.0.1 (In development)
    +
    PlgElasticReport 6.0.1.0 (In development)
      -
    • Reports library changes taken into account
    • +
    • Supports audit log
    PlgElasticReport 6.0.0.0 (May 15, 2023)
    diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 89cff221b..d1019ca30 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -104,9 +104,9 @@

    Гибкий отчёт

    -
    PlgElasticReport 6.0.0.1 (В разработке)
    +
    PlgElasticReport 6.0.1.0 (В разработке)
      -
    • Учтены изменения в библиотеке отчётов
    • +
    • Поддержка журнала аудита
    PlgElasticReport 6.0.0.0 (15.05.2023)
    From 3512a165cf54c35d28e17a1178f8fd5e9c2d4adc Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 14:20:43 +0300 Subject: [PATCH 130/184] PlgChart: support audit log --- .../VersionHistory/WebstationHistory.cshtml | 1 + .../VersionHistory/WebstationHistory.cshtml | 1 + .../PlgChart/Areas/Chart/Pages/Chart.cshtml.cs | 15 ++++++++++++++- .../ScadaWebCommon/Audit/AuditActionType.cs | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 59f52d072..9c51ae435 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -58,6 +58,7 @@

    Chart

    PlgChart 6.0.1.0 (In development)
      +
    • Supports audit log
    • JavaScript refactoring
    diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index d1019ca30..6bbd1dbdb 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -58,6 +58,7 @@

    Графики

    PlgChart 6.0.1.0 (В разработке)
      +
    • Поддержка журнала аудита
    • Рефакторинг JavaScript
    diff --git a/ScadaWeb/OpenPlugins/PlgChart/Areas/Chart/Pages/Chart.cshtml.cs b/ScadaWeb/OpenPlugins/PlgChart/Areas/Chart/Pages/Chart.cshtml.cs index 149d2a4fc..79c78f443 100644 --- a/ScadaWeb/OpenPlugins/PlgChart/Areas/Chart/Pages/Chart.cshtml.cs +++ b/ScadaWeb/OpenPlugins/PlgChart/Areas/Chart/Pages/Chart.cshtml.cs @@ -7,6 +7,7 @@ using Scada.Data.Const; using Scada.Lang; using Scada.Web.Api; +using Scada.Web.Audit; using Scada.Web.Authorization; using Scada.Web.Plugins.PlgChart.Code; using Scada.Web.Services; @@ -23,12 +24,15 @@ public class ChartModel : PageModel { private readonly IWebContext webContext; private readonly IUserContext userContext; + private readonly IAuditLog auditLog; private readonly IClientAccessor clientAccessor; - public ChartModel(IWebContext webContext, IUserContext userContext, IClientAccessor clientAccessor) + public ChartModel(IWebContext webContext, IUserContext userContext, + IAuditLog auditLog, IClientAccessor clientAccessor) { this.webContext = webContext; this.userContext = userContext; + this.auditLog = auditLog; this.clientAccessor = clientAccessor; } @@ -81,6 +85,15 @@ public void OnGet(IntRange cnlNums, DateTime startDate, string archive, int? gap .AppendLine(); ChartDataHtml = new HtmlString(sbChartData.ToString()); + + // write to audit log + auditLog.Write(new AuditLogEntry(userContext.UserEntity) + { + ActionType = AuditActionType.OpenChart, + ActionArgs = AuditActionArgs.FromObject(new { CnlNum = cnlNum }), + ActionResult = AuditActionResult.Success, + Severity = Severity.Info + }); } } } diff --git a/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditActionType.cs b/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditActionType.cs index 4ea74459a..decc2b11a 100644 --- a/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditActionType.cs +++ b/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditActionType.cs @@ -42,6 +42,7 @@ static AuditActionType() Login = "Вход в систему"; Logout = "Выход из системы"; OpenView = "Просмотр представления"; + OpenChart = "Просмотр графика"; GenerateReport = "Формирование отчёта"; SendCommand = "Отправка команды"; } @@ -50,6 +51,7 @@ static AuditActionType() Login = "Login"; Logout = "Logout"; OpenView = "Open view"; + OpenChart = "Open chart"; GenerateReport = "Generate report"; SendCommand = "Send command"; } @@ -58,6 +60,7 @@ static AuditActionType() public static string Login { get; private set; } public static string Logout { get; private set; } public static string OpenView { get; private set; } + public static string OpenChart { get; private set; } public static string GenerateReport { get; private set; } public static string SendCommand { get; private set; } } From d9142855036f0da4d5d69f40ea74771b1c12a6b8 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 14:23:21 +0300 Subject: [PATCH 131/184] ScadaDoc: update plugin history --- .../Pages/En/Version61/VersionHistory/WebstationHistory.cshtml | 1 + .../Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml | 1 + 2 files changed, 2 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 9c51ae435..49aa76487 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -77,6 +77,7 @@

    Chart Pro

    PlgChartPro 6.0.1.0 (In development)
      +
    • Supports audit log
    • JavaScript refactoring
    diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 6bbd1dbdb..f060cd93f 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -77,6 +77,7 @@

    Графики Про

    PlgChartPro 6.0.1.0 (В разработке)
      +
    • Поддержка журнала аудита
    • Рефакторинг JavaScript
    From 75338f94731ba12b0b31457ab008de20cee6b516 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 14:43:37 +0300 Subject: [PATCH 132/184] Update LoginService.cs --- .../ScadaWeb/ScadaWeb/Code/LoginService.cs | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs index bf786f516..f97040dd0 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs @@ -26,8 +26,10 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Http; +using Scada.Data.Const; using Scada.Data.Models; using Scada.Lang; +using Scada.Web.Audit; using Scada.Web.Config; using Scada.Web.Lang; using Scada.Web.Plugins; @@ -46,6 +48,7 @@ namespace Scada.Web.Code internal class LoginService : ILoginService { private readonly IWebContext webContext; + private readonly IAuditLog auditLog; private readonly IClientAccessor clientAccessor; private readonly HttpContext httpContext; @@ -53,11 +56,12 @@ internal class LoginService : ILoginService /// /// Initializes a new instance of the class. /// - public LoginService(IWebContext webContext, IClientAccessor clientAccessor, - IHttpContextAccessor httpContextAccessor) + public LoginService(IWebContext webContext, IAuditLog auditLog, + IClientAccessor clientAccessor, IHttpContextAccessor httpContextAccessor) { this.webContext = webContext ?? throw new ArgumentNullException(nameof(webContext)); - this.clientAccessor = clientAccessor; + this.auditLog = auditLog ?? throw new ArgumentNullException(nameof(auditLog)); + this.clientAccessor = clientAccessor ?? throw new ArgumentNullException(nameof(clientAccessor)); httpContext = httpContextAccessor?.HttpContext ?? throw new ArgumentException("HTTP context must not be null.", nameof(httpContextAccessor)); } @@ -126,6 +130,16 @@ public async Task LoginAsync(string username, string password, boo webContext.PluginHolder.OnUserLogin(userLoginArgs); + // write to audit log + auditLog.Write(new AuditLogEntry() + { + Username = username, + ActionType = AuditActionType.Login, + ActionResult = AuditActionResult.FromBool(userLoginArgs.UserIsValid), + Severity = userLoginArgs.UserIsValid ? Severity.Info : Severity.Major, + Message = userLoginArgs.FriendlyError + }); + // show login result if (userLoginArgs.UserIsValid) { @@ -156,6 +170,7 @@ public async Task LogoutAsync() { if (httpContext.User.IsAuthenticated()) { + // perform logout UserLoginArgs userLoginArgs = new() { Username = httpContext.User.GetUsername(), @@ -174,6 +189,15 @@ public async Task LogoutAsync() "User {0} is logged out, IP {1}", userLoginArgs.Username, userLoginArgs.RemoteIP); webContext.PluginHolder.OnUserLogout(userLoginArgs); + + // write to audit log + auditLog.Write(new AuditLogEntry() + { + Username = userLoginArgs.Username, + ActionType = AuditActionType.Logout, + ActionResult = AuditActionResult.Success, + Severity = Severity.Info + }); } } } From d32dabcca9505a668d45ddc23502798e983a544e Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 16:05:19 +0300 Subject: [PATCH 133/184] ScadaWeb: audit loading views --- ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs | 109 ++++++++++++------ 1 file changed, 72 insertions(+), 37 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs index 28b097c45..012d5bf48 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs @@ -20,20 +20,21 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2021 + * Modified : 2023 */ using Microsoft.Extensions.Caching.Memory; +using Scada.Data.Const; using Scada.Data.Entities; using Scada.Data.Models; using Scada.Lang; using Scada.Protocol; using Scada.Storages; +using Scada.Web.Audit; using Scada.Web.Lang; using Scada.Web.Plugins; using Scada.Web.Services; using System; -using System.Collections.Generic; using System.IO; namespace Scada.Web.Code @@ -46,17 +47,20 @@ internal class ViewLoader : IViewLoader { private readonly IWebContext webContext; private readonly IUserContext userContext; + private readonly IAuditLog auditLog; private readonly IClientAccessor clientAccessor; private readonly IMemoryCache memoryCache; + /// /// Initializes a new instance of the class. /// - public ViewLoader(IWebContext webContext, IUserContext userContext, + public ViewLoader(IWebContext webContext, IUserContext userContext, IAuditLog auditLog, IClientAccessor clientAccessor, IMemoryCache memoryCache) { this.webContext = webContext ?? throw new ArgumentNullException(nameof(webContext)); this.userContext = userContext ?? throw new ArgumentNullException(nameof(userContext)); + this.auditLog = auditLog ?? throw new ArgumentNullException(nameof(auditLog)); this.clientAccessor = clientAccessor ?? throw new ArgumentNullException(nameof(clientAccessor)); this.memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache)); } @@ -120,15 +124,31 @@ private bool GetViewSpec(View viewEntity, out ViewSpec viewSpec, out string errM /// /// Creates and loads the specified view. /// - private ViewBase GetView(View viewEntity, Type viewType) + private bool GetView(View viewEntity, Type viewType, out ViewBase view, out string errMsg) { try { - ViewBase view = (ViewBase)Activator.CreateInstance(viewType, viewEntity); + // get exact view type if needed + if (viewType == typeof(ViewBase)) + { + if (GetViewSpec(viewEntity, out ViewSpec viewSpec, out errMsg)) + { + viewType = viewSpec.ViewType; + } + else + { + view = null; + return false; + } + } + + // create view + view = (ViewBase)Activator.CreateInstance(viewType, viewEntity); if (webContext.PluginHolder.GetPluginByViewType(viewType, out PluginLogic pluginLogic)) pluginLogic.PrepareView(view); + // load view if (view.StoredOnServer) { if (webContext.Storage.ViewAvailable) @@ -139,7 +159,8 @@ private ViewBase GetView(View viewEntity, Type viewType) view.Build(); view.Bind(webContext.ConfigDatabase); - return view; + errMsg = ""; + return true; } catch (Exception ex) { @@ -147,7 +168,10 @@ private ViewBase GetView(View viewEntity, Type viewType) "Ошибка при загрузке представления с ид. {0} по пути {1}" : "Error loading view with ID {0} by the path {1}", viewEntity.ViewID, viewEntity.Path); - return null; + + view = null; + errMsg = WebPhrases.UnableLoadView; + return false; } } @@ -207,6 +231,21 @@ private void LoadViewFromServer(ViewBase view, string path) } } + /// + /// Writes the entry to the audit log. + /// + private void WriteToAuditLog(int viewID, bool success, string message) + { + auditLog.Write(new AuditLogEntry(userContext.UserEntity) + { + ActionType = AuditActionType.OpenView, + ActionArgs = AuditActionArgs.FromObject(new { ViewID = viewID }), + ActionResult = AuditActionResult.FromBool(success), + Severity = success ? Severity.Info : Severity.Minor, + Message = message + }); + } + /// /// Gets a specification of the specified view. @@ -227,45 +266,41 @@ public bool GetViewSpec(int viewID, out ViewSpec viewSpec, out string errMsg) /// public bool GetView(int viewID, out T view, out string errMsg) where T : ViewBase { - if (!ValidateView(viewID, out View viewEntity, out errMsg)) - { - view = null; - return false; - } - - Type viewType = typeof(T); + bool success = false; + bool audit = false; + string message = null; - if (viewType == typeof(ViewBase)) + if (ValidateView(viewID, out View viewEntity, out string msg1)) { - if (GetViewSpec(viewEntity, out ViewSpec viewSpec, out errMsg)) + view = (T)memoryCache.GetOrCreate(WebUtils.GetViewCacheKey(viewID), entry => { - viewType = viewSpec.ViewType; - } - else - { - view = null; - return false; - } - } + if (!GetView(viewEntity, typeof(T), out ViewBase createdView, out string msg2)) + message = msg2; - view = (T)memoryCache.GetOrCreate(WebUtils.GetViewCacheKey(viewID), entry => - { - ViewBase viewBase = GetView(viewEntity, viewType); - entry.SetSlidingExpiration(viewBase == null ? - WebUtils.ErrorCacheExpiration : WebUtils.ViewCacheExpiration); - entry.AddExpirationToken(webContext); - return viewBase; - }); + audit = true; + entry.SetSlidingExpiration(createdView == null + ? WebUtils.ErrorCacheExpiration + : WebUtils.ViewCacheExpiration); + entry.AddExpirationToken(webContext); + return createdView; + }); - if (view == null) - { - errMsg = WebPhrases.UnableLoadView; - return false; + if (view == null) + message ??= WebPhrases.UnableLoadView; + else + success = true; } else { - return true; + view = null; + message = msg1; } + + if (audit) + WriteToAuditLog(viewID, success, message); + + errMsg = message; + return success; } /// From 39ca49004af348a18c0af317ba666ecf96d5902f Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 17:14:03 +0300 Subject: [PATCH 134/184] ScadaDoc: update plugin history --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 7 +++++++ .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 49aa76487..0cdd6a8db 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -11,6 +11,7 @@
  • Webstation Application
  • Chart
  • Chart Pro
  • +
  • Dashboard
  • Elastic Report
  • Guard
  • Main Plugin
  • @@ -105,6 +106,12 @@
  • Option to display trend color according to channel status
  • +

    Dashboard

    +
    PlgDashboard 6.0.0.0 (In development)
    +
      +
    • Links to charts and sending commands from current data widgets
    • +
    +

    Elastic Report

    PlgElasticReport 6.0.1.0 (In development)
    +

    Дэшборды

    +
    PlgDashboard 6.0.0.0 (В разработке)
    +
      +
    • Ссылки на графики и отправка команд из виджетов текущих данных
    • +
    +

    Гибкий отчёт

    PlgElasticReport 6.0.1.0 (В разработке)
      From f456cf2cbd3c65b34d8576344e6cbd662f3667bd Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 17:25:55 +0300 Subject: [PATCH 135/184] ScadaWeb: view loader, enable audit parameter --- ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs | 6 ++---- .../ScadaWeb/ScadaWebCommon/Services/IViewLoader.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs index 012d5bf48..e6b552894 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs @@ -264,10 +264,9 @@ public bool GetViewSpec(int viewID, out ViewSpec viewSpec, out string errMsg) /// /// Gets a view from the server or cache. /// - public bool GetView(int viewID, out T view, out string errMsg) where T : ViewBase + public bool GetView(int viewID, bool enableAudit, out T view, out string errMsg) where T : ViewBase { bool success = false; - bool audit = false; string message = null; if (ValidateView(viewID, out View viewEntity, out string msg1)) @@ -277,7 +276,6 @@ public bool GetView(int viewID, out T view, out string errMsg) where T : View if (!GetView(viewEntity, typeof(T), out ViewBase createdView, out string msg2)) message = msg2; - audit = true; entry.SetSlidingExpiration(createdView == null ? WebUtils.ErrorCacheExpiration : WebUtils.ViewCacheExpiration); @@ -296,7 +294,7 @@ public bool GetView(int viewID, out T view, out string errMsg) where T : View message = msg1; } - if (audit) + if (enableAudit) WriteToAuditLog(viewID, success, message); errMsg = message; diff --git a/ScadaWeb/ScadaWeb/ScadaWebCommon/Services/IViewLoader.cs b/ScadaWeb/ScadaWeb/ScadaWebCommon/Services/IViewLoader.cs index 479f475f5..7094fba09 100644 --- a/ScadaWeb/ScadaWeb/ScadaWebCommon/Services/IViewLoader.cs +++ b/ScadaWeb/ScadaWeb/ScadaWebCommon/Services/IViewLoader.cs @@ -20,7 +20,7 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2021 + * Modified : 2023 */ using Scada.Data.Models; @@ -42,7 +42,15 @@ public interface IViewLoader /// /// Gets a view from the server or cache. /// - bool GetView(int viewID, out T view, out string errMsg) where T : ViewBase; + bool GetView(int viewID, bool enableAudit, out T view, out string errMsg) where T : ViewBase; + + /// + /// Gets a view from the server or cache. + /// + bool GetView(int viewID, out T view, out string errMsg) where T : ViewBase + { + return GetView(viewID, false, out view, out errMsg); + } /// /// Gets a view from the cache. From ff0534857b1edf66120a51c76d9a341a2e0a492e Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 17:31:40 +0300 Subject: [PATCH 136/184] Update TableView.cshtml.cs --- .../OpenPlugins/PlgMain/Areas/Main/Pages/TableView.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/TableView.cshtml.cs b/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/TableView.cshtml.cs index 2ff9dbb14..27ee1ba8d 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/TableView.cshtml.cs +++ b/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/TableView.cshtml.cs @@ -67,7 +67,7 @@ private void LoadView(int? id, string localDate) { ViewID = id ?? userContext.Views.GetFirstViewID() ?? 0; - if (viewLoader.GetView(ViewID, out tableView, out string errMsg)) + if (viewLoader.GetView(ViewID, true, out tableView, out string errMsg)) { TableOptions tableOptions = pluginContext.GetTableOptions(tableView); ArchiveBit = webContext.ConfigDatabase.FindArchiveBit( From e89a0cc1895a0d009e0ea38b8697b371fef61988 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 17:37:05 +0300 Subject: [PATCH 137/184] PlgWebPage: support audit --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 5 +++++ .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 5 +++++ ScadaWeb/OpenPlugins/PlgWebPage.View/PlgWebPage.View.csproj | 5 +++-- .../PlgWebPage/Areas/WebPage/Pages/Landing.cshtml.cs | 2 +- ScadaWeb/OpenPlugins/PlgWebPage/PlgWebPage.csproj | 5 +++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 0cdd6a8db..6a2ae98fe 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -208,6 +208,11 @@

    Web Pages

    +
    PlgWebPage 6.0.1.0 (In development)
    +
      +
    • Supports audit log
    • +
    +
    PlgWebPage 6.0.0.0 (December 03, 2022)
    • Porting the plugin to the new version
    • diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 5f4ce6d65..5731cad48 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -208,6 +208,11 @@

    Веб-страницы

    +
    PlgWebPage 6.0.1.0 (В разработке)
    +
      +
    • Поддержка журнала аудита
    • +
    +
    PlgWebPage 6.0.0.0 (03.12.2022)
    • Портирование плагина на новую версию
    • diff --git a/ScadaWeb/OpenPlugins/PlgWebPage.View/PlgWebPage.View.csproj b/ScadaWeb/OpenPlugins/PlgWebPage.View/PlgWebPage.View.csproj index 265fb17b9..e4f5d81f1 100644 --- a/ScadaWeb/OpenPlugins/PlgWebPage.View/PlgWebPage.View.csproj +++ b/ScadaWeb/OpenPlugins/PlgWebPage.View/PlgWebPage.View.csproj @@ -5,11 +5,12 @@ enable disable Scada.Web.Plugins.PlgWebPage.View - 6.0.0 Mikhail Shiryaev Rapid Software LLC Rapid SCADA - Copyright © 2022 + Copyright © 2023 + 6.0.1 + 6.0.1.0 diff --git a/ScadaWeb/OpenPlugins/PlgWebPage/Areas/WebPage/Pages/Landing.cshtml.cs b/ScadaWeb/OpenPlugins/PlgWebPage/Areas/WebPage/Pages/Landing.cshtml.cs index 685e6fe20..03546f384 100644 --- a/ScadaWeb/OpenPlugins/PlgWebPage/Areas/WebPage/Pages/Landing.cshtml.cs +++ b/ScadaWeb/OpenPlugins/PlgWebPage/Areas/WebPage/Pages/Landing.cshtml.cs @@ -33,7 +33,7 @@ public void OnGet(int? id) { int viewID = id ?? userContext.Views.GetFirstViewID() ?? 0; - if (viewLoader.GetView(viewID, out WebPageView webPageView, out string errMsg)) + if (viewLoader.GetView(viewID, true, out WebPageView webPageView, out string errMsg)) { ViewData["Title"] = webPageView.Title; diff --git a/ScadaWeb/OpenPlugins/PlgWebPage/PlgWebPage.csproj b/ScadaWeb/OpenPlugins/PlgWebPage/PlgWebPage.csproj index c9d967eaf..20d5d7c90 100644 --- a/ScadaWeb/OpenPlugins/PlgWebPage/PlgWebPage.csproj +++ b/ScadaWeb/OpenPlugins/PlgWebPage/PlgWebPage.csproj @@ -6,11 +6,12 @@ enable true Scada.Web.Plugins.PlgWebPage - 6.0.0 Mikhail Shiryaev Rapid Software LLC Rapid SCADA - Copyright © 2022 + Copyright © 2023 + 6.0.1 + 6.0.1.0 From e710d7952b338442a80883ebc60dd29a6584fb5e Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 17:38:23 +0300 Subject: [PATCH 138/184] PlgScheme: enable audit when load scheme --- .../OpenPlugins/PlgScheme/Controllers/SchemeApiController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScadaWeb/OpenPlugins/PlgScheme/Controllers/SchemeApiController.cs b/ScadaWeb/OpenPlugins/PlgScheme/Controllers/SchemeApiController.cs index f3da7d7e2..d81cc626e 100644 --- a/ScadaWeb/OpenPlugins/PlgScheme/Controllers/SchemeApiController.cs +++ b/ScadaWeb/OpenPlugins/PlgScheme/Controllers/SchemeApiController.cs @@ -53,7 +53,7 @@ public Dto GetSchemeDoc(int viewID, long viewStamp) { try { - if (viewLoader.GetView(viewID, out SchemeView schemeView, out string errMsg)) + if (viewLoader.GetView(viewID, true, out SchemeView schemeView, out string errMsg)) { DocumentPacket documentPacket = new(schemeView); documentPacket.FillCnlProps(webContext.ConfigDatabase); From 7e6a4fc6f5892f45050e1c0520e353b11428695c Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 15 Jun 2023 18:01:21 +0300 Subject: [PATCH 139/184] Update ViewLoader.cs --- ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs index e6b552894..4bafe3e92 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/ViewLoader.cs @@ -273,14 +273,19 @@ public bool GetView(int viewID, bool enableAudit, out T view, out string errM { view = (T)memoryCache.GetOrCreate(WebUtils.GetViewCacheKey(viewID), entry => { - if (!GetView(viewEntity, typeof(T), out ViewBase createdView, out string msg2)) - message = msg2; - - entry.SetSlidingExpiration(createdView == null - ? WebUtils.ErrorCacheExpiration - : WebUtils.ViewCacheExpiration); entry.AddExpirationToken(webContext); - return createdView; + + if (GetView(viewEntity, typeof(T), out ViewBase createdView, out string msg2)) + { + entry.SetSlidingExpiration(WebUtils.ViewCacheExpiration); + return createdView; + } + else + { + entry.SetSlidingExpiration(WebUtils.ErrorCacheExpiration); + message = msg2; + return null; + } }); if (view == null) From a63bbc142dc0d8077105974fdb05d20c05aeccbf Mon Sep 17 00:00:00 2001 From: 2mik Date: Fri, 16 Jun 2023 15:50:33 +0300 Subject: [PATCH 140/184] Create StorageCode.cs --- .../ScadaCommon/Data/Const/StorageCode.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs diff --git a/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs b/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs new file mode 100644 index 000000000..1d24bcbb6 --- /dev/null +++ b/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs @@ -0,0 +1,39 @@ +/* + * Copyright 2023 Rapid Software LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * Product : Rapid SCADA + * Module : ScadaCommon + * Summary : Specifies the storage codes + * + * Author : Mikhail Shiryaev + * Created : 2023 + * Modified : 2023 + */ + +#pragma warning disable 1591 // Missing XML comment for publicly visible type or member + +namespace Scada.Data.Const +{ + /// + /// Specifies the storage codes. + /// Задаёт коды хранилищ. + /// + public static class StorageCode + { + public const string FileStorage = nameof(FileStorage); + public const string PostgreSqlStorage = nameof(PostgreSqlStorage); + } +} From 0a9355e168bd40c5c49bb8bddc49305d04e7e24e Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 12:48:28 +0300 Subject: [PATCH 141/184] Update ScadaWebConfig.xml --- ScadaWeb/ScadaWeb/ScadaWebCommon/Config/ScadaWebConfig.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ScadaWeb/ScadaWeb/ScadaWebCommon/Config/ScadaWebConfig.xml b/ScadaWeb/ScadaWeb/ScadaWebCommon/Config/ScadaWebConfig.xml index 0a0be3949..7b96e059f 100644 --- a/ScadaWeb/ScadaWeb/ScadaWebCommon/Config/ScadaWebConfig.xml +++ b/ScadaWeb/ScadaWeb/ScadaWebCommon/Config/ScadaWebConfig.xml @@ -45,6 +45,9 @@ + +
    private static readonly TimeSpan ConnectAttemptPeriod = TimeSpan.FromSeconds(10); - private TimeSpan waitTimeout; // how long to wait for connection - private DbConnectionOptions connOptions; // the database connection options - private NpgsqlConnection conn; // the database connection + private TimeSpan waitTimeout; // how long to wait for connection + private NpgsqlConnection conn; // the database connection /// @@ -60,7 +58,6 @@ public PostgreSqlStorageLogic(StorageContext storageContext) : base(storageContext) { waitTimeout = TimeSpan.Zero; - connOptions = null; conn = null; } @@ -291,12 +288,6 @@ public override void LoadConfig(XmlElement xmlElement) { base.LoadConfig(xmlElement); waitTimeout = TimeSpan.FromSeconds(xmlElement.GetChildAsInt("WaitTimeout")); - - if (xmlElement.SelectSingleNode("Connection") is XmlNode connectionNode) - { - connOptions = new DbConnectionOptions(); - connOptions.LoadFromXml(connectionNode); - } } /// @@ -304,10 +295,7 @@ public override void LoadConfig(XmlElement xmlElement) /// public override void MakeReady() { - if (connOptions == null) - throw new ScadaException(CommonPhrases.ConnOptionsNotFound); - - conn = CreateDbConnection(connOptions); + conn = CreateDbConnection(StorageContext.InstanceConfig.Connection); // wait for connection DateTime utcNow = DateTime.UtcNow; diff --git a/ScadaCommon/ScadaCommon.MultiDb/DataSource.cs b/ScadaCommon/ScadaCommon.MultiDb/DataSource.cs index e45dc5124..b716fceda 100644 --- a/ScadaCommon/ScadaCommon.MultiDb/DataSource.cs +++ b/ScadaCommon/ScadaCommon.MultiDb/DataSource.cs @@ -3,7 +3,6 @@ using Scada.Dbms; using System.Data.Common; -using System.Diagnostics; namespace Scada.MultiDb { diff --git a/ScadaCommon/ScadaCommon/Config/InstanceConfig.cs b/ScadaCommon/ScadaCommon/Config/InstanceConfig.cs index ad1d64930..1d9fc3747 100644 --- a/ScadaCommon/ScadaCommon/Config/InstanceConfig.cs +++ b/ScadaCommon/ScadaCommon/Config/InstanceConfig.cs @@ -20,9 +20,10 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2021 + * Modified : 2023 */ +using Scada.Dbms; using Scada.Lang; using System; using System.Collections.Generic; @@ -72,6 +73,11 @@ public InstanceConfig() /// public string ActiveStorage { get; set; } + /// + /// Gets the default database connection options. + /// + public DbConnectionOptions Connection { get; private set; } + /// /// Gets the storage configurations accessed by storage code. /// @@ -86,6 +92,7 @@ private void SetToDefault() Culture = Locale.DefaultCulture.Name; LogDir = ""; ActiveStorage = DefaultStorageCode; + Connection = new DbConnectionOptions(); Storages = new SortedList(); } @@ -106,6 +113,9 @@ public bool Load(string fileName, out string errMsg) LogDir = rootElem.GetChildAsString("LogDir"); ActiveStorage = rootElem.GetChildAsString("ActiveStorage"); + if (rootElem.SelectSingleNode("Connection") is XmlNode connectionNode) + Connection.LoadFromXml(connectionNode); + if (rootElem.SelectSingleNode("Storages") is XmlNode storagesNode) { foreach (XmlElement storageElem in storagesNode.SelectNodes("Storage")) @@ -144,6 +154,7 @@ public bool Save(string fileName, out string errMsg) rootElem.AppendElem("Culture", Culture); rootElem.AppendElem("LogDir", LogDir); rootElem.AppendElem("ActiveStorage", ActiveStorage); + Connection.SaveToXml(rootElem.AppendElem("Connection")); XmlElement storagesElem = rootElem.AppendElem("Storages"); foreach (XmlElement storageElem in Storages.Values) diff --git a/ScadaCommon/ScadaCommon/Config/ScadaInstanceConfig.xml b/ScadaCommon/ScadaCommon/Config/ScadaInstanceConfig.xml index f92767105..b2fdab093 100644 --- a/ScadaCommon/ScadaCommon/Config/ScadaInstanceConfig.xml +++ b/ScadaCommon/ScadaCommon/Config/ScadaInstanceConfig.xml @@ -3,6 +3,15 @@ en-GB FileStorage + + Default Connection + PostgreSQL + localhost + rapid_scada + postgres + 4D83D8AEB31C1B40335A78AF3539DD22 + + false @@ -10,14 +19,6 @@ true 30 - - PostgreConn - localhost - rapid_scada - postgres - 4D83D8AEB31C1B40335A78AF3539DD22 - - diff --git a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs index f24072dbb..fe47edfe0 100644 --- a/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs +++ b/ScadaCommon/ScadaCommon/Dbms/ConnectionStringBuilder.cs @@ -20,11 +20,10 @@ * * Author : Mikhail Shiryaev * Created : 2022 - * Modified : 2022 + * Modified : 2023 */ using Scada.Lang; -using System; namespace Scada.Dbms { @@ -59,19 +58,28 @@ private static int GetDefaultPort(KnownDBMS knownDBMS) } /// - /// Builds a connection string. + /// Builds a connection string according to the database connection options. /// public static string Build(DbConnectionOptions options, bool hidePassword) + { + return Build(options, KnownDBMS.Undefined, hidePassword); + } + + /// + /// Builds a connection string according to the database connection options, overwriting the DBMS. + /// + public static string Build(DbConnectionOptions options, KnownDBMS forceDBMS, bool hidePassword) { if (options == null) return ""; + KnownDBMS knownDBMS = forceDBMS == KnownDBMS.Undefined ? options.KnownDBMS : forceDBMS; string password = hidePassword ? CommonPhrases.HiddenPassword : options.Password; - switch (options.KnownDBMS) + switch (knownDBMS) { case KnownDBMS.PostgreSQL: - ScadaUtils.RetrieveHostAndPort(options.Server, GetDefaultPort(options.KnownDBMS), + ScadaUtils.RetrieveHostAndPort(options.Server, GetDefaultPort(knownDBMS), out string host, out int port); return string.Format("Server={0};Port={1};Database={2};User Id={3};Password={4}", host, port, options.Database, options.Username, password); @@ -92,5 +100,19 @@ public static string Build(DbConnectionOptions options, bool hidePassword) return ""; } } + + /// + /// Builds a connection string according to the database connection options, overwriting the DBMS. + /// If a non-empty connection string is specified in the options, it is returned. + /// + public static string BuildConnectionString(this DbConnectionOptions options, KnownDBMS forceDBMS) + { + if (options == null) + return ""; + + return string.IsNullOrEmpty(options.ConnectionString) + ? Build(options, forceDBMS, false) + : options.ConnectionString; + } } } diff --git a/ScadaCommon/ScadaCommon/Storages/StorageContext.cs b/ScadaCommon/ScadaCommon/Storages/StorageContext.cs index 302ee3c4d..1fc2595af 100644 --- a/ScadaCommon/ScadaCommon/Storages/StorageContext.cs +++ b/ScadaCommon/ScadaCommon/Storages/StorageContext.cs @@ -20,9 +20,10 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2021 + * Modified : 2023 */ +using Scada.Config; using Scada.Log; namespace Scada.Storages @@ -31,8 +32,14 @@ namespace Scada.Storages /// Represents an application storage environment. /// Представляет окружение хранилища приложения. /// + /// Use the required and init keywords in C# 11. public class StorageContext { + /// + /// Gets or sets the instance configuration. + /// + public InstanceConfig InstanceConfig { get; set; } + /// /// Gets or sets the current application. /// diff --git a/ScadaCommon/ScadaCommon/Storages/StorageWrapper.cs b/ScadaCommon/ScadaCommon/Storages/StorageWrapper.cs index de1f81a5e..264b0b4e5 100644 --- a/ScadaCommon/ScadaCommon/Storages/StorageWrapper.cs +++ b/ScadaCommon/ScadaCommon/Storages/StorageWrapper.cs @@ -20,10 +20,9 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2021 + * Modified : 2023 */ -using Scada.Config; using Scada.Lang; using System; @@ -36,17 +35,15 @@ namespace Scada.Storages public class StorageWrapper { private readonly StorageContext storageContext; - private readonly InstanceConfig instanceConfig; private StorageLogic storageLogic; /// /// Initializes a new instance of the class. /// - public StorageWrapper(StorageContext storageContext, InstanceConfig instanceConfig) + public StorageWrapper(StorageContext storageContext) { this.storageContext = storageContext ?? throw new ArgumentNullException(nameof(storageContext)); - this.instanceConfig = instanceConfig ?? throw new ArgumentNullException(nameof(instanceConfig)); storageLogic = null; } @@ -62,8 +59,8 @@ public StorageWrapper(StorageContext storageContext, InstanceConfig instanceConf /// public bool InitStorage() { - if (StorageFactory.GetStorage(storageContext.AppDirs.ExeDir, instanceConfig.ActiveStorage, storageContext, - out storageLogic, out string message)) + if (StorageFactory.GetStorage(storageContext.AppDirs.ExeDir, storageContext.InstanceConfig.ActiveStorage, + storageContext, out storageLogic, out string message)) { storageContext.Log.WriteAction(message); } @@ -75,7 +72,7 @@ public bool InitStorage() try { - storageLogic.LoadConfig(instanceConfig.GetActiveStorageXml()); + storageLogic.LoadConfig(storageContext.InstanceConfig.GetActiveStorageXml()); storageLogic.MakeReady(); storageLogic.IsReady = true; return true; From e1b4c5966bdad9aeae678a62c7a7bf1b9b6b066e Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:07:43 +0300 Subject: [PATCH 143/184] Delete StorageCode.cs --- .../ScadaCommon/Data/Const/StorageCode.cs | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs diff --git a/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs b/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs deleted file mode 100644 index 1d24bcbb6..000000000 --- a/ScadaCommon/ScadaCommon/Data/Const/StorageCode.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023 Rapid Software LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * Product : Rapid SCADA - * Module : ScadaCommon - * Summary : Specifies the storage codes - * - * Author : Mikhail Shiryaev - * Created : 2023 - * Modified : 2023 - */ - -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member - -namespace Scada.Data.Const -{ - /// - /// Specifies the storage codes. - /// Задаёт коды хранилищ. - /// - public static class StorageCode - { - public const string FileStorage = nameof(FileStorage); - public const string PostgreSqlStorage = nameof(PostgreSqlStorage); - } -} From b862d9999037fc43956be25a5b9bf1cc1802da09 Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:13:05 +0300 Subject: [PATCH 144/184] ScadaDoc: update module history --- .../Pages/En/Version61/VersionHistory/ServerHistory.cshtml | 5 +++++ .../Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml | 5 +++++ .../ModArcPostgreSql.View/ModArcPostgreSql.View.csproj | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml index ef424b169..ba6bc72bf 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml @@ -113,6 +113,11 @@ @**** ModArcPostgreSql ****@

    PostgreSQL Archive

    +
    ModArcPostgreSql 6.1.1.0 (In development)
    +
      +
    • Changes in archive options
    • +
    +
    ModArcPostgreSql 6.1.0.0 (March 21, 2023)
    • Refactoring and optimization
    • diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml index 121fc8239..02cf6ea52 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml @@ -113,6 +113,11 @@ @**** ModArcPostgreSql ****@

      Архив PostgreSQL

      +
      ModArcPostgreSql 6.1.1.0 (В разработке)
      +
        +
      • Изменения в параметрах архивов
      • +
      +
      ModArcPostgreSql 6.1.0.0 (21.03.2023)
      • Рефакторинг и оптимизация
      • diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/ModArcPostgreSql.View.csproj b/ScadaServer/OpenModules/ModArcPostgreSql.View/ModArcPostgreSql.View.csproj index 336ba714d..8d2318d23 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/ModArcPostgreSql.View.csproj +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/ModArcPostgreSql.View.csproj @@ -12,8 +12,8 @@ Rapid Software LLC Rapid SCADA Copyright © 2023 - 6.1.0 - 6.1.0.0 + 6.1.1 + 6.1.1.0 From 3c167197e3f02bb1742bf154a1ea9a31fb2bed19 Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:14:35 +0300 Subject: [PATCH 145/184] ModArcPostgreSql: UseDefaultConn option --- .../ModArcPostgreSql.Logic/DbUtils.cs | 38 ----------------- .../ModArcPostgreSql.Logic.csproj | 4 +- .../ModArcPostgreSql.Logic/PostgreCAL.cs | 6 +-- .../ModArcPostgreSql.Logic/PostgreEAL.cs | 6 +-- .../ModArcPostgreSql.Logic/PostgreHAL.cs | 6 +-- .../Config/IDatabaseOptions.cs | 4 +- .../Config/ModuleConfig.cs | 12 ++++++ .../Config/PostgreCAO.cs | 8 ++-- .../Config/PostgreEAO.cs | 8 ++-- .../Config/PostgreHAO.cs | 8 ++-- .../Controls/CtrlDatabaseOptions.Designer.cs | 42 +++++++++---------- .../Controls/CtrlDatabaseOptions.cs | 8 ++-- .../Forms/FrmPostgreCAO.Designer.cs | 42 +++++++++---------- .../Forms/FrmPostgreCAO.cs | 8 ++-- .../Lang/ModArcPostgreSql.en-GB.xml | 4 +- .../Lang/ModArcPostgreSql.ru-RU.xml | 4 +- 16 files changed, 91 insertions(+), 117 deletions(-) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/DbUtils.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/DbUtils.cs index 7fb0145a2..c6292e2b7 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/DbUtils.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/DbUtils.cs @@ -2,12 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Npgsql; -using Scada.Config; using Scada.Dbms; -using Scada.Lang; using Scada.Server.Modules.ModArcPostgreSql.Config; using System.Globalization; -using System.Xml; namespace Scada.Server.Modules.ModArcPostgreSql.Logic { @@ -17,10 +14,6 @@ namespace Scada.Server.Modules.ModArcPostgreSql.Logic /// internal static class DbUtils { - /// - /// The code of the storage that contains connection options. - /// - private const string StorageCode = "PostgreSqlStorage"; /// /// The date format used for naming partitions. /// @@ -40,37 +33,6 @@ private static bool ParsePartitionDate(string s, out DateTime result) CultureInfo.InvariantCulture, DateTimeStyles.None, out result); } - /// - /// Gets the connection options from the module configuration. - /// - public static DbConnectionOptions GetConnectionOptions(ModuleConfig moduleConfig, string connName) - { - ArgumentNullException.ThrowIfNull(moduleConfig, nameof(moduleConfig)); - ArgumentNullException.ThrowIfNull(connName, nameof(connName)); - - return moduleConfig.Connections.TryGetValue(connName, out DbConnectionOptions connOptions) - ? connOptions - : throw new ScadaException(CommonPhrases.ConnectionNotFound, connName); - } - - /// - /// Gets the connection options from the instance configuration. - /// - public static DbConnectionOptions GetConnectionOptions(InstanceConfig instanceConfig) - { - ArgumentNullException.ThrowIfNull(instanceConfig, nameof(instanceConfig)); - - if (instanceConfig.Storages.TryGetValue(StorageCode, out XmlElement storageElem) && - storageElem.SelectSingleNode("Connection") is XmlNode connectionNode) - { - DbConnectionOptions connOptions = new(); - connOptions.LoadFromXml(connectionNode); - return connOptions; - } - - throw new ScadaException(CommonPhrases.ConnOptionsNotFound); - } - /// /// Creates a database connection. /// diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/ModArcPostgreSql.Logic.csproj b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/ModArcPostgreSql.Logic.csproj index 5dfe8eff4..9ae42e82f 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/ModArcPostgreSql.Logic.csproj +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/ModArcPostgreSql.Logic.csproj @@ -10,8 +10,8 @@ Rapid Software LLC Rapid SCADA Copyright © 2023 - 6.1.0 - 6.1.0.0 + 6.1.1 + 6.1.1.0 diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreCAL.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreCAL.cs index ac8d911a4..2b50b2327 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreCAL.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreCAL.cs @@ -132,9 +132,9 @@ private void Execute() public override void MakeReady() { // prepare database - connOptions = options.UseStorageConn - ? DbUtils.GetConnectionOptions(ArchiveContext.InstanceConfig) - : DbUtils.GetConnectionOptions(moduleConfig, options.Connection); + connOptions = options.UseDefaultConn + ? ArchiveContext.InstanceConfig.Connection + : moduleConfig.GetConnectionOptions(options.Connection); readingConn = DbUtils.CreateDbConnection(connOptions); if (!options.ReadOnly) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreEAL.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreEAL.cs index 9b31d367e..73e110cca 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreEAL.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreEAL.cs @@ -206,9 +206,9 @@ private void Execute() public override void MakeReady() { // prepare database - connOptions = options.UseStorageConn - ? DbUtils.GetConnectionOptions(ArchiveContext.InstanceConfig) - : DbUtils.GetConnectionOptions(moduleConfig, options.Connection); + connOptions = options.UseDefaultConn + ? ArchiveContext.InstanceConfig.Connection + : moduleConfig.GetConnectionOptions(options.Connection); readingConn = DbUtils.CreateDbConnection(connOptions); writingConn = DbUtils.CreateDbConnection(connOptions); diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreHAL.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreHAL.cs index cf53849c3..bd570b83e 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreHAL.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Logic/PostgreHAL.cs @@ -335,9 +335,9 @@ private void Execute() public override void MakeReady() { // prepare database - connOptions = options.UseStorageConn - ? DbUtils.GetConnectionOptions(ArchiveContext.InstanceConfig) - : DbUtils.GetConnectionOptions(moduleConfig, options.Connection); + connOptions = options.UseDefaultConn + ? ArchiveContext.InstanceConfig.Connection + : moduleConfig.GetConnectionOptions(options.Connection); readingConn = DbUtils.CreateDbConnection(connOptions); if (!options.ReadOnly) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/IDatabaseOptions.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/IDatabaseOptions.cs index 3af2130a6..e52d4074d 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/IDatabaseOptions.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/IDatabaseOptions.cs @@ -10,9 +10,9 @@ namespace Scada.Server.Modules.ModArcPostgreSql.Config internal interface IDatabaseOptions { /// - /// Gets or sets a value indicating whether to use a connection specified in the storage configuration. + /// Gets or sets a value indicating whether to use a connection specified in the instance configuration. /// - bool UseStorageConn { get; set; } + bool UseDefaultConn { get; set; } /// /// Gets or sets the connection name. diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/ModuleConfig.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/ModuleConfig.cs index 52e7610e9..c87bc2950 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/ModuleConfig.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/ModuleConfig.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Dbms; +using Scada.Lang; using System.Xml; namespace Scada.Server.Modules.ModArcPostgreSql.Config @@ -71,5 +72,16 @@ protected override void Save(TextWriter writer) xmlDoc.Save(writer); } + + + /// + /// Gets the connection options by name, or raises an exception. + /// + public DbConnectionOptions GetConnectionOptions(string connectionName) + { + return Connections.TryGetValue(connectionName, out DbConnectionOptions options) + ? options + : throw new ScadaException(CommonPhrases.ConnectionNotFound, connectionName); + } } } diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreCAO.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreCAO.cs index 532c8c3dc..d003ea098 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreCAO.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreCAO.cs @@ -18,7 +18,7 @@ internal class PostgreCAO : CurrentArchiveOptions public PostgreCAO(OptionList options) : base(options) { - UseStorageConn = options.GetValueAsBool("UseStorageConn", true); + UseDefaultConn = options.GetValueAsBool("UseDefaultConn", true); Connection = options.GetValueAsString("Connection"); MaxQueueSize = options.GetValueAsInt("MaxQueueSize", ModuleUtils.DefaultQueueSize); BatchSize = options.GetValueAsInt("BatchSize", ModuleUtils.DefaultBatchSize); @@ -26,9 +26,9 @@ public PostgreCAO(OptionList options) /// - /// Gets or sets a value indicating whether to use a connection specified in the storage configuration. + /// Gets or sets a value indicating whether to use a connection specified in the instance configuration. /// - public bool UseStorageConn { get; set; } + public bool UseDefaultConn { get; set; } /// /// Gets or sets the connection name. @@ -52,7 +52,7 @@ public PostgreCAO(OptionList options) public override void AddToOptionList(OptionList options) { base.AddToOptionList(options); - options["UseStorageConn"] = UseStorageConn.ToLowerString(); + options["UseDefaultConn"] = UseDefaultConn.ToLowerString(); options["Connection"] = Connection; if (!ReadOnly) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreEAO.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreEAO.cs index 90157e8d6..659bf5595 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreEAO.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreEAO.cs @@ -18,7 +18,7 @@ internal class PostgreEAO : EventArchiveOptions, IDatabaseOptions public PostgreEAO(OptionList options) : base(options) { - UseStorageConn = options.GetValueAsBool("UseStorageConn", true); + UseDefaultConn = options.GetValueAsBool("UseDefaultConn", true); Connection = options.GetValueAsString("Connection"); PartitionSize = options.GetValueAsEnum("PartitionSize", PartitionSize.OneMonth); MaxQueueSize = options.GetValueAsInt("MaxQueueSize", ModuleUtils.DefaultQueueSize); @@ -27,9 +27,9 @@ public PostgreEAO(OptionList options) /// - /// Gets or sets a value indicating whether to use a connection specified in the storage configuration. + /// Gets or sets a value indicating whether to use a connection specified in the instance configuration. /// - public bool UseStorageConn { get; set; } + public bool UseDefaultConn { get; set; } /// /// Gets or sets the connection name. @@ -58,7 +58,7 @@ public PostgreEAO(OptionList options) public override void AddToOptionList(OptionList options) { base.AddToOptionList(options); - options["UseStorageConn"] = UseStorageConn.ToLowerString(); + options["UseDefaultConn"] = UseDefaultConn.ToLowerString(); options["Connection"] = Connection; if (!ReadOnly) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreHAO.cs b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreHAO.cs index 86f8bc833..9a3c33198 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreHAO.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.Shared/Config/PostgreHAO.cs @@ -18,7 +18,7 @@ internal class PostgreHAO : HistoricalArchiveOptions, IDatabaseOptions public PostgreHAO(OptionList options) : base(options) { - UseStorageConn = options.GetValueAsBool("UseStorageConn", true); + UseDefaultConn = options.GetValueAsBool("UseDefaultConn", true); Connection = options.GetValueAsString("Connection"); PartitionSize = options.GetValueAsEnum("PartitionSize", PartitionSize.OneMonth); MaxQueueSize = options.GetValueAsInt("MaxQueueSize", ModuleUtils.DefaultQueueSize); @@ -27,9 +27,9 @@ public PostgreHAO(OptionList options) /// - /// Gets or sets a value indicating whether to use a connection specified in the storage configuration. + /// Gets or sets a value indicating whether to use a connection specified in the instance configuration. /// - public bool UseStorageConn { get; set; } + public bool UseDefaultConn { get; set; } /// /// Gets or sets the connection name. @@ -58,7 +58,7 @@ public PostgreHAO(OptionList options) public override void AddToOptionList(OptionList options) { base.AddToOptionList(options); - options["UseStorageConn"] = UseStorageConn.ToLowerString(); + options["UseDefaultConn"] = UseDefaultConn.ToLowerString(); options["Connection"] = Connection; if (!ReadOnly) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.Designer.cs b/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.Designer.cs index 742bc7f51..a31d95f95 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.Designer.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.Designer.cs @@ -37,8 +37,8 @@ private void InitializeComponent() lblPartitionSize = new Label(); cbConnection = new ComboBox(); lblConnection = new Label(); - chkUseStorageConn = new CheckBox(); - lblUseStorageConn = new Label(); + chkUseDefaultConn = new CheckBox(); + lblUseDefaultConn = new Label(); gbDbOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)numBatchSize).BeginInit(); ((System.ComponentModel.ISupportInitialize)numMaxQueueSize).BeginInit(); @@ -54,8 +54,8 @@ private void InitializeComponent() gbDbOptions.Controls.Add(lblPartitionSize); gbDbOptions.Controls.Add(cbConnection); gbDbOptions.Controls.Add(lblConnection); - gbDbOptions.Controls.Add(chkUseStorageConn); - gbDbOptions.Controls.Add(lblUseStorageConn); + gbDbOptions.Controls.Add(chkUseDefaultConn); + gbDbOptions.Controls.Add(lblUseDefaultConn); gbDbOptions.Location = new Point(0, 0); gbDbOptions.Name = "gbDbOptions"; gbDbOptions.Padding = new Padding(10, 3, 10, 10); @@ -134,24 +134,24 @@ private void InitializeComponent() lblConnection.TabIndex = 2; lblConnection.Text = "Connection"; // - // chkUseStorageConn + // chkUseDefaultConn // - chkUseStorageConn.AutoSize = true; - chkUseStorageConn.Location = new Point(332, 26); - chkUseStorageConn.Name = "chkUseStorageConn"; - chkUseStorageConn.Size = new Size(15, 14); - chkUseStorageConn.TabIndex = 1; - chkUseStorageConn.UseVisualStyleBackColor = true; - chkUseStorageConn.CheckedChanged += chkUseStorageConn_CheckedChanged; + chkUseDefaultConn.AutoSize = true; + chkUseDefaultConn.Location = new Point(332, 26); + chkUseDefaultConn.Name = "chkUseDefaultConn"; + chkUseDefaultConn.Size = new Size(15, 14); + chkUseDefaultConn.TabIndex = 1; + chkUseDefaultConn.UseVisualStyleBackColor = true; + chkUseDefaultConn.CheckedChanged += chkUseDefaultConn_CheckedChanged; // - // lblUseStorageConn + // lblUseDefaultConn // - lblUseStorageConn.AutoSize = true; - lblUseStorageConn.Location = new Point(13, 26); - lblUseStorageConn.Name = "lblUseStorageConn"; - lblUseStorageConn.Size = new Size(131, 15); - lblUseStorageConn.TabIndex = 0; - lblUseStorageConn.Text = "Use storage connection"; + lblUseDefaultConn.AutoSize = true; + lblUseDefaultConn.Location = new Point(13, 26); + lblUseDefaultConn.Name = "lblUseDefaultConn"; + lblUseDefaultConn.Size = new Size(131, 15); + lblUseDefaultConn.TabIndex = 0; + lblUseDefaultConn.Text = "Use default connection"; // // CtrlDatabaseOptions // @@ -178,7 +178,7 @@ private void InitializeComponent() private Label lblMaxQueueSize; private ComboBox cbConnection; private Label lblConnection; - private CheckBox chkUseStorageConn; - private Label lblUseStorageConn; + private CheckBox chkUseDefaultConn; + private Label lblUseDefaultConn; } } diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.cs b/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.cs index 312c760c6..84024d294 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Controls/CtrlDatabaseOptions.cs @@ -60,7 +60,7 @@ private void OptionsToControls() } else { - chkUseStorageConn.Checked = options.UseStorageConn; + chkUseDefaultConn.Checked = options.UseDefaultConn; cbConnection.Text = options.Connection; cbPartitionSize.SelectedIndex = (int)options.PartitionSize; numMaxQueueSize.SetValue(options.MaxQueueSize); @@ -75,7 +75,7 @@ public void ControlsToOptions() { if (options != null) { - options.UseStorageConn = chkUseStorageConn.Checked; + options.UseDefaultConn = chkUseDefaultConn.Checked; options.Connection = cbConnection.Text; options.PartitionSize = (PartitionSize)cbPartitionSize.SelectedIndex; options.MaxQueueSize = Convert.ToInt32(numMaxQueueSize.Value); @@ -84,9 +84,9 @@ public void ControlsToOptions() } - private void chkUseStorageConn_CheckedChanged(object sender, EventArgs e) + private void chkUseDefaultConn_CheckedChanged(object sender, EventArgs e) { - cbConnection.Enabled = !chkUseStorageConn.Checked; + cbConnection.Enabled = !chkUseDefaultConn.Checked; } } } diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.Designer.cs b/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.Designer.cs index eb6062bc0..1d719ff46 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.Designer.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.Designer.cs @@ -30,14 +30,14 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { ctrlCurrentArchiveOptions = new Server.Forms.Controls.CtrlCurrentArchiveOptions(); - chkUseStorageConn = new CheckBox(); + chkUseDefaultConn = new CheckBox(); cbConnection = new ComboBox(); btnManageConn = new Button(); lblMaxQueueSize = new Label(); numMaxQueueSize = new NumericUpDown(); btnCancel = new Button(); btnOK = new Button(); - lblUseStorageConn = new Label(); + lblUseDefaultConn = new Label(); lblConnection = new Label(); gbDbOptions = new GroupBox(); numBatchSize = new NumericUpDown(); @@ -55,15 +55,15 @@ private void InitializeComponent() ctrlCurrentArchiveOptions.Size = new Size(360, 116); ctrlCurrentArchiveOptions.TabIndex = 0; // - // chkUseStorageConn + // chkUseDefaultConn // - chkUseStorageConn.AutoSize = true; - chkUseStorageConn.Location = new Point(332, 26); - chkUseStorageConn.Name = "chkUseStorageConn"; - chkUseStorageConn.Size = new Size(15, 14); - chkUseStorageConn.TabIndex = 1; - chkUseStorageConn.UseVisualStyleBackColor = true; - chkUseStorageConn.CheckedChanged += chkUseStorageConn_CheckedChanged; + chkUseDefaultConn.AutoSize = true; + chkUseDefaultConn.Location = new Point(332, 26); + chkUseDefaultConn.Name = "chkUseDefaultConn"; + chkUseDefaultConn.Size = new Size(15, 14); + chkUseDefaultConn.TabIndex = 1; + chkUseDefaultConn.UseVisualStyleBackColor = true; + chkUseDefaultConn.CheckedChanged += chkUseDefaultConn_CheckedChanged; // // cbConnection // @@ -119,14 +119,14 @@ private void InitializeComponent() btnOK.UseVisualStyleBackColor = true; btnOK.Click += btnOK_Click; // - // lblUseStorageConn + // lblUseDefaultConn // - lblUseStorageConn.AutoSize = true; - lblUseStorageConn.Location = new Point(13, 26); - lblUseStorageConn.Name = "lblUseStorageConn"; - lblUseStorageConn.Size = new Size(131, 15); - lblUseStorageConn.TabIndex = 0; - lblUseStorageConn.Text = "Use storage connection"; + lblUseDefaultConn.AutoSize = true; + lblUseDefaultConn.Location = new Point(13, 26); + lblUseDefaultConn.Name = "lblUseDefaultConn"; + lblUseDefaultConn.Size = new Size(131, 15); + lblUseDefaultConn.TabIndex = 0; + lblUseDefaultConn.Text = "Use default connection"; // // lblConnection // @@ -145,8 +145,8 @@ private void InitializeComponent() gbDbOptions.Controls.Add(lblMaxQueueSize); gbDbOptions.Controls.Add(cbConnection); gbDbOptions.Controls.Add(lblConnection); - gbDbOptions.Controls.Add(chkUseStorageConn); - gbDbOptions.Controls.Add(lblUseStorageConn); + gbDbOptions.Controls.Add(chkUseDefaultConn); + gbDbOptions.Controls.Add(lblUseDefaultConn); gbDbOptions.Location = new Point(12, 134); gbDbOptions.Name = "gbDbOptions"; gbDbOptions.Padding = new Padding(10, 3, 10, 10); @@ -201,14 +201,14 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.CheckBox chkUseStorageConn; + private System.Windows.Forms.CheckBox chkUseDefaultConn; private System.Windows.Forms.ComboBox cbConnection; private System.Windows.Forms.Button btnManageConn; private System.Windows.Forms.Label lblMaxQueueSize; private System.Windows.Forms.NumericUpDown numMaxQueueSize; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Label lblUseStorageConn; + private System.Windows.Forms.Label lblUseDefaultConn; private System.Windows.Forms.Label lblConnection; private System.Windows.Forms.GroupBox gbDbOptions; private Server.Forms.Controls.CtrlCurrentArchiveOptions ctrlCurrentArchiveOptions; diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.cs b/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.cs index 43204e288..046def0fc 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.cs +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Forms/FrmPostgreCAO.cs @@ -47,7 +47,7 @@ private void OptionsToControls() ctrlCurrentArchiveOptions.ArchiveOptions = options; // database options - chkUseStorageConn.Checked = options.UseStorageConn; + chkUseDefaultConn.Checked = options.UseDefaultConn; cbConnection.Text = options.Connection; numMaxQueueSize.SetValue(options.MaxQueueSize); numBatchSize.SetValue(options.BatchSize); @@ -62,7 +62,7 @@ private void ControlsToOptions() ctrlCurrentArchiveOptions.ControlsToOptions(); // database options - options.UseStorageConn = chkUseStorageConn.Checked; + options.UseDefaultConn = chkUseDefaultConn.Checked; options.Connection = cbConnection.Text; options.MaxQueueSize = Convert.ToInt32(numMaxQueueSize.Value); options.BatchSize = Convert.ToInt32(numBatchSize.Value); @@ -80,9 +80,9 @@ private void FrmPostgreHAO_Load(object sender, EventArgs e) UiUtils.FillConnections(cbConnection, appDirs.ConfigDir); } - private void chkUseStorageConn_CheckedChanged(object sender, EventArgs e) + private void chkUseDefaultConn_CheckedChanged(object sender, EventArgs e) { - cbConnection.Enabled = !chkUseStorageConn.Checked; + cbConnection.Enabled = !chkUseDefaultConn.Checked; } private void btnManageConn_Click(object sender, EventArgs e) diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.en-GB.xml b/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.en-GB.xml index 65c177bfa..46b68f52c 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.en-GB.xml +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.en-GB.xml @@ -2,7 +2,7 @@ Database Options - Use storage connection + Use default connection Connection Partition size One month @@ -21,7 +21,7 @@ Current Archive Options Database Options - Use storage connection + Use default connection Connection Maximum queue size Items per transaction diff --git a/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.ru-RU.xml b/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.ru-RU.xml index 8cc1cda94..11b30af5c 100644 --- a/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.ru-RU.xml +++ b/ScadaServer/OpenModules/ModArcPostgreSql.View/Lang/ModArcPostgreSql.ru-RU.xml @@ -2,7 +2,7 @@ Параметры базы данных - Соединение хранилища + Соединение по умолчанию Соединение Размер секции Один месяц @@ -21,7 +21,7 @@ Параметры архива текущих данных Параметры базы данных - Соединение хранилища + Соединение по умолчанию Соединение Макс. размер очереди Элементов на транзакцию From 91567a89f8c2d28b3a3307ef6b54fc2f4fc13194 Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:20:06 +0300 Subject: [PATCH 146/184] ScadaCommon: remove ConnOptionsNotFound phrase --- ScadaCommon/ScadaCommon/Lang/CommonPhrases.cs | 2 -- ScadaCommon/ScadaCommon/Lang/ScadaCommon.en-GB.xml | 1 - ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml | 1 - 3 files changed, 4 deletions(-) diff --git a/ScadaCommon/ScadaCommon/Lang/CommonPhrases.cs b/ScadaCommon/ScadaCommon/Lang/CommonPhrases.cs index ece952486..fd746e290 100644 --- a/ScadaCommon/ScadaCommon/Lang/CommonPhrases.cs +++ b/ScadaCommon/ScadaCommon/Lang/CommonPhrases.cs @@ -51,7 +51,6 @@ public static class CommonPhrases public static string ThreadFatalError { get; private set; } public static string WriteInfoError { get; private set; } public static string ConnectionNotFound { get; private set; } - public static string ConnOptionsNotFound { get; private set; } public static string DatabaseNotSupported { get; private set; } public static string OperationNotSupported { get; private set; } public static string CommandSent { get; private set; } @@ -186,7 +185,6 @@ public static void Init() ThreadFatalError = dict[nameof(ThreadFatalError)]; WriteInfoError = dict[nameof(WriteInfoError)]; ConnectionNotFound = dict[nameof(ConnectionNotFound)]; - ConnOptionsNotFound = dict[nameof(ConnOptionsNotFound)]; DatabaseNotSupported = dict[nameof(DatabaseNotSupported)]; OperationNotSupported = dict[nameof(OperationNotSupported)]; CommandSent = dict[nameof(CommandSent)]; diff --git a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.en-GB.xml b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.en-GB.xml index c7179394f..777cf2b84 100644 --- a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.en-GB.xml +++ b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.en-GB.xml @@ -19,7 +19,6 @@ Fatal error in thread Error writing application information to the file Connection "{0}" not found. - Connection options not found. Database not supported. Operation not supported. Command has been sent. diff --git a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml index c2dc9bf14..2caf7b0e0 100644 --- a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml +++ b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml @@ -19,7 +19,6 @@ Неустранимая ошибка в потоке Ошибка при записи в файл информации о работе приложения Соединение "{0}" не найдено. - Параметры соединения не найдены. База данных не поддерживается. Операция не поддерживается. Команда отправлена. From ed5bae6a3a0c7a90158497d83a77b7f9c94f9a3c Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:26:49 +0300 Subject: [PATCH 147/184] ScadaServer: works with new instance config --- .../Pages/En/Version61/VersionHistory/ServerHistory.cshtml | 3 ++- .../Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml | 3 ++- ScadaServer/ScadaServer/ScadaServerApp/ScadaServerApp.csproj | 4 ++-- .../ScadaServerCommon.Forms/ScadaServerCommon.Forms.csproj | 2 +- .../ScadaServer/ScadaServerCommon/ScadaServerCommon.csproj | 2 +- ScadaServer/ScadaServer/ScadaServerEngine/Manager.cs | 5 +++-- .../ScadaServer/ScadaServerEngine/ScadaServerEngine.csproj | 4 ++-- ScadaServer/ScadaServer/ScadaServerWkr/ScadaServerWkr.csproj | 4 ++-- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml index ba6bc72bf..308e82ee0 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml @@ -24,8 +24,9 @@

        Server History

        Server Application

        -
        ScadaServer 6.1.0.3 (In development)
        +
        ScadaServer 6.1.1.0 (In development)
          +
        • Works with new instance configuration
        • Time of writing to archives is set as current when Server starts.
        diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml index 02cf6ea52..f00c6a6b7 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml @@ -24,8 +24,9 @@

        История Сервера

        Приложение Сервер

        -
        ScadaServer 6.1.0.3 (В разработке)
        +
        ScadaServer 6.1.1.0 (В разработке)
          +
        • Работает с новой конфигурацией экземпляра
        • Время записи в архивы устанавливается как текущее при старте Сервера.
        diff --git a/ScadaServer/ScadaServer/ScadaServerApp/ScadaServerApp.csproj b/ScadaServer/ScadaServer/ScadaServerApp/ScadaServerApp.csproj index d05152784..b361056b3 100644 --- a/ScadaServer/ScadaServer/ScadaServerApp/ScadaServerApp.csproj +++ b/ScadaServer/ScadaServer/ScadaServerApp/ScadaServerApp.csproj @@ -8,8 +8,8 @@ Rapid Software LLC Rapid SCADA Copyright © 2023 - 6.1.0 - 6.1.0.3 + 6.1.1 + 6.1.1.0 diff --git a/ScadaServer/ScadaServer/ScadaServerCommon.Forms/ScadaServerCommon.Forms.csproj b/ScadaServer/ScadaServer/ScadaServerCommon.Forms/ScadaServerCommon.Forms.csproj index 857b454d3..b0bb6da39 100644 --- a/ScadaServer/ScadaServer/ScadaServerCommon.Forms/ScadaServerCommon.Forms.csproj +++ b/ScadaServer/ScadaServer/ScadaServerCommon.Forms/ScadaServerCommon.Forms.csproj @@ -8,7 +8,7 @@ enable True Scada.Server.Forms - 6.1.0 + 6.1.1 Mikhail Shiryaev Rapid Software LLC Rapid SCADA diff --git a/ScadaServer/ScadaServer/ScadaServerCommon/ScadaServerCommon.csproj b/ScadaServer/ScadaServer/ScadaServerCommon/ScadaServerCommon.csproj index 7265bda9a..d541f8dc2 100644 --- a/ScadaServer/ScadaServer/ScadaServerCommon/ScadaServerCommon.csproj +++ b/ScadaServer/ScadaServer/ScadaServerCommon/ScadaServerCommon.csproj @@ -4,7 +4,7 @@ netstandard2.0 Scada.Server True - 6.1.0 + 6.1.1 Mikhail Shiryaev Rapid Software LLC Rapid SCADA diff --git a/ScadaServer/ScadaServer/ScadaServerEngine/Manager.cs b/ScadaServer/ScadaServer/ScadaServerEngine/Manager.cs index 5c8cc9217..b011747a0 100644 --- a/ScadaServer/ScadaServer/ScadaServerEngine/Manager.cs +++ b/ScadaServer/ScadaServer/ScadaServerEngine/Manager.cs @@ -20,7 +20,7 @@ * * Author : Mikhail Shiryaev * Created : 2015 - * Modified : 2022 + * Modified : 2023 */ using Scada.Config; @@ -149,10 +149,11 @@ public bool StartService() storageWrapper = new StorageWrapper(new StorageContext { + InstanceConfig = instanceConfig, App = ServiceApp.Server, AppDirs = AppDirs, Log = log - }, instanceConfig); + }); assemblyResolver = new AssemblyResolver(AppDirs.GetProbingDirs()); ServerConfig appConfig = new ServerConfig(); diff --git a/ScadaServer/ScadaServer/ScadaServerEngine/ScadaServerEngine.csproj b/ScadaServer/ScadaServer/ScadaServerEngine/ScadaServerEngine.csproj index be0a9351c..8aaac4dc3 100644 --- a/ScadaServer/ScadaServer/ScadaServerEngine/ScadaServerEngine.csproj +++ b/ScadaServer/ScadaServer/ScadaServerEngine/ScadaServerEngine.csproj @@ -7,8 +7,8 @@ Rapid Software LLC Mikhail Shiryaev Copyright © 2023 - 6.1.0 - 6.1.0.3 + 6.1.1 + 6.1.1.0 diff --git a/ScadaServer/ScadaServer/ScadaServerWkr/ScadaServerWkr.csproj b/ScadaServer/ScadaServer/ScadaServerWkr/ScadaServerWkr.csproj index 4cc092277..3270e35c1 100644 --- a/ScadaServer/ScadaServer/ScadaServerWkr/ScadaServerWkr.csproj +++ b/ScadaServer/ScadaServer/ScadaServerWkr/ScadaServerWkr.csproj @@ -8,8 +8,8 @@ Rapid Software LLC Rapid SCADA Copyright © 2023 - 6.1.0 - 6.1.0.3 + 6.1.1 + 6.1.1.0 From 21aa7bdc5eb7f242a45ee2846a29f3590ba416bb Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:27:52 +0300 Subject: [PATCH 148/184] ScadaComm: works with new instance config --- ScadaComm/ScadaComm/ScadaCommEngine/Manager.cs | 5 +++-- .../En/Version61/VersionHistory/CommunicatorHistory.cshtml | 1 + .../Ru/Version61/VersionHistory/CommunicatorHistory.cshtml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ScadaComm/ScadaComm/ScadaCommEngine/Manager.cs b/ScadaComm/ScadaComm/ScadaCommEngine/Manager.cs index 0a4385b9d..c2d456031 100644 --- a/ScadaComm/ScadaComm/ScadaCommEngine/Manager.cs +++ b/ScadaComm/ScadaComm/ScadaCommEngine/Manager.cs @@ -20,7 +20,7 @@ * * Author : Mikhail Shiryaev * Created : 2020 - * Modified : 2022 + * Modified : 2023 */ using Scada.Comm.Config; @@ -149,10 +149,11 @@ public bool StartService() storageWrapper = new StorageWrapper(new StorageContext { + InstanceConfig = instanceConfig, App = ServiceApp.Comm, AppDirs = AppDirs, Log = log - }, instanceConfig); + }); assemblyResolver = new AssemblyResolver(AppDirs.GetProbingDirs()); CommConfig appConfig = new CommConfig(); diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml index c25fe5df5..529ba85f9 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml @@ -37,6 +37,7 @@

        Communicator Application

        ScadaComm 6.1.1.0 (In development)
          +
        • Works with new instance configuration
        • Device status is set to error if connection is not established
        diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml index ce2a8c497..c3413cd5f 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml @@ -38,6 +38,7 @@

        Приложение Коммуникатор

        ScadaComm 6.1.1.0 (В разработке)
          +
        • Работает с новой конфигурацией экземпляра
        • Статус устройства устанавливается как ошибка, если соединение не установлено
        From 37163c5c35c7f135773574607c6e1696ada76d62 Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:31:31 +0300 Subject: [PATCH 149/184] ScadaWeb: works with new instance config --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 2 +- .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 2 +- ScadaWeb/ScadaWeb/ScadaWeb/Code/WebContext.cs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 6a2ae98fe..021b61141 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -27,9 +27,9 @@

        Webstation Application

        ScadaWeb 6.1.1.0 (In development)
          +
        • Works with new instance configuration
        • Supports audit log
        • Plugins can add JavaScript to the main page
        • -
        • Added phrases to dictionaries
        ScadaWeb 6.1.0.1 (May 15, 2023)
        diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 5731cad48..124150db2 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -27,9 +27,9 @@

        Приложение Вебстанция

        ScadaWeb 6.1.1.0 (В разработке)
          +
        • Работает с новой конфигурацией экземпляра
        • Поддержка журнала аудита
        • Плагины могут добавлять JavaScript на главную страницу
        • -
        • Добавлены фразы в словари
        ScadaWeb 6.1.0.1 (15.05.2023)
        diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/WebContext.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/WebContext.cs index b6403db5b..84afef464 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/WebContext.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/WebContext.cs @@ -20,7 +20,7 @@ * * Author : Mikhail Shiryaev * Created : 2021 - * Modified : 2022 + * Modified : 2023 */ using Scada.Client; @@ -213,10 +213,11 @@ private bool InitStorage() { storageWrapper = new StorageWrapper(new StorageContext { + InstanceConfig = InstanceConfig, App = ServiceApp.Web, AppDirs = AppDirs, Log = Log - }, InstanceConfig); + }); return storageWrapper.InitStorage(); } From 4983b14cfe019b65006af7f6a7da41a43270b80a Mon Sep 17 00:00:00 2001 From: 2mik Date: Sat, 17 Jun 2023 13:36:39 +0300 Subject: [PATCH 150/184] Update ScadaServerConfig.xml --- .../ScadaServerCommon/Config/ScadaServerConfig.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ScadaServer/ScadaServer/ScadaServerCommon/Config/ScadaServerConfig.xml b/ScadaServer/ScadaServer/ScadaServerCommon/Config/ScadaServerConfig.xml index 211ded7d9..8bc566a94 100644 --- a/ScadaServer/ScadaServer/ScadaServerCommon/Config/ScadaServerConfig.xml +++ b/ScadaServer/ScadaServer/ScadaServerCommon/Config/ScadaServerConfig.xml @@ -71,7 +71,7 @@
        public ScadaClient ScadaClient { get; init; } + /// + /// Gets the external database connection string. + /// + public string ConnectionString { get; init; } + /// /// Gets the culture. /// From 1d6a51796cea24eac4c5a78ad36f58897270ac92 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 20 Jun 2023 12:02:17 +0300 Subject: [PATCH 161/184] PlgMain: update report args --- .../PlgMain.Report/EventReportArgs.cs | 27 +------------------ .../PlgMain.Report/HistDataReportArgs.cs | 17 +----------- .../PlgMain.Report/TableViewReportArgs.cs | 14 ---------- .../OpenPlugins/PlgMain/Code/PluginOptions.cs | 2 +- .../PlgMain/Controllers/PrintController.cs | 12 ++++----- 5 files changed, 9 insertions(+), 63 deletions(-) diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportArgs.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportArgs.cs index a4436fe82..890880a7c 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportArgs.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportArgs.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Data.Models; -using Scada.Lang; using Scada.Report; namespace Scada.Web.Plugins.PlgMain.Report @@ -19,14 +18,12 @@ public class EventReportArgs : ReportArgs public EventReportArgs() : base() { - ArchiveCode = ""; TailMode = false; EventCount = 0; EventDepth = 0; View = null; ObjNums = null; Severities = null; - MaxPeriod = 0; } /// @@ -38,6 +35,7 @@ public EventReportArgs(ReportArgs reportArgs) ArgumentNullException.ThrowIfNull(reportArgs, nameof(reportArgs)); StartTime = reportArgs.StartTime; EndTime = reportArgs.EndTime; + MaxPeriod = reportArgs.MaxPeriod; ArchiveCode = reportArgs.ArchiveCode; Format = reportArgs.Format; CustomArgs = reportArgs.CustomArgs; @@ -50,7 +48,6 @@ public EventReportArgs(ReportArgs reportArgs) string severitiesStr = CustomArgs.GetValueAsString("Severities"); ObjNums = string.IsNullOrEmpty(objNumsStr) ? null : ScadaUtils.ParseRange(objNumsStr, true, true); Severities = string.IsNullOrEmpty(severitiesStr) ? null : ScadaUtils.ParseRange(severitiesStr, true, true); - MaxPeriod = 0; } @@ -99,27 +96,5 @@ public EventReportArgs(ReportArgs reportArgs) /// Gets a value indicating whether to filter events by severity. /// public bool FilterBySeverity => Severities != null; - - /// - /// Gets the time maximum report period, in days. - /// - public int MaxPeriod { get; init; } - - - /// - /// Validates the arguments, raises an exception on failure. - /// - public override void Validate() - { - base.Validate(); - - if (MaxPeriod > 0 && (EndTime - StartTime).TotalDays > MaxPeriod) - { - throw new ScadaException(Locale.IsRussian ? - "Превышен период отчёта." : - "Report period exceeded.") - { MessageIsPublic = true }; - } - } } } diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportArgs.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportArgs.cs index cd97e1a8c..10e3f4e33 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportArgs.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportArgs.cs @@ -18,9 +18,7 @@ public class HistDataReportArgs : ReportArgs public HistDataReportArgs() : base() { - ArchiveCode = ""; CnlNums = null; - MaxPeriod = 0; } /// @@ -32,12 +30,12 @@ public HistDataReportArgs(ReportArgs reportArgs) ArgumentNullException.ThrowIfNull(reportArgs, nameof(reportArgs)); StartTime = reportArgs.StartTime; EndTime = reportArgs.EndTime; + MaxPeriod = reportArgs.MaxPeriod; ArchiveCode = reportArgs.ArchiveCode; Format = reportArgs.Format; CustomArgs = reportArgs.CustomArgs; CnlNums = ScadaUtils.ParseRange(CustomArgs.GetValueAsString("CnlNums"), true, true); - MaxPeriod = 0; } @@ -46,11 +44,6 @@ public HistDataReportArgs(ReportArgs reportArgs) /// public IList CnlNums { get; init; } - /// - /// Gets the time maximum report period, in days. - /// - public int MaxPeriod { get; init; } - /// /// Validates the arguments, raises an exception on failure. @@ -66,14 +59,6 @@ public override void Validate() "Channel numbers are missing.") { MessageIsPublic = true }; } - - if (MaxPeriod > 0 && (EndTime - StartTime).TotalDays > MaxPeriod) - { - throw new ScadaException(Locale.IsRussian ? - "Превышен период отчёта." : - "Report period exceeded.") - { MessageIsPublic = true }; - } } } } diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportArgs.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportArgs.cs index 0b257a5df..c21e4a9aa 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportArgs.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportArgs.cs @@ -20,7 +20,6 @@ public TableViewReportArgs() { TableView = null; TableOptions = null; - MaxPeriod = 0; } @@ -34,11 +33,6 @@ public TableViewReportArgs() /// public TableOptions TableOptions { get; init; } - /// - /// Gets the time maximum report period, in days. - /// - public int MaxPeriod { get; init; } - /// /// Validates the arguments, raises an exception on failure. @@ -62,14 +56,6 @@ public override void Validate() "Table view options must not be null.") { MessageIsPublic = true }; } - - if (MaxPeriod > 0 && (EndTime - StartTime).TotalDays > MaxPeriod) - { - throw new ScadaException(Locale.IsRussian ? - "Превышен период отчёта." : - "Report period exceeded.") - { MessageIsPublic = true }; - } } } } diff --git a/ScadaWeb/OpenPlugins/PlgMain/Code/PluginOptions.cs b/ScadaWeb/OpenPlugins/PlgMain/Code/PluginOptions.cs index e67624f49..9df9336e8 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/Code/PluginOptions.cs +++ b/ScadaWeb/OpenPlugins/PlgMain/Code/PluginOptions.cs @@ -61,7 +61,7 @@ public PluginOptions(OptionList options) public int EventDepth { get; set; } /// - /// Gets or sets the time maximum report period, in days. + /// Gets or sets the maximum report period, in days. /// public int MaxReportPeriod { get; set; } diff --git a/ScadaWeb/OpenPlugins/PlgMain/Controllers/PrintController.cs b/ScadaWeb/OpenPlugins/PlgMain/Controllers/PrintController.cs index 9783a1ca2..319d5c747 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/Controllers/PrintController.cs +++ b/ScadaWeb/OpenPlugins/PlgMain/Controllers/PrintController.cs @@ -161,9 +161,9 @@ public IActionResult PrintTableView(int viewID, DateTime startTime, DateTime end { StartTime = userContext.ConvertTimeToUtc(startTime), EndTime = userContext.ConvertTimeToUtc(endTime), + MaxPeriod = pluginContext.Options.MaxReportPeriod, TableView = tableView, - TableOptions = pluginContext.GetTableOptions(tableView), - MaxPeriod = pluginContext.Options.MaxReportPeriod + TableOptions = pluginContext.GetTableOptions(tableView) }, stream); fileName = ReportUtils.BuildFileName(TableViewReportPrefix, @@ -256,10 +256,10 @@ public IActionResult PrintEventReport(DateTime startTime, DateTime endTime, { StartTime = userContext.ConvertTimeToUtc(startTime), EndTime = userContext.ConvertTimeToUtc(endTime), + MaxPeriod = pluginContext.Options.MaxReportPeriod, ArchiveCode = archive, ObjNums = objNums, - Severities = severities, - MaxPeriod = pluginContext.Options.MaxReportPeriod + Severities = severities }; return File( @@ -285,9 +285,9 @@ public IActionResult PrintHistDataReport(DateTime startTime, DateTime endTime, { StartTime = userContext.ConvertTimeToUtc(startTime), EndTime = userContext.ConvertTimeToUtc(endTime), + MaxPeriod = pluginContext.Options.MaxReportPeriod, ArchiveCode = archive, - CnlNums = cnlNums, - MaxPeriod = pluginContext.Options.MaxReportPeriod + CnlNums = cnlNums }, stream); fileName = ReportUtils.BuildFileName(HistDataReportPrefix, From f31760045178928a6dbcdbe62131a81295385c2b Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 20 Jun 2023 16:23:15 +0300 Subject: [PATCH 162/184] Update AuditLogEntry.cs --- ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditLogEntry.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditLogEntry.cs b/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditLogEntry.cs index 18a9ee1b2..329285281 100644 --- a/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditLogEntry.cs +++ b/ScadaWeb/ScadaWeb/ScadaWebCommon/Audit/AuditLogEntry.cs @@ -38,7 +38,7 @@ public class AuditLogEntry /// public AuditLogEntry() { - ActionTime = DateTime.UtcNow; + ActionTime = DateTime.MinValue; Username = null; ActionType = null; ActionArgs = null; @@ -53,6 +53,7 @@ public AuditLogEntry() public AuditLogEntry(User userEntity) : this() { + ActionTime = DateTime.UtcNow; Username = userEntity?.Name; } @@ -60,7 +61,7 @@ public AuditLogEntry(User userEntity) /// /// Gets the action timestamp (UTC). /// - public DateTime ActionTime { get; } + public DateTime ActionTime { get; init; } /// /// Gets the username who performed the action. From cf7ed060704e6d4de242078c7231f0172f341469 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 20 Jun 2023 18:52:27 +0300 Subject: [PATCH 163/184] ScadaWeb: fix writing to audit log --- ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs b/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs index f97040dd0..c6dc0a73f 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs +++ b/ScadaWeb/ScadaWeb/ScadaWeb/Code/LoginService.cs @@ -131,8 +131,9 @@ public async Task LoginAsync(string username, string password, boo webContext.PluginHolder.OnUserLogin(userLoginArgs); // write to audit log - auditLog.Write(new AuditLogEntry() + auditLog.Write(new AuditLogEntry { + ActionTime = DateTime.UtcNow, Username = username, ActionType = AuditActionType.Login, ActionResult = AuditActionResult.FromBool(userLoginArgs.UserIsValid), @@ -191,8 +192,9 @@ public async Task LogoutAsync() webContext.PluginHolder.OnUserLogout(userLoginArgs); // write to audit log - auditLog.Write(new AuditLogEntry() + auditLog.Write(new AuditLogEntry { + ActionTime = DateTime.UtcNow, Username = userLoginArgs.Username, ActionType = AuditActionType.Logout, ActionResult = AuditActionResult.Success, From 5680e41339f79d2df9196a1751dc87c2625d8486 Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 12:52:30 +0300 Subject: [PATCH 164/184] ScadaReport: time to string functions --- ScadaReport/ScadaReport/IReportContext.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ScadaReport/ScadaReport/IReportContext.cs b/ScadaReport/ScadaReport/IReportContext.cs index 783b8bc7f..2a8310e7a 100644 --- a/ScadaReport/ScadaReport/IReportContext.cs +++ b/ScadaReport/ScadaReport/IReportContext.cs @@ -60,6 +60,22 @@ DateTime ConvertTimeFromUtc(DateTime dateTime) return TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZone); } + /// + /// Converts a date and time (UTC) to a string representation in the report's time zone and culture. + /// + string DateTimeToString(DateTime dateTime) + { + return TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZone).ToLocalizedString(Culture); + } + + /// + /// Converts a date (UTC) to a string representation in the report's time zone and culture. + /// + string DateToString(DateTime dateTime) + { + return TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZone).ToLocalizedDateString(Culture); + } + /// /// Finds an archive entity by the first non-empty archive code. /// Raises an exception if not found. From ba8941dfd4df2e9f39d071c1b2ff18f8b49d2535 Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 12:53:00 +0300 Subject: [PATCH 165/184] ScadaWeb: add common features to js and css --- .../ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css | 3 +++ .../ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.min.css | 2 +- .../ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss | 4 ++++ ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/js/scada-common.js | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css index 55fb6ef57..bf5b20804 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css +++ b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.css @@ -394,6 +394,9 @@ body.left-panel-visible #Main_divLeftPanel { overflow: auto; padding: 20px; } +#Main_divContent form.report-args { + max-width: 500px; +} /********** Stats **********/ #Main_frameStats { diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.min.css b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.min.css index d27d3d8f8..4864b3c5b 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.min.css +++ b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.min.css @@ -1 +1 @@ -.rs-modal-overlay{position:fixed;left:0;top:0;width:100%;height:100%;background-color:#808080;opacity:0;}.rs-modal-frame{margin:0;padding:0;border:0;display:inline-block;overflow:hidden;}.modal-footer .btn{min-width:75px;}.notif-panel{background-color:#111;color:#eee;opacity:.97;overflow-x:hidden;overflow-y:auto;padding:30px 0 0;position:fixed;right:0;top:30px;width:30%;z-index:900;}.notif-panel.hidden{display:none;}.notif-panel.mobile{width:75%;}.notif-panel .notif-toolbar{height:30px;position:absolute;top:0;}.notif-panel .notif-toolbar .notif-tool-item,.notif-panel .notif-toolbar .notif-tool-btn{display:inline-block;font-size:14px;height:30px;line-height:30px;margin:0 5px 0 0;padding:0 10px;white-space:nowrap;}.notif-panel .notif-toolbar .notif-tool-item i,.notif-panel .notif-toolbar .notif-tool-btn i{font-size:15px;margin-right:5px;}.notif-panel .notif-toolbar .notif-tool-btn{cursor:pointer;}.notif-panel .notif-toolbar .notif-tool-btn.disabled{color:#9ca1a6;cursor:not-allowed;}.notif-panel .notif-toolbar .notif-tool-btn:hover{background-color:#32373c;color:#00b9eb;text-decoration:none;}body:not(.header-visible) .notif-panel{padding-top:60px;top:0;}body:not(.header-visible) .notif-panel .notif-toolbar{top:30px;}.notif-panel .notif{color:#eee;font-size:13px;margin:0 5px 5px 10px;}.notif-panel .notif a,.notif-panel .notif a:active,.notif-panel .notif a:focus,.notif-panel .notif a:visited{text-decoration:underline;}.notif-panel .notif a:hover{color:#00b9eb;text-decoration:underline;}.notif-panel .notif.empty{font-size:16px;}.notif-panel .notif.hidden{display:none;}.notif-panel .notif .notif-icon{float:left;font-size:14px;width:14px;text-align:center;}.notif-panel .notif .notif-time,.notif-panel .notif .notif-msg{margin-left:25px;}.notif-panel .notif .notif-btn{color:#9ca1a6;cursor:pointer;margin:0 10px 0 -10px;padding:5px 10px;}.notif-panel .notif .notif-btn:hover{text-decoration:underline;}.notif-icon.critical,.notif-bell.critical{color:#dc3545;}.notif-icon.major,.notif-bell.major{color:#fd7e14;}.notif-icon.minor,.notif-bell.minor{color:#ffc107;}.notif-icon.info,.notif-bell.info{color:#0dcaf0;}.notif-icon.undef,.notif-bell.undef{color:#ced4da;}.tree-view .node{cursor:pointer;display:table;width:100%;}.tree-view .node.disabled{cursor:not-allowed;}.tree-view .node-parts{display:table-row;}.tree-view .node-parts>div{display:table-cell;}.tree-view .child-nodes.hidden{display:none;}.tree-view .indent{min-width:20px;width:20px;}.tree-view .icon{min-width:20px;width:20px;}.tree-view .icon img{border:0;height:16px;position:relative;top:-2px;vertical-align:middle;width:16px;}.tree-view .expander{font-family:"Font Awesome 6 Free";font-weight:900;min-width:20px;width:20px;}.tree-view .expander.left::before{content:"";}.tree-view .expander.right{text-align:right;width:0;}.tree-view .expander.right::before{content:"";}.tree-view .expander.expanded::before{content:"";}.tree-view .expander.empty{visibility:hidden;}body a,body a:active,body a:focus,body a:hover,body a:visited{color:inherit;outline:0;text-decoration:none;}body.header-visible{padding-top:30px;}body.left-panel-visible{padding-left:300px;}#Main_divHeader{position:fixed;display:none;left:0;top:0;width:100%;min-width:300px;height:30px;margin:0;padding:0;background-color:#23282d;color:#eee;}#Main_divHeader .main-hdr-block{position:absolute;top:0;background-color:#23282d;}#Main_divHeader .main-hdr-block.left{left:0;}#Main_divHeader .main-hdr-block.left .main-hdr-btn{margin-right:5px;}#Main_divHeader .main-hdr-block.right{right:0;}#Main_divHeader .main-hdr-block.right .main-hdr-btn{margin-left:5px;}#Main_divNoHeaderMenu{height:30px;opacity:.5;position:fixed;right:0;top:0;background-color:#fff;z-index:901;}#Main_divNoHeaderMenu:hover{opacity:1;}#Main_divNoHeaderMenu .main-hdr-btn{margin-left:5px;}#Main_divNoHeaderMenu .main-hdr-btn:hover{background-color:#fff;}body.header-visible #Main_divHeader{display:block;}body.header-visible #Main_divNoHeaderMenu{display:none;}body.full-screen #Main_spanFullscreenBtn2{display:none;}body:not(.full-screen) #Main_spanExitFullscreenBtn{display:none;}#Main_spanMenuBtn{padding:0;width:30px;text-align:center;}#Main_spanAppTitle{position:relative;display:inline-block;top:1px;margin-left:10px;font-family:"Open Sans",sans-serif;font-size:17px;white-space:nowrap;}.main-hdr-btn{display:inline-block;height:30px;line-height:30px;margin:0;padding:0 10px;cursor:pointer;font-size:14px;white-space:nowrap;}.main-hdr-btn:hover{background-color:#32373c;color:#00b9eb;text-decoration:none;}#Main_divLeftPanel{position:fixed;display:none;left:0;top:0;width:300px;min-height:200px;background-color:#23282d;color:#eee;overflow:hidden;}#Main_divLeftPanel .tree-view{font-size:14px;}#Main_divLeftPanel .tree-view .node{padding:3px 10px;}#Main_divLeftPanel .tree-view .node.selected,#Main_divLeftPanel .tree-view .node.selected:hover{background-color:#0073aa;color:#fff;}#Main_divLeftPanel .tree-view .node.disabled{color:#9ca1a6;}#Main_divLeftPanel .tree-view .node:hover{background-color:#191e23;color:#00b9eb;}#Main_divLeftPanel .tool-window{height:100%;margin:0 0 0 30px;padding:5px 0 0 0;overflow-x:hidden;overflow-y:auto;}body.header-visible #Main_divLeftPanel{top:30px;}body.left-panel-visible #Main_divLeftPanel{display:block;}#Main_divTabPanel{position:absolute;left:30px;top:0;height:30px;min-width:200px;background-color:#32373c;transform:rotate(90deg);transform-origin:left top 0;}#Main_divTabPanel .tab{height:30px;margin:0 0 0 5px;padding:0 10px;color:#9ca1a6;display:inline-block;line-height:30px;font-size:15px;white-space:nowrap;}#Main_divTabPanel .tab.selected{color:#eee;font-weight:500;}#Main_divTabPanel .tab:hover{color:#00b9eb;cursor:pointer;}#Main_divMainMenu .node[data-level="0"]{font-size:15px;}#Main_divMainMenu .node:not([data-level="0"]){color:#9ca1a6;}#Main_divContent{background-color:#f8f9fa;color:#212529;overflow:auto;padding:20px;}#Main_frameStats{position:fixed;width:0;height:0;border:0;visibility:hidden;} \ No newline at end of file +.rs-modal-overlay{position:fixed;left:0;top:0;width:100%;height:100%;background-color:#808080;opacity:0;}.rs-modal-frame{margin:0;padding:0;border:0;display:inline-block;overflow:hidden;}.modal-footer .btn{min-width:75px;}.notif-panel{background-color:#111;color:#eee;opacity:.97;overflow-x:hidden;overflow-y:auto;padding:30px 0 0;position:fixed;right:0;top:30px;width:30%;z-index:900;}.notif-panel.hidden{display:none;}.notif-panel.mobile{width:75%;}.notif-panel .notif-toolbar{height:30px;position:absolute;top:0;}.notif-panel .notif-toolbar .notif-tool-item,.notif-panel .notif-toolbar .notif-tool-btn{display:inline-block;font-size:14px;height:30px;line-height:30px;margin:0 5px 0 0;padding:0 10px;white-space:nowrap;}.notif-panel .notif-toolbar .notif-tool-item i,.notif-panel .notif-toolbar .notif-tool-btn i{font-size:15px;margin-right:5px;}.notif-panel .notif-toolbar .notif-tool-btn{cursor:pointer;}.notif-panel .notif-toolbar .notif-tool-btn.disabled{color:#9ca1a6;cursor:not-allowed;}.notif-panel .notif-toolbar .notif-tool-btn:hover{background-color:#32373c;color:#00b9eb;text-decoration:none;}body:not(.header-visible) .notif-panel{padding-top:60px;top:0;}body:not(.header-visible) .notif-panel .notif-toolbar{top:30px;}.notif-panel .notif{color:#eee;font-size:13px;margin:0 5px 5px 10px;}.notif-panel .notif a,.notif-panel .notif a:active,.notif-panel .notif a:focus,.notif-panel .notif a:visited{text-decoration:underline;}.notif-panel .notif a:hover{color:#00b9eb;text-decoration:underline;}.notif-panel .notif.empty{font-size:16px;}.notif-panel .notif.hidden{display:none;}.notif-panel .notif .notif-icon{float:left;font-size:14px;width:14px;text-align:center;}.notif-panel .notif .notif-time,.notif-panel .notif .notif-msg{margin-left:25px;}.notif-panel .notif .notif-btn{color:#9ca1a6;cursor:pointer;margin:0 10px 0 -10px;padding:5px 10px;}.notif-panel .notif .notif-btn:hover{text-decoration:underline;}.notif-icon.critical,.notif-bell.critical{color:#dc3545;}.notif-icon.major,.notif-bell.major{color:#fd7e14;}.notif-icon.minor,.notif-bell.minor{color:#ffc107;}.notif-icon.info,.notif-bell.info{color:#0dcaf0;}.notif-icon.undef,.notif-bell.undef{color:#ced4da;}.tree-view .node{cursor:pointer;display:table;width:100%;}.tree-view .node.disabled{cursor:not-allowed;}.tree-view .node-parts{display:table-row;}.tree-view .node-parts>div{display:table-cell;}.tree-view .child-nodes.hidden{display:none;}.tree-view .indent{min-width:20px;width:20px;}.tree-view .icon{min-width:20px;width:20px;}.tree-view .icon img{border:0;height:16px;position:relative;top:-2px;vertical-align:middle;width:16px;}.tree-view .expander{font-family:"Font Awesome 6 Free";font-weight:900;min-width:20px;width:20px;}.tree-view .expander.left::before{content:"";}.tree-view .expander.right{text-align:right;width:0;}.tree-view .expander.right::before{content:"";}.tree-view .expander.expanded::before{content:"";}.tree-view .expander.empty{visibility:hidden;}body a,body a:active,body a:focus,body a:hover,body a:visited{color:inherit;outline:0;text-decoration:none;}body.header-visible{padding-top:30px;}body.left-panel-visible{padding-left:300px;}#Main_divHeader{position:fixed;display:none;left:0;top:0;width:100%;min-width:300px;height:30px;margin:0;padding:0;background-color:#23282d;color:#eee;}#Main_divHeader .main-hdr-block{position:absolute;top:0;background-color:#23282d;}#Main_divHeader .main-hdr-block.left{left:0;}#Main_divHeader .main-hdr-block.left .main-hdr-btn{margin-right:5px;}#Main_divHeader .main-hdr-block.right{right:0;}#Main_divHeader .main-hdr-block.right .main-hdr-btn{margin-left:5px;}#Main_divNoHeaderMenu{height:30px;opacity:.5;position:fixed;right:0;top:0;background-color:#fff;z-index:901;}#Main_divNoHeaderMenu:hover{opacity:1;}#Main_divNoHeaderMenu .main-hdr-btn{margin-left:5px;}#Main_divNoHeaderMenu .main-hdr-btn:hover{background-color:#fff;}body.header-visible #Main_divHeader{display:block;}body.header-visible #Main_divNoHeaderMenu{display:none;}body.full-screen #Main_spanFullscreenBtn2{display:none;}body:not(.full-screen) #Main_spanExitFullscreenBtn{display:none;}#Main_spanMenuBtn{padding:0;width:30px;text-align:center;}#Main_spanAppTitle{position:relative;display:inline-block;top:1px;margin-left:10px;font-family:"Open Sans",sans-serif;font-size:17px;white-space:nowrap;}.main-hdr-btn{display:inline-block;height:30px;line-height:30px;margin:0;padding:0 10px;cursor:pointer;font-size:14px;white-space:nowrap;}.main-hdr-btn:hover{background-color:#32373c;color:#00b9eb;text-decoration:none;}#Main_divLeftPanel{position:fixed;display:none;left:0;top:0;width:300px;min-height:200px;background-color:#23282d;color:#eee;overflow:hidden;}#Main_divLeftPanel .tree-view{font-size:14px;}#Main_divLeftPanel .tree-view .node{padding:3px 10px;}#Main_divLeftPanel .tree-view .node.selected,#Main_divLeftPanel .tree-view .node.selected:hover{background-color:#0073aa;color:#fff;}#Main_divLeftPanel .tree-view .node.disabled{color:#9ca1a6;}#Main_divLeftPanel .tree-view .node:hover{background-color:#191e23;color:#00b9eb;}#Main_divLeftPanel .tool-window{height:100%;margin:0 0 0 30px;padding:5px 0 0 0;overflow-x:hidden;overflow-y:auto;}body.header-visible #Main_divLeftPanel{top:30px;}body.left-panel-visible #Main_divLeftPanel{display:block;}#Main_divTabPanel{position:absolute;left:30px;top:0;height:30px;min-width:200px;background-color:#32373c;transform:rotate(90deg);transform-origin:left top 0;}#Main_divTabPanel .tab{height:30px;margin:0 0 0 5px;padding:0 10px;color:#9ca1a6;display:inline-block;line-height:30px;font-size:15px;white-space:nowrap;}#Main_divTabPanel .tab.selected{color:#eee;font-weight:500;}#Main_divTabPanel .tab:hover{color:#00b9eb;cursor:pointer;}#Main_divMainMenu .node[data-level="0"]{font-size:15px;}#Main_divMainMenu .node:not([data-level="0"]){color:#9ca1a6;}#Main_divContent{background-color:#f8f9fa;color:#212529;overflow:auto;padding:20px;}#Main_divContent form.report-args{max-width:500px;}#Main_frameStats{position:fixed;width:0;height:0;border:0;visibility:hidden;} \ No newline at end of file diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss index d88343cad..8ebb97374 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss +++ b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/css/layouts/main-layout.scss @@ -234,6 +234,10 @@ body { color: $content-fore-color; overflow: auto; padding: 20px; + + form.report-args { + max-width: 500px; + } } /********** Stats **********/ diff --git a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/js/scada-common.js b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/js/scada-common.js index a7c94fe97..9e818b820 100644 --- a/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/js/scada-common.js +++ b/ScadaWeb/ScadaWeb/ScadaWeb/wwwroot/js/scada-common.js @@ -9,8 +9,12 @@ class ScadaUtils { static SMALL_WND_WIDTH = 800; // The z-index that moves an element to the front. static FRONT_ZINDEX = 10000; + // The number of milliseconds in a day. + static MS_PER_DAY = 24 * 60 * 60 * 1000; // Specifies how long an error badge is displayed, ms. static ERROR_DISPLAY_DURATION = 5000; + // Specifies how long a button is locked after click, ms. + static BUTTON_LOCK_DURATION = 3000; // Checks if a browser window is small sized, such as a mobile device. static get isSmallScreen() { From ed654161f5c4ed87e0c65372ff7aab684c5b21e5 Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 12:53:21 +0300 Subject: [PATCH 166/184] PlgMain: refactor reports --- .../PlgMain.Report/EventReportBuilder.cs | 12 ++++++------ .../PlgMain.Report/HistDataReportBuilder.cs | 13 ++++--------- .../PlgMain.Report/TableViewReportBuilder.cs | 9 +++------ 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportBuilder.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportBuilder.cs index 5686312dd..18fdeb9f6 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportBuilder.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/EventReportBuilder.cs @@ -72,15 +72,15 @@ private string GetTitle() { if (reportArgs.TailMode) { - return string.Format(dict.TailTitleFormat, reportArgs.EventCount, reportArgs.EventDepth * 24); + return string.Format(dict.TailTitleFormat, + reportArgs.EventCount, + reportArgs.EventDepth * 24); } else { - DateTime localStartTime = ReportContext.ConvertTimeFromUtc(reportArgs.StartTime); - DateTime localEndTime = ReportContext.ConvertTimeFromUtc(reportArgs.EndTime); return string.Format(dict.GeneralTitleFormat, - localStartTime.ToLocalizedString(), - localEndTime.ToLocalizedString()); + ReportContext.DateTimeToString(reportArgs.StartTime), + ReportContext.DateTimeToString(reportArgs.EndTime)); } } @@ -197,7 +197,7 @@ private void Renderer_DirectiveFound(object sender, ExcelDirectiveEventArgs e) else if (e.DirectiveValue == "GenCaption") cellText = reportDict.GenCaption; else if (e.DirectiveValue == "Gen") - cellText = ReportContext.ConvertTimeFromUtc(GenerateTime).ToLocalizedString(ReportContext.Culture); + cellText = ReportContext.DateTimeToString(GenerateTime); else if (e.DirectiveValue == "TzCaption") cellText = reportDict.TzCaption; else if (e.DirectiveValue == "Tz") diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportBuilder.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportBuilder.cs index 6f309b01f..bf6486714 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportBuilder.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/HistDataReportBuilder.cs @@ -4,7 +4,6 @@ using Scada.Data.Const; using Scada.Data.Entities; using Scada.Data.Models; -using Scada.Data.Tables; using Scada.Lang; using Scada.Report; using Scada.Report.Xml2003; @@ -106,11 +105,9 @@ public HistDataReportBuilder(IReportContext reportContext) /// private string GetTitle() { - DateTime localStartTime = ReportContext.ConvertTimeFromUtc(reportArgs.StartTime); - DateTime localEndTime = ReportContext.ConvertTimeFromUtc(reportArgs.EndTime); return string.Format(dict.TitleFormat, - localStartTime.ToLocalizedString(), - localEndTime.ToLocalizedString()); + ReportContext.DateTimeToString(reportArgs.StartTime), + ReportContext.DateTimeToString(reportArgs.EndTime)); } /// @@ -165,9 +162,7 @@ private void PrintChannelData() for (int timeIdx = 0, timeCnt = trendBundle.Timestamps.Count; timeIdx < timeCnt; timeIdx++) { Row dataRow = dataRowTemplate.Clone(); - dataRow.Cells[0].Text = ReportContext - .ConvertTimeFromUtc(trendBundle.Timestamps[timeIdx]) - .ToLocalizedString(ReportContext.Culture); + dataRow.Cells[0].Text = ReportContext.DateTimeToString(trendBundle.Timestamps[timeIdx]); for (int cnlIdx = 0; cnlIdx < cnlCnt; cnlIdx++) { @@ -301,7 +296,7 @@ private void Renderer_DirectiveFound(object sender, ExcelDirectiveEventArgs e) else if (e.DirectiveValue == "GenCaption") cellText = reportDict.GenCaption; else if (e.DirectiveValue == "Gen") - cellText = ReportContext.ConvertTimeFromUtc(GenerateTime).ToLocalizedString(ReportContext.Culture); + cellText = ReportContext.DateTimeToString(GenerateTime); else if (e.DirectiveValue == "TzCaption") cellText = reportDict.TzCaption; else if (e.DirectiveValue == "Tz") diff --git a/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportBuilder.cs b/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportBuilder.cs index e99648e55..fb283c9bf 100644 --- a/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportBuilder.cs +++ b/ScadaWeb/OpenPlugins/PlgMain.Report/TableViewReportBuilder.cs @@ -3,7 +3,6 @@ using Scada.Data.Entities; using Scada.Data.Models; -using Scada.Data.Tables; using Scada.Lang; using Scada.Report; using Scada.Report.Xml2003; @@ -78,12 +77,10 @@ public TableViewReportBuilder(IReportContext reportContext) /// private string GetTitle() { - DateTime localStartTime = ReportContext.ConvertTimeFromUtc(reportArgs.StartTime); - DateTime localEndTime = ReportContext.ConvertTimeFromUtc(reportArgs.EndTime); return string.Format(dict.TitleFormat, reportArgs.TableView.Title, - localStartTime.ToLocalizedString(), - localEndTime.ToLocalizedString()); + ReportContext.DateTimeToString(reportArgs.StartTime), + ReportContext.DateTimeToString(reportArgs.EndTime)); } /// @@ -285,7 +282,7 @@ private void Renderer_DirectiveFound(object sender, ExcelDirectiveEventArgs e) else if (e.DirectiveValue == "GenCaption") cellText = reportDict.GenCaption; else if (e.DirectiveValue == "Gen") - cellText = ReportContext.ConvertTimeFromUtc(GenerateTime).ToLocalizedString(ReportContext.Culture); + cellText = ReportContext.DateTimeToString(GenerateTime); else if (e.DirectiveValue == "ArcCaption") cellText = reportDict.ArcCaption; else if (e.DirectiveValue == "Arc") From f1aac3d2fe8755ccdae5dd91a90bf65a8664679b Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 12:55:55 +0300 Subject: [PATCH 167/184] PlgMain: refactor report arg forms --- .../PlgMain/Areas/Main/Pages/EventReport.cshtml | 4 ---- .../PlgMain/Areas/Main/Pages/HistDataReport.cshtml | 4 ---- .../PlgMain/wwwroot/plugins/Main/css/report.css | 3 --- .../PlgMain/wwwroot/plugins/Main/css/report.min.css | 1 - .../PlgMain/wwwroot/plugins/Main/css/report.scss | 3 --- .../PlgMain/wwwroot/plugins/Main/js/event-report.js | 9 +++------ .../PlgMain/wwwroot/plugins/Main/js/hist-data-report.js | 9 +++------ 7 files changed, 6 insertions(+), 27 deletions(-) delete mode 100644 ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.css delete mode 100644 ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.min.css delete mode 100644 ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.scss diff --git a/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/EventReport.cshtml b/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/EventReport.cshtml index be12cecc4..c6289173b 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/EventReport.cshtml +++ b/ScadaWeb/OpenPlugins/PlgMain/Areas/Main/Pages/EventReport.cshtml @@ -8,10 +8,6 @@ ViewBag.Title = dict.PageTitle; } -@section Styles { - -} - @section Scripts { diff --git a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.css b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.css deleted file mode 100644 index 8b55b2a41..000000000 --- a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.css +++ /dev/null @@ -1,3 +0,0 @@ -.report-args { - max-width: 500px; -} diff --git a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.min.css b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.min.css deleted file mode 100644 index fa6bbd58a..000000000 --- a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.min.css +++ /dev/null @@ -1 +0,0 @@ -.report-args{max-width:500px;} \ No newline at end of file diff --git a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.scss b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.scss deleted file mode 100644 index 1c053c768..000000000 --- a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/css/report.scss +++ /dev/null @@ -1,3 +0,0 @@ -.report-args { - max-width: 500px; -} diff --git a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/event-report.js b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/event-report.js index e4cd7af64..e6713b420 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/event-report.js +++ b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/event-report.js @@ -1,7 +1,4 @@ -const BUTTON_LOCK_DURATION = 3000; // ms -const MS_PER_DAY = 24 * 60 * 60 * 1000; - -// The variables below are set in EventReport.cshtml +// The variables below are set in EventReport.cshtml var phrases = {}; var maxReportPeriod = 0; @@ -18,7 +15,7 @@ function reportValidityExtra() { if (startTimeMs > endTimeMs) { errors.push(phrases.InvalidPeriod); - } else if (endTimeMs - startTimeMs > maxReportPeriod * MS_PER_DAY) { + } else if (endTimeMs - startTimeMs > maxReportPeriod * ScadaUtils.MS_PER_DAY) { errors.push(ScadaUtils.formatString(phrases.PeriodTooLong, maxReportPeriod)); } @@ -44,7 +41,7 @@ function lockGenerateButton() { setTimeout(function () { $("#btnGenerateReport").prop("disabled", false); $("#divWaitHint").addClass("hidden"); - }, BUTTON_LOCK_DURATION); + }, ScadaUtils.BUTTON_LOCK_DURATION); } function isSeveritySelected() { diff --git a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/hist-data-report.js b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/hist-data-report.js index 9886c3e1b..1931eb174 100644 --- a/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/hist-data-report.js +++ b/ScadaWeb/OpenPlugins/PlgMain/wwwroot/plugins/Main/js/hist-data-report.js @@ -1,7 +1,4 @@ -const BUTTON_LOCK_DURATION = 3000; // ms -const MS_PER_DAY = 24 * 60 * 60 * 1000; - -// The variables below are set in HistDataReport.cshtml +// The variables below are set in HistDataReport.cshtml var phrases = {}; var maxReportPeriod = 0; @@ -18,7 +15,7 @@ function reportValidityExtra() { if (startTimeMs > endTimeMs) { errors.push(phrases.InvalidPeriod); - } else if (endTimeMs - startTimeMs > maxReportPeriod * MS_PER_DAY) { + } else if (endTimeMs - startTimeMs > maxReportPeriod * ScadaUtils.MS_PER_DAY) { errors.push(ScadaUtils.formatString(phrases.PeriodTooLong, maxReportPeriod)); } @@ -46,7 +43,7 @@ function lockGenerateButton() { setTimeout(function () { $("#btnGenerateReport").prop("disabled", false); $("#divWaitHint").addClass("hidden"); - }, BUTTON_LOCK_DURATION); + }, ScadaUtils.BUTTON_LOCK_DURATION); } function getReportUrl() { From fa78602947d0541f1b8c746d811150ed7a2643a9 Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 16:26:55 +0300 Subject: [PATCH 168/184] ScadaReport: update time range normalization --- ScadaReport/ScadaReport/ReportUtils.cs | 44 +++++++++++--------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/ScadaReport/ScadaReport/ReportUtils.cs b/ScadaReport/ScadaReport/ReportUtils.cs index 4551aa74e..e46ecaf55 100644 --- a/ScadaReport/ScadaReport/ReportUtils.cs +++ b/ScadaReport/ScadaReport/ReportUtils.cs @@ -10,7 +10,7 @@ namespace Scada.Report public static class ReportUtils { /// - /// Gets the report start time as UTC if not specified by a user. + /// Gets the report start time as UTC. /// public static DateTime GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, PeriodUnit unit) { @@ -24,46 +24,39 @@ public static DateTime GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, P return TimeZoneInfo.ConvertTimeToUtc(localStartTime, timeZone); } + /// + /// Gets the report end time. + /// + public static DateTime GetEndTime(DateTime startTime, int period, PeriodUnit unit) + { + NormalizeTimeRange(ref startTime, ref period, unit); + return AddPeriod(startTime, period, unit); + } + /// /// Normalizes the report time range. /// /// - /// Makes the startTime a left point of the time range, and makes the period positive. + /// Makes startTime the left point of the time range, and makes the period non-negative. /// public static void NormalizeTimeRange(ref DateTime startTime, ref int period, PeriodUnit unit) { if (startTime == DateTime.MinValue) throw new ArgumentException("Start time is not specified.", nameof(startTime)); - if (unit == PeriodUnit.Month) + if (period < 0) { - if (period < 0) - { - startTime = startTime.AddMonths(period); - period = -period; - } - } - else - { - // Examples: - // If the period is -1, 0 or 1, it means the single day, the startTime. - // If the period is 2, it means 2 days starting from the startTime. - // If the period is -2, it means 2 days ending with the startTime and including it. - if (period <= -2) - { - startTime = startTime.AddDays(period + 1); - period = -period; - } - else if (period < 1) - { - period = 1; - } + startTime = AddPeriod(startTime, period, unit); + period = -period; } } /// /// Normalizes the report time range. /// + /// + /// Makes startTime less than or equal to endTime. + /// public static void NormalizeTimeRange(ref DateTime startTime, ref DateTime endTime, int period, PeriodUnit unit) { @@ -79,8 +72,7 @@ public static void NormalizeTimeRange(ref DateTime startTime, ref DateTime endTi } else if (endTime > DateTime.MinValue) { - period = Math.Max(Math.Abs(period), 1); - startTime = AddPeriod(endTime, -period, unit); + startTime = AddPeriod(endTime, -Math.Abs(period), unit); } else { From 65fe0656085364597126ed9ab742277a68cc412a Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 16:33:03 +0300 Subject: [PATCH 169/184] Update ReportUtils.cs --- ScadaReport/ScadaReport/ReportUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ScadaReport/ScadaReport/ReportUtils.cs b/ScadaReport/ScadaReport/ReportUtils.cs index e46ecaf55..a9ed5b330 100644 --- a/ScadaReport/ScadaReport/ReportUtils.cs +++ b/ScadaReport/ScadaReport/ReportUtils.cs @@ -25,9 +25,9 @@ public static DateTime GetUtcStartTime(DateTime utcNow, TimeZoneInfo timeZone, P } /// - /// Gets the report end time. + /// Gets the report end time, and possibly updates the start time. /// - public static DateTime GetEndTime(DateTime startTime, int period, PeriodUnit unit) + public static DateTime GetEndTime(ref DateTime startTime, int period, PeriodUnit unit) { NormalizeTimeRange(ref startTime, ref period, unit); return AddPeriod(startTime, period, unit); From aaf2a8b21f5216bac3bb9b40ed9d8d8fc6c167d3 Mon Sep 17 00:00:00 2001 From: 2mik Date: Wed, 21 Jun 2023 18:47:42 +0300 Subject: [PATCH 170/184] ScadaDoc: update plugin history --- .../Pages/En/Version61/VersionHistory/WebstationHistory.cshtml | 1 + .../Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml | 1 + 2 files changed, 2 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 021b61141..5f450fb90 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -115,6 +115,7 @@

        Elastic Report

        PlgElasticReport 6.0.1.0 (In development)
          +
        • End date in report arguments is 1 day more
        • Supports audit log
        diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 124150db2..509a68c43 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -115,6 +115,7 @@

        Гибкий отчёт

        PlgElasticReport 6.0.1.0 (В разработке)
          +
        • Конечная дата в аргументах отчёта на 1 день больше
        • Поддержка журнала аудита
        From 91d32cd65622278f261d1ed5c7e419f13a9505a3 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 16:57:32 +0300 Subject: [PATCH 171/184] PlgScheme: fix title --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 1 + .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 1 + ScadaWeb/OpenPlugins/PlgScheme.Common/SchemeView.cs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 5f450fb90..c0c9728f6 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -168,6 +168,7 @@
        PlgScheme 6.0.1.0 (In development)
        • Supports audit log
        • +
        • Fixed loading scheme title
        • JavaScript refactoring
        diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 509a68c43..161333ebe 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -168,6 +168,7 @@
        PlgScheme 6.0.1.0 (В разработке)
        • Поддержка журнала аудита
        • +
        • Исправлена загрузка заголовка схемы
        • Рефакторинг JavaScript
        diff --git a/ScadaWeb/OpenPlugins/PlgScheme.Common/SchemeView.cs b/ScadaWeb/OpenPlugins/PlgScheme.Common/SchemeView.cs index 89204dc15..0e065d37e 100644 --- a/ScadaWeb/OpenPlugins/PlgScheme.Common/SchemeView.cs +++ b/ScadaWeb/OpenPlugins/PlgScheme.Common/SchemeView.cs @@ -130,7 +130,9 @@ public override void LoadView(Stream stream) SchemeDoc.LoadFromXml(schemeNode); // update scheme title - if (string.IsNullOrEmpty(Title) && !string.IsNullOrEmpty(SchemeDoc.Title)) + if (string.IsNullOrEmpty(SchemeDoc.Title)) + SchemeDoc.Title = Title; + else Title = SchemeDoc.Title; } From 0f956741e09509783ec10352cd0eb06e0c4b6b3f Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 18:10:24 +0300 Subject: [PATCH 172/184] ScadaCommon: controls, hide border --- .../Controls/CtrlClientConnection.Designer.cs | 337 +++++++++--------- .../Controls/CtrlClientConnection.cs | 14 +- .../Controls/CtrlClientConnection.resx | 62 +++- .../Controls/CtrlDbConnection.Designer.cs | 329 ++++++++--------- .../Controls/CtrlDbConnection.cs | 16 +- .../Controls/CtrlDbConnection.resx | 62 +++- .../ScadaCommon.Forms.csproj | 2 + 7 files changed, 487 insertions(+), 335 deletions(-) diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.Designer.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.Designer.cs index ec592fd20..e524bb58d 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.Designer.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.Designer.cs @@ -29,73 +29,93 @@ protected override void Dispose(bool disposing) ///
        private void InitializeComponent() { - gbConnectionOptions = new System.Windows.Forms.GroupBox(); - btnPaste = new System.Windows.Forms.Button(); - txtSecretKey = new System.Windows.Forms.TextBox(); - lblSecretKey = new System.Windows.Forms.Label(); - txtInstance = new System.Windows.Forms.TextBox(); - lblInstance = new System.Windows.Forms.Label(); - txtPassword = new System.Windows.Forms.TextBox(); - lblPassword = new System.Windows.Forms.Label(); - txtUsername = new System.Windows.Forms.TextBox(); - lblUsername = new System.Windows.Forms.Label(); - numTimeout = new System.Windows.Forms.NumericUpDown(); - lblTimeout = new System.Windows.Forms.Label(); - numPort = new System.Windows.Forms.NumericUpDown(); - lblPort = new System.Windows.Forms.Label(); - txtHost = new System.Windows.Forms.TextBox(); - lblHost = new System.Windows.Forms.Label(); - txtName = new System.Windows.Forms.TextBox(); - lblName = new System.Windows.Forms.Label(); + gbConnectionOptions = new GroupBox(); + pnlConnectionOptions = new Panel(); + btnPaste = new Button(); + lblName = new Label(); + txtSecretKey = new TextBox(); + txtName = new TextBox(); + lblSecretKey = new Label(); + txtHost = new TextBox(); + lblHost = new Label(); + txtInstance = new TextBox(); + lblPort = new Label(); + lblInstance = new Label(); + numPort = new NumericUpDown(); + txtPassword = new TextBox(); + lblTimeout = new Label(); + lblPassword = new Label(); + numTimeout = new NumericUpDown(); + txtUsername = new TextBox(); + lblUsername = new Label(); gbConnectionOptions.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)numTimeout).BeginInit(); + pnlConnectionOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)numPort).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numTimeout).BeginInit(); SuspendLayout(); // // gbConnectionOptions // - gbConnectionOptions.Controls.Add(btnPaste); - gbConnectionOptions.Controls.Add(txtSecretKey); - gbConnectionOptions.Controls.Add(lblSecretKey); - gbConnectionOptions.Controls.Add(txtInstance); - gbConnectionOptions.Controls.Add(lblInstance); - gbConnectionOptions.Controls.Add(txtPassword); - gbConnectionOptions.Controls.Add(lblPassword); - gbConnectionOptions.Controls.Add(txtUsername); - gbConnectionOptions.Controls.Add(lblUsername); - gbConnectionOptions.Controls.Add(numTimeout); - gbConnectionOptions.Controls.Add(lblTimeout); - gbConnectionOptions.Controls.Add(numPort); - gbConnectionOptions.Controls.Add(lblPort); - gbConnectionOptions.Controls.Add(txtHost); - gbConnectionOptions.Controls.Add(lblHost); - gbConnectionOptions.Controls.Add(txtName); - gbConnectionOptions.Controls.Add(lblName); - gbConnectionOptions.Dock = System.Windows.Forms.DockStyle.Fill; - gbConnectionOptions.Location = new System.Drawing.Point(0, 0); + gbConnectionOptions.Controls.Add(pnlConnectionOptions); + gbConnectionOptions.Dock = DockStyle.Fill; + gbConnectionOptions.Location = new Point(0, 0); gbConnectionOptions.Name = "gbConnectionOptions"; - gbConnectionOptions.Padding = new System.Windows.Forms.Padding(10, 3, 10, 10); - gbConnectionOptions.Size = new System.Drawing.Size(300, 366); + gbConnectionOptions.Padding = new Padding(10, 3, 10, 10); + gbConnectionOptions.Size = new Size(300, 366); gbConnectionOptions.TabIndex = 0; gbConnectionOptions.TabStop = false; gbConnectionOptions.Text = "Connection Options"; // + // pnlConnectionOptions + // + pnlConnectionOptions.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + pnlConnectionOptions.Controls.Add(btnPaste); + pnlConnectionOptions.Controls.Add(lblName); + pnlConnectionOptions.Controls.Add(txtSecretKey); + pnlConnectionOptions.Controls.Add(txtName); + pnlConnectionOptions.Controls.Add(lblSecretKey); + pnlConnectionOptions.Controls.Add(txtHost); + pnlConnectionOptions.Controls.Add(lblHost); + pnlConnectionOptions.Controls.Add(txtInstance); + pnlConnectionOptions.Controls.Add(lblPort); + pnlConnectionOptions.Controls.Add(lblInstance); + pnlConnectionOptions.Controls.Add(numPort); + pnlConnectionOptions.Controls.Add(txtPassword); + pnlConnectionOptions.Controls.Add(lblTimeout); + pnlConnectionOptions.Controls.Add(lblPassword); + pnlConnectionOptions.Controls.Add(numTimeout); + pnlConnectionOptions.Controls.Add(txtUsername); + pnlConnectionOptions.Controls.Add(lblUsername); + pnlConnectionOptions.Location = new Point(13, 22); + pnlConnectionOptions.Name = "pnlConnectionOptions"; + pnlConnectionOptions.Size = new Size(274, 331); + pnlConnectionOptions.TabIndex = 1; + // // btnPaste // - btnPaste.Location = new System.Drawing.Point(13, 330); + btnPaste.Location = new Point(0, 308); btnPaste.Name = "btnPaste"; - btnPaste.Size = new System.Drawing.Size(75, 23); + btnPaste.Size = new Size(75, 23); btnPaste.TabIndex = 16; btnPaste.Text = "Paste"; btnPaste.UseVisualStyleBackColor = true; btnPaste.Click += btnPaste_Click; // + // lblName + // + lblName.AutoSize = true; + lblName.Location = new Point(-3, -3); + lblName.Name = "lblName"; + lblName.Size = new Size(39, 15); + lblName.TabIndex = 0; + lblName.Text = "Name"; + // // txtSecretKey // - txtSecretKey.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtSecretKey.Location = new System.Drawing.Point(13, 301); + txtSecretKey.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtSecretKey.Location = new Point(0, 279); txtSecretKey.Name = "txtSecretKey"; - txtSecretKey.Size = new System.Drawing.Size(274, 23); + txtSecretKey.Size = new Size(274, 23); txtSecretKey.TabIndex = 15; txtSecretKey.UseSystemPasswordChar = true; txtSecretKey.TextChanged += txtSecretKey_TextChanged; @@ -103,180 +123,173 @@ private void InitializeComponent() txtSecretKey.Leave += txtSecretKey_Leave; txtSecretKey.Validating += txtSecretKey_Validating; // + // txtName + // + txtName.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtName.Location = new Point(0, 15); + txtName.Name = "txtName"; + txtName.Size = new Size(274, 23); + txtName.TabIndex = 1; + txtName.TextChanged += txtName_TextChanged; + txtName.Validated += txtName_Validated; + // // lblSecretKey // lblSecretKey.AutoSize = true; - lblSecretKey.Location = new System.Drawing.Point(10, 283); + lblSecretKey.Location = new Point(-3, 261); lblSecretKey.Name = "lblSecretKey"; - lblSecretKey.Size = new System.Drawing.Size(60, 15); + lblSecretKey.Size = new Size(60, 15); lblSecretKey.TabIndex = 14; lblSecretKey.Text = "Secret key"; // + // txtHost + // + txtHost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtHost.Location = new Point(0, 59); + txtHost.Name = "txtHost"; + txtHost.Size = new Size(274, 23); + txtHost.TabIndex = 3; + txtHost.TextChanged += txtHost_TextChanged; + // + // lblHost + // + lblHost.AutoSize = true; + lblHost.Location = new Point(-3, 41); + lblHost.Name = "lblHost"; + lblHost.Size = new Size(32, 15); + lblHost.TabIndex = 2; + lblHost.Text = "Host"; + // // txtInstance // - txtInstance.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtInstance.Location = new System.Drawing.Point(13, 257); + txtInstance.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtInstance.Location = new Point(0, 235); txtInstance.Name = "txtInstance"; - txtInstance.Size = new System.Drawing.Size(274, 23); + txtInstance.Size = new Size(274, 23); txtInstance.TabIndex = 13; txtInstance.TextChanged += txtInstance_TextChanged; // + // lblPort + // + lblPort.AutoSize = true; + lblPort.Location = new Point(-3, 85); + lblPort.Name = "lblPort"; + lblPort.Size = new Size(29, 15); + lblPort.TabIndex = 4; + lblPort.Text = "Port"; + // // lblInstance // lblInstance.AutoSize = true; - lblInstance.Location = new System.Drawing.Point(10, 239); + lblInstance.Location = new Point(-3, 217); lblInstance.Name = "lblInstance"; - lblInstance.Size = new System.Drawing.Size(51, 15); + lblInstance.Size = new Size(51, 15); lblInstance.TabIndex = 12; lblInstance.Text = "Instance"; // + // numPort + // + numPort.Location = new Point(0, 103); + numPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + numPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); + numPort.Name = "numPort"; + numPort.Size = new Size(120, 23); + numPort.TabIndex = 5; + numPort.Value = new decimal(new int[] { 1, 0, 0, 0 }); + numPort.ValueChanged += numPort_ValueChanged; + // // txtPassword // - txtPassword.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtPassword.Location = new System.Drawing.Point(13, 213); + txtPassword.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtPassword.Location = new Point(0, 191); txtPassword.Name = "txtPassword"; - txtPassword.Size = new System.Drawing.Size(274, 23); + txtPassword.Size = new Size(274, 23); txtPassword.TabIndex = 11; txtPassword.UseSystemPasswordChar = true; txtPassword.TextChanged += txtPassword_TextChanged; // + // lblTimeout + // + lblTimeout.AutoSize = true; + lblTimeout.Location = new Point(123, 85); + lblTimeout.Name = "lblTimeout"; + lblTimeout.Size = new Size(51, 15); + lblTimeout.TabIndex = 6; + lblTimeout.Text = "Timeout"; + // // lblPassword // lblPassword.AutoSize = true; - lblPassword.Location = new System.Drawing.Point(10, 195); + lblPassword.Location = new Point(-3, 173); lblPassword.Name = "lblPassword"; - lblPassword.Size = new System.Drawing.Size(57, 15); + lblPassword.Size = new Size(57, 15); lblPassword.TabIndex = 10; lblPassword.Text = "Password"; // - // txtUsername - // - txtUsername.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtUsername.Location = new System.Drawing.Point(13, 169); - txtUsername.Name = "txtUsername"; - txtUsername.Size = new System.Drawing.Size(274, 23); - txtUsername.TabIndex = 9; - txtUsername.TextChanged += txtUsername_TextChanged; - // - // lblUsername - // - lblUsername.AutoSize = true; - lblUsername.Location = new System.Drawing.Point(10, 151); - lblUsername.Name = "lblUsername"; - lblUsername.Size = new System.Drawing.Size(60, 15); - lblUsername.TabIndex = 8; - lblUsername.Text = "Username"; - // // numTimeout // - numTimeout.Location = new System.Drawing.Point(139, 125); + numTimeout.Location = new Point(126, 103); numTimeout.Maximum = new decimal(new int[] { 100000, 0, 0, 0 }); numTimeout.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); numTimeout.Name = "numTimeout"; - numTimeout.Size = new System.Drawing.Size(120, 23); + numTimeout.Size = new Size(120, 23); numTimeout.TabIndex = 7; numTimeout.Value = new decimal(new int[] { 10000, 0, 0, 0 }); numTimeout.ValueChanged += numTimeout_ValueChanged; // - // lblTimeout - // - lblTimeout.AutoSize = true; - lblTimeout.Location = new System.Drawing.Point(136, 107); - lblTimeout.Name = "lblTimeout"; - lblTimeout.Size = new System.Drawing.Size(51, 15); - lblTimeout.TabIndex = 6; - lblTimeout.Text = "Timeout"; - // - // numPort - // - numPort.Location = new System.Drawing.Point(13, 125); - numPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); - numPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); - numPort.Name = "numPort"; - numPort.Size = new System.Drawing.Size(120, 23); - numPort.TabIndex = 5; - numPort.Value = new decimal(new int[] { 1, 0, 0, 0 }); - numPort.ValueChanged += numPort_ValueChanged; - // - // lblPort - // - lblPort.AutoSize = true; - lblPort.Location = new System.Drawing.Point(10, 107); - lblPort.Name = "lblPort"; - lblPort.Size = new System.Drawing.Size(29, 15); - lblPort.TabIndex = 4; - lblPort.Text = "Port"; - // - // txtHost - // - txtHost.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtHost.Location = new System.Drawing.Point(13, 81); - txtHost.Name = "txtHost"; - txtHost.Size = new System.Drawing.Size(274, 23); - txtHost.TabIndex = 3; - txtHost.TextChanged += txtHost_TextChanged; - // - // lblHost - // - lblHost.AutoSize = true; - lblHost.Location = new System.Drawing.Point(10, 63); - lblHost.Name = "lblHost"; - lblHost.Size = new System.Drawing.Size(32, 15); - lblHost.TabIndex = 2; - lblHost.Text = "Host"; - // - // txtName + // txtUsername // - txtName.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - txtName.Location = new System.Drawing.Point(13, 37); - txtName.Name = "txtName"; - txtName.Size = new System.Drawing.Size(274, 23); - txtName.TabIndex = 1; - txtName.TextChanged += txtName_TextChanged; - txtName.Validated += txtName_Validated; + txtUsername.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtUsername.Location = new Point(0, 147); + txtUsername.Name = "txtUsername"; + txtUsername.Size = new Size(274, 23); + txtUsername.TabIndex = 9; + txtUsername.TextChanged += txtUsername_TextChanged; // - // lblName + // lblUsername // - lblName.AutoSize = true; - lblName.Location = new System.Drawing.Point(10, 19); - lblName.Name = "lblName"; - lblName.Size = new System.Drawing.Size(39, 15); - lblName.TabIndex = 0; - lblName.Text = "Name"; + lblUsername.AutoSize = true; + lblUsername.Location = new Point(-3, 129); + lblUsername.Name = "lblUsername"; + lblUsername.Size = new Size(60, 15); + lblUsername.TabIndex = 8; + lblUsername.Text = "Username"; // // CtrlClientConnection // - AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; Controls.Add(gbConnectionOptions); Name = "CtrlClientConnection"; - Size = new System.Drawing.Size(300, 366); + Size = new Size(300, 366); gbConnectionOptions.ResumeLayout(false); - gbConnectionOptions.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)numTimeout).EndInit(); + pnlConnectionOptions.ResumeLayout(false); + pnlConnectionOptions.PerformLayout(); ((System.ComponentModel.ISupportInitialize)numPort).EndInit(); + ((System.ComponentModel.ISupportInitialize)numTimeout).EndInit(); ResumeLayout(false); } #endregion - private System.Windows.Forms.GroupBox gbConnectionOptions; - private System.Windows.Forms.TextBox txtName; - private System.Windows.Forms.Label lblName; - private System.Windows.Forms.TextBox txtHost; - private System.Windows.Forms.Label lblHost; - private System.Windows.Forms.NumericUpDown numPort; - private System.Windows.Forms.Label lblPort; - private System.Windows.Forms.TextBox txtPassword; - private System.Windows.Forms.Label lblPassword; - private System.Windows.Forms.TextBox txtUsername; - private System.Windows.Forms.Label lblUsername; - private System.Windows.Forms.TextBox txtInstance; - private System.Windows.Forms.Label lblInstance; - private System.Windows.Forms.Label lblTimeout; - private System.Windows.Forms.NumericUpDown numTimeout; - private System.Windows.Forms.Label lblSecretKey; - private System.Windows.Forms.TextBox txtSecretKey; - private System.Windows.Forms.Button btnPaste; + private GroupBox gbConnectionOptions; + private TextBox txtName; + private Label lblName; + private TextBox txtHost; + private Label lblHost; + private NumericUpDown numPort; + private Label lblPort; + private TextBox txtPassword; + private Label lblPassword; + private TextBox txtUsername; + private Label lblUsername; + private TextBox txtInstance; + private Label lblInstance; + private Label lblTimeout; + private NumericUpDown numTimeout; + private Label lblSecretKey; + private TextBox txtSecretKey; + private Button btnPaste; + private Panel pnlConnectionOptions; } } diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.cs index 4a6c5d635..121ff3ebc 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.cs @@ -3,11 +3,7 @@ using Scada.Client; using Scada.Lang; -using System; using System.ComponentModel; -using System.Drawing; -using System.Threading.Tasks; -using System.Windows.Forms; namespace Scada.Forms.Controls { @@ -145,6 +141,16 @@ public void SetFocus() txtName.Select(); } + /// + /// Hides the component border. + /// + public void HideBorder() + { + gbConnectionOptions.Hide(); + pnlConnectionOptions.Parent = this; + pnlConnectionOptions.Dock = DockStyle.Fill; + } + /// /// Occurs when the connection options change. diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.resx b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.resx index f298a7be8..a395bffc9 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.resx +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlClientConnection.resx @@ -1,4 +1,64 @@ - + + + diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.Designer.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.Designer.cs index ba9bff33a..eb315fbad 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.Designer.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.Designer.cs @@ -29,220 +29,223 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.gbConnectionOptions = new System.Windows.Forms.GroupBox(); - this.txtConnectionString = new System.Windows.Forms.TextBox(); - this.chkConnectionString = new System.Windows.Forms.CheckBox(); - this.txtPassword = new System.Windows.Forms.TextBox(); - this.lblPassword = new System.Windows.Forms.Label(); - this.txtUsername = new System.Windows.Forms.TextBox(); - this.lblUsername = new System.Windows.Forms.Label(); - this.txtDatabase = new System.Windows.Forms.TextBox(); - this.lblDatabase = new System.Windows.Forms.Label(); - this.txtServer = new System.Windows.Forms.TextBox(); - this.lblServer = new System.Windows.Forms.Label(); - this.cbDbms = new System.Windows.Forms.ComboBox(); - this.lblDbms = new System.Windows.Forms.Label(); - this.txtName = new System.Windows.Forms.TextBox(); - this.lblName = new System.Windows.Forms.Label(); - this.gbConnectionOptions.SuspendLayout(); - this.SuspendLayout(); + gbConnectionOptions = new GroupBox(); + txtConnectionString = new TextBox(); + chkConnectionString = new CheckBox(); + txtPassword = new TextBox(); + lblPassword = new Label(); + txtUsername = new TextBox(); + lblUsername = new Label(); + txtDatabase = new TextBox(); + lblDatabase = new Label(); + txtServer = new TextBox(); + lblServer = new Label(); + cbDbms = new ComboBox(); + lblDbms = new Label(); + txtName = new TextBox(); + lblName = new Label(); + pnlConnectionOptions = new Panel(); + gbConnectionOptions.SuspendLayout(); + pnlConnectionOptions.SuspendLayout(); + SuspendLayout(); // // gbConnectionOptions // - this.gbConnectionOptions.Controls.Add(this.txtConnectionString); - this.gbConnectionOptions.Controls.Add(this.chkConnectionString); - this.gbConnectionOptions.Controls.Add(this.txtPassword); - this.gbConnectionOptions.Controls.Add(this.lblPassword); - this.gbConnectionOptions.Controls.Add(this.txtUsername); - this.gbConnectionOptions.Controls.Add(this.lblUsername); - this.gbConnectionOptions.Controls.Add(this.txtDatabase); - this.gbConnectionOptions.Controls.Add(this.lblDatabase); - this.gbConnectionOptions.Controls.Add(this.txtServer); - this.gbConnectionOptions.Controls.Add(this.lblServer); - this.gbConnectionOptions.Controls.Add(this.cbDbms); - this.gbConnectionOptions.Controls.Add(this.lblDbms); - this.gbConnectionOptions.Controls.Add(this.txtName); - this.gbConnectionOptions.Controls.Add(this.lblName); - this.gbConnectionOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.gbConnectionOptions.Location = new System.Drawing.Point(0, 0); - this.gbConnectionOptions.Name = "gbConnectionOptions"; - this.gbConnectionOptions.Padding = new System.Windows.Forms.Padding(10, 3, 10, 10); - this.gbConnectionOptions.Size = new System.Drawing.Size(300, 399); - this.gbConnectionOptions.TabIndex = 0; - this.gbConnectionOptions.TabStop = false; - this.gbConnectionOptions.Text = "Connection Options"; + gbConnectionOptions.Controls.Add(pnlConnectionOptions); + gbConnectionOptions.Dock = DockStyle.Fill; + gbConnectionOptions.Location = new Point(0, 0); + gbConnectionOptions.Name = "gbConnectionOptions"; + gbConnectionOptions.Padding = new Padding(10, 3, 10, 10); + gbConnectionOptions.Size = new Size(300, 399); + gbConnectionOptions.TabIndex = 0; + gbConnectionOptions.TabStop = false; + gbConnectionOptions.Text = "Connection Options"; // // txtConnectionString // - this.txtConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtConnectionString.Location = new System.Drawing.Point(13, 311); - this.txtConnectionString.Multiline = true; - this.txtConnectionString.Name = "txtConnectionString"; - this.txtConnectionString.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtConnectionString.Size = new System.Drawing.Size(274, 75); - this.txtConnectionString.TabIndex = 13; - this.txtConnectionString.TextChanged += new System.EventHandler(this.txtConnectionString_TextChanged); + txtConnectionString.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + txtConnectionString.Location = new Point(0, 289); + txtConnectionString.Multiline = true; + txtConnectionString.Name = "txtConnectionString"; + txtConnectionString.ScrollBars = ScrollBars.Vertical; + txtConnectionString.Size = new Size(274, 75); + txtConnectionString.TabIndex = 13; + txtConnectionString.TextChanged += txtConnectionString_TextChanged; // // chkConnectionString // - this.chkConnectionString.AutoSize = true; - this.chkConnectionString.Location = new System.Drawing.Point(13, 286); - this.chkConnectionString.Name = "chkConnectionString"; - this.chkConnectionString.Size = new System.Drawing.Size(121, 19); - this.chkConnectionString.TabIndex = 12; - this.chkConnectionString.Text = "Connection string"; - this.chkConnectionString.UseVisualStyleBackColor = true; - this.chkConnectionString.CheckedChanged += new System.EventHandler(this.chkConnectionString_CheckedChanged); + chkConnectionString.AutoSize = true; + chkConnectionString.Location = new Point(0, 264); + chkConnectionString.Name = "chkConnectionString"; + chkConnectionString.Size = new Size(121, 19); + chkConnectionString.TabIndex = 12; + chkConnectionString.Text = "Connection string"; + chkConnectionString.UseVisualStyleBackColor = true; + chkConnectionString.CheckedChanged += chkConnectionString_CheckedChanged; // // txtPassword // - this.txtPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtPassword.Location = new System.Drawing.Point(13, 257); - this.txtPassword.Name = "txtPassword"; - this.txtPassword.Size = new System.Drawing.Size(274, 23); - this.txtPassword.TabIndex = 11; - this.txtPassword.UseSystemPasswordChar = true; - this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); + txtPassword.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtPassword.Location = new Point(0, 235); + txtPassword.Name = "txtPassword"; + txtPassword.Size = new Size(274, 23); + txtPassword.TabIndex = 11; + txtPassword.UseSystemPasswordChar = true; + txtPassword.TextChanged += txtPassword_TextChanged; // // lblPassword // - this.lblPassword.AutoSize = true; - this.lblPassword.Location = new System.Drawing.Point(10, 239); - this.lblPassword.Name = "lblPassword"; - this.lblPassword.Size = new System.Drawing.Size(57, 15); - this.lblPassword.TabIndex = 10; - this.lblPassword.Text = "Password"; + lblPassword.AutoSize = true; + lblPassword.Location = new Point(-3, 217); + lblPassword.Name = "lblPassword"; + lblPassword.Size = new Size(57, 15); + lblPassword.TabIndex = 10; + lblPassword.Text = "Password"; // // txtUsername // - this.txtUsername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtUsername.Location = new System.Drawing.Point(13, 213); - this.txtUsername.Name = "txtUsername"; - this.txtUsername.Size = new System.Drawing.Size(274, 23); - this.txtUsername.TabIndex = 9; - this.txtUsername.TextChanged += new System.EventHandler(this.txtUsername_TextChanged); + txtUsername.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtUsername.Location = new Point(0, 191); + txtUsername.Name = "txtUsername"; + txtUsername.Size = new Size(274, 23); + txtUsername.TabIndex = 9; + txtUsername.TextChanged += txtUsername_TextChanged; // // lblUsername // - this.lblUsername.AutoSize = true; - this.lblUsername.Location = new System.Drawing.Point(10, 195); - this.lblUsername.Name = "lblUsername"; - this.lblUsername.Size = new System.Drawing.Size(60, 15); - this.lblUsername.TabIndex = 8; - this.lblUsername.Text = "Username"; + lblUsername.AutoSize = true; + lblUsername.Location = new Point(-3, 173); + lblUsername.Name = "lblUsername"; + lblUsername.Size = new Size(60, 15); + lblUsername.TabIndex = 8; + lblUsername.Text = "Username"; // // txtDatabase // - this.txtDatabase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtDatabase.Location = new System.Drawing.Point(13, 169); - this.txtDatabase.Name = "txtDatabase"; - this.txtDatabase.Size = new System.Drawing.Size(274, 23); - this.txtDatabase.TabIndex = 7; - this.txtDatabase.TextChanged += new System.EventHandler(this.txtDatabase_TextChanged); + txtDatabase.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtDatabase.Location = new Point(0, 147); + txtDatabase.Name = "txtDatabase"; + txtDatabase.Size = new Size(274, 23); + txtDatabase.TabIndex = 7; + txtDatabase.TextChanged += txtDatabase_TextChanged; // // lblDatabase // - this.lblDatabase.AutoSize = true; - this.lblDatabase.Location = new System.Drawing.Point(10, 151); - this.lblDatabase.Name = "lblDatabase"; - this.lblDatabase.Size = new System.Drawing.Size(55, 15); - this.lblDatabase.TabIndex = 6; - this.lblDatabase.Text = "Database"; + lblDatabase.AutoSize = true; + lblDatabase.Location = new Point(-3, 129); + lblDatabase.Name = "lblDatabase"; + lblDatabase.Size = new Size(55, 15); + lblDatabase.TabIndex = 6; + lblDatabase.Text = "Database"; // // txtServer // - this.txtServer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtServer.Location = new System.Drawing.Point(13, 125); - this.txtServer.Name = "txtServer"; - this.txtServer.Size = new System.Drawing.Size(274, 23); - this.txtServer.TabIndex = 5; - this.txtServer.TextChanged += new System.EventHandler(this.txtServer_TextChanged); + txtServer.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtServer.Location = new Point(0, 103); + txtServer.Name = "txtServer"; + txtServer.Size = new Size(274, 23); + txtServer.TabIndex = 5; + txtServer.TextChanged += txtServer_TextChanged; // // lblServer // - this.lblServer.AutoSize = true; - this.lblServer.Location = new System.Drawing.Point(10, 107); - this.lblServer.Name = "lblServer"; - this.lblServer.Size = new System.Drawing.Size(39, 15); - this.lblServer.TabIndex = 4; - this.lblServer.Text = "Server"; + lblServer.AutoSize = true; + lblServer.Location = new Point(-3, 85); + lblServer.Name = "lblServer"; + lblServer.Size = new Size(39, 15); + lblServer.TabIndex = 4; + lblServer.Text = "Server"; // // cbDbms // - this.cbDbms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cbDbms.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbDbms.FormattingEnabled = true; - this.cbDbms.Location = new System.Drawing.Point(13, 81); - this.cbDbms.Name = "cbDbms"; - this.cbDbms.Size = new System.Drawing.Size(274, 23); - this.cbDbms.TabIndex = 3; - this.cbDbms.SelectedIndexChanged += new System.EventHandler(this.cbDbms_SelectedIndexChanged); + cbDbms.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + cbDbms.DropDownStyle = ComboBoxStyle.DropDownList; + cbDbms.FormattingEnabled = true; + cbDbms.Location = new Point(0, 59); + cbDbms.Name = "cbDbms"; + cbDbms.Size = new Size(274, 23); + cbDbms.TabIndex = 3; + cbDbms.SelectedIndexChanged += cbDbms_SelectedIndexChanged; // // lblDbms // - this.lblDbms.AutoSize = true; - this.lblDbms.Location = new System.Drawing.Point(10, 63); - this.lblDbms.Name = "lblDbms"; - this.lblDbms.Size = new System.Drawing.Size(39, 15); - this.lblDbms.TabIndex = 2; - this.lblDbms.Text = "DBMS"; + lblDbms.AutoSize = true; + lblDbms.Location = new Point(-3, 41); + lblDbms.Name = "lblDbms"; + lblDbms.Size = new Size(39, 15); + lblDbms.TabIndex = 2; + lblDbms.Text = "DBMS"; // // txtName // - this.txtName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtName.Location = new System.Drawing.Point(13, 37); - this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(274, 23); - this.txtName.TabIndex = 1; - this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); - this.txtName.Validated += new System.EventHandler(this.txtName_Validated); + txtName.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + txtName.Location = new Point(0, 15); + txtName.Name = "txtName"; + txtName.Size = new Size(274, 23); + txtName.TabIndex = 1; + txtName.TextChanged += txtName_TextChanged; + txtName.Validated += txtName_Validated; // // lblName // - this.lblName.AutoSize = true; - this.lblName.Location = new System.Drawing.Point(10, 19); - this.lblName.Name = "lblName"; - this.lblName.Size = new System.Drawing.Size(39, 15); - this.lblName.TabIndex = 0; - this.lblName.Text = "Name"; + lblName.AutoSize = true; + lblName.Location = new Point(-3, -3); + lblName.Name = "lblName"; + lblName.Size = new Size(39, 15); + lblName.TabIndex = 0; + lblName.Text = "Name"; + // + // pnlConnectionOptions + // + pnlConnectionOptions.Controls.Add(txtConnectionString); + pnlConnectionOptions.Controls.Add(lblName); + pnlConnectionOptions.Controls.Add(chkConnectionString); + pnlConnectionOptions.Controls.Add(txtName); + pnlConnectionOptions.Controls.Add(txtPassword); + pnlConnectionOptions.Controls.Add(lblDbms); + pnlConnectionOptions.Controls.Add(lblPassword); + pnlConnectionOptions.Controls.Add(cbDbms); + pnlConnectionOptions.Controls.Add(txtUsername); + pnlConnectionOptions.Controls.Add(lblServer); + pnlConnectionOptions.Controls.Add(lblUsername); + pnlConnectionOptions.Controls.Add(txtServer); + pnlConnectionOptions.Controls.Add(txtDatabase); + pnlConnectionOptions.Controls.Add(lblDatabase); + pnlConnectionOptions.Location = new Point(13, 22); + pnlConnectionOptions.Name = "pnlConnectionOptions"; + pnlConnectionOptions.Size = new Size(274, 364); + pnlConnectionOptions.TabIndex = 1; // // CtrlDbConnection // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.gbConnectionOptions); - this.Name = "CtrlDbConnection"; - this.Size = new System.Drawing.Size(300, 399); - this.gbConnectionOptions.ResumeLayout(false); - this.gbConnectionOptions.PerformLayout(); - this.ResumeLayout(false); - + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gbConnectionOptions); + Name = "CtrlDbConnection"; + Size = new Size(300, 399); + gbConnectionOptions.ResumeLayout(false); + pnlConnectionOptions.ResumeLayout(false); + pnlConnectionOptions.PerformLayout(); + ResumeLayout(false); } #endregion - private System.Windows.Forms.GroupBox gbConnectionOptions; - private System.Windows.Forms.TextBox txtConnectionString; - private System.Windows.Forms.CheckBox chkConnectionString; - private System.Windows.Forms.TextBox txtPassword; - private System.Windows.Forms.Label lblPassword; - private System.Windows.Forms.TextBox txtUsername; - private System.Windows.Forms.Label lblUsername; - private System.Windows.Forms.TextBox txtDatabase; - private System.Windows.Forms.Label lblDatabase; - private System.Windows.Forms.TextBox txtServer; - private System.Windows.Forms.Label lblServer; - private System.Windows.Forms.TextBox txtName; - private System.Windows.Forms.Label lblName; - private System.Windows.Forms.ComboBox cbDbms; - private System.Windows.Forms.Label lblDbms; + private GroupBox gbConnectionOptions; + private TextBox txtConnectionString; + private CheckBox chkConnectionString; + private TextBox txtPassword; + private Label lblPassword; + private TextBox txtUsername; + private Label lblUsername; + private TextBox txtDatabase; + private Label lblDatabase; + private TextBox txtServer; + private Label lblServer; + private TextBox txtName; + private Label lblName; + private ComboBox cbDbms; + private Label lblDbms; + private Panel pnlConnectionOptions; } } diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.cs index 35a7efab2..c5db4dcfa 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.cs @@ -2,9 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Dbms; -using System; using System.ComponentModel; -using System.Windows.Forms; namespace Scada.Forms.Controls { @@ -151,7 +149,7 @@ private void SetFieldsReadOnly(bool useConnectionString) txtPassword.ReadOnly = useConnectionString; txtConnectionString.ReadOnly = !useConnectionString; } - + /// /// Builds the connection string. /// @@ -197,13 +195,23 @@ public void SetFocus() txtName.Select(); } + /// + /// Hides the component border. + /// + public void HideBorder() + { + gbConnectionOptions.Hide(); + pnlConnectionOptions.Parent = this; + pnlConnectionOptions.Dock = DockStyle.Fill; + } + /// /// Occurs when the connection options change. /// [Category("Property Changed")] public event EventHandler ConnectionOptionsChanged; - + /// /// Occurs when the connection name changes. /// diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.resx b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.resx index f298a7be8..a395bffc9 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.resx +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlDbConnection.resx @@ -1,4 +1,64 @@ - + + + diff --git a/ScadaCommon/ScadaCommon.Forms/ScadaCommon.Forms.csproj b/ScadaCommon/ScadaCommon.Forms/ScadaCommon.Forms.csproj index b13a27d1f..c553a87c9 100644 --- a/ScadaCommon/ScadaCommon.Forms/ScadaCommon.Forms.csproj +++ b/ScadaCommon/ScadaCommon.Forms/ScadaCommon.Forms.csproj @@ -2,8 +2,10 @@ net6.0-windows + disable true true + enable Scada.Forms True 6.1.0 From 7654f0522087ce61840865e3febba6374757d3dd Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 18:10:50 +0300 Subject: [PATCH 173/184] ScadaAdmin: profile form --- .../Deployment/FrmProfileEdit.Designer.cs | 345 +++++++++--------- .../Forms/Deployment/FrmProfileEdit.resx | 62 +++- 2 files changed, 233 insertions(+), 174 deletions(-) diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.Designer.cs b/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.Designer.cs index 4c7f55e87..1c7887661 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.Designer.cs +++ b/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.Designer.cs @@ -29,233 +29,232 @@ protected override void Dispose(bool disposing) ///
        private void InitializeComponent() { - this.tabControl = new System.Windows.Forms.TabControl(); - this.pageGeneral = new System.Windows.Forms.TabPage(); - this.txtWebUrl = new System.Windows.Forms.TextBox(); - this.lblWebUrl = new System.Windows.Forms.Label(); - this.cbExtension = new System.Windows.Forms.ComboBox(); - this.lblExtension = new System.Windows.Forms.Label(); - this.txtName = new System.Windows.Forms.TextBox(); - this.lblName = new System.Windows.Forms.Label(); - this.pageAgentConnection = new System.Windows.Forms.TabPage(); - this.chkAgentEnabled = new System.Windows.Forms.CheckBox(); - this.ctrlAgentConnection = new Scada.Forms.Controls.CtrlClientConnection(); - this.pageDbConnection = new System.Windows.Forms.TabPage(); - this.chkDbEnabled = new System.Windows.Forms.CheckBox(); - this.ctrlDbConnection = new Scada.Forms.Controls.CtrlDbConnection(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.pnlBottom = new System.Windows.Forms.Panel(); - this.tabControl.SuspendLayout(); - this.pageGeneral.SuspendLayout(); - this.pageAgentConnection.SuspendLayout(); - this.pageDbConnection.SuspendLayout(); - this.pnlBottom.SuspendLayout(); - this.SuspendLayout(); + tabControl = new System.Windows.Forms.TabControl(); + pageGeneral = new System.Windows.Forms.TabPage(); + txtWebUrl = new System.Windows.Forms.TextBox(); + lblWebUrl = new System.Windows.Forms.Label(); + cbExtension = new System.Windows.Forms.ComboBox(); + lblExtension = new System.Windows.Forms.Label(); + txtName = new System.Windows.Forms.TextBox(); + lblName = new System.Windows.Forms.Label(); + pageAgentConnection = new System.Windows.Forms.TabPage(); + chkAgentEnabled = new System.Windows.Forms.CheckBox(); + ctrlAgentConnection = new Scada.Forms.Controls.CtrlClientConnection(); + pageDbConnection = new System.Windows.Forms.TabPage(); + chkDbEnabled = new System.Windows.Forms.CheckBox(); + ctrlDbConnection = new Scada.Forms.Controls.CtrlDbConnection(); + btnOK = new System.Windows.Forms.Button(); + btnCancel = new System.Windows.Forms.Button(); + pnlBottom = new System.Windows.Forms.Panel(); + tabControl.SuspendLayout(); + pageGeneral.SuspendLayout(); + pageAgentConnection.SuspendLayout(); + pageDbConnection.SuspendLayout(); + pnlBottom.SuspendLayout(); + SuspendLayout(); // // tabControl // - this.tabControl.Controls.Add(this.pageGeneral); - this.tabControl.Controls.Add(this.pageAgentConnection); - this.tabControl.Controls.Add(this.pageDbConnection); - this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl.Location = new System.Drawing.Point(0, 0); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(384, 468); - this.tabControl.TabIndex = 0; + tabControl.Controls.Add(pageGeneral); + tabControl.Controls.Add(pageAgentConnection); + tabControl.Controls.Add(pageDbConnection); + tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + tabControl.Location = new System.Drawing.Point(0, 0); + tabControl.Name = "tabControl"; + tabControl.SelectedIndex = 0; + tabControl.Size = new System.Drawing.Size(384, 468); + tabControl.TabIndex = 0; // // pageGeneral // - this.pageGeneral.Controls.Add(this.txtWebUrl); - this.pageGeneral.Controls.Add(this.lblWebUrl); - this.pageGeneral.Controls.Add(this.cbExtension); - this.pageGeneral.Controls.Add(this.lblExtension); - this.pageGeneral.Controls.Add(this.txtName); - this.pageGeneral.Controls.Add(this.lblName); - this.pageGeneral.Location = new System.Drawing.Point(4, 24); - this.pageGeneral.Name = "pageGeneral"; - this.pageGeneral.Padding = new System.Windows.Forms.Padding(5); - this.pageGeneral.Size = new System.Drawing.Size(376, 440); - this.pageGeneral.TabIndex = 0; - this.pageGeneral.Text = "General"; - this.pageGeneral.UseVisualStyleBackColor = true; + pageGeneral.Controls.Add(txtWebUrl); + pageGeneral.Controls.Add(lblWebUrl); + pageGeneral.Controls.Add(cbExtension); + pageGeneral.Controls.Add(lblExtension); + pageGeneral.Controls.Add(txtName); + pageGeneral.Controls.Add(lblName); + pageGeneral.Location = new System.Drawing.Point(4, 24); + pageGeneral.Name = "pageGeneral"; + pageGeneral.Padding = new System.Windows.Forms.Padding(5); + pageGeneral.Size = new System.Drawing.Size(376, 440); + pageGeneral.TabIndex = 0; + pageGeneral.Text = "General"; + pageGeneral.UseVisualStyleBackColor = true; // // txtWebUrl // - this.txtWebUrl.Location = new System.Drawing.Point(8, 111); - this.txtWebUrl.Name = "txtWebUrl"; - this.txtWebUrl.Size = new System.Drawing.Size(360, 23); - this.txtWebUrl.TabIndex = 5; + txtWebUrl.Location = new System.Drawing.Point(8, 111); + txtWebUrl.Name = "txtWebUrl"; + txtWebUrl.Size = new System.Drawing.Size(360, 23); + txtWebUrl.TabIndex = 5; // // lblWebUrl // - this.lblWebUrl.AutoSize = true; - this.lblWebUrl.Location = new System.Drawing.Point(5, 93); - this.lblWebUrl.Name = "lblWebUrl"; - this.lblWebUrl.Size = new System.Drawing.Size(91, 15); - this.lblWebUrl.TabIndex = 4; - this.lblWebUrl.Text = "Webstation URL"; + lblWebUrl.AutoSize = true; + lblWebUrl.Location = new System.Drawing.Point(5, 93); + lblWebUrl.Name = "lblWebUrl"; + lblWebUrl.Size = new System.Drawing.Size(91, 15); + lblWebUrl.TabIndex = 4; + lblWebUrl.Text = "Webstation URL"; // // cbExtension // - this.cbExtension.FormattingEnabled = true; - this.cbExtension.Location = new System.Drawing.Point(8, 67); - this.cbExtension.Name = "cbExtension"; - this.cbExtension.Size = new System.Drawing.Size(360, 23); - this.cbExtension.Sorted = true; - this.cbExtension.TabIndex = 3; + cbExtension.FormattingEnabled = true; + cbExtension.Location = new System.Drawing.Point(8, 67); + cbExtension.Name = "cbExtension"; + cbExtension.Size = new System.Drawing.Size(360, 23); + cbExtension.Sorted = true; + cbExtension.TabIndex = 3; // // lblExtension // - this.lblExtension.AutoSize = true; - this.lblExtension.Location = new System.Drawing.Point(5, 49); - this.lblExtension.Name = "lblExtension"; - this.lblExtension.Size = new System.Drawing.Size(58, 15); - this.lblExtension.TabIndex = 2; - this.lblExtension.Text = "Extension"; + lblExtension.AutoSize = true; + lblExtension.Location = new System.Drawing.Point(5, 49); + lblExtension.Name = "lblExtension"; + lblExtension.Size = new System.Drawing.Size(58, 15); + lblExtension.TabIndex = 2; + lblExtension.Text = "Extension"; // // txtName // - this.txtName.Location = new System.Drawing.Point(8, 23); - this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(360, 23); - this.txtName.TabIndex = 1; + txtName.Location = new System.Drawing.Point(8, 23); + txtName.Name = "txtName"; + txtName.Size = new System.Drawing.Size(360, 23); + txtName.TabIndex = 1; // // lblName // - this.lblName.AutoSize = true; - this.lblName.Location = new System.Drawing.Point(5, 5); - this.lblName.Name = "lblName"; - this.lblName.Size = new System.Drawing.Size(74, 15); - this.lblName.TabIndex = 0; - this.lblName.Text = "Profile name"; + lblName.AutoSize = true; + lblName.Location = new System.Drawing.Point(5, 5); + lblName.Name = "lblName"; + lblName.Size = new System.Drawing.Size(74, 15); + lblName.TabIndex = 0; + lblName.Text = "Profile name"; // // pageAgentConnection // - this.pageAgentConnection.Controls.Add(this.chkAgentEnabled); - this.pageAgentConnection.Controls.Add(this.ctrlAgentConnection); - this.pageAgentConnection.Location = new System.Drawing.Point(4, 24); - this.pageAgentConnection.Name = "pageAgentConnection"; - this.pageAgentConnection.Padding = new System.Windows.Forms.Padding(5); - this.pageAgentConnection.Size = new System.Drawing.Size(376, 440); - this.pageAgentConnection.TabIndex = 1; - this.pageAgentConnection.Text = "Agent Connection"; - this.pageAgentConnection.UseVisualStyleBackColor = true; + pageAgentConnection.Controls.Add(chkAgentEnabled); + pageAgentConnection.Controls.Add(ctrlAgentConnection); + pageAgentConnection.Location = new System.Drawing.Point(4, 24); + pageAgentConnection.Name = "pageAgentConnection"; + pageAgentConnection.Padding = new System.Windows.Forms.Padding(5); + pageAgentConnection.Size = new System.Drawing.Size(376, 440); + pageAgentConnection.TabIndex = 1; + pageAgentConnection.Text = "Agent Connection"; + pageAgentConnection.UseVisualStyleBackColor = true; // // chkAgentEnabled // - this.chkAgentEnabled.AutoSize = true; - this.chkAgentEnabled.Location = new System.Drawing.Point(8, 8); - this.chkAgentEnabled.Name = "chkAgentEnabled"; - this.chkAgentEnabled.Size = new System.Drawing.Size(103, 19); - this.chkAgentEnabled.TabIndex = 0; - this.chkAgentEnabled.Text = "Agent enabled"; - this.chkAgentEnabled.UseVisualStyleBackColor = true; - this.chkAgentEnabled.CheckedChanged += new System.EventHandler(this.chkAgentEnabled_CheckedChanged); + chkAgentEnabled.AutoSize = true; + chkAgentEnabled.Location = new System.Drawing.Point(8, 8); + chkAgentEnabled.Name = "chkAgentEnabled"; + chkAgentEnabled.Size = new System.Drawing.Size(103, 19); + chkAgentEnabled.TabIndex = 0; + chkAgentEnabled.Text = "Agent enabled"; + chkAgentEnabled.UseVisualStyleBackColor = true; + chkAgentEnabled.CheckedChanged += chkAgentEnabled_CheckedChanged; // // ctrlAgentConnection // - this.ctrlAgentConnection.ConnectionOptions = null; - this.ctrlAgentConnection.InstanceEnabled = false; - this.ctrlAgentConnection.Location = new System.Drawing.Point(8, 33); - this.ctrlAgentConnection.Name = "ctrlAgentConnection"; - this.ctrlAgentConnection.NameEnabled = false; - this.ctrlAgentConnection.Size = new System.Drawing.Size(360, 366); - this.ctrlAgentConnection.TabIndex = 0; + ctrlAgentConnection.ConnectionOptions = null; + ctrlAgentConnection.InstanceEnabled = false; + ctrlAgentConnection.Location = new System.Drawing.Point(8, 33); + ctrlAgentConnection.Name = "ctrlAgentConnection"; + ctrlAgentConnection.NameEnabled = false; + ctrlAgentConnection.Size = new System.Drawing.Size(360, 399); + ctrlAgentConnection.TabIndex = 0; // // pageDbConnection // - this.pageDbConnection.Controls.Add(this.chkDbEnabled); - this.pageDbConnection.Controls.Add(this.ctrlDbConnection); - this.pageDbConnection.Location = new System.Drawing.Point(4, 24); - this.pageDbConnection.Name = "pageDbConnection"; - this.pageDbConnection.Padding = new System.Windows.Forms.Padding(5); - this.pageDbConnection.Size = new System.Drawing.Size(376, 440); - this.pageDbConnection.TabIndex = 2; - this.pageDbConnection.Text = "DB Connection"; - this.pageDbConnection.UseVisualStyleBackColor = true; + pageDbConnection.Controls.Add(chkDbEnabled); + pageDbConnection.Controls.Add(ctrlDbConnection); + pageDbConnection.Location = new System.Drawing.Point(4, 24); + pageDbConnection.Name = "pageDbConnection"; + pageDbConnection.Padding = new System.Windows.Forms.Padding(5); + pageDbConnection.Size = new System.Drawing.Size(376, 440); + pageDbConnection.TabIndex = 2; + pageDbConnection.Text = "DB Connection"; + pageDbConnection.UseVisualStyleBackColor = true; // // chkDbEnabled // - this.chkDbEnabled.AutoSize = true; - this.chkDbEnabled.Location = new System.Drawing.Point(8, 8); - this.chkDbEnabled.Name = "chkDbEnabled"; - this.chkDbEnabled.Size = new System.Drawing.Size(119, 19); - this.chkDbEnabled.TabIndex = 0; - this.chkDbEnabled.Text = "Database enabled"; - this.chkDbEnabled.UseVisualStyleBackColor = true; - this.chkDbEnabled.CheckedChanged += new System.EventHandler(this.chkDbEnabled_CheckedChanged); + chkDbEnabled.AutoSize = true; + chkDbEnabled.Location = new System.Drawing.Point(8, 8); + chkDbEnabled.Name = "chkDbEnabled"; + chkDbEnabled.Size = new System.Drawing.Size(119, 19); + chkDbEnabled.TabIndex = 0; + chkDbEnabled.Text = "Database enabled"; + chkDbEnabled.UseVisualStyleBackColor = true; + chkDbEnabled.CheckedChanged += chkDbEnabled_CheckedChanged; // // ctrlDbConnection // - this.ctrlDbConnection.BuildConnectionStringFunc = null; - this.ctrlDbConnection.ConnectionOptions = null; - this.ctrlDbConnection.DbmsEnabled = false; - this.ctrlDbConnection.Location = new System.Drawing.Point(8, 33); - this.ctrlDbConnection.Name = "ctrlDbConnection"; - this.ctrlDbConnection.NameEnabled = false; - this.ctrlDbConnection.Size = new System.Drawing.Size(360, 399); - this.ctrlDbConnection.TabIndex = 0; + ctrlDbConnection.BuildConnectionStringFunc = null; + ctrlDbConnection.ConnectionOptions = null; + ctrlDbConnection.DbmsEnabled = false; + ctrlDbConnection.Location = new System.Drawing.Point(8, 33); + ctrlDbConnection.Name = "ctrlDbConnection"; + ctrlDbConnection.NameEnabled = false; + ctrlDbConnection.Size = new System.Drawing.Size(360, 399); + ctrlDbConnection.TabIndex = 0; // // btnOK // - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnOK.Location = new System.Drawing.Point(216, 6); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(75, 23); - this.btnOK.TabIndex = 0; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + btnOK.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnOK.Location = new System.Drawing.Point(216, 6); + btnOK.Name = "btnOK"; + btnOK.Size = new System.Drawing.Size(75, 23); + btnOK.TabIndex = 0; + btnOK.Text = "OK"; + btnOK.UseVisualStyleBackColor = true; + btnOK.Click += btnOK_Click; // // btnCancel // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.Location = new System.Drawing.Point(297, 6); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 1; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; + btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnCancel.Location = new System.Drawing.Point(297, 6); + btnCancel.Name = "btnCancel"; + btnCancel.Size = new System.Drawing.Size(75, 23); + btnCancel.TabIndex = 1; + btnCancel.Text = "Cancel"; + btnCancel.UseVisualStyleBackColor = true; // // pnlBottom // - this.pnlBottom.Controls.Add(this.btnCancel); - this.pnlBottom.Controls.Add(this.btnOK); - this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlBottom.Location = new System.Drawing.Point(0, 468); - this.pnlBottom.Name = "pnlBottom"; - this.pnlBottom.Size = new System.Drawing.Size(384, 41); - this.pnlBottom.TabIndex = 1; + pnlBottom.Controls.Add(btnCancel); + pnlBottom.Controls.Add(btnOK); + pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; + pnlBottom.Location = new System.Drawing.Point(0, 468); + pnlBottom.Name = "pnlBottom"; + pnlBottom.Size = new System.Drawing.Size(384, 41); + pnlBottom.TabIndex = 1; // // FrmProfileEdit // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(384, 509); - this.Controls.Add(this.tabControl); - this.Controls.Add(this.pnlBottom); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmProfileEdit"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Edit Profile"; - this.Load += new System.EventHandler(this.FrmProfileEdit_Load); - this.tabControl.ResumeLayout(false); - this.pageGeneral.ResumeLayout(false); - this.pageGeneral.PerformLayout(); - this.pageAgentConnection.ResumeLayout(false); - this.pageAgentConnection.PerformLayout(); - this.pageDbConnection.ResumeLayout(false); - this.pageDbConnection.PerformLayout(); - this.pnlBottom.ResumeLayout(false); - this.ResumeLayout(false); - + AcceptButton = btnOK; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + CancelButton = btnCancel; + ClientSize = new System.Drawing.Size(384, 509); + Controls.Add(tabControl); + Controls.Add(pnlBottom); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + MaximizeBox = false; + MinimizeBox = false; + Name = "FrmProfileEdit"; + ShowInTaskbar = false; + StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + Text = "Edit Profile"; + Load += FrmProfileEdit_Load; + tabControl.ResumeLayout(false); + pageGeneral.ResumeLayout(false); + pageGeneral.PerformLayout(); + pageAgentConnection.ResumeLayout(false); + pageAgentConnection.PerformLayout(); + pageDbConnection.ResumeLayout(false); + pageDbConnection.PerformLayout(); + pnlBottom.ResumeLayout(false); + ResumeLayout(false); } #endregion diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.resx b/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.resx index f298a7be8..a395bffc9 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.resx +++ b/ScadaAdmin/ScadaAdmin/ScadaAdmin/Forms/Deployment/FrmProfileEdit.resx @@ -1,4 +1,64 @@ - + + + From 0f21222d106148d372ec103b90da022602a43474 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 18:13:43 +0300 Subject: [PATCH 174/184] ScadaCommon.Forms: implicit usings --- ScadaCommon/ScadaCommon.Forms/BitItemCollection.cs | 2 -- ScadaCommon/ScadaCommon.Forms/ConfigProvider.cs | 4 ---- ScadaCommon/ScadaCommon.Forms/Controls/CtrlBitmask.cs | 2 -- ScadaCommon/ScadaCommon.Forms/FormTranslator.cs | 3 --- ScadaCommon/ScadaCommon.Forms/FormTranslatorOptions.cs | 2 -- ScadaCommon/ScadaCommon.Forms/Forms/FrmBitSelect.cs | 2 -- ScadaCommon/ScadaCommon.Forms/Forms/FrmBitmask.cs | 3 --- ScadaCommon/ScadaCommon.Forms/Forms/FrmCnlSelect.cs | 4 ---- ScadaCommon/ScadaCommon.Forms/Forms/FrmEntitySelect.cs | 4 ---- ScadaCommon/ScadaCommon.Forms/Forms/FrmModuleConfig.cs | 4 ---- ScadaCommon/ScadaCommon.Forms/Forms/FrmOptions.cs | 3 --- ScadaCommon/ScadaCommon.Forms/Forms/FrmRangeEdit.cs | 3 --- ScadaCommon/ScadaCommon.Forms/ListViewExtensions.cs | 3 --- ScadaCommon/ScadaCommon.Forms/LogBox.cs | 5 ----- ScadaCommon/ScadaCommon.Forms/ObjectChangedEventArgs.cs | 2 -- ScadaCommon/ScadaCommon.Forms/RemoteLogBox.cs | 3 --- ScadaCommon/ScadaCommon.Forms/RichTextBoxHelper.cs | 4 ---- ScadaCommon/ScadaCommon.Forms/ScadaUiUtils.cs | 7 ------- ScadaCommon/ScadaCommon.Forms/TreeNodeTag.cs | 3 --- ScadaCommon/ScadaCommon.Forms/TreeUpdateTypes.cs | 2 -- ScadaCommon/ScadaCommon.Forms/TreeViewExtensions.cs | 3 --- 21 files changed, 68 deletions(-) diff --git a/ScadaCommon/ScadaCommon.Forms/BitItemCollection.cs b/ScadaCommon/ScadaCommon.Forms/BitItemCollection.cs index a4c902362..1cf6a38cb 100644 --- a/ScadaCommon/ScadaCommon.Forms/BitItemCollection.cs +++ b/ScadaCommon/ScadaCommon.Forms/BitItemCollection.cs @@ -5,8 +5,6 @@ using Scada.Data.Entities; using Scada.Data.Tables; using Scada.Lang; -using System; -using System.Collections.Generic; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/ConfigProvider.cs b/ScadaCommon/ScadaCommon.Forms/ConfigProvider.cs index 9715cedd6..ab08292f8 100644 --- a/ScadaCommon/ScadaCommon.Forms/ConfigProvider.cs +++ b/ScadaCommon/ScadaCommon.Forms/ConfigProvider.cs @@ -2,10 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Config; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Windows.Forms; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlBitmask.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlBitmask.cs index b6c30f0f8..95efc3b94 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlBitmask.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlBitmask.cs @@ -1,9 +1,7 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections; -using System.Windows.Forms; namespace Scada.Forms.Controls { diff --git a/ScadaCommon/ScadaCommon.Forms/FormTranslator.cs b/ScadaCommon/ScadaCommon.Forms/FormTranslator.cs index dc2da6956..f497fddf8 100644 --- a/ScadaCommon/ScadaCommon.Forms/FormTranslator.cs +++ b/ScadaCommon/ScadaCommon.Forms/FormTranslator.cs @@ -2,10 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Lang; -using System; using System.Collections; -using System.Collections.Generic; -using System.Windows.Forms; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/FormTranslatorOptions.cs b/ScadaCommon/ScadaCommon.Forms/FormTranslatorOptions.cs index cc696fc49..692128d9d 100644 --- a/ScadaCommon/ScadaCommon.Forms/FormTranslatorOptions.cs +++ b/ScadaCommon/ScadaCommon.Forms/FormTranslatorOptions.cs @@ -1,8 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Windows.Forms; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitSelect.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitSelect.cs index 7df5a8f43..90f6bdd3e 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitSelect.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitSelect.cs @@ -1,9 +1,7 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitmask.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitmask.cs index 2d37c931e..51d878e44 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitmask.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmBitmask.cs @@ -1,9 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Windows.Forms; - namespace Scada.Forms.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmCnlSelect.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmCnlSelect.cs index fe016b043..803c7c487 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmCnlSelect.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmCnlSelect.cs @@ -5,12 +5,8 @@ using Scada.Data.Entities; using Scada.Data.Models; -using System; -using System.Collections.Generic; using System.ComponentModel; using System.Data; -using System.Linq; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmEntitySelect.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmEntitySelect.cs index 7cde0530f..1baf50761 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmEntitySelect.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmEntitySelect.cs @@ -4,12 +4,8 @@ #pragma warning disable CA1806 // Do not ignore method results using Scada.Data.Tables; -using System; -using System.Collections.Generic; using System.ComponentModel; using System.Data; -using System.Linq; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmModuleConfig.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmModuleConfig.cs index 3eef9b968..a80dc53a7 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmModuleConfig.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmModuleConfig.cs @@ -2,10 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Lang; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmOptions.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmOptions.cs index 3eff0865b..f256fe411 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmOptions.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmOptions.cs @@ -2,9 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Config; -using System; -using System.IO; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/Forms/FrmRangeEdit.cs b/ScadaCommon/ScadaCommon.Forms/Forms/FrmRangeEdit.cs index ae18af410..7825b952e 100644 --- a/ScadaCommon/ScadaCommon.Forms/Forms/FrmRangeEdit.cs +++ b/ScadaCommon/ScadaCommon.Forms/Forms/FrmRangeEdit.cs @@ -2,9 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Lang; -using System; -using System.Collections.Generic; -using System.Windows.Forms; namespace Scada.Forms.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/ListViewExtensions.cs b/ScadaCommon/ScadaCommon.Forms/ListViewExtensions.cs index c44a52732..5dcce00d9 100644 --- a/ScadaCommon/ScadaCommon.Forms/ListViewExtensions.cs +++ b/ScadaCommon/ScadaCommon.Forms/ListViewExtensions.cs @@ -1,9 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Windows.Forms; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/LogBox.cs b/ScadaCommon/ScadaCommon.Forms/LogBox.cs index 8a0f9a43f..d906ba711 100644 --- a/ScadaCommon/ScadaCommon.Forms/LogBox.cs +++ b/ScadaCommon/ScadaCommon.Forms/LogBox.cs @@ -2,12 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Scada.Lang; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; using System.Text; -using System.Windows.Forms; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/ObjectChangedEventArgs.cs b/ScadaCommon/ScadaCommon.Forms/ObjectChangedEventArgs.cs index 6a734bb1e..a8e55b9eb 100644 --- a/ScadaCommon/ScadaCommon.Forms/ObjectChangedEventArgs.cs +++ b/ScadaCommon/ScadaCommon.Forms/ObjectChangedEventArgs.cs @@ -1,8 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/RemoteLogBox.cs b/ScadaCommon/ScadaCommon.Forms/RemoteLogBox.cs index ec4e587e2..754431977 100644 --- a/ScadaCommon/ScadaCommon.Forms/RemoteLogBox.cs +++ b/ScadaCommon/ScadaCommon.Forms/RemoteLogBox.cs @@ -3,9 +3,6 @@ using Scada.Agent; using Scada.Protocol; -using System; -using System.Collections.Generic; -using System.Windows.Forms; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/RichTextBoxHelper.cs b/ScadaCommon/ScadaCommon.Forms/RichTextBoxHelper.cs index 397c3342d..9b9376a2a 100644 --- a/ScadaCommon/ScadaCommon.Forms/RichTextBoxHelper.cs +++ b/ScadaCommon/ScadaCommon.Forms/RichTextBoxHelper.cs @@ -1,10 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Drawing; -using System.Windows.Forms; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/ScadaUiUtils.cs b/ScadaCommon/ScadaCommon.Forms/ScadaUiUtils.cs index d7f503ed6..4009ee1ed 100644 --- a/ScadaCommon/ScadaCommon.Forms/ScadaUiUtils.cs +++ b/ScadaCommon/ScadaCommon.Forms/ScadaUiUtils.cs @@ -3,15 +3,8 @@ using Scada.Lang; using Scada.Log; -using System; using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; namespace Scada.Forms { diff --git a/ScadaCommon/ScadaCommon.Forms/TreeNodeTag.cs b/ScadaCommon/ScadaCommon.Forms/TreeNodeTag.cs index af713e8ae..34efe95c5 100644 --- a/ScadaCommon/ScadaCommon.Forms/TreeNodeTag.cs +++ b/ScadaCommon/ScadaCommon.Forms/TreeNodeTag.cs @@ -1,9 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Windows.Forms; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/TreeUpdateTypes.cs b/ScadaCommon/ScadaCommon.Forms/TreeUpdateTypes.cs index 1f4a42c55..6eb14ccd4 100644 --- a/ScadaCommon/ScadaCommon.Forms/TreeUpdateTypes.cs +++ b/ScadaCommon/ScadaCommon.Forms/TreeUpdateTypes.cs @@ -1,8 +1,6 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; - namespace Scada.Forms { /// diff --git a/ScadaCommon/ScadaCommon.Forms/TreeViewExtensions.cs b/ScadaCommon/ScadaCommon.Forms/TreeViewExtensions.cs index 2ec1de818..3c47c45c0 100644 --- a/ScadaCommon/ScadaCommon.Forms/TreeViewExtensions.cs +++ b/ScadaCommon/ScadaCommon.Forms/TreeViewExtensions.cs @@ -1,10 +1,7 @@ // Copyright (c) Rapid Software LLC. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections; -using System.Collections.Generic; -using System.Windows.Forms; namespace Scada.Forms { From 3b27f6bb5bbf21f9073fdf712e7a16c659a25d9f Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 18:46:12 +0300 Subject: [PATCH 175/184] ScadaCommon.Forms: add registration control --- .../Controls/CtrlRegistration.Designer.cs | 236 ++++++++++++++++++ .../Controls/CtrlRegistration.cs | 128 ++++++++++ .../Controls/CtrlRegistration.resx | 120 +++++++++ .../Properties/Resources.Designer.cs | 10 + .../Properties/Resources.resx | 3 + .../ScadaCommon.Forms/Resources/info.png | Bin 0 -> 516 bytes .../ScadaCommon/Lang/ScadaCommon.en-GB.xml | 12 + .../ScadaCommon/Lang/ScadaCommon.ru-RU.xml | 12 + 8 files changed, 521 insertions(+) create mode 100644 ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.Designer.cs create mode 100644 ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs create mode 100644 ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.resx create mode 100644 ScadaCommon/ScadaCommon.Forms/Resources/info.png diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.Designer.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.Designer.cs new file mode 100644 index 000000000..c718932ce --- /dev/null +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.Designer.cs @@ -0,0 +1,236 @@ +namespace Scada.Forms.Controls +{ + partial class CtrlRegistration + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + pbInfo2 = new PictureBox(); + lblRegKeyInfo = new Label(); + llblGetTrialKey = new LinkLabel(); + llblGetPermanentKey = new LinkLabel(); + btnPasteRegKey = new Button(); + txtRegKey = new TextBox(); + lblRegKey = new Label(); + pbInfo1 = new PictureBox(); + lblCompCodeInfo = new Label(); + btnRefreshCompCode = new Button(); + btnCopyCompCode = new Button(); + txtCompCode = new TextBox(); + lblCompCode = new Label(); + txtProductName = new TextBox(); + lblProductName = new Label(); + ((System.ComponentModel.ISupportInitialize)pbInfo2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pbInfo1).BeginInit(); + SuspendLayout(); + // + // pbInfo2 + // + pbInfo2.Image = Properties.Resources.info; + pbInfo2.Location = new Point(0, 309); + pbInfo2.Name = "pbInfo2"; + pbInfo2.Size = new Size(16, 16); + pbInfo2.TabIndex = 28; + pbInfo2.TabStop = false; + // + // lblRegKeyInfo + // + lblRegKeyInfo.AutoSize = true; + lblRegKeyInfo.ForeColor = SystemColors.GrayText; + lblRegKeyInfo.Location = new Point(22, 310); + lblRegKeyInfo.Name = "lblRegKeyInfo"; + lblRegKeyInfo.Size = new Size(347, 15); + lblRegKeyInfo.TabIndex = 10; + lblRegKeyInfo.Text = "Key verification result is written in the application or module log."; + // + // llblGetTrialKey + // + llblGetTrialKey.AutoSize = true; + llblGetTrialKey.Location = new Point(-3, 358); + llblGetTrialKey.Name = "llblGetTrialKey"; + llblGetTrialKey.Size = new Size(69, 15); + llblGetTrialKey.TabIndex = 12; + llblGetTrialKey.TabStop = true; + llblGetTrialKey.Text = "Get trial key"; + llblGetTrialKey.LinkClicked += llblGetTrialKey_LinkClicked; + // + // llblGetPermanentKey + // + llblGetPermanentKey.AutoSize = true; + llblGetPermanentKey.Location = new Point(-3, 338); + llblGetPermanentKey.Name = "llblGetPermanentKey"; + llblGetPermanentKey.Size = new Size(107, 15); + llblGetPermanentKey.TabIndex = 11; + llblGetPermanentKey.TabStop = true; + llblGetPermanentKey.Text = "Get permanent key"; + llblGetPermanentKey.LinkClicked += llblGetPermanentKey_LinkClicked; + // + // btnPasteRegKey + // + btnPasteRegKey.Location = new Point(0, 280); + btnPasteRegKey.Name = "btnPasteRegKey"; + btnPasteRegKey.Size = new Size(90, 23); + btnPasteRegKey.TabIndex = 9; + btnPasteRegKey.Text = "Paste"; + btnPasteRegKey.UseVisualStyleBackColor = true; + btnPasteRegKey.Click += btnPasteRegKey_Click; + // + // txtRegKey + // + txtRegKey.Location = new Point(0, 251); + txtRegKey.Name = "txtRegKey"; + txtRegKey.Size = new Size(510, 23); + txtRegKey.TabIndex = 8; + // + // lblRegKey + // + lblRegKey.AutoSize = true; + lblRegKey.Location = new Point(-3, 233); + lblRegKey.Name = "lblRegKey"; + lblRegKey.Size = new Size(91, 15); + lblRegKey.TabIndex = 7; + lblRegKey.Text = "Registration key"; + // + // pbInfo1 + // + pbInfo1.Image = Properties.Resources.info; + pbInfo1.Location = new Point(0, 204); + pbInfo1.Name = "pbInfo1"; + pbInfo1.Size = new Size(16, 16); + pbInfo1.TabIndex = 19; + pbInfo1.TabStop = false; + // + // lblCompCodeInfo + // + lblCompCodeInfo.AutoSize = true; + lblCompCodeInfo.ForeColor = SystemColors.GrayText; + lblCompCodeInfo.Location = new Point(22, 205); + lblCompCodeInfo.Name = "lblCompCodeInfo"; + lblCompCodeInfo.Size = new Size(377, 15); + lblCompCodeInfo.TabIndex = 6; + lblCompCodeInfo.Text = "If the code is missing, upload the configuration and restart the service."; + // + // btnRefreshCompCode + // + btnRefreshCompCode.Location = new Point(96, 175); + btnRefreshCompCode.Name = "btnRefreshCompCode"; + btnRefreshCompCode.Size = new Size(90, 23); + btnRefreshCompCode.TabIndex = 5; + btnRefreshCompCode.Text = "Refresh"; + btnRefreshCompCode.UseVisualStyleBackColor = true; + btnRefreshCompCode.Click += btnRefreshCompCode_Click; + // + // btnCopyCompCode + // + btnCopyCompCode.Location = new Point(0, 175); + btnCopyCompCode.Name = "btnCopyCompCode"; + btnCopyCompCode.Size = new Size(90, 23); + btnCopyCompCode.TabIndex = 4; + btnCopyCompCode.Text = "Copy"; + btnCopyCompCode.UseVisualStyleBackColor = true; + btnCopyCompCode.Click += btnCopyCompCode_Click; + // + // txtCompCode + // + txtCompCode.Location = new Point(0, 69); + txtCompCode.Multiline = true; + txtCompCode.Name = "txtCompCode"; + txtCompCode.ReadOnly = true; + txtCompCode.Size = new Size(510, 100); + txtCompCode.TabIndex = 3; + // + // lblCompCode + // + lblCompCode.AutoSize = true; + lblCompCode.Location = new Point(-3, 51); + lblCompCode.Name = "lblCompCode"; + lblCompCode.Size = new Size(90, 15); + lblCompCode.TabIndex = 2; + lblCompCode.Text = "Computer code"; + // + // txtProductName + // + txtProductName.Location = new Point(0, 15); + txtProductName.Name = "txtProductName"; + txtProductName.ReadOnly = true; + txtProductName.Size = new Size(510, 23); + txtProductName.TabIndex = 1; + // + // lblProductName + // + lblProductName.AutoSize = true; + lblProductName.Location = new Point(-3, -3); + lblProductName.Name = "lblProductName"; + lblProductName.Size = new Size(82, 15); + lblProductName.TabIndex = 0; + lblProductName.Text = "Product name"; + // + // CtrlRegistration + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(llblGetTrialKey); + Controls.Add(llblGetPermanentKey); + Controls.Add(lblRegKeyInfo); + Controls.Add(pbInfo2); + Controls.Add(btnPasteRegKey); + Controls.Add(txtRegKey); + Controls.Add(lblRegKey); + Controls.Add(lblCompCodeInfo); + Controls.Add(pbInfo1); + Controls.Add(btnRefreshCompCode); + Controls.Add(btnCopyCompCode); + Controls.Add(txtCompCode); + Controls.Add(lblCompCode); + Controls.Add(txtProductName); + Controls.Add(lblProductName); + Name = "CtrlRegistration"; + Size = new Size(510, 375); + ((System.ComponentModel.ISupportInitialize)pbInfo2).EndInit(); + ((System.ComponentModel.ISupportInitialize)pbInfo1).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private PictureBox pbInfo2; + private Label lblRegKeyInfo; + private LinkLabel llblGetTrialKey; + private LinkLabel llblGetPermanentKey; + private Button btnPasteRegKey; + private TextBox txtRegKey; + private Label lblRegKey; + private PictureBox pbInfo1; + private Label lblCompCodeInfo; + private Button btnRefreshCompCode; + private Button btnCopyCompCode; + private TextBox txtCompCode; + private Label lblCompCode; + private TextBox txtProductName; + private Label lblProductName; + } +} diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs new file mode 100644 index 000000000..2ac195d99 --- /dev/null +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs @@ -0,0 +1,128 @@ +// Copyright (c) Rapid Software LLC. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Scada.Lang; +using System.ComponentModel; + +namespace Scada.Forms.Controls +{ + /// + /// Represents a control for module registration. + /// Представляет элемент управления для регистрации модуля. + /// + public partial class CtrlRegistration : UserControl + { + private string productCode; + + + /// + /// Initializes a new instance of the class. + /// + public CtrlRegistration() + { + InitializeComponent(); + + productCode = ""; + PermanentKeyUrl = ""; + TrialKeyUrl = ""; + } + + + /// + /// Gets or sets the product name. + /// + public new string ProductName + { + get => txtProductName.Text; + set => txtProductName.Text = value; + } + + /// + /// Gets or sets the product code. + /// + public string ProductCode + { + get => productCode; + set => productCode = value; + } + + /// + /// Gets or sets the computer code. + /// + public string ComputerName + { + get => txtCompCode.Text; + set => txtCompCode.Text = value; + } + + /// + /// Gets the URL to get a permanent key. + /// + public string PermanentKeyUrl { get; set; } + + /// + /// Gets the default URL to get a trial key. + /// + public string TrialKeyUrl { get; set; } + + + /// + /// Gets the default URL to get a permanent key. + /// + private static string GetDefaultPermanentKeyUrl() + { + return Locale.IsRussian ? + "https://rapidscada.ru/download-all-files/purchase-module/" : + "https://rapidscada.org/download-all-files/purchase-module/"; + } + + /// + /// Gets the default URL to get a trial key. + /// + private static string GetDefaultTrialKeyUrl(string productCode) + { + return string.Format(Locale.IsRussian ? + "https://rapidscada.net/trial/?prod={0}&ver=6&lang=ru" : + "https://rapidscada.net/trial/?prod={0}&ver=6", + productCode); + } + + + /// + /// Occurs when the Refresh button is clicked. + /// + [Category("Action")] + public event EventHandler RefreshCompCode; + + + private void btnCopyCompCode_Click(object sender, EventArgs e) + { + if (txtCompCode.Text != "") + Clipboard.SetText(txtCompCode.Text); + } + + private void btnRefreshCompCode_Click(object sender, EventArgs e) + { + RefreshCompCode?.Invoke(this, EventArgs.Empty); + } + + private void btnPasteRegKey_Click(object sender, EventArgs e) + { + txtRegKey.Text = Clipboard.GetText(); + } + + private void llblGetPermanentKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + ScadaUiUtils.StartProcess(string.IsNullOrEmpty(PermanentKeyUrl) + ? GetDefaultPermanentKeyUrl() + : PermanentKeyUrl); + } + + private void llblGetTrialKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + ScadaUiUtils.StartProcess(string.IsNullOrEmpty(TrialKeyUrl) + ? GetDefaultTrialKeyUrl(ProductCode) + : TrialKeyUrl); + } + } +} diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.resx b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.resx new file mode 100644 index 000000000..a395bffc9 --- /dev/null +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ScadaCommon/ScadaCommon.Forms/Properties/Resources.Designer.cs b/ScadaCommon/ScadaCommon.Forms/Properties/Resources.Designer.cs index a096ac7a7..0f31e4116 100644 --- a/ScadaCommon/ScadaCommon.Forms/Properties/Resources.Designer.cs +++ b/ScadaCommon/ScadaCommon.Forms/Properties/Resources.Designer.cs @@ -90,6 +90,16 @@ internal static System.Drawing.Bitmap delete { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap info { + get { + object obj = ResourceManager.GetObject("info", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ScadaCommon/ScadaCommon.Forms/Properties/Resources.resx b/ScadaCommon/ScadaCommon.Forms/Properties/Resources.resx index 584933cdb..93638289a 100644 --- a/ScadaCommon/ScadaCommon.Forms/Properties/Resources.resx +++ b/ScadaCommon/ScadaCommon.Forms/Properties/Resources.resx @@ -127,6 +127,9 @@ ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\info.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\move_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/ScadaCommon/ScadaCommon.Forms/Resources/info.png b/ScadaCommon/ScadaCommon.Forms/Resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..d47b22beae7e7cd361549eb251fe161a6cb37185 GIT binary patch literal 516 zcmV+f0{i`mP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-ib+I4RCwB~le9c z1zRtqRuT)vm?B#!f;J%{h*4scj3Fzmg+?|(F-^4pC|8-^3$?4q}HaO;Uk`Q7j>fr#YSoN6R_`ONX`0R8$~uyCpZz}Z~z!z`StkT82#pXhUx zQc+DrtVV3V_$$ulf@~LRWJ_*DM67^_q!*7KPassword Connection string + + Product name + Computer code + Copy + Refresh + If the code is missing, upload the configuration and restart the service. + Registration key + Paste + Key verification result is written in the application or module log. + Get permanent key + Get trial key + Bit Mask OK diff --git a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml index 2caf7b0e0..7b7e94890 100644 --- a/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml +++ b/ScadaCommon/ScadaCommon/Lang/ScadaCommon.ru-RU.xml @@ -134,6 +134,18 @@ Пароль Строка соединения + + Наименование продукта + Код компьютера + Копировать + Обновить + Если код отсутствует, передайте конфигурацию и перезапустите службу. + Регистрационный ключ + Вставить + Результат проверки ключа записывается в журнал приложения или модуля. + Получить постоянный ключ + Получить пробный ключ + Битовая маска OK From d5d9ba46668462b00839140206d4025f9942e531 Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 19:14:57 +0300 Subject: [PATCH 176/184] Update CtrlRegistration.cs --- .../Controls/CtrlRegistration.cs | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs index 2ac195d99..9d0867c2c 100644 --- a/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs +++ b/ScadaCommon/ScadaCommon.Forms/Controls/CtrlRegistration.cs @@ -3,6 +3,7 @@ using Scada.Lang; using System.ComponentModel; +using System.Xml.Linq; namespace Scada.Forms.Controls { @@ -28,6 +29,15 @@ public CtrlRegistration() } + /// + /// Gets or sets the product code. + /// + public string ProductCode + { + get => productCode; + set => productCode = value; + } + /// /// Gets or sets the product name. /// @@ -38,21 +48,21 @@ public CtrlRegistration() } /// - /// Gets or sets the product code. + /// Gets or sets the computer code. /// - public string ProductCode + public string ComputerCode { - get => productCode; - set => productCode = value; + get => txtCompCode.Text; + set => txtCompCode.Text = value; } /// - /// Gets or sets the computer code. + /// Gets or sets the registration key. /// - public string ComputerName + public string RegistrationKey { - get => txtCompCode.Text; - set => txtCompCode.Text = value; + get => txtRegKey.Text; + set => txtRegKey.Text = value; } /// @@ -87,6 +97,14 @@ private static string GetDefaultTrialKeyUrl(string productCode) productCode); } + /// + /// Sets input focus. + /// + public void SetFocus() + { + txtRegKey.Select(); + } + /// /// Occurs when the Refresh button is clicked. From c432158e6f4a93bc7fcc2809c7da4a5a3fac325f Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 19:17:00 +0300 Subject: [PATCH 177/184] ScadaAdmin: use registration control --- .../Forms/FrmRegistration.Designer.cs | 273 +++--------------- .../ScadaAdminCommon/Forms/FrmRegistration.cs | 70 +---- .../Forms/FrmRegistration.resx | 62 +++- .../Lang/ScadaAdmin.en-GB.xml | 10 - .../Lang/ScadaAdmin.ru-RU.xml | 10 - 5 files changed, 123 insertions(+), 302 deletions(-) diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.Designer.cs b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.Designer.cs index 513c89d8d..d7543308c 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.Designer.cs +++ b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.Designer.cs @@ -28,244 +28,67 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.lblCompCode = new System.Windows.Forms.Label(); - this.txtCompCode = new System.Windows.Forms.TextBox(); - this.btnCopyCompCode = new System.Windows.Forms.Button(); - this.pbInfo1 = new System.Windows.Forms.PictureBox(); - this.lblCompCodeInfo = new System.Windows.Forms.Label(); - this.lblRegKey = new System.Windows.Forms.Label(); - this.txtRegKey = new System.Windows.Forms.TextBox(); - this.btnPasteRegKey = new System.Windows.Forms.Button(); - this.llblGetPermanentKey = new System.Windows.Forms.LinkLabel(); - this.llblGetTrialKey = new System.Windows.Forms.LinkLabel(); - this.btnSave = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.lblProductName = new System.Windows.Forms.Label(); - this.txtProductName = new System.Windows.Forms.TextBox(); - this.pbInfo2 = new System.Windows.Forms.PictureBox(); - this.lblRegKeyInfo = new System.Windows.Forms.Label(); - this.btnRefreshCompCode = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.pbInfo1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbInfo2)).BeginInit(); - this.SuspendLayout(); - // - // lblCompCode - // - this.lblCompCode.AutoSize = true; - this.lblCompCode.Location = new System.Drawing.Point(9, 63); - this.lblCompCode.Name = "lblCompCode"; - this.lblCompCode.Size = new System.Drawing.Size(90, 15); - this.lblCompCode.TabIndex = 2; - this.lblCompCode.Text = "Computer code"; - // - // txtCompCode - // - this.txtCompCode.Location = new System.Drawing.Point(12, 81); - this.txtCompCode.Multiline = true; - this.txtCompCode.Name = "txtCompCode"; - this.txtCompCode.ReadOnly = true; - this.txtCompCode.Size = new System.Drawing.Size(510, 100); - this.txtCompCode.TabIndex = 3; - // - // btnCopyCompCode - // - this.btnCopyCompCode.Location = new System.Drawing.Point(12, 187); - this.btnCopyCompCode.Name = "btnCopyCompCode"; - this.btnCopyCompCode.Size = new System.Drawing.Size(90, 23); - this.btnCopyCompCode.TabIndex = 4; - this.btnCopyCompCode.Text = "Copy"; - this.btnCopyCompCode.UseVisualStyleBackColor = true; - this.btnCopyCompCode.Click += new System.EventHandler(this.btnCopyCompCode_Click); - // - // pbInfo1 - // - this.pbInfo1.Image = global::Scada.Admin.Properties.Resources.info; - this.pbInfo1.Location = new System.Drawing.Point(12, 216); - this.pbInfo1.Name = "pbInfo1"; - this.pbInfo1.Size = new System.Drawing.Size(16, 16); - this.pbInfo1.TabIndex = 3; - this.pbInfo1.TabStop = false; - // - // lblCompCodeInfo - // - this.lblCompCodeInfo.AutoSize = true; - this.lblCompCodeInfo.ForeColor = System.Drawing.SystemColors.GrayText; - this.lblCompCodeInfo.Location = new System.Drawing.Point(34, 217); - this.lblCompCodeInfo.Name = "lblCompCodeInfo"; - this.lblCompCodeInfo.Size = new System.Drawing.Size(379, 15); - this.lblCompCodeInfo.TabIndex = 5; - this.lblCompCodeInfo.Text = "If the code is missing, upload the configuration and restart the services"; - // - // lblRegKey - // - this.lblRegKey.AutoSize = true; - this.lblRegKey.Location = new System.Drawing.Point(9, 245); - this.lblRegKey.Name = "lblRegKey"; - this.lblRegKey.Size = new System.Drawing.Size(91, 15); - this.lblRegKey.TabIndex = 6; - this.lblRegKey.Text = "Registration key"; - // - // txtRegKey - // - this.txtRegKey.Location = new System.Drawing.Point(12, 263); - this.txtRegKey.Name = "txtRegKey"; - this.txtRegKey.Size = new System.Drawing.Size(510, 23); - this.txtRegKey.TabIndex = 7; - // - // btnPasteRegKey - // - this.btnPasteRegKey.Location = new System.Drawing.Point(12, 292); - this.btnPasteRegKey.Name = "btnPasteRegKey"; - this.btnPasteRegKey.Size = new System.Drawing.Size(90, 23); - this.btnPasteRegKey.TabIndex = 8; - this.btnPasteRegKey.Text = "Paste"; - this.btnPasteRegKey.UseVisualStyleBackColor = true; - this.btnPasteRegKey.Click += new System.EventHandler(this.btnPasteRegKey_Click); - // - // llblGetPermanentKey - // - this.llblGetPermanentKey.AutoSize = true; - this.llblGetPermanentKey.Location = new System.Drawing.Point(9, 350); - this.llblGetPermanentKey.Name = "llblGetPermanentKey"; - this.llblGetPermanentKey.Size = new System.Drawing.Size(107, 15); - this.llblGetPermanentKey.TabIndex = 9; - this.llblGetPermanentKey.TabStop = true; - this.llblGetPermanentKey.Text = "Get permanent key"; - this.llblGetPermanentKey.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llblGetPermanentKey_LinkClicked); - // - // llblGetTrialKey - // - this.llblGetTrialKey.AutoSize = true; - this.llblGetTrialKey.Location = new System.Drawing.Point(9, 370); - this.llblGetTrialKey.Name = "llblGetTrialKey"; - this.llblGetTrialKey.Size = new System.Drawing.Size(69, 15); - this.llblGetTrialKey.TabIndex = 10; - this.llblGetTrialKey.TabStop = true; - this.llblGetTrialKey.Text = "Get trial key"; - this.llblGetTrialKey.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llblGetTrialKey_LinkClicked); + btnSave = new System.Windows.Forms.Button(); + ctrlRegistration = new Scada.Forms.Controls.CtrlRegistration(); + btnCancel = new System.Windows.Forms.Button(); + SuspendLayout(); // // btnSave // - this.btnSave.Location = new System.Drawing.Point(366, 398); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 11; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + btnSave.Location = new System.Drawing.Point(366, 398); + btnSave.Name = "btnSave"; + btnSave.Size = new System.Drawing.Size(75, 23); + btnSave.TabIndex = 1; + btnSave.Text = "Save"; + btnSave.UseVisualStyleBackColor = true; + btnSave.Click += btnSave_Click; + // + // ctrlRegistration + // + ctrlRegistration.ComputerCode = ""; + ctrlRegistration.Location = new System.Drawing.Point(12, 12); + ctrlRegistration.Name = "ctrlRegistration"; + ctrlRegistration.PermanentKeyUrl = ""; + ctrlRegistration.ProductCode = ""; + ctrlRegistration.RegistrationKey = ""; + ctrlRegistration.Size = new System.Drawing.Size(510, 375); + ctrlRegistration.TabIndex = 0; + ctrlRegistration.TrialKeyUrl = ""; + ctrlRegistration.RefreshCompCode += ctrlRegistration_RefreshCompCode; // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(447, 398); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 12; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - // - // lblProductName - // - this.lblProductName.AutoSize = true; - this.lblProductName.Location = new System.Drawing.Point(9, 9); - this.lblProductName.Name = "lblProductName"; - this.lblProductName.Size = new System.Drawing.Size(82, 15); - this.lblProductName.TabIndex = 0; - this.lblProductName.Text = "Product name"; - // - // txtProductName - // - this.txtProductName.Location = new System.Drawing.Point(12, 27); - this.txtProductName.Name = "txtProductName"; - this.txtProductName.ReadOnly = true; - this.txtProductName.Size = new System.Drawing.Size(510, 23); - this.txtProductName.TabIndex = 1; - // - // pbInfo2 - // - this.pbInfo2.Image = global::Scada.Admin.Properties.Resources.info; - this.pbInfo2.Location = new System.Drawing.Point(12, 321); - this.pbInfo2.Name = "pbInfo2"; - this.pbInfo2.Size = new System.Drawing.Size(16, 16); - this.pbInfo2.TabIndex = 13; - this.pbInfo2.TabStop = false; - // - // lblRegKeyInfo - // - this.lblRegKeyInfo.AutoSize = true; - this.lblRegKeyInfo.ForeColor = System.Drawing.SystemColors.GrayText; - this.lblRegKeyInfo.Location = new System.Drawing.Point(34, 322); - this.lblRegKeyInfo.Name = "lblRegKeyInfo"; - this.lblRegKeyInfo.Size = new System.Drawing.Size(347, 15); - this.lblRegKeyInfo.TabIndex = 14; - this.lblRegKeyInfo.Text = "Key verification result is written in the application or module log."; - // - // btnRefreshCompCode - // - this.btnRefreshCompCode.Location = new System.Drawing.Point(108, 187); - this.btnRefreshCompCode.Name = "btnRefreshCompCode"; - this.btnRefreshCompCode.Size = new System.Drawing.Size(90, 23); - this.btnRefreshCompCode.TabIndex = 15; - this.btnRefreshCompCode.Text = "Refresh"; - this.btnRefreshCompCode.UseVisualStyleBackColor = true; - this.btnRefreshCompCode.Click += new System.EventHandler(this.btnRefreshCompCode_Click); + btnCancel.Location = new System.Drawing.Point(447, 398); + btnCancel.Name = "btnCancel"; + btnCancel.Size = new System.Drawing.Size(75, 23); + btnCancel.TabIndex = 2; + btnCancel.Text = "Cancel"; + btnCancel.UseVisualStyleBackColor = true; // // FrmRegistration // - this.AcceptButton = this.btnSave; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(534, 433); - this.Controls.Add(this.pbInfo2); - this.Controls.Add(this.lblRegKeyInfo); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.llblGetTrialKey); - this.Controls.Add(this.llblGetPermanentKey); - this.Controls.Add(this.btnPasteRegKey); - this.Controls.Add(this.txtRegKey); - this.Controls.Add(this.lblRegKey); - this.Controls.Add(this.pbInfo1); - this.Controls.Add(this.lblCompCodeInfo); - this.Controls.Add(this.btnRefreshCompCode); - this.Controls.Add(this.btnCopyCompCode); - this.Controls.Add(this.txtCompCode); - this.Controls.Add(this.lblCompCode); - this.Controls.Add(this.txtProductName); - this.Controls.Add(this.lblProductName); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmRegistration"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Registration"; - this.Load += new System.EventHandler(this.FrmRegistration_Load); - ((System.ComponentModel.ISupportInitialize)(this.pbInfo1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbInfo2)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - + AcceptButton = btnSave; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + CancelButton = btnCancel; + ClientSize = new System.Drawing.Size(534, 433); + Controls.Add(btnCancel); + Controls.Add(btnSave); + Controls.Add(ctrlRegistration); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + MaximizeBox = false; + MinimizeBox = false; + Name = "FrmRegistration"; + ShowInTaskbar = false; + StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + Text = "Registration"; + Load += FrmRegistration_Load; + ResumeLayout(false); } #endregion - - private System.Windows.Forms.Label lblCompCode; - private System.Windows.Forms.TextBox txtCompCode; - private System.Windows.Forms.Button btnCopyCompCode; - private System.Windows.Forms.PictureBox pbInfo1; - private System.Windows.Forms.Label lblCompCodeInfo; - private System.Windows.Forms.Label lblRegKey; - private System.Windows.Forms.TextBox txtRegKey; - private System.Windows.Forms.Button btnPasteRegKey; - private System.Windows.Forms.LinkLabel llblGetPermanentKey; - private System.Windows.Forms.LinkLabel llblGetTrialKey; private System.Windows.Forms.Button btnSave; + private Scada.Forms.Controls.CtrlRegistration ctrlRegistration; private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Label lblProductName; - private System.Windows.Forms.TextBox txtProductName; - private System.Windows.Forms.PictureBox pbInfo2; - private System.Windows.Forms.Label lblRegKeyInfo; - private System.Windows.Forms.Button btnRefreshCompCode; } } \ No newline at end of file diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.cs b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.cs index 0c2693b9c..b0aca26b2 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.cs +++ b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.cs @@ -31,7 +31,6 @@ public partial class FrmRegistration : Form private readonly IAdminContext adminContext; // the Administrator context private readonly ProjectApp projectApp; // the application containing the registered module - private readonly string productCode; // the registered product code private readonly string regKeyFileName; // the registration key file name @@ -46,15 +45,15 @@ private FrmRegistration() /// /// Initializes a new instance of the class. /// - public FrmRegistration(IAdminContext adminContext, ProjectApp projectApp, + public FrmRegistration(IAdminContext adminContext, ProjectApp projectApp, string productCode, string productName) : this() { this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext)); - this.productCode = productCode ?? throw new ArgumentNullException(nameof(productCode)); this.projectApp = projectApp ?? throw new ArgumentNullException(nameof(projectApp)); regKeyFileName = Path.Combine(projectApp.ConfigDir, productCode + "_Reg.xml"); - txtProductName.Text = productName; + ctrlRegistration.ProductCode = productCode; + ctrlRegistration.ProductName = productName; } @@ -67,7 +66,7 @@ private void RequestCompCode() { if (adminContext.MainForm.GetAgentClient(false) is IAgentClient agentClient) { - txtCompCode.Text = AdminPhrases.FileLoading; + ctrlRegistration.ComputerCode = AdminPhrases.FileLoading; DateTime newerThan = DateTime.MinValue; ICollection lines; @@ -78,18 +77,18 @@ private void RequestCompCode() ref newerThan, out lines); } - txtCompCode.Text = lines != null && lines.Count > 0 - ? lines.First() + ctrlRegistration.ComputerCode = lines != null && lines.Count > 0 + ? lines.First() : CommonPhrases.NoData; } else { - txtCompCode.Text = AdminPhrases.AgentNotEnabled; + ctrlRegistration.ComputerCode = AdminPhrases.AgentNotEnabled; } } catch (Exception ex) { - txtCompCode.Text = ex.Message; + ctrlRegistration.ComputerCode = ex.Message; } } @@ -104,7 +103,7 @@ private void LoadRegKey() { XmlDocument xmlDoc = new(); xmlDoc.Load(regKeyFileName); - txtRegKey.Text = xmlDoc.DocumentElement.Name == "RegKey" ? + ctrlRegistration.RegistrationKey = xmlDoc.DocumentElement.Name == "RegKey" ? xmlDoc.DocumentElement.InnerText.Trim() : ""; } } @@ -121,13 +120,13 @@ private bool SaveRegKey() { try { - XmlDocument xmlDoc = new XmlDocument(); + XmlDocument xmlDoc = new(); XmlDeclaration xmlDecl = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null); xmlDoc.AppendChild(xmlDecl); XmlElement xmlElem = xmlDoc.CreateElement("RegKey"); xmlDoc.AppendChild(xmlElem); - xmlElem.InnerText = txtRegKey.Text.Trim(); + xmlElem.InnerText = ctrlRegistration.RegistrationKey.Trim(); xmlDoc.Save(regKeyFileName); return true; @@ -139,62 +138,21 @@ private bool SaveRegKey() } } - /// - /// Gets the URL to get a permanent key. - /// - private static string GetPermanentKeyUrl() - { - return Locale.IsRussian ? - "https://rapidscada.ru/download-all-files/purchase-module/" : - "https://rapidscada.org/download-all-files/purchase-module/"; - } - - /// - /// Gets the URL to get a trial key. - /// - private string GetTrialKeyUrl() - { - return string.Format(Locale.IsRussian ? - "https://rapidscada.net/trial/?prod={0}&ver=6&lang=ru" : - "https://rapidscada.net/trial/?prod={0}&ver=6", - productCode); - } - private async void FrmRegistration_Load(object sender, EventArgs e) { FormTranslator.Translate(this, GetType().FullName); + FormTranslator.Translate(ctrlRegistration, ctrlRegistration.GetType().FullName); LoadRegKey(); - txtRegKey.Select(); + ctrlRegistration.SetFocus(); await Task.Run(() => RequestCompCode()); } - private void btnCopyCompCode_Click(object sender, EventArgs e) - { - if (txtCompCode.Text != "") - Clipboard.SetText(txtCompCode.Text); - } - - private void btnPasteRegKey_Click(object sender, EventArgs e) - { - txtRegKey.Text = Clipboard.GetText(); - } - - private async void btnRefreshCompCode_Click(object sender, EventArgs e) + private async void ctrlRegistration_RefreshCompCode(object sender, EventArgs e) { await Task.Run(() => RequestCompCode()); } - private void llblGetPermanentKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - ScadaUiUtils.StartProcess(GetPermanentKeyUrl()); - } - - private void llblGetTrialKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - ScadaUiUtils.StartProcess(GetTrialKeyUrl()); - } - private void btnSave_Click(object sender, EventArgs e) { if (SaveRegKey()) diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.resx b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.resx index f298a7be8..a395bffc9 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.resx +++ b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Forms/FrmRegistration.resx @@ -1,4 +1,64 @@ - + + + diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.en-GB.xml b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.en-GB.xml index 0e5033130..46da35920 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.en-GB.xml +++ b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.en-GB.xml @@ -664,16 +664,6 @@ Registration - Product name - Computer code - Copy - Refresh - If the code is missing, upload the configuration and restart the services. - Registration key - Paste - Key verification result is written in the application or module log. - Get permanent key - Get trial key Save Cancel Error loading registration key diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.ru-RU.xml b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.ru-RU.xml index ddff7f981..8850a000f 100644 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.ru-RU.xml +++ b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Lang/ScadaAdmin.ru-RU.xml @@ -664,16 +664,6 @@ Регистрация - Наименование продукта - Код компьютера - Копировать - Обновить - Если код отсутствует, передайте конфигурацию и перезапустите службы. - Регистрационный ключ - Вставить - Результат проверки ключа записывается в журнал приложения или модуля. - Получить постоянный ключ - Получить пробный ключ Сохранить Отмена Ошибка при загрузке регистрационного ключа From 933649b6fc75904f956d954b73c9b512caea8d1c Mon Sep 17 00:00:00 2001 From: 2mik Date: Thu, 22 Jun 2023 19:41:26 +0300 Subject: [PATCH 178/184] ScadaAdminCommon: delete resources --- .../Properties/Resources.Designer.cs | 73 ----------- .../Properties/Resources.resx | 124 ------------------ .../ScadaAdminCommon/Resources/info.png | Bin 516 -> 0 bytes .../ScadaAdminCommon/ScadaAdminCommon.csproj | 15 --- 4 files changed, 212 deletions(-) delete mode 100644 ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.Designer.cs delete mode 100644 ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.resx delete mode 100644 ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Resources/info.png diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.Designer.cs b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.Designer.cs deleted file mode 100644 index 5bdee539e..000000000 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.Designer.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Scada.Admin.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Scada.Admin.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap info { - get { - object obj = ResourceManager.GetObject("info", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.resx b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.resx deleted file mode 100644 index 9ad84d53c..000000000 --- a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\info.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Resources/info.png b/ScadaAdmin/ScadaAdmin/ScadaAdminCommon/Resources/info.png deleted file mode 100644 index d47b22beae7e7cd361549eb251fe161a6cb37185..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 516 zcmV+f0{i`mP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-ib+I4RCwB~le9c z1zRtqRuT)vm?B#!f;J%{h*4scj3Fzmg+?|(F-^4pC|8-^3$?4q}HaO;Uk`Q7j>fr#YSoN6R_`ONX`0R8$~uyCpZz}Z~z!z`StkT82#pXhUx zQc+DrtVV3V_$$ulf@~LRWJ_*DM67^_q!*7K - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - PreserveNewest From 485626bde5637955bd4b0cb408da1587fe256fa7 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 10:31:58 +0300 Subject: [PATCH 179/184] ScadaDoc: update history --- .../VersionHistory/ScadaHistory.cshtml | 39 +++++++++++++++++++ .../VersionHistory/ScadaHistory.cshtml | 39 +++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml index 254963d3e..8aca0abcb 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml @@ -6,6 +6,45 @@

        History of Rapid SCADA

        +
        Rapid SCADA 6.1.3 (July 04, 2023)
        +
          +
        • + Server 6.1.1.0 +
            +
          • ModArcPostgreSql 6.1.1.0
          • +
          • ModDbExport 6.0.0.1
          • +
          • ModRapidGate 6.0.1.2
          • +
          +
        • +
        • + Communicator 6.1.1.0 +
            +
          • DrvCnlBasic 6.0.1.0
          • +
          • DrvMqttClient 6.0.0.3
          • +
          • DrvMqttPublisher 6.0.0.3
          • +
          • DrvSnmp 6.0.0.1
          • +
          +
        • +
        • + Webstation 6.1.1.0 +
            +
          • PlgChart 6.0.1.0
          • +
          • PlgMain 6.0.2.0
          • +
          • PlgScheme 6.0.1.0
          • +
          • PlgSchBasicComp 6.0.1.0
          • +
          • PlgWebPage 6.0.1.0
          • +
          +
        • +
        • Agent 6.1.0.0
        • +
        • + Administrator 6.1.0.2 +
            +
          • ExtCommConfig 6.0.1.2
          • +
          +
        • +
        • Scheme Editor 5.3.1.1
        • +
        +
        Rapid SCADA 6.1.2 (May 15, 2023)
        • Server 6.1.0.2
        • diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml index 27395f804..ad5e49143 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml @@ -6,6 +6,45 @@

          История Rapid SCADA

          +
          Rapid SCADA 6.1.3 (04.07.2023)
          +
            +
          • + Сервер 6.1.1.0 +
              +
            • ModArcPostgreSql 6.1.1.0
            • +
            • ModDbExport 6.0.0.1
            • +
            • ModRapidGate 6.0.1.2
            • +
            +
          • +
          • + Коммуникатор 6.1.1.0 +
              +
            • DrvCnlBasic 6.0.1.0
            • +
            • DrvMqttClient 6.0.0.3
            • +
            • DrvMqttPublisher 6.0.0.3
            • +
            • DrvSnmp 6.0.0.1
            • +
            +
          • +
          • + Вебстанция 6.1.1.0 +
              +
            • PlgChart 6.0.1.0
            • +
            • PlgMain 6.0.2.0
            • +
            • PlgScheme 6.0.1.0
            • +
            • PlgSchBasicComp 6.0.1.0
            • +
            • PlgWebPage 6.0.1.0
            • +
            +
          • +
          • Агент 6.1.0.0
          • +
          • + Администратор 6.1.0.2 +
              +
            • ExtCommConfig 6.0.1.2
            • +
            +
          • +
          • Редактор схем 5.3.1.1
          • +
          +
          Rapid SCADA 6.1.2 (15.05.2023)
          • Сервер 6.1.0.2
          • From 263e61dc17d8a8b8e8fd244f0a875901f228dd71 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 13:04:21 +0300 Subject: [PATCH 180/184] ScadaDoc: plugin history --- .../En/Version61/VersionHistory/WebstationHistory.cshtml | 7 +++++++ .../Ru/Version61/VersionHistory/WebstationHistory.cshtml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index c0c9728f6..38cf470f2 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -15,6 +15,7 @@
          • Elastic Report
          • Guard
          • Main Plugin
          • +
          • Notification Plugin
          • Schemes
          • Basic Scheme Components
          • Extra Scheme Components
          • @@ -164,6 +165,12 @@
          • The maximum reporting period is specified in the configuration
          +

          Notification Plugin

          +
          PlgNotification 6.0.0.0 (July 04, 2023)
          +
            +
          • Added the Ack All button
          • +
          +

          Schemes

          PlgScheme 6.0.1.0 (In development)
          +

          Плагин Уведомления

          +
          PlgNotification 6.0.0.0 (04.07.2023)
          +
            +
          • Добавлена кнопка "Подтвердить все"
          • +
          +

          Схемы

          PlgScheme 6.0.1.0 (В разработке)
            From d1ff63e263d8fb3667babb69632c47798614c34f Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 15:11:17 +0300 Subject: [PATCH 181/184] ScadaDoc: update app history --- .../En/Version61/VersionHistory/ApplicationsHistory.cshtml | 5 +++++ .../Ru/Version61/VersionHistory/ApplicationsHistory.cshtml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ApplicationsHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ApplicationsHistory.cshtml index 1fe508e9b..680be1786 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ApplicationsHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ApplicationsHistory.cshtml @@ -15,6 +15,11 @@

            History of Additional Applications

            Auto Report

            +
            ScadaAutoReport 6.0.0.1 (July 04, 2023)
            +
              +
            • Fixed calculation of report period
            • +
            +
            ScadaAutoReport 6.0.0.0 (May 24, 2023)
            • Report types are loaded dynamically according to the configuration
            • diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ApplicationsHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ApplicationsHistory.cshtml index 29e34ed4f..96d3fbb8c 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ApplicationsHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ApplicationsHistory.cshtml @@ -15,6 +15,11 @@

              История дополнительных приложений

              Автоотчёт

              +
              ScadaAutoReport 6.0.0.1 (04.07.2023)
              +
                +
              • Исправлено вычисление периода отчётов
              • +
              +
              ScadaAutoReport 6.0.0.0 (24.05.2023)
              • Типы отчётов загружаются динамически согласно конфигурации
              • From 8a75a304ba5d5bdf99994298dee0e61e82bfb064 Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 15:47:44 +0300 Subject: [PATCH 182/184] ScadaDoc: update release date, en --- .../AdministratorHistory.cshtml | 2 +- .../VersionHistory/CommunicatorHistory.cshtml | 10 +++++----- .../VersionHistory/ServerHistory.cshtml | 8 ++++---- .../VersionHistory/WebstationHistory.cshtml | 20 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/AdministratorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/AdministratorHistory.cshtml index cb5eea371..44d078699 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/AdministratorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/AdministratorHistory.cshtml @@ -51,7 +51,7 @@

              Communicator Configurator

              -
              ExtCommConfig 6.0.1.2 (In development)
              +
              ExtCommConfig 6.0.1.2 (July 04, 2023)
              • Added inactive device icon
              diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml index 529ba85f9..c83e3ac20 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/CommunicatorHistory.cshtml @@ -35,7 +35,7 @@

              Communicator History

              Communicator Application

              -
              ScadaComm 6.1.1.0 (In development)
              +
              ScadaComm 6.1.1.0 (July 04, 2023)
              • Works with new instance configuration
              • Device status is set to error if connection is not established
              • @@ -76,7 +76,7 @@ @**** DrvCnlBasic ****@

                Basic Communication Channels

                -
                DrvCnlBasic 6.0.1.0 (In development)
                +
                DrvCnlBasic 6.0.1.0 (July 04, 2023)
                • Added TCP client option whether to disconnect if session fails
                @@ -221,7 +221,7 @@ @**** DrvMqttClient ****@

                MQTT Client

                -
                DrvMqttClient 6.0.0.3 (In development)
                +
                DrvMqttClient 6.0.0.3 (July 04, 2023)
                • Optimized driver configuration source code
                @@ -243,7 +243,7 @@ @**** DrvMqttPublisher ****@

                MQTT Publisher

                -
                DrvMqttPublisher 6.0.0.3 (In development)
                +
                DrvMqttPublisher 6.0.0.3 (July 04, 2023)
                • Optimized driver configuration source code
                @@ -299,7 +299,7 @@ @**** DrvSnmp ****@

                SNMP

                -
                DrvSnmp 6.0.0.1 (In development)
                +
                DrvSnmp 6.0.0.1 (July 04, 2023)
                • Optimized driver configuration source code
                diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml index 308e82ee0..eaabe1f44 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ServerHistory.cshtml @@ -24,7 +24,7 @@

                Server History

                Server Application

                -
                ScadaServer 6.1.1.0 (In development)
                +
                ScadaServer 6.1.1.0 (July 04, 2023)
                • Works with new instance configuration
                • Time of writing to archives is set as current when Server starts.
                • @@ -114,7 +114,7 @@ @**** ModArcPostgreSql ****@

                  PostgreSQL Archive

                  -
                  ModArcPostgreSql 6.1.1.0 (In development)
                  +
                  ModArcPostgreSql 6.1.1.0 (July 04, 2023)
                  • Changes in archive options
                  @@ -145,7 +145,7 @@ @**** ModDbExport ****@

                  DB Export

                  -
                  ModDbExport 6.0.0.1 (In development)
                  +
                  ModDbExport 6.0.0.1 (July 04, 2023)
                  • Optimized module configuration source code
                  @@ -168,7 +168,7 @@ @**** ModRapidGate ****@

                  Rapid Gate

                  -
                  ModRapidGate 6.0.1.2 (In development)
                  +
                  ModRapidGate 6.0.1.2 (July 04, 2023)
                  • Optimized module configuration source code
                  diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml index 38cf470f2..20326fe23 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/WebstationHistory.cshtml @@ -26,7 +26,7 @@

                  Webstation History

                  Webstation Application

                  -
                  ScadaWeb 6.1.1.0 (In development)
                  +
                  ScadaWeb 6.1.1.0 (July 04, 2023)
                  • Works with new instance configuration
                  • Supports audit log
                  • @@ -58,7 +58,7 @@

                  Chart

                  -
                  PlgChart 6.0.1.0 (In development)
                  +
                  PlgChart 6.0.1.0 (July 04, 2023)
                  • Supports audit log
                  • JavaScript refactoring
                  • @@ -77,7 +77,7 @@

                  Chart Pro

                  -
                  PlgChartPro 6.0.1.0 (In development)
                  +
                  PlgChartPro 6.0.1.0 (July 04, 2023)
                  • Supports audit log
                  • JavaScript refactoring
                  • @@ -108,13 +108,13 @@

                  Dashboard

                  -
                  PlgDashboard 6.0.0.0 (In development)
                  +
                  PlgDashboard 6.0.0.0 (July 04, 2023)
                  • Links to charts and sending commands from current data widgets

                  Elastic Report

                  -
                  PlgElasticReport 6.0.1.0 (In development)
                  +
                  PlgElasticReport 6.0.1.0 (July 04, 2023)
                  • End date in report arguments is 1 day more
                  • Supports audit log
                  • @@ -136,7 +136,7 @@

                  Main Plugin

                  -
                  PlgMain 6.0.2.0 (In development)
                  +
                  PlgMain 6.0.2.0 (July 04, 2023)
                  • Supports audit log
                  • Improved filters when using plugin API
                  • @@ -172,7 +172,7 @@

                  Schemes

                  -
                  PlgScheme 6.0.1.0 (In development)
                  +
                  PlgScheme 6.0.1.0 (July 04, 2023)
                  • Supports audit log
                  • Fixed loading scheme title
                  • @@ -190,7 +190,7 @@

                  Basic Scheme Components

                  -
                  PlgSchBasicComp 6.0.1.0 (In development)
                  +
                  PlgSchBasicComp 6.0.1.0 (July 04, 2023)
                  • JavaScript refactoring
                  @@ -206,7 +206,7 @@

                Extra Scheme Components

                -
                PlgSchExtraComp 6.0.0.1 (In development)
                +
                PlgSchExtraComp 6.0.0.1 (July 04, 2023)
                • Fixed a bug with displaying a view in a frame
                @@ -217,7 +217,7 @@

              Web Pages

              -
              PlgWebPage 6.0.1.0 (In development)
              +
              PlgWebPage 6.0.1.0 (July 04, 2023)
              • Supports audit log
              From fa3e85f853c86492dc00a5983348c9c02565382b Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 15:48:37 +0300 Subject: [PATCH 183/184] ScadaDoc: update release date, ru --- .../AdministratorHistory.cshtml | 2 +- .../VersionHistory/CommunicatorHistory.cshtml | 10 +++++----- .../VersionHistory/ServerHistory.cshtml | 8 ++++---- .../VersionHistory/WebstationHistory.cshtml | 20 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/AdministratorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/AdministratorHistory.cshtml index 7cdccf5b4..07dde29a9 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/AdministratorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/AdministratorHistory.cshtml @@ -51,7 +51,7 @@

            Конфигуратор Коммуникатора

            -
            ExtCommConfig 6.0.1.2 (В разработке)
            +
            ExtCommConfig 6.0.1.2 (04.07.2023)
            • Добавлен значок неактивного устройства
            diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml index c3413cd5f..86bf686f0 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/CommunicatorHistory.cshtml @@ -36,7 +36,7 @@

            История Коммуникатора

            Приложение Коммуникатор

            -
            ScadaComm 6.1.1.0 (В разработке)
            +
            ScadaComm 6.1.1.0 (04.07.2023)
            • Работает с новой конфигурацией экземпляра
            • Статус устройства устанавливается как ошибка, если соединение не установлено
            • @@ -89,7 +89,7 @@ @**** DrvCnlBasic ****@

              Основные каналы связи

              -
              DrvCnlBasic 6.0.1.0 (В разработке)
              +
              DrvCnlBasic 6.0.1.0 (04.07.2023)
              • Добавлена опция TCP-клиента для разрыва соединения в случае неудачного сеанса
              @@ -234,7 +234,7 @@ @**** DrvMqttClient ****@

              MQTT-клиент

              -
              DrvMqttClient 6.0.0.3 (В разработке)
              +
              DrvMqttClient 6.0.0.3 (04.07.2023)
              • Оптимизация исходного кода конфигурации драйвера
              @@ -256,7 +256,7 @@ @**** DrvMqttPublisher ****@

              MQTT-издатель

              -
              DrvMqttPublisher 6.0.0.3 (В разработке)
              +
              DrvMqttPublisher 6.0.0.3 (04.07.2023)
              • Оптимизация исходного кода конфигурации драйвера
              @@ -312,7 +312,7 @@ @**** DrvSnmp ****@

              SNMP

              -
              DrvSnmp 6.0.0.1 (В разработке)
              +
              DrvSnmp 6.0.0.1 (04.07.2023)
              • Оптимизация исходного кода конфигурации драйвера
              diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml index f00c6a6b7..1f1c33df2 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ServerHistory.cshtml @@ -24,7 +24,7 @@

              История Сервера

              Приложение Сервер

              -
              ScadaServer 6.1.1.0 (В разработке)
              +
              ScadaServer 6.1.1.0 (04.07.2023)
              • Работает с новой конфигурацией экземпляра
              • Время записи в архивы устанавливается как текущее при старте Сервера.
              • @@ -114,7 +114,7 @@ @**** ModArcPostgreSql ****@

                Архив PostgreSQL

                -
                ModArcPostgreSql 6.1.1.0 (В разработке)
                +
                ModArcPostgreSql 6.1.1.0 (04.07.2023)
                • Изменения в параметрах архивов
                @@ -145,7 +145,7 @@ @**** ModDbExport ****@

                Экспорт в БД

                -
                ModDbExport 6.0.0.1 (В разработке)
                +
                ModDbExport 6.0.0.1 (04.07.2023)
                • Оптимизация исходного кода конфигурации модуля
                @@ -168,7 +168,7 @@ @**** ModRapidGate ****@

                Быстрый шлюз

                -
                ModRapidGate 6.0.1.2 (В разработке)
                +
                ModRapidGate 6.0.1.2 (04.07.2023)
                • Оптимизация исходного кода конфигурации модуля
                diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml index 5d24a9ca1..80b83b5b1 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/WebstationHistory.cshtml @@ -26,7 +26,7 @@

                История Вебстанции

                Приложение Вебстанция

                -
                ScadaWeb 6.1.1.0 (В разработке)
                +
                ScadaWeb 6.1.1.0 (04.07.2023)
                • Работает с новой конфигурацией экземпляра
                • Поддержка журнала аудита
                • @@ -58,7 +58,7 @@

                Графики

                -
                PlgChart 6.0.1.0 (В разработке)
                +
                PlgChart 6.0.1.0 (04.07.2023)
                • Поддержка журнала аудита
                • Рефакторинг JavaScript
                • @@ -77,7 +77,7 @@

                Графики Про

                -
                PlgChartPro 6.0.1.0 (В разработке)
                +
                PlgChartPro 6.0.1.0 (04.07.2023)
                • Поддержка журнала аудита
                • Рефакторинг JavaScript
                • @@ -108,13 +108,13 @@

                Дэшборды

                -
                PlgDashboard 6.0.0.0 (В разработке)
                +
                PlgDashboard 6.0.0.0 (04.07.2023)
                • Ссылки на графики и отправка команд из виджетов текущих данных

                Гибкий отчёт

                -
                PlgElasticReport 6.0.1.0 (В разработке)
                +
                PlgElasticReport 6.0.1.0 (04.07.2023)
                • Конечная дата в аргументах отчёта на 1 день больше
                • Поддержка журнала аудита
                • @@ -136,7 +136,7 @@

                Основной плагин

                -
                PlgMain 6.0.2.0 (В разработке)
                +
                PlgMain 6.0.2.0 (04.07.2023)
                • Поддержка журнала аудита
                • Улучшена работа фильтров при использовании API плагина
                • @@ -172,7 +172,7 @@

                Схемы

                -
                PlgScheme 6.0.1.0 (В разработке)
                +
                PlgScheme 6.0.1.0 (04.07.2023)
                • Поддержка журнала аудита
                • Исправлена загрузка заголовка схемы
                • @@ -190,7 +190,7 @@

                Основные компоненты схем

                -
                PlgSchBasicComp 6.0.1.0 (В разработке)
                +
                PlgSchBasicComp 6.0.1.0 (04.07.2023)
                • Рефакторинг JavaScript
                @@ -206,7 +206,7 @@

              Дополнительные компоненты схем

              -
              PlgSchExtraComp 6.0.0.1 (В разработке)
              +
              PlgSchExtraComp 6.0.0.1 (04.07.2023)
              • Исправлена ошибка при отображении представления во фрейме
              @@ -217,7 +217,7 @@

            Веб-страницы

            -
            PlgWebPage 6.0.1.0 (В разработке)
            +
            PlgWebPage 6.0.1.0 (04.07.2023)
            • Поддержка журнала аудита
            From 611bde3a1931d54c47c311e4ce2b9520c523c8fa Mon Sep 17 00:00:00 2001 From: 2mik Date: Tue, 4 Jul 2023 15:51:09 +0300 Subject: [PATCH 184/184] ScadaDoc: fix history --- .../Pages/En/Version61/VersionHistory/ScadaHistory.cshtml | 1 - .../Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml | 1 - 2 files changed, 2 deletions(-) diff --git a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml index 8aca0abcb..4283b5fb1 100644 --- a/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/En/Version61/VersionHistory/ScadaHistory.cshtml @@ -13,7 +13,6 @@
            • ModArcPostgreSql 6.1.1.0
            • ModDbExport 6.0.0.1
            • -
            • ModRapidGate 6.0.1.2
          • diff --git a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml index ad5e49143..162779522 100644 --- a/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml +++ b/ScadaDoc/ScadaDoc/Pages/Ru/Version61/VersionHistory/ScadaHistory.cshtml @@ -13,7 +13,6 @@
            • ModArcPostgreSql 6.1.1.0
            • ModDbExport 6.0.0.1
            • -
            • ModRapidGate 6.0.1.2