diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2f25df..4ad8a6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - VERS_MAIN: '1.4' + VERS_MAIN: '1.5' NEW_REL: '' NUM_REL: '0.1.2.3' NUM_DEB: '0.1.2-beta.3' @@ -104,6 +104,7 @@ EgwCoreLib.Utils:build: before_script: - *nuget-fix - dotnet restore "$env:SOL_NAME.sln" + - *version-fix script: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj @@ -117,6 +118,7 @@ EgwCoreLib.Razor:build: before_script: - *nuget-fix - dotnet restore "$env:SOL_NAME.sln" + - *version-fix script: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj @@ -130,6 +132,7 @@ EgwCoreLib.BlazorTest:build: before_script: - *nuget-fix - dotnet restore "$env:SOL_NAME.sln" + - *version-fix script: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj @@ -144,6 +147,7 @@ EgwCoreLib.BlazorTest:IIS01:deploy: before_script: - *nuget-fix - dotnet restore "$env:SOL_NAME.sln" + - *version-fix rules: - if: $CI_COMMIT_BRANCH == 'develop' needs: ["EgwCoreLib.BlazorTest:build"] diff --git a/EgwCoreLib.BlazorTest/Components/CmpTop.razor b/EgwCoreLib.BlazorTest/Components/CmpTop.razor index 659c0de..dd65666 100644 --- a/EgwCoreLib.BlazorTest/Components/CmpTop.razor +++ b/EgwCoreLib.BlazorTest/Components/CmpTop.razor @@ -2,7 +2,7 @@
- + Home
diff --git a/EgwCoreLib.BlazorTest/Data/TestData.cs b/EgwCoreLib.BlazorTest/Data/TestData.cs index f8e6c3a..5a7a05a 100644 --- a/EgwCoreLib.BlazorTest/Data/TestData.cs +++ b/EgwCoreLib.BlazorTest/Data/TestData.cs @@ -16,8 +16,7 @@ namespace EgwCoreLib.BlazorTest.Data {"TestComponenti", "Test Componenti"}, {"TestSvgDraw", "Test SVG draw"}, {"TestGauges", "Test Gauges"}, - {"TestChart", "Test Chart"}, - {"TestMultiline", "Test Chart Multiline"}, + {"TestChart", "Test Chart.js"}, }; } } diff --git a/EgwCoreLib.BlazorTest/Pages/ForceReload.razor b/EgwCoreLib.BlazorTest/Pages/ForceReload.razor new file mode 100644 index 0000000..8144286 --- /dev/null +++ b/EgwCoreLib.BlazorTest/Pages/ForceReload.razor @@ -0,0 +1,10 @@ +@page "/ForceReload" +@inject NavigationManager NavMan +

ForceReload

+ +@code { + protected override void OnInitialized() + { + NavMan.NavigateTo("/", true); + } +} diff --git a/EgwCoreLib.BlazorTest/Pages/TestChart.razor b/EgwCoreLib.BlazorTest/Pages/TestChart.razor index c0c54bd..7e9867e 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestChart.razor +++ b/EgwCoreLib.BlazorTest/Pages/TestChart.razor @@ -4,35 +4,63 @@ Test -

TestCompo

- -
-
- @if (periodo != null) +
+
+
+

Test Grafici Chart.js

+
+
+ +
+
+
+ @if (showMulti) { -
- Periodo Selezionato: @($"{periodo.Inizio:yyyy/MM/dd}") → @($"{periodo.Fine:yyyy/MM/dd}") +
+
+ +
+
+ +
+
+ } + else + { +
+
+ @if (periodo != null) + { +
+ Periodo Selezionato: @($"{periodo.Inizio:yyyy/MM/dd}") → @($"{periodo.Fine:yyyy/MM/dd}") +
+ } +
+
+ +
+
+ +
+
+
+ +
+ display con animazione +
+
+
+ +
+ display con animazione +
+
+ +
}
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
+ diff --git a/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs b/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs index c98da5d..9a26370 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs +++ b/EgwCoreLib.BlazorTest/Pages/TestChart.razor.cs @@ -1,5 +1,8 @@ +using EgwCoreLib.Razor; using EgwCoreLib.Razor.Data; using EgwCoreLib.Utils; +using static EgwCoreLib.Razor.Data.chartJsData; +using static EgwCoreLib.Razor.Toggler; namespace EgwCoreLib.BlazorTest.Pages { @@ -21,6 +24,8 @@ namespace EgwCoreLib.BlazorTest.Pages #region Protected Properties + protected List? ChLabels { get; set; } = null; + protected List? currDS { get; set; } = null; protected DtUtils.Periodo? periodo { get; set; } = new DtUtils.Periodo(DtUtils.PeriodSet.ThisTrim); #endregion Protected Properties @@ -49,7 +54,16 @@ namespace EgwCoreLib.BlazorTest.Pages protected override async Task OnInitializedAsync() { - await Task.Delay(1); + CurrFilt = new Toggler.SelectGlobalToggle() + { + leftString = "Multi-linea", + rightString = "Singolo", + isActive = true, + toolTip = "Tipo di grafico" + }; + currDS = null; + await Task.Delay(200); + await setupData(); } protected override async Task OnParametersSetAsync() @@ -69,6 +83,14 @@ namespace EgwCoreLib.BlazorTest.Pages periodo = newPeriodo; } + protected void SetTipo(SelectGlobalToggle selFilt) + { + if (selFilt != null) + { + showMulti = !selFilt.isActive; + } + } + protected double[] SimData() { List answ = new List(); @@ -94,5 +116,60 @@ namespace EgwCoreLib.BlazorTest.Pages } #endregion Protected Methods + + #region Private Fields + + private bool showMulti = false; + + #endregion Private Fields + + #region Private Properties + + private Toggler.SelectGlobalToggle CurrFilt { get; set; } = new Toggler.SelectGlobalToggle(); + + #endregion Private Properties + + #region Private Methods + + private async Task setupData() + { + currDS = null; + List currDemo = new List(); + ChLabels = new List(); + int numMesi = 6; + for (int iMese = 1; iMese <= numMesi; iMese++) + { + ChLabels.Add($"{iMese:00}"); + } + for (int iSerie = 0; iSerie < 4; iSerie++) + { + // simulo 12 mesi... + List simData = new List(); + for (int iMese = 1; iMese <= numMesi; iMese++) + { + simData.Add(new chartJsXY() { x = iMese, y = iMese + rnd.Next(-4, 4) }); + } + int rCol = rnd.Next(0, 155); + int gCol = rnd.Next(0, 155); + int bCol = rnd.Next(0, 100); + + chartJsData.chartJsDataSetXY singleData = new chartJsData.chartJsDataSetXY() + { + label = $"Data_{iSerie:00}", + data = simData, + borderColor = $"#{10 + rCol:X2}{30 + gCol:X2}{100 + bCol:X2}", + backgroundColor = $"rgba({60 + rCol},{80 + gCol},{155 + bCol},0.3)", + lineTension = 0, + stepped = iSerie % 5 == 0, + fill = iSerie % 3 == 0 ? "start" : "false" + }; + // aggiungo + currDemo.Add(singleData); + } + currDS = currDemo; + await Task.Delay(10); + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor b/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor deleted file mode 100644 index 046168d..0000000 --- a/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor +++ /dev/null @@ -1,18 +0,0 @@ -@page "/TestMultiLine" - -@if (currDS == null) -{ - -} -else -{ -

TestMultiLine

-
-
- -
-
- -
-
-} diff --git a/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor.cs b/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor.cs deleted file mode 100644 index 189626a..0000000 --- a/EgwCoreLib.BlazorTest/Pages/TestMultiLine.razor.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using EgwCoreLib.BlazorTest; -using EgwCoreLib.BlazorTest.Components; -using EgwCoreLib.BlazorTest.Shared; -using EgwCoreLib.Razor; -using EgwCoreLib.Razor.Data; -using static EgwCoreLib.Razor.Data.chartJsData; - -namespace EgwCoreLib.BlazorTest.Pages -{ - public partial class TestMultiLine - { - - protected override async Task OnInitializedAsync() - { - currDS = null; - await Task.Delay(200); - await setupData(); - } - - protected List? currDS { get; set; } = null; - - protected List? ChLabels { get; set; } = null; - - protected Random rnd = new Random(); - - private async Task setupData() - { - currDS = null; - List currDemo = new List(); - ChLabels = new List(); - int numMesi = 6; - for (int iMese = 1; iMese <= numMesi; iMese++) - { - ChLabels.Add($"{iMese:00}"); - } - for (int iSerie = 0; iSerie < 4; iSerie++) - { - // simulo 12 mesi... - List simData = new List(); - for (int iMese = 1; iMese <= numMesi; iMese++) - { - simData.Add(new chartJsXY() { x = iMese, y = iMese + rnd.Next(-4, 4) }); - } - int rCol = rnd.Next(0, 155); - int gCol = rnd.Next(0, 155); - int bCol = rnd.Next(0, 100); - - chartJsData.chartJsDataSetXY singleData = new chartJsData.chartJsDataSetXY() - { - label = $"Data_{iSerie:00}", - data = simData, - borderColor = $"#{10 + rCol:X2}{30 + gCol:X2}{100 + bCol:X2}", - backgroundColor = $"rgba({60 + rCol},{80 + gCol},{155 + bCol},0.3)", - lineTension = 0, - stepped = iSerie % 5 == 0, - fill = iSerie % 3 == 0 ? "start" : "false" - }; - // aggiungo - currDemo.Add(singleData); - } - currDS = currDemo; - await Task.Delay(10); - } - - protected string[] histLabel(int num) - { - List answ = new List(); - for (int i = 0; i < 50; i++) - { - answ.Add($"LBL_{i:00}"); - } - return answ.ToArray(); - } - protected string[] histData(int num) - { - List answ = new List(); - for (int i = 0; i < 50; i++) - { - answ.Add($"{(double)(rnd.Next(10, 100)) / 10 + i}"); - } - return answ.ToArray(); - } - } -} \ No newline at end of file diff --git a/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor b/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor index ada0643..fca139d 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor +++ b/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor @@ -13,7 +13,7 @@
AZTEC
-
+

diff --git a/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml b/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml index fb522f7..fa505cf 100644 --- a/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml +++ b/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml @@ -38,19 +38,30 @@ + @*Gestione ricollegamento successivo: https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0*@ + @* *@ diff --git a/EgwCoreLib.BlazorTest/Program.cs b/EgwCoreLib.BlazorTest/Program.cs index d254c51..ab1512c 100644 --- a/EgwCoreLib.BlazorTest/Program.cs +++ b/EgwCoreLib.BlazorTest/Program.cs @@ -19,6 +19,12 @@ if (!app.Environment.IsDevelopment()) app.UseHsts(); } +// disabilita risposta compressa in debug +if (!app.Environment.IsDevelopment()) +{ + app.UseResponseCompression(); +} + app.UseHttpsRedirection(); app.UseStaticFiles();