diff --git a/EgwCoreLib.Lux.Core/Dto/ParamConfigDto.cs b/EgwCoreLib.Lux.Core/Dto/ParamConfigDto.cs new file mode 100644 index 00000000..a8b4cc2a --- /dev/null +++ b/EgwCoreLib.Lux.Core/Dto/ParamConfigDto.cs @@ -0,0 +1,27 @@ +namespace EgwCoreLib.Lux.Core.Dto +{ + public class ParamConfigDto + { + /// + /// Nome parametro + /// + public string Name { get; set; } = "fix"; + + /// + /// Tipo parametro: + /// - fix (fisso) + /// - url (prende da URL QueryString) + /// + public string Type { get; set; } = "fix"; + + /// + /// Per recuperare da ingresso (es URL) + /// + public string vIN { get; set; } = ""; + + /// + /// Valore out (da passare come apram x report) + /// + public string vOUT { get; set; } = ""; + } +} diff --git a/EgwCoreLib.Lux.Data/DbModel/Report/ReportModel.cs b/EgwCoreLib.Lux.Data/DbModel/Report/ReportModel.cs new file mode 100644 index 00000000..eb0b350f --- /dev/null +++ b/EgwCoreLib.Lux.Data/DbModel/Report/ReportModel.cs @@ -0,0 +1,70 @@ +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace EgwCoreLib.Lux.Data.DbModel.Report +{ + /// + /// Classe dei report gestiti + /// + [Table("report_list")] + public class ReportModel + { + /// + /// ID del record + /// + [Key] + public int ReportID { get; set; } + + /// + /// Denominazione + /// + public string Name { get; set; } = ""; + + /// + /// Descrizione + /// + public string Description { get; set; } = ""; + + /// + /// Valore completo Json per recupero dati, con segnaposto con [[param_01]] + /// + public string JsonDSN { get; set; } = ""; + + /// + /// Nome del report Active tra quelli nella folder + /// + public string ActRepFileName { get; set; } = ""; + + /// + /// Conf dei parametri per il report + /// + public string ParamConfigRaw { get; set; } = ""; + + /// + /// Conf relative ai file report + /// + public string FileConfDataRaw { get; set; } = ""; + + /// + /// Elenco dei parametri da gestire x il ReportTemplate + /// + [NotMapped] + public List ParamConfig + { + get + { + List answ = new(); + if (!string.IsNullOrEmpty(ParamConfigRaw) && ParamConfigRaw.Length > 2) + { + answ = JsonConvert.DeserializeObject>(ParamConfigRaw) ?? new(); + } + return answ; + } + set + { + string rawVal = JsonConvert.SerializeObject(value); + ParamConfigRaw = rawVal; + } + } + } +} diff --git a/EgwCoreLib.Lux.Data/GlobalUsings.cs b/EgwCoreLib.Lux.Data/GlobalUsings.cs index 4170412c..d5961095 100644 --- a/EgwCoreLib.Lux.Data/GlobalUsings.cs +++ b/EgwCoreLib.Lux.Data/GlobalUsings.cs @@ -1,4 +1,5 @@ -global using EgwCoreLib.Lux.Core.RestPayload; +global using EgwCoreLib.Lux.Core.Dto; +global using EgwCoreLib.Lux.Core.RestPayload; global using EgwCoreLib.Lux.Data.Data.DbModel.Admin; global using EgwCoreLib.Lux.Data.DbModel.Catalog; global using EgwCoreLib.Lux.Data.DbModel.Config; diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index de29e7e9..393b04c7 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2604.2413 + 1.1.2604.2414 diff --git a/Lux.Report.Data/DbModel/ReportModel.cs b/Lux.Report.Data/DbModel/ReportModel.cs index a84f062a..957d411b 100644 --- a/Lux.Report.Data/DbModel/ReportModel.cs +++ b/Lux.Report.Data/DbModel/ReportModel.cs @@ -1,11 +1,6 @@ using Lux.Report.Data.DTO; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Lux.Report.Data.DbModel { @@ -46,6 +41,11 @@ namespace Lux.Report.Data.DbModel /// public string ParamConfigRaw { get; set; } = ""; + /// + /// Conf relative ai file report + /// + public string FileConfDataRaw { get; set; } = ""; + /// /// Elenco dei parametri da gestire x il ReportTemplate /// diff --git a/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.Designer.cs b/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.Designer.cs new file mode 100644 index 00000000..864ba3b2 --- /dev/null +++ b/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.Designer.cs @@ -0,0 +1,66 @@ +// +using Lux.Report.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lux.Report.Data.Migrations +{ + [DbContext(typeof(ReportContext))] + [Migration("20260424130010_AddReportFileConf")] + partial class AddReportFileConf + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.23") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Lux.Report.Data.DbModel.ReportModel", b => + { + b.Property("ReportID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ReportID")); + + b.Property("ActRepFileName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FileConfDataRaw") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("JsonDSN") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ParamConfigRaw") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("ReportID"); + + b.ToTable("report_list"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.cs b/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.cs new file mode 100644 index 00000000..3f7c036a --- /dev/null +++ b/Lux.Report.Data/Migrations/20260424130010_AddReportFileConf.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lux.Report.Data.Migrations +{ + /// + public partial class AddReportFileConf : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "FileConfDataRaw", + table: "report_list", + type: "longtext", + nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "FileConfDataRaw", + table: "report_list"); + } + } +} diff --git a/Lux.Report.Data/Migrations/ReportContextModelSnapshot.cs b/Lux.Report.Data/Migrations/ReportContextModelSnapshot.cs index c84b5e78..708d6d15 100644 --- a/Lux.Report.Data/Migrations/ReportContextModelSnapshot.cs +++ b/Lux.Report.Data/Migrations/ReportContextModelSnapshot.cs @@ -37,6 +37,10 @@ namespace Lux.Report.Data.Migrations .IsRequired() .HasColumnType("longtext"); + b.Property("FileConfDataRaw") + .IsRequired() + .HasColumnType("longtext"); + b.Property("JsonDSN") .IsRequired() .HasColumnType("longtext"); diff --git a/Lux.Report.Manager/Components/App.razor b/Lux.Report.Manager/Components/App.razor index ab318dd0..1f12f71d 100644 --- a/Lux.Report.Manager/Components/App.razor +++ b/Lux.Report.Manager/Components/App.razor @@ -11,6 +11,7 @@ + @* *@ diff --git a/Lux.Report.Manager/Components/Compo/RepoFileList.razor b/Lux.Report.Manager/Components/Compo/RepoFileList.razor index c0daff22..b34ac374 100644 --- a/Lux.Report.Manager/Components/Compo/RepoFileList.razor +++ b/Lux.Report.Manager/Components/Compo/RepoFileList.razor @@ -8,12 +8,12 @@
@if (AddEnabled) { - + } - else + else { - + }
@@ -23,18 +23,33 @@ @foreach (var item in ListReports) { - - + + - +
@FileName(item)
+ @if (!string.IsNullOrEmpty(aliasKey) && FileName(item) == aliasKey) + { +
+ + + +
+ } + else + { +
+ +
@GetAlias(FileName(item))
+
+ } - + diff --git a/Lux.Report.Manager/Components/Compo/RepoFileList.razor.cs b/Lux.Report.Manager/Components/Compo/RepoFileList.razor.cs index 4a0cc1a4..8d32a0e1 100644 --- a/Lux.Report.Manager/Components/Compo/RepoFileList.razor.cs +++ b/Lux.Report.Manager/Components/Compo/RepoFileList.razor.cs @@ -2,6 +2,7 @@ using Lux.Report.Data.DbModel; using Lux.Report.Data.Services; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using Newtonsoft.Json; namespace Lux.Report.Manager.Components.Compo { @@ -17,6 +18,8 @@ namespace Lux.Report.Manager.Components.Compo [Parameter] public EventCallback EC_ReqUpdate { get; set; } + [Parameter] + public EventCallback> EC_SaveDict { get; set; } #endregion Public Properties @@ -31,6 +34,7 @@ namespace Lux.Report.Manager.Components.Compo #region Private Fields + private Dictionary DictAlias = new(); private List ListReports = new List(); #endregion Private Fields @@ -96,12 +100,56 @@ namespace Lux.Report.Manager.Components.Compo return Path.GetFileName(fullName); } + private void SetEditAlias(string fullName) + { + aliasKey = Path.GetFileName(fullName); + aliasVal = GetAlias(aliasKey); + } + private void CancelEditAlias(string fullName) + { + aliasKey = ""; + } + + private string aliasKey = ""; + private string aliasVal = ""; + + private async Task SaveEditAlias() + { + if (!string.IsNullOrEmpty(aliasKey)) + { + if (DictAlias.ContainsKey(aliasKey)) + { + DictAlias[aliasKey] = aliasVal; + } + else + { + DictAlias.Add(aliasKey, aliasVal); + } + await EC_SaveDict.InvokeAsync(DictAlias); + } + } + + private string GetAlias(string alias) + { + // cerco nel dizionario... + if (DictAlias.ContainsKey(alias)) + { + alias = DictAlias[alias]; + } + return alias; + } + private void ReloadData() { //base.OnParametersSet(); string repPath = Path.Combine("reports", CurrReport.Name); // elenco file esclusi quelli nascosti (template) ListReports = FService.ListFile(repPath, "*.repx", true); + // fix alias disponibili + if (!string.IsNullOrEmpty(CurrReport.FileConfDataRaw)) + { + DictAlias = JsonConvert.DeserializeObject>(CurrReport.FileConfDataRaw) ?? new(); + } } private async Task ReqEdit(string fullPath) diff --git a/Lux.Report.Manager/Components/Pages/Home.razor b/Lux.Report.Manager/Components/Pages/Home.razor deleted file mode 100644 index bb468e88..00000000 --- a/Lux.Report.Manager/Components/Pages/Home.razor +++ /dev/null @@ -1,8 +0,0 @@ - -@page "/Home" - -ReportManager - -

Lux Report Manager

- -Lux Report Manager Landing Page diff --git a/Lux.Report.Manager/Components/Pages/ReportMan.razor b/Lux.Report.Manager/Components/Pages/ReportMan.razor index 06d1c7ed..3d8b5d7a 100644 --- a/Lux.Report.Manager/Components/Pages/ReportMan.razor +++ b/Lux.Report.Manager/Components/Pages/ReportMan.razor @@ -1,4 +1,5 @@ @page "/" +@page "/Home" @page "/report-man" diff --git a/Lux.Report.Manager/Components/Pages/ReportMan.razor.cs b/Lux.Report.Manager/Components/Pages/ReportMan.razor.cs index c049e025..cdafbadb 100644 --- a/Lux.Report.Manager/Components/Pages/ReportMan.razor.cs +++ b/Lux.Report.Manager/Components/Pages/ReportMan.razor.cs @@ -1,6 +1,7 @@ using Lux.Report.Data.DbModel; using Lux.Report.Data.Services; using Microsoft.AspNetCore.Components; +using Newtonsoft.Json; namespace Lux.Report.Manager.Components.Pages { @@ -158,5 +159,19 @@ namespace Lux.Report.Manager.Components.Pages } #endregion Private Methods + private async Task DoSaveDict(Dictionary currDict) + { + if (SelRecord != null) + { + // serializzo nel record corrente + string rawDict = JsonConvert.SerializeObject(currDict); + SelRecord.FileConfDataRaw = rawDict; + // salvo! + await RepService.UpsertAsync(SelRecord); + } + await ReloadDataAsync(); + UpdateTable(); + + } } } \ No newline at end of file diff --git a/Lux.Report.Manager/Lux.Report.Manager.csproj b/Lux.Report.Manager/Lux.Report.Manager.csproj index 66c07339..2e10d0e8 100644 --- a/Lux.Report.Manager/Lux.Report.Manager.csproj +++ b/Lux.Report.Manager/Lux.Report.Manager.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2604.2316 + 1.1.2604.2415 diff --git a/Lux.Report.Manager/wwwroot/favicon.ico b/Lux.Report.Manager/wwwroot/favicon.ico new file mode 100644 index 00000000..77a09bc5 Binary files /dev/null and b/Lux.Report.Manager/wwwroot/favicon.ico differ diff --git a/Lux.Report.Manager/wwwroot/favicon.png b/Lux.Report.Manager/wwwroot/favicon.png index 8422b596..d145b9c0 100644 Binary files a/Lux.Report.Manager/wwwroot/favicon.png and b/Lux.Report.Manager/wwwroot/favicon.png differ diff --git a/Lux.Report.Server/Components/App.razor b/Lux.Report.Server/Components/App.razor index 9fa5c487..779ffdc3 100644 --- a/Lux.Report.Server/Components/App.razor +++ b/Lux.Report.Server/Components/App.razor @@ -11,6 +11,7 @@ + @* *@ diff --git a/Lux.Report.Server/Lux.Report.Server.csproj b/Lux.Report.Server/Lux.Report.Server.csproj index 9c538b7b..c6f004db 100644 --- a/Lux.Report.Server/Lux.Report.Server.csproj +++ b/Lux.Report.Server/Lux.Report.Server.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2604.2409 + 1.1.2604.2415 diff --git a/Lux.Report.Server/wwwroot/favicon.ico b/Lux.Report.Server/wwwroot/favicon.ico new file mode 100644 index 00000000..60a2bb1c Binary files /dev/null and b/Lux.Report.Server/wwwroot/favicon.ico differ diff --git a/Lux.Report.Server/wwwroot/favicon.png b/Lux.Report.Server/wwwroot/favicon.png index 8422b596..9300407f 100644 Binary files a/Lux.Report.Server/wwwroot/favicon.png and b/Lux.Report.Server/wwwroot/favicon.png differ diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index bd4894d6..dceb9a1b 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2604.2413 + 1.1.2604.2414 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index fe9ed420..ba91840d 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2604.2413

+

Versione: 1.1.2604.2415


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index fe1f54b7..105ac1ea 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2604.2413 +1.1.2604.2415 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index febc4a15..f7c70193 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2604.2413 + 1.1.2604.2415 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false