refresh gestione versioni

This commit is contained in:
Samuele Locatelli
2025-03-14 18:47:27 +01:00
parent e079f683f3
commit 47be99a78b
21 changed files with 231 additions and 45 deletions
@@ -6,6 +6,13 @@ namespace MP.MON.Client.Components
{
public partial class CmpFooter : ComponentBase, IDisposable
{
#region Public Properties
[Parameter]
public Version version { get; set; } = null!;
#endregion Public Properties
#region Public Methods
public void Dispose()
@@ -80,8 +87,6 @@ namespace MP.MON.Client.Components
protected override void OnInitialized()
{
var currAssembly = typeof(Program).Assembly.GetName();
version = currAssembly.Version != null ? currAssembly.Version : new Version();
StartTimer();
Console.WriteLine($"OnInitialized completato");
}
@@ -91,7 +96,6 @@ namespace MP.MON.Client.Components
#region Private Fields
private static System.Timers.Timer aTimer = null!;
private Version version = null!;
#endregion Private Fields
@@ -8,6 +8,7 @@
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
<RootNamespace>MP.MON.Client</RootNamespace>
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
<Version>6.16.2503.1418</Version>
</PropertyGroup>
<ItemGroup>
@@ -28,4 +29,11 @@
<ProjectReference Include="..\..\MP.Core\MP.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
-16
View File
@@ -1,16 +0,0 @@
@page "/counter"
@rendermode InteractiveAuto
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<hr />
<MP.MON.Client.Component.CmpFooter></MP.MON.Client.Component.CmpFooter>
@@ -1,23 +0,0 @@
using Microsoft.AspNetCore.Components;
using System;
namespace MP.MON.Client.Pages
{
public partial class Counter : ComponentBase
{
#region Private Fields
private int currentCount = 0;
#endregion Private Fields
#region Private Methods
private void IncrementCount()
{
currentCount++;
}
#endregion Private Methods
}
}
@@ -0,0 +1,25 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: {{CURRENT-REL}}</h4>
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.6.15.* &rarr;</b>
<ul>
<li>Prima release dotnet6</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2023</a>
</div>
</div>
</body>
@@ -0,0 +1,25 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2503.1418</h4>
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.6.15.* &rarr;</b>
<ul>
<li>Prima release dotnet6</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2023</a>
</div>
</div>
</body>
@@ -0,0 +1 @@
6.16.2503.1418
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.0.0</version>
<url>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2503.1418</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+32
View File
@@ -0,0 +1,32 @@
param([string]$ProjectDir, [string]$ProjectPath);
$FileMajMin = "..\..\MajMin.vers"
$FileVers = "Resources\VersNum.txt"
$FileManIn = "Resources\manifest-original.xml"
$FileManOut = "Resources\manifest.xml"
$FileCLogIn = "Resources\ChangeLog-original.html"
$FileCLogOut = "Resources\ChangeLog.html"
$MajMin = Get-Content $FileMajMin
$currentDate = get-date -format yyMM;
$currentTime = get-date -format dHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum = $MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileVers -Value $currRelNum
# replace x manifest
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $currRelNum
$manData = $manData -replace "{{DIRNAME}}", "MP-TAB3"
$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST"
$manData = $manData -replace "{{PACKNAME}}", "MP-TAB3"
Set-Content -Path $FileManOut -Value $manData
# replace x ChangeLog
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
Set-Content -Path $FileCLogOut -Value $clogData
@@ -12,7 +12,7 @@
@Body
</article>
<div class="fixed-bottom bottom-row px-2">
<CmpFooter @rendermode="InteractiveWebAssembly"></CmpFooter>
<CmpFooter @rendermode="InteractiveWebAssembly" version="@version"></CmpFooter>
</div>
</main>
</div>
@@ -22,3 +22,17 @@
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@code{
protected override void OnInitialized()
{
// base.OnInitialized();
var currAssembly = typeof(Program).Assembly.GetName();
version = currAssembly.Version != null ? currAssembly.Version : new Version();
}
/// <summary>
/// Versione applicativo ada passare al controllo footer
/// </summary>
private Version version = null!;
}
@@ -232,7 +232,7 @@ namespace MP.MON.Components.Pages
Random rnd = new Random();
cssOverlayOff = config.GetValue<string>("ServerConf:cssOverlayOff") ?? "";
maxChar4Scroll = config.GetValue<int>("ServerConf:maxChar4Scroll");
await Task.Delay(rnd.Next(400, 600));
await Task.Delay(rnd.Next(50, 150));
StartTimer();
}
@@ -248,6 +248,7 @@ namespace MP.MON.Components.Pages
private string CodGruppo = "";
private string cssOverlayOff = "bg-dark text-light opacity-100";
private List<ConfigModel>? CurrConfig = null;
private bool doBlink = false;
@@ -265,6 +266,10 @@ namespace MP.MON.Components.Pages
#endregion Private Fields
#region Private Properties
#endregion Private Properties
#region Private Methods
/// <summary>
+1 -1
View File
@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.MON</RootNamespace>
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
<Version>6.16.2503.1409</Version>
</PropertyGroup>
<ItemGroup>
@@ -13,7 +14,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="..\MP-MON.Client\Pages\Counter.razor.cs" Link="Counter.razor.cs" />
<Compile Include="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
@@ -0,0 +1,25 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: {{CURRENT-REL}}</h4>
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.6.15.* &rarr;</b>
<ul>
<li>Prima release dotnet6</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2023</a>
</div>
</div>
</body>
+25
View File
@@ -0,0 +1,25 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2503.1410</h4>
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.6.15.* &rarr;</b>
<ul>
<li>Prima release dotnet6</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2023</a>
</div>
</div>
</body>
+1
View File
@@ -0,0 +1 @@
6.16.2503.1410
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.0.0</version>
<url>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2503.1410</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+32
View File
@@ -0,0 +1,32 @@
param([string]$ProjectDir, [string]$ProjectPath);
$FileMajMin = "..\..\MajMin.vers"
$FileVers = "Resources\VersNum.txt"
$FileManIn = "Resources\manifest-original.xml"
$FileManOut = "Resources\manifest.xml"
$FileCLogIn = "Resources\ChangeLog-original.html"
$FileCLogOut = "Resources\ChangeLog.html"
$MajMin = Get-Content $FileMajMin
$currentDate = get-date -format yyMM;
$currentTime = get-date -format dHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum = $MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileVers -Value $currRelNum
# replace x manifest
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $currRelNum
$manData = $manData -replace "{{DIRNAME}}", "MP-TAB3"
$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST"
$manData = $manData -replace "{{PACKNAME}}", "MP-TAB3"
Set-Content -Path $FileManOut -Value $manData
# replace x ChangeLog
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
Set-Content -Path $FileCLogOut -Value $clogData