diff --git a/LiMan.Api/Resources/ChangeLog.html b/LiMan.Api/Resources/ChangeLog.html
index 5bdadfc..2a88e01 100644
--- a/LiMan.Api/Resources/ChangeLog.html
+++ b/LiMan.Api/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
License Manager
- Versione: 2.1.2501.2907
+ Versione: 2.1.2501.2909
Note di rilascio:
-
diff --git a/LiMan.Api/Resources/VersNum.txt b/LiMan.Api/Resources/VersNum.txt
index 1e22251..2d9c15f 100644
--- a/LiMan.Api/Resources/VersNum.txt
+++ b/LiMan.Api/Resources/VersNum.txt
@@ -1 +1 @@
-2.1.2501.2907
+2.1.2501.2909
diff --git a/LiMan.Api/Resources/manifest.xml b/LiMan.Api/Resources/manifest.xml
index 8cc3a19..2914bb0 100644
--- a/LiMan.Api/Resources/manifest.xml
+++ b/LiMan.Api/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 2.1.2501.2907
+ 2.1.2501.2909
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html
false
diff --git a/LiMan.DB/Services/CommonDataServices.cs b/LiMan.DB/Services/CommonDataServices.cs
index 9c9b7cc..8ee6095 100644
--- a/LiMan.DB/Services/CommonDataServices.cs
+++ b/LiMan.DB/Services/CommonDataServices.cs
@@ -618,6 +618,136 @@ namespace LiMan.DB.Services
return answ;
}
+ ///
+ /// Recupera licenza dato IDX
+ ///
+ ///
+ ///
+ public LicenzaModel LicenzaNextGetByIdx(int IdxLic)
+ {
+ Stopwatch sw = new Stopwatch();
+ LicenzaModel dbResult = new LicenzaModel();
+ sw.Start();
+ dbResult = dbControllerNext.GetLicenza(IdxLic);
+ sw.Stop();
+ TimeSpan ts = sw.Elapsed;
+ Log.Trace($"Effettuata lettura da DB per LicenzeNextGetByIdx: {ts.TotalMilliseconds} ms");
+ return dbResult;
+ }
+
+ public async Task ReleaseDelete(ReleaseModel rec2del)
+ {
+ bool fatto = dbControllerNext.ReleaseDelete(rec2del);
+ await FlushRedisCache();
+ return fatto;
+ }
+
+ ///
+ /// Elenco Release dato Applicativo
+ ///
+ /// Codice Applicazione
+ ///
+ public async Task
> ReleaseGetByApp(string CodApp)
+ {
+ string source = "DB";
+ List? dbResult = new List();
+ try
+ {
+ string currKey = $"{Const.rKeyConfig}:App:AllRel:{CodApp}";
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ string? rawData = await redisDb.StringGetAsync(currKey);
+ if (!string.IsNullOrEmpty(rawData))
+ {
+ source = "REDIS";
+ var tempResult = JsonConvert.DeserializeObject>(rawData);
+ if (tempResult == null)
+ {
+ dbResult = new List();
+ }
+ else
+ {
+ dbResult = tempResult;
+ }
+ }
+ else
+ {
+ dbResult = dbControllerNext.ReleaseGetByApp(CodApp);
+ rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
+ await redisDb.StringSetAsync(currKey, rawData, LongCache);
+ // per evitare loopback uso deserialize...
+ var tempResult = JsonConvert.DeserializeObject>(rawData);
+ if (tempResult != null)
+ {
+ dbResult = tempResult;
+ }
+ }
+ if (dbResult == null)
+ {
+ dbResult = new List();
+ }
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"ReleaseGetByApp | {source} in: {ts.TotalMilliseconds} ms");
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Error during ReleaseGetByApp:{Environment.NewLine}{exc}");
+ }
+ return dbResult;
+ }
+
+ ///
+ /// Elenco Release dato Applicativo + versione minima
+ ///
+ /// Codice Applicazione
+ /// Versione minima richiesta
+ ///
+ public async Task> ReleaseGetByAppVers(string CodApp, string VersMin)
+ {
+ await Task.Delay(1);
+ List dbResult = new List();
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ dbResult = dbControllerNext.ReleaseGetByAppVers(CodApp, VersMin);
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Trace($"Effettuata lettura da DB per ReleaseGetByAppVers | {CodApp} | vers >= {VersMin} | {ts.TotalMilliseconds} ms");
+ return dbResult;
+ }
+
+ ///
+ /// Ultima Release dato Applicativo VALIDA (= rilasciata)
+ ///
+ /// Codice Applicazione
+ ///
+ public async Task ReleaseLastGetByApp(string CodApp)
+ {
+ string answ = "";
+ RedisKey currKey = $"{Const.rKeyConfig}:App:CurrRel";
+ var rawVal = await redisDb.HashGetAsync(currKey, CodApp);
+ if (rawVal.HasValue)
+ {
+ answ = $"{rawVal}";
+ }
+ else
+ {
+ var rawList = await ReleaseGetByApp(CodApp);
+ if (rawList != null)
+ {
+ var lastRel = rawList
+ .Where(x => x.IsReleased)
+ .OrderByDescending(x => x.VersVal)
+ .ThenByDescending(x => x.ReleaseDate)
+ .FirstOrDefault() ?? new ReleaseModel() { CodApp = CodApp };
+ answ = lastRel.VersNum;
+ // salvo su redis tab...
+ await redisDb.HashSetAsync(currKey, CodApp, answ);
+ }
+ }
+ return answ;
+ }
+
///
/// Restituisce i task associati ad un dato EgwACC in stato DONE
///
diff --git a/LiMan.Transfer/Resources/ChangeLog.html b/LiMan.Transfer/Resources/ChangeLog.html
index 0d1d222..c3b1591 100644
--- a/LiMan.Transfer/Resources/ChangeLog.html
+++ b/LiMan.Transfer/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
License Manager
- Versione: 2.1.2501.2907
+ Versione: 2.1.2501.2909
Note di rilascio:
diff --git a/LiMan.Transfer/Resources/VersNum.txt b/LiMan.Transfer/Resources/VersNum.txt
index 1e22251..2d9c15f 100644
--- a/LiMan.Transfer/Resources/VersNum.txt
+++ b/LiMan.Transfer/Resources/VersNum.txt
@@ -1 +1 @@
-2.1.2501.2907
+2.1.2501.2909
diff --git a/LiMan.Transfer/Resources/manifest.xml b/LiMan.Transfer/Resources/manifest.xml
index 012d1cd..f07b6de 100644
--- a/LiMan.Transfer/Resources/manifest.xml
+++ b/LiMan.Transfer/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 2.1.2501.2907
+ 2.1.2501.2909
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html
false
diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs
index d53fe9f..23f596a 100644
--- a/LiMan.UI/Data/LiManDataService.cs
+++ b/LiMan.UI/Data/LiManDataService.cs
@@ -63,6 +63,7 @@ namespace LiMan.UI.Data
public async Task
> ApplicazioniGLSGetAll()
{
+#if false
List dbResult = new List();
string cacheKey = mHash("GLS:Applicazioni");
string rawData;
@@ -84,7 +85,48 @@ namespace LiMan.UI.Data
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB + caching per ApplicazioniGLSGetAll: {ts.TotalMilliseconds} ms");
}
- return await Task.FromResult(dbResult);
+ return await Task.FromResult(dbResult);
+#endif
+ string source = "DB";
+ List? dbResult = new List();
+ try
+ {
+ string currKey = $"{Const.rKeyConfig}:GLS:Applicazioni";
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ string? rawData = await redisDb.StringGetAsync(currKey);
+ if (!string.IsNullOrEmpty(rawData))
+ {
+ source = "REDIS";
+ var tempResult = JsonConvert.DeserializeObject>(rawData);
+ if (tempResult == null)
+ {
+ dbResult = new List();
+ }
+ else
+ {
+ dbResult = tempResult;
+ }
+ }
+ else
+ {
+ dbResult = dbControllerGLS.GetApplicazioni();
+ rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
+ await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
+ }
+ if (dbResult == null)
+ {
+ dbResult = new List();
+ }
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"ApplicazioniGLSGetAll | {source} in: {ts.TotalMilliseconds} ms");
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Error during ApplicazioniGLSGetAll:{Environment.NewLine}{exc}");
+ }
+ return dbResult;
}
public async Task ApplicazioniGLSUpdate(GLS.DatabaseModels.AnagApplicazioni currItem)
@@ -438,23 +480,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(done);
}
- ///
- /// Recupera licenza dato IDX
- ///
- ///
- ///
- public LicenzaModel LicenzaNextGetByIdx(int IdxLic)
- {
- Stopwatch sw = new Stopwatch();
- LicenzaModel dbResult = new LicenzaModel();
- sw.Start();
- dbResult = dbControllerNext.GetLicenza(IdxLic);
- sw.Stop();
- TimeSpan ts = sw.Elapsed;
- Log.Trace($"Effettuata lettura da DB per LicenzeNextGetByIdx: {ts.TotalMilliseconds} ms");
- return dbResult;
- }
-
///
/// Trasferisce una licenza da GLS a Next
///
@@ -627,131 +652,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(done);
}
- public async Task ReleaseDelete(ReleaseModel rec2del)
- {
- bool fatto = dbControllerNext.ReleaseDelete(rec2del);
- await FlushRedisCache();
- return fatto;
- }
-
- ///
- /// Elenco Release dato Applicativo
- ///
- /// Codice Applicazione
- ///
- public async Task> ReleaseGetByApp(string CodApp)
- {
- string source = "DB";
- List? dbResult = new List();
- try
- {
- string currKey = $"{Const.rKeyConfig}:App:AllRel:{CodApp}";
- Stopwatch stopWatch = new Stopwatch();
- stopWatch.Start();
- string? rawData = await redisDb.StringGetAsync(currKey);
- if (!string.IsNullOrEmpty(rawData))
- {
- source = "REDIS";
- var tempResult = JsonConvert.DeserializeObject>(rawData);
- if (tempResult == null)
- {
- dbResult = new List();
- }
- else
- {
- dbResult = tempResult;
- }
- }
- else
- {
- dbResult = dbControllerNext.ReleaseGetByApp(CodApp);
- rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
- await redisDb.StringSetAsync(currKey, rawData, LongCache);
- // per evitare loopback uso deserialize...
- var tempResult = JsonConvert.DeserializeObject>(rawData);
- if (tempResult != null)
- {
- dbResult = tempResult;
- }
- }
- if (dbResult == null)
- {
- dbResult = new List();
- }
- stopWatch.Stop();
- TimeSpan ts = stopWatch.Elapsed;
- Log.Debug($"ReleaseGetByApp | {source} in: {ts.TotalMilliseconds} ms");
- }
- catch (Exception exc)
- {
- Log.Error($"Error during ReleaseGetByApp:{Environment.NewLine}{exc}");
- }
- return dbResult;
-
-#if false
- await Task.Delay(1);
- List dbResult = new List();
- Stopwatch stopWatch = new Stopwatch();
- stopWatch.Start();
- dbResult = dbControllerNext.ReleaseGetByApp(CodApp);
- stopWatch.Stop();
- TimeSpan ts = stopWatch.Elapsed;
- Log.Trace($"Effettuata lettura da DB per ReleaseGetByApp | {CodApp} | {ts.TotalMilliseconds} ms");
- return dbResult;
-#endif
- }
-
- ///
- /// Elenco Release dato Applicativo + versione minima
- ///
- /// Codice Applicazione
- /// Versione minima richiesta
- ///
- public async Task> ReleaseGetByAppVers(string CodApp, string VersMin)
- {
- await Task.Delay(1);
- List dbResult = new List();
- Stopwatch stopWatch = new Stopwatch();
- stopWatch.Start();
- dbResult = dbControllerNext.ReleaseGetByAppVers(CodApp, VersMin);
- stopWatch.Stop();
- TimeSpan ts = stopWatch.Elapsed;
- Log.Trace($"Effettuata lettura da DB per ReleaseGetByAppVers | {CodApp} | vers >= {VersMin} | {ts.TotalMilliseconds} ms");
- return dbResult;
- }
-
- ///
- /// Ultima Release dato Applicativo VALIDA (= rilasciata)
- ///
- /// Codice Applicazione
- ///
- public async Task ReleaseLastGetByApp(string CodApp)
- {
- string answ = "";
- RedisKey currKey = $"{Const.rKeyConfig}:App:CurrRel";
- var rawVal = await redisDb.HashGetAsync(currKey, CodApp);
- if (rawVal.HasValue)
- {
- answ = $"{rawVal}";
- }
- else
- {
- var rawList = await ReleaseGetByApp(CodApp);
- if (rawList != null)
- {
- var lastRel = rawList
- .Where(x => x.IsReleased)
- .OrderByDescending(x => x.VersVal)
- .ThenByDescending(x => x.ReleaseDate)
- .FirstOrDefault() ?? new ReleaseModel() { CodApp = CodApp };
- answ = lastRel.VersNum;
- // salvo su redis tab...
- await redisDb.HashSetAsync(currKey, CodApp, answ);
- }
- }
- return answ;
- }
-
///
/// Upsert record Release applicazione
///
diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj
index 523353c..d009c81 100644
--- a/LiMan.UI/LiMan.UI.csproj
+++ b/LiMan.UI/LiMan.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 2.1.2501.2907
+ 2.1.2501.2909
LiMan.UI
LiMan.UI
diff --git a/LiMan.UI/Program.cs b/LiMan.UI/Program.cs
index 43b94ba..b1c1e56 100644
--- a/LiMan.UI/Program.cs
+++ b/LiMan.UI/Program.cs
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
+using NLog;
using NLog.Web;
using System;
using System.Collections.Generic;
@@ -20,19 +21,14 @@ namespace LiMan.UI
{
webBuilder.UseStartup();
})
- .ConfigureLogging(logging =>
- {
- logging.ClearProviders();
- logging.SetMinimumLevel(LogLevel.Debug);
- })
- .UseNLog();
+ // importante x onorare i livelli di log impostati in appsettings.json
+ .UseNLog(new NLogAspNetCoreOptions() { RemoveLoggerFactoryFilter = false });
public static void Main(string[] args)
{
- // inclusione NLog:
- // https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-5
- // https://codewithmukesh.com/blog/logging-with-nlog-in-aspnet-core/
- var logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
+ var logger = LogManager.Setup()
+ .LoadConfigurationFromAppSettings()
+ .GetCurrentClassLogger();
try
{
logger.Info("LiMan.UI Application Starting Up");
@@ -48,7 +44,6 @@ namespace LiMan.UI
NLog.LogManager.Shutdown();
}
- //CreateHostBuilder(args).Build().Run();
}
#endregion Public Methods
diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html
index 5bdadfc..2a88e01 100644
--- a/LiMan.UI/Resources/ChangeLog.html
+++ b/LiMan.UI/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
License Manager
- Versione: 2.1.2501.2907
+ Versione: 2.1.2501.2909
Note di rilascio:
-
diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt
index 1e22251..2d9c15f 100644
--- a/LiMan.UI/Resources/VersNum.txt
+++ b/LiMan.UI/Resources/VersNum.txt
@@ -1 +1 @@
-2.1.2501.2907
+2.1.2501.2909
diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml
index 8cc3a19..2914bb0 100644
--- a/LiMan.UI/Resources/manifest.xml
+++ b/LiMan.UI/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 2.1.2501.2907
+ 2.1.2501.2909
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html
false
diff --git a/LiMan.UI/appsettings.json b/LiMan.UI/appsettings.json
index 3ffb87c..ef84657 100644
--- a/LiMan.UI/appsettings.json
+++ b/LiMan.UI/appsettings.json
@@ -2,10 +2,60 @@
"Logging": {
"LogLevel": {
"Default": "Information",
- "Microsoft": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
+ "Microsoft.AspNetCore": "Warning",
+ "Microsoft.AspNetCore.Components.RenderTree.Renderer": "Warning",
+ "Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository": "Warning",
+ "Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware": "Warning",
+ "Microsoft.AspNetCore.Hosting.Diagnostics": "Warning",
+ "Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsTransport": "Warning",
+ "Microsoft.AspNetCore.Server.Kestrel": "Warning",
+ "Microsoft.AspNetCore.SignalR.HubConnectionContext": "Warning",
+ "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher": "Warning",
+ "Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware": "Warning",
+ "Microsoft.WebTools.BrowserLink.Net.VsContentMiddleware": "Warning"
}
},
+ "NLog": {
+ "variables": {
+ "baseFileDir": "${basedir}/logs/",
+ "layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"
+ },
+ "extensions": [
+ { "assembly": "NLog.Extensions.Logging" },
+ { "assembly": "NLog.Web.AspNetCore" }
+ ],
+ "throwConfigExceptions": true,
+ "targets": {
+ "async": true,
+ "logfile": {
+ "type": "File",
+ "fileName": "${basedir}/logs/${shortdate}.log",
+ "archiveEvery": "Day",
+ "archiveFileName": "${basedir}/logs/old/${shortdate}_{#}.log",
+ "archiveNumbering": "DateAndSequence",
+ "archiveAboveSize": "1024000",
+ "archiveDateFormat": "HH",
+ "maxArchiveFiles": "60",
+ "maxArchiveDays": "30"
+ },
+ "logconsole": {
+ "type": "ColoredConsole",
+ "layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"
+ }
+ },
+ "rules": [
+ {
+ "logger": "*",
+ "minLevel": "Trace",
+ "writeTo": "logconsole"
+ },
+ {
+ "logger": "*",
+ "minLevel": "Info",
+ "writeTo": "logfile"
+ }
+ ]
+ },
"AllowedHosts": "*",
"ConnectionStrings": {
"LiMan.GLS": "Server=W2019-SQL-STEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;",
@@ -37,7 +87,7 @@
},
"RuntimeOpt": {
"BaseUrl": "/ELM.UI",
- "MultiRoleEnab": true
+ "MultiRoleEnab": true
},
"ApiUrl": "https://liman.egalware.com",
"HostOs": "Win"