Compare commits

...

28 Commits

Author SHA1 Message Date
Samuele Locatelli d5d47076df Merge branch 'release/AddConfMaxAge' 2022-07-15 17:36:41 +02:00
Samuele Locatelli 612c3c95f7 MON:
- fix: parametro MaxAge usato anche x redis
- cambio maxAge a 2000ms
2022-07-15 17:36:21 +02:00
Samuele Locatelli dddac15b52 MON:
- update x conf maxAge da appsetting.json
2022-07-15 17:23:58 +02:00
Samuele Locatelli a315e4f0ef Merge tag 'FixDisplayMonHours' into develop
Update x display ore in MON
2022-07-15 17:16:43 +02:00
Samuele Locatelli d71e9465e5 Merge branch 'release/FixDisplayMonHours' 2022-07-15 17:15:57 +02:00
Samuele Locatelli 876197b0ac Update display MON x vedere HH 2022-07-15 17:14:44 +02:00
Samuele Locatelli cd07a940d0 Merge tag 'UpdateLand4WCS' into develop
update x compatibilità con nuovi metodi WebConfigSetter
2022-07-14 17:55:44 +02:00
Samuele Locatelli d2f7dd53f3 Merge branch 'release/UpdateLand4WCS' 2022-07-14 17:55:28 +02:00
Samuele Locatelli 8c75556240 Update LAND:
- spostamento aree conf server in apposito blocco
- implementaizone compatibile con WebConfigSetter
2022-07-14 17:54:59 +02:00
Samuele Locatelli a025057865 Merge tag 'FixRedisNugetStat' into develop
Cambio modalità auto-reconnect e tentativi
2022-07-13 09:49:43 +02:00
Samuele Locatelli c5ebcd5b40 Merge branch 'release/FixRedisNugetStat' 2022-07-13 09:49:33 +02:00
Samuele Locatelli df1526d522 MP MON:
- cambio gestione auto-reconnect: più tentativi, per 10 minuti
2022-07-13 09:49:16 +02:00
Samuele Locatelli fb88e6e30d Merge tag 'FixRedisNugetStats' into develop
Fix nuget stats
2022-07-13 09:06:08 +02:00
Samuele Locatelli e83945488d Merge branch 'release/FixRedisNugetStats' 2022-07-13 09:05:53 +02:00
Samuele Locatelli 23835d330d Fix nuget redis x STATS 2022-07-13 09:05:36 +02:00
Samuele Locatelli b57885576e Merge tag 'FixRedisRegression' into develop
Update x fix regressione valore redis mal testato
2022-07-13 08:58:13 +02:00
Samuele Locatelli 417ea1a77d Merge branch 'release/FixRedisRegression' 2022-07-13 08:57:59 +02:00
Samuele Locatelli 335fdf78f0 Correzione regressione test valori redis 2022-07-13 08:57:33 +02:00
Samuele Locatelli d50e5a6860 Merge tag 'UpdatePack' into develop
Update nuget e eliminazione warnings
2022-07-13 08:29:21 +02:00
Samuele Locatelli 86d28f1901 Merge branch 'release/UpdatePack' 2022-07-13 08:28:57 +02:00
Samuele Locatelli 202c5f6faf Refresh pacchetti nuget + minor fix 2022-07-13 08:28:38 +02:00
Samuele Locatelli e2947d1017 Merge tag 'UpdateSlowTimerElapse' into develop
Aggiornamento slow time elapse (+/- 10%)
2022-07-13 07:57:33 +02:00
Samuele Locatelli 55faefcb9a Merge branch 'release/UpdateSlowTimerElapse' 2022-07-13 07:57:19 +02:00
Samuele Locatelli 1e5f894fd9 MON:
- attesa refresh variabile x client
- esclusione compilazione WASM (NON pronta)
2022-07-13 07:55:12 +02:00
Samuele Locatelli cf8baa054f Merge tag 'MonCleanup' into develop
Update con cleanup codice ed un paio di fix dispose
2022-07-12 19:06:59 +02:00
Samuele Locatelli 871a0c8ca5 Merge branch 'release/MonCleanup' 2022-07-12 19:05:53 +02:00
Samuele Locatelli 78cb17d8fc Cleanup MP/MON 2022-07-12 19:05:30 +02:00
Samuele Locatelli 22ff799204 Merge tag 'MonWithRedisChannels' into develop
Gestioen con redis channels (da ripulire...)
2022-07-12 18:45:32 +02:00
35 changed files with 301 additions and 375 deletions
+106 -105
View File
@@ -121,19 +121,19 @@ MON:build:
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
WAMON:build:
stage: build
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
# WAMON:build:
# stage: build
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# script:
# - dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
LAND:test:
stage: test
@@ -199,22 +199,22 @@ MON:test:
script:
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
WAMON:test:
stage: test
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["WAMON:build"]
script:
- dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
# WAMON:test:
# stage: test
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# - develop
# needs: ["WAMON:build"]
# script:
# - dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
LAND:IIS01:deploy:
stage: deploy
@@ -280,22 +280,22 @@ MON:IIS01:deploy:
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
WAMON:IIS01:deploy:
stage: deploy
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["WAMON:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
# WAMON:IIS01:deploy:
# stage: deploy
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# - develop
# needs: ["WAMON:test"]
# script:
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
LAND:IIS02:deploy:
stage: deploy
@@ -365,23 +365,23 @@ MON:IIS02:deploy:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
WAMON:IIS02:deploy:
stage: deploy
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["WAMON:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
# WAMON:IIS02:deploy:
# stage: deploy
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# - master
# needs: ["WAMON:build"]
# script:
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
# - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
LAND:installer:
stage: installer
@@ -467,27 +467,27 @@ MON:installer:
- *hashBuild
- *nexusUpload
WAMON:installer:
stage: installer
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
NEXUS_PATH: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["WAMON:build"]
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
# WAMON:installer:
# stage: installer
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# NEXUS_PATH: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# - develop
# - master
# needs: ["WAMON:build"]
# script:
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
# # qui il deploy su nexus...
# - *hashBuild
# - *nexusUpload
LAND:release:
stage: release
@@ -583,25 +583,26 @@ MON:release:
script:
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
WAMON:release:
stage: release
tags:
- win
variables:
PROJ_PATH: MP.WASM.Mon\Server
APP_NAME: MP.WASM.Mon.Server
SOL_NAME: MP-WAMON
NEXUS_PATH: MP-WAMON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
needs: ["WAMON:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
# WAMON:release:
# stage: release
# tags:
# - win
# variables:
# PROJ_PATH: MP.WASM.Mon\Server
# APP_NAME: MP.WASM.Mon.Server
# SOL_NAME: MP-WAMON
# NEXUS_PATH: MP-WAMON
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# - tags
# except:
# - branches
# needs: ["WAMON:build"]
# artifacts:
# paths:
# - publish/
# script:
# - dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
+6 -6
View File
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
@@ -12,14 +12,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
<PackageReference Include="NLog" Version="5.0.1" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -118,7 +118,7 @@ else // disegno box non cliccabile e licenza mancante
protected string fullUrl(string relUrl)
{
return $"{Configuration["BaseUrl"]}{relUrl}";
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
}
protected MarkupString traduci(string lemma)
+2 -2
View File
@@ -81,12 +81,12 @@ namespace MP.Land.Components
protected string fullUrl(string relUrl)
{
return $"{Configuration["BaseUrl"]}{relUrl}";
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
}
protected string localPath(string localRepo)
{
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
}
protected override void OnInitialized()
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.15.2207.0718</Version>
<Version>6.15.2207.1417</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -121,7 +121,7 @@ namespace MP.Land.Pages
protected string localPath(string localRepo)
{
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
}
protected override void OnInitialized()
+1 -1
View File
@@ -34,7 +34,7 @@ namespace MP.Land.Pages
protected string BaseUrlTab
{
get => $"{Configuration["BaseUrl"]}{Configuration["QrJumpPath"]}";
get => $"{Configuration["ServerConf:BaseUrl"]}{Configuration["QrJumpPath"]}";
}
[Inject]
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.15.2207.0718</h4>
<h4>Versione: 6.15.2207.1417</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.15.2207.0718
6.15.2207.1417
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2207.0718</version>
<version>6.15.2207.1417</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+20 -18
View File
@@ -1,21 +1,23 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "Steam PROD",
"BaseUrl": "https://iis02.egalware.com/",
"AllowedHosts": "*",
"QrJumpPath": "MP/TAB/jumper?",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "Steam PROD",
"AllowedHosts": "*",
"QrJumpPath": "MP/TAB/jumper?",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
},
"ServerConf": {
"BaseUrl": "https://iis02.egalware.com/",
"downloadPath": "C:\\Steamware\\installers\\MP"
}
}
+4 -1
View File
@@ -8,5 +8,8 @@
}
},
"Environment": "Steam DEV",
"BaseUrl": "https://iis01.egalware.com/"
"ServerConf": {
"BaseUrl": "https://iis01.egalware.com/",
"downloadPath": "C:\\Steamware\\installers\\MP"
}
}
+4 -2
View File
@@ -7,15 +7,17 @@
}
},
"AllowedHosts": "*",
"BaseUrl": "https://localhost:44309/",
"QrJumpPath": "MP/TAB/jumper?",
"Environment": "Steam DEV",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
},
"ServerConf": {
"BaseUrl": "https://localhost:44309/",
"downloadPath": "C:\\Steamware\\installers\\MP"
}
//"ConnectionStrings": {
// "DefaultConnection": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="px-2">
<img class="logoImg img-fluid" src="images/LogoMapo.png" height="24" />
<span class="mainHead p-3"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
<span class="mainHead p-3 align-middle"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
</div>
<div class="px-2">
<span id="text-white text-right">
+24 -40
View File
@@ -12,11 +12,6 @@ namespace MP.Mon.Components
[Parameter]
public MappaStatoExpl? CurrRecord { get; set; } = null;
/// <summary>
/// Valore precedente x calcolo variazione
/// </summary>
private MappaStatoExpl? OldRecord { get; set; } = null;
[Parameter]
public List<TagData>? currTagConf { get; set; } = null;
@@ -26,37 +21,22 @@ namespace MP.Mon.Components
[Parameter]
public bool doAnimate { get; set; } = true;
[Parameter]
public bool doBlink { get; set; } = false;
[Parameter]
public int keepAliveMin { get; set; } = 5;
[Parameter]
public string showArt { get; set; } = "";
[Parameter]
public bool doBlink { get; set; } = false;
//{
// set
// {
// // se true --> ricarica
// if (value)
// {
// var pUpd = Task.Run(async () =>
// {
// await InvokeAsync(() => StateHasChanged());
// });
// pUpd.Wait();
// }
// }
//}
#endregion Public Properties
#region Public Methods
public void Dispose()
{
//aTimer.Elapsed -= ElapsedTimer;
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
}
@@ -88,10 +68,6 @@ namespace MP.Mon.Components
}
if (needUpdate)
{
if (false)
{
Log.Trace($"Elapsed Timer {CurrRecord?.CodMacchina}");
}
await InvokeAsync(() => StateHasChanged());
}
OldRecord = CurrRecord;
@@ -114,6 +90,7 @@ namespace MP.Mon.Components
#region Protected Fields
protected string baseCss = "sem";
protected int kaFactor = 60 / 2;
#endregion Protected Fields
@@ -209,11 +186,21 @@ namespace MP.Mon.Components
#region Private Fields
private static System.Timers.Timer aTimer { get; set; } = null!;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Properties
private static System.Timers.Timer aTimer { get; set; } = null!;
/// <summary>
/// Valore precedente x calcolo variazione
/// </summary>
private MappaStatoExpl? OldRecord { get; set; } = null;
#endregion Private Properties
#region Private Methods
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
@@ -246,16 +233,6 @@ namespace MP.Mon.Components
string answ = $"{baseCss}{codColore}";
if (doAnimate && codColore != "Ve")
{
#if false
// blink se secondo pari...
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
answ += "_b";
}
#endif
if (doBlink)
{
answ += "_b";
@@ -282,7 +259,14 @@ namespace MP.Mon.Components
{
double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0;
tSpan = TimeSpan.FromMinutes(cTimeMin);
answ = $"{tSpan:mm}:{tSpan:ss}";
if (tSpan.TotalHours < 1)
{
answ = $"{tSpan:mm}:{tSpan:ss}";
}
else
{
answ = $"{tSpan.TotalHours:N0}h {tSpan:mm}:{tSpan:ss}";
}
}
catch
{ }
+7 -3
View File
@@ -1,6 +1,10 @@
<div class="row p-5 m-5 bg-light">
<div class="col-12 text-center mt-5 py-5 alert alert-primary">
<div class="row p-5 m-5 alert alert-primary">
<div class="col-6 text-center mt-4 py-3 bg-light">
<h1>MAPO MON</h1>
EgalWare MES suite <img class="logoImg img-fluid" src="images/logoCliente.png" />
</div>
<div class="col-6 text-center mt-4 py-3 bg-light">
<h3>loading data</h3>
<i class="fas fa-spinner fa-spin fa-5x"></i>
<i class="fas fa-spinner fa-spin fa-4x"></i>
</div>
</div>
+69 -70
View File
@@ -36,7 +36,6 @@ namespace MP.Mon.Data
dbController = new MP.Data.Controllers.MpMonController(configuration);
StringBuilder sb = new StringBuilder();
sb.AppendLine($"DbController OK");
//sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}");
_logger.LogInformation(sb.ToString());
}
@@ -47,75 +46,21 @@ namespace MP.Mon.Data
startTimers();
}
private void startTimers()
{
fastTimer = new System.Timers.Timer(fastRefreshMs);
fastTimer.Elapsed += ElapsedFastTimer;
fastTimer.Enabled = true;
fastTimer.Start();
}
private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
// secondi pari --> blink, secondi dispari --> ricarica
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
// invio in channel blink il segnale
blinkPipe.sendMessage("true");
Log.Trace("Elapsed Fast Timer Blink");
}
else
{
// invio in channel blink segnale false
blinkPipe.sendMessage("false");
// rileggo dati ed invio
await ReloadData();
Log.Trace("Elapsed Fast Timer reload");
}
});
pUpd.Wait();
}
private async Task ReloadData()
{
// legge i dati e li invia tramite redis channels
var newData = await MseGetAll();
// invio tramite la pipe...
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
}
/// <summary>
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min ad ogni chiamata client)
/// </summary>
private DateTime fastLimit = DateTime.Now;
private int fastRefreshMs = 1000;
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
/// <summary>
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
/// </summary>
public void doActivate()
{
fastLimit = DateTime.Now.AddMinutes(1);
}
#endregion Public Constructors
#region Public Properties
public static MP.Data.Controllers.MpMonController dbController { get; set; } = null!;
public MessagePipe blinkPipe { get; set; } = null!;
/// <summary>
/// Dizionario dei tag configurati per IOB
/// </summary>
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
public MessagePipe dataPipe { get; set; } = null!;
#endregion Public Properties
#region Public Methods
@@ -131,6 +76,14 @@ namespace MP.Mon.Data
dbController.Dispose();
}
/// <summary>
/// Richiesta attivazione --&gt; sposto avanti 1 minuto il periodo limite x fast running
/// </summary>
public void doActivate()
{
fastLimit = DateTime.Now.AddMinutes(1);
}
/// <summary>
/// Elenco setup dei tag conf correnti
/// </summary>
@@ -164,27 +117,29 @@ namespace MP.Mon.Data
public async Task<List<MappaStatoExpl>> MseGetAll()
{
int maxAge = 2000;
int.TryParse(_configuration.GetValue<string>("ServerConf:maxAge"), out maxAge);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<MappaStatoExpl> result = new List<MappaStatoExpl>();
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
// cerco in redis...
var rawData = await redisDb.StringGetAsync(redisMseKey);
if (!string.IsNullOrEmpty(rawData))
RedisValue rawData = await redisDb.StringGetAsync(redisMseKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(rawData);
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Read from REDIS: {ts.TotalMilliseconds}ms");
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
}
else
{
result = await Task.FromResult(dbController.MseGetAll());
result = await Task.FromResult(dbController.MseGetAll(maxAge));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromSeconds(2));
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Read from DB: {ts.TotalMilliseconds}ms");
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
}
if (result == null)
{
@@ -195,16 +150,24 @@ namespace MP.Mon.Data
#endregion Public Methods
public MessagePipe dataPipe { get; set; } = null!;
public MessagePipe blinkPipe { get; set; } = null!;
#region Private Fields
private static IConfiguration _configuration = null!;
private static ILogger<MpDataService> _logger = null!;
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min
/// ad ogni chiamata client)
/// </summary>
private DateTime fastLimit = DateTime.Now;
private int fastRefreshMs = 1000;
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
@@ -222,6 +185,42 @@ namespace MP.Mon.Data
#region Private Methods
private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
// secondi pari --> blink, secondi dispari --> ricarica
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
// invio in channel blink il segnale
blinkPipe.sendMessage("true");
Log.Debug("Elapsed Fast Timer Blink");
}
else
{
// invio in channel blink segnale false
blinkPipe.sendMessage("false");
// rileggo dati...
var newData = await MseGetAll();
// invio tramite la pipe...
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
Log.Debug("Elapsed Fast Timer reload");
}
});
pUpd.Wait();
}
private void startTimers()
{
fastTimer = new System.Timers.Timer(fastRefreshMs);
fastTimer.Elapsed += ElapsedFastTimer;
fastTimer.Enabled = true;
fastTimer.Start();
}
/// <summary>
/// Prova a caricare da file la conf degli IOB se presente
/// </summary>
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>6.15.2207.1218</Version>
<Version>6.15.2207.1517</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -39,7 +39,7 @@
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
-1
View File
@@ -5,7 +5,6 @@
<PageTitle>MP MON</PageTitle>
<div class="row statusMap mx-1 my-1">
@if (listMSE == null)
{
<div class="col-12">
+15 -74
View File
@@ -14,62 +14,23 @@ namespace MP.Mon.Pages
public void Dispose()
{
#if false
fastTimer.Stop();
fastTimer.Dispose();
#endif
slowTimer.Stop();
slowTimer.Dispose();
disposeTimers();
}
#if false
public void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
// secondi pari --> blink, secondi dispari --> ricarica
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
doBlink = true;
Log.Trace("Elapsed Fast Timer Blink");
await Task.Delay(1);
await InvokeAsync(StateHasChanged);
}
else
{
doBlink = false;
await ReloadData();
Log.Trace("Elapsed Fast Timer reload");
}
});
pUpd.Wait();
}
#endif
public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e)
{
listMSE = null;
await Task.Delay(1);
await Task.Delay(10);
Log.Info("Elapsed Slow Timer --> full page reload");
// dispongo i vari timers...
disposeTimers();
await Task.Delay(10);
// reload pagina
NavManager.NavigateTo(NavManager.Uri);
}
public void StartTimer()
{
#if false
// timer veloce
fastTimer = new System.Timers.Timer(fastRefreshMs);
fastTimer.Elapsed += ElapsedFastTimer;
fastTimer.Enabled = true;
fastTimer.Start();
#endif
// timer lento
slowTimer = new System.Timers.Timer(slowRefreshMs);
slowTimer.Elapsed += ElapsedSlowTimer;
@@ -100,7 +61,12 @@ namespace MP.Mon.Pages
protected int slowRefreshMs
{
get => 1000 * slowRefreshSec;
get
{
// tempo variabile tra +/- 10% del target
int answ = rnd.Next(900, 1100) * slowRefreshSec;
return answ;
}
}
#endregion Protected Properties
@@ -191,12 +157,14 @@ namespace MP.Mon.Pages
protected override async Task OnInitializedAsync()
{
await setupConf();
//await ReloadData();
MMDataService.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
MMDataService.blinkPipe.EA_NewMessage += BlinkPipe_EA_NewMessage;
Random rnd = new Random();
await Task.Delay(rnd.Next(1000, 1200));
StartTimer();
}
#endregion Protected Methods
#region Private Fields
@@ -205,12 +173,10 @@ namespace MP.Mon.Pages
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
private List<ConfigModel>? CurrConfig = null;
private bool doBlink = false;
private List<MappaStatoExpl>? listMSE = null;
private Random rnd = new Random();
#endregion Private Fields
@@ -247,7 +213,6 @@ namespace MP.Mon.Pages
/// <exception cref="NotImplementedException"></exception>
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
{
//fastTimer.Stop();
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly List<string> --> allarmi
if (!string.IsNullOrEmpty(currArgs.newMessage))
@@ -275,46 +240,22 @@ namespace MP.Mon.Pages
}
InvokeAsync(() =>
{
#if false
// attesa random 0-50ms...
Random rnd = new Random();
Task.Delay(rnd.Next(5, 50));
Task.Delay(rnd.Next(5, 50));
#endif
StateHasChanged();
});
//fastTimer.Start();
}
private void disposeTimers()
{
//fastTimer.Elapsed -= ElapsedFastTimer;
//fastTimer.Stop();
//fastTimer.Dispose();
slowTimer.Elapsed -= ElapsedSlowTimer;
slowTimer.Stop();
slowTimer.Dispose();
}
#if false
private async Task ReloadData()
{
// legge i dati e li invia tramite redis channels
var newData = await MMDataService.MseGetAll();
// invio tramite la pipe...
MMDataService.dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
//#if DEBUG
// // hack: legge 4 volte i dati x stressare sistema
// var singleData = await MMDataService.MseGetAll();
// listMSE = new List<MappaStatoExpl>();
// for (int i = 0; i < 4; i++)
// {
// listMSE.AddRange(singleData);
// }
//#else
// listMSE = await MMDataService.MseGetAll();
//#endif
}
#endif
private async Task setupConf()
{
CurrConfig = await MMDataService.ConfigGetAll();
+19 -14
View File
@@ -7,6 +7,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="google" content="notranslate">
<base href="~/" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/site.css" />
@@ -28,24 +29,28 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js" autostart="false"></script>
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
<script>
Blazor.start().then(() => {
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
get() {
return this.__reconnectionDisplay;
},
set(value) {
this.__reconnectionDisplay = {
show: () => value.show(),
update: (d) => value.update(d),
rejected: (d) => document.location.reload()
Blazor.start({
reconnectionOptions: {
maxRetries: 300,
retryIntervalMilliseconds: 2000
}
}).then(() => {
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
get() {
return this.__reconnectionDisplay;
},
set(value) {
this.__reconnectionDisplay = {
show: () => value.show(),
update: (d) => value.update(d),
rejected: (d) => document.location.reload()
}
}
}
});
});
});
</script>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MON MAPO</i>
<h4>Versione: 6.15.2207.1218</h4>
<h4>Versione: 6.15.2207.1517</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.15.2207.1218
6.15.2207.1517
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2207.1218</version>
<version>6.15.2207.1517</version>
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+2 -2
View File
@@ -13,14 +13,14 @@ main {
/*border-bottom: 1px solid #696969;*/
color: #696969;
font-size: 1.4em;
height: 3rem;
height: 2.6rem;
display: flex;
align-items: center;
justify-content: space-evenly;
}
.mainHead{
font-size: 1.7rem;
font-size: 1.6rem;
}
.top-row ::deep a,
+3
View File
@@ -11,5 +11,8 @@
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
},
"ServerConf": {
"maxAge": "2000"
}
}
+1 -1
View File
@@ -308,7 +308,7 @@ a,
/* Gestione size caratteri */
.mainHead,
.logoImg {
height: 1.6em;
height: 1.5em;
}
@media all and (min-width: 425px) {
.mainHead {
+2 -2
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Stats</RootNamespace>
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
<Version>6.15.2207.0718</Version>
<Version>6.15.2207.1309</Version>
</PropertyGroup>
<ItemGroup>
@@ -188,7 +188,7 @@
<PackageReference Include="ElmahCore" Version="2.1.2" />
<PackageReference Include="ElmahCore.Common" Version="2.1.2" />
<PackageReference Include="ElmahCore.Sql" Version="2.1.2" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
</ItemGroup>
-1
View File
@@ -42,7 +42,6 @@
// rejected: (d) => document.location.reload()
// };
//});
Blazor.start().then(() => {
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
get() {
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo statistiche MAPO</i>
<h4>Versione: 6.15.2207.0718</h4>
<h4>Versione: 6.15.2207.1309</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.15.2207.0718
6.15.2207.1309
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2207.0718</version>
<version>6.15.2207.1309</version>
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
@@ -246,16 +246,6 @@ namespace MP.WASM.Mon.Client.Components
string answ = $"{baseCss}{codColore}";
if (doAnimate && codColore != "Ve")
{
#if false
// blink se secondo pari...
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
answ += "_b";
}
#endif
if (doBlink)
{
answ += "_b";
+1 -7
View File
@@ -11,12 +11,6 @@ namespace MP.WASM.Mon.Client.Pages
public void Dispose()
{
#if false
fastTimer.Stop();
fastTimer.Dispose();
slowTimer.Stop();
slowTimer.Dispose();
#endif
disposeTimers();
}
@@ -222,7 +216,7 @@ namespace MP.WASM.Mon.Client.Pages
{
// leggo stato server...
fastTimer.Interval = fastRefreshMs * 3;
var res = await Http.GetAsync("/api/MSE/checkAlive");
var res = await Http.GetAsync("api/MSE/checkAlive");
Console.WriteLine("GetAsync end");
if (res.IsSuccessStatusCode)
{