Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bf93c4996 | |||
| 82248f1068 | |||
| b0c37aa79f | |||
| 967a4e0e2f | |||
| 361854f5b5 | |||
| 52d65add22 | |||
| b868660ed9 | |||
| 2bbfa4b6bf | |||
| 118e43f0c2 | |||
| 726df4d36c | |||
| 68204acddd | |||
| 2b2e258020 | |||
| 17bbaf2136 | |||
| b2fd3a39fa | |||
| f843aff337 | |||
| 13afc6464f | |||
| eb64db41da | |||
| 65e54aefbe | |||
| e44d1e04a2 | |||
| fa948fd5d0 | |||
| 30fa3b8444 | |||
| 35815c3a56 | |||
| 4585ac4bf8 | |||
| 70cd621f80 | |||
| 145a0f5c7e | |||
| 9bac691032 | |||
| ba7d395d20 | |||
| 3c07a3ae26 | |||
| ca5731d2e6 | |||
| f8426f304a | |||
| b9414c7a48 | |||
| 6c9c3d8d85 | |||
| 5df108a979 | |||
| f15b1694f7 | |||
| 30e37531a2 | |||
| 215383c630 | |||
| 5df5391030 | |||
| 530faf053f | |||
| 592034c9d4 | |||
| 2a2e31d087 | |||
| 419150a41f | |||
| fc4be10caa | |||
| 2413b27678 | |||
| 95ff88ac11 | |||
| 54d7e594f1 | |||
| 7900141bda | |||
| 13953a86d6 | |||
| 7f0ee8ad7f | |||
| 788112e54e | |||
| 0e8ec13e68 | |||
| 67fe028cb6 | |||
| 55f4ee077d | |||
| cc6b195aa3 |
+13
-9
@@ -111,6 +111,8 @@ WDC.Api:staging:
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
## IIS 02
|
||||
#- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WDC.UI:staging:
|
||||
stage: staging
|
||||
@@ -131,6 +133,8 @@ WDC.UI:staging:
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
## IIS 02
|
||||
#- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# ---------- DEPLOY ----------
|
||||
WDC.Api:deploy:
|
||||
@@ -151,10 +155,10 @@ WDC.Api:deploy:
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
# IIS 02
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
# IIS PROD
|
||||
- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
# IIS OVH PROD
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=steamware -p:Password=$WDC_IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
## IIS PROD
|
||||
#- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WDC.UI:deploy:
|
||||
stage: deploy
|
||||
@@ -171,11 +175,11 @@ WDC.UI:deploy:
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
# IIS EXT
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
# IIS INT
|
||||
- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# IIS OVH PROD
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=steamware -p:Password=$WDC_IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
## IIS PROD
|
||||
#- dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# ---------- RELEASE ----------
|
||||
WDC.Api:release:
|
||||
stage: release
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>WebDoorCreator - Egalware</i>
|
||||
<h4>Version: 0.9.2401.0415</h4>
|
||||
<h4>Version: 0.9.2403.0411</h4>
|
||||
<br /> Release note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2401.0415
|
||||
0.9.2403.0411
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2401.0415</version>
|
||||
<version>0.9.2403.0411</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -5,9 +5,10 @@ using Svg;
|
||||
using Svg.Skia;
|
||||
using System.Drawing;
|
||||
using WebDoorCreator.Data.Services;
|
||||
|
||||
#if false
|
||||
using SkiaSharp;
|
||||
using Svg.Skia;
|
||||
using Svg.Skia;
|
||||
#endif
|
||||
|
||||
namespace WebDoorCreator.API.Controllers
|
||||
@@ -18,11 +19,13 @@ namespace WebDoorCreator.API.Controllers
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public DoorImageController(IConfiguration configuration, QueueDataService DataService)
|
||||
public DoorImageController(IConfiguration configuration, QueueDataService cQDService, WebDoorCreatorService cWDCService)
|
||||
{
|
||||
Log.Info("Starting DoorImageController");
|
||||
_configuration = configuration;
|
||||
QDataServ = DataService;
|
||||
WaitReloadSvg = _configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
|
||||
QDService = cQDService;
|
||||
WDService = cWDCService;
|
||||
Log.Info("Avviato DoorImageController");
|
||||
}
|
||||
|
||||
@@ -37,12 +40,24 @@ namespace WebDoorCreator.API.Controllers
|
||||
return "OK";
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("GetImage.png")]
|
||||
public async Task<IActionResult> GetImagePng(int DoorId)
|
||||
{
|
||||
byte[] result = new byte[0];
|
||||
string svgContent = await QDataServ.DoorGetLastSvg(DoorId);
|
||||
string svgContent = await QDService.DoorGetLastSvg(DoorId);
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
// richiede ricalcolo img
|
||||
svgContent = await SendRecalcReq(DoorId);
|
||||
}
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
// legge img vuota
|
||||
svgContent = QDService.DoorGetMissingSvg();
|
||||
}
|
||||
// ora prosegue con conversione...
|
||||
if (!string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
using (var svg = new SKSvg())
|
||||
@@ -73,7 +88,15 @@ namespace WebDoorCreator.API.Controllers
|
||||
[HttpGet("GetImage.svg")]
|
||||
public async Task<IActionResult> GetImageSvg(int DoorId)
|
||||
{
|
||||
string svgContent = await QDataServ.DoorGetLastSvg(DoorId);
|
||||
string svgContent = await QDService.DoorGetLastSvg(DoorId);
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
// richiede ricalcolo img
|
||||
await SendRecalcReq(DoorId);
|
||||
// legge img vuota
|
||||
svgContent = QDService.DoorGetMissingSvg();
|
||||
}
|
||||
var result = System.Text.Encoding.UTF8.GetBytes(svgContent);
|
||||
return File(result, "image/svg+xml");
|
||||
}
|
||||
@@ -86,18 +109,48 @@ namespace WebDoorCreator.API.Controllers
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private int WaitReloadSvg = 100;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private QueueDataService QDataServ { get; set; } = null!;
|
||||
private QueueDataService QDService { get; set; } = null!;
|
||||
|
||||
private WebDoorCreatorService WDService { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio richiesta ricalcolo porta
|
||||
/// </summary>
|
||||
/// <param name="DoorId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> SendRecalcReq(int DoorId)
|
||||
{
|
||||
string answ = "";
|
||||
// richiede ricalcolo img
|
||||
List<string> doorIdList = new List<string>() { $"{DoorId}" };
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
|
||||
// recupero DDF ed invio x processing
|
||||
if (DoorId > 0)
|
||||
{
|
||||
string currDDF = await WDService.DoorOpGetDDF(DoorId);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
|
||||
}
|
||||
|
||||
// attende ...
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
// riprova lettura
|
||||
answ = await QDService.DoorGetLastSvg(DoorId);
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using WebDoorCreator.Core;
|
||||
using WebDoorCreator.Data.DTO;
|
||||
using WebDoorCreator.Data.Services;
|
||||
|
||||
@@ -13,11 +15,20 @@ namespace WebDoorCreator.API.Controllers
|
||||
|
||||
public QueueController(IConfiguration configuration, QueueDataService DataService, WebDoorCreatorService _WDService)
|
||||
{
|
||||
Log.Info("Starting QueueController");
|
||||
_configuration = configuration;
|
||||
logTimingEnable = configuration.GetValue<bool>("RuntimeOpt:LogTimingEnable");
|
||||
QDataServ = DataService;
|
||||
WDService = _WDService;
|
||||
Log.Info("Avviato QueueController");
|
||||
// aggiungo..
|
||||
string statName = "QueueController";
|
||||
bool doWrite = QDataServ.StatUpsert(statName, new TimeSpan(), 5).Result;
|
||||
// se campione "pieno"...
|
||||
if (doWrite)
|
||||
{
|
||||
// recupero e resetto
|
||||
ExecStats statRec = QDataServ.StatReset(statName).Result;
|
||||
Log.Trace($"Avviato QueueController x {statRec.NumCall}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -133,6 +144,7 @@ namespace WebDoorCreator.API.Controllers
|
||||
string answ = "NA";
|
||||
bool fatto = await QDataServ.SaveProcessingResult(calcResults);
|
||||
answ = fatto ? "OK" : "NO";
|
||||
Log.Debug("Eseguito SaveProcResult");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -143,6 +155,11 @@ namespace WebDoorCreator.API.Controllers
|
||||
[HttpGet("StatusList")]
|
||||
public async Task<Dictionary<string, Dictionary<string, string>>> StatusList()
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
Dictionary<string, Dictionary<string, string>> answ = new Dictionary<string, Dictionary<string, string>>();
|
||||
var actPend = await QDataServ.RequestPending();
|
||||
answ.Add("pending", actPend);
|
||||
@@ -155,6 +172,20 @@ namespace WebDoorCreator.API.Controllers
|
||||
|
||||
var actDone = await QDataServ.RequestDone();
|
||||
answ.Add("done", actDone);
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// aggiungo..
|
||||
string statName = "StatusList";
|
||||
bool doWrite = await QDataServ.StatUpsert(statName, sw.Elapsed, 5);
|
||||
// se campione "pieno"...
|
||||
if (doWrite)
|
||||
{
|
||||
// recupero e resetto
|
||||
ExecStats statRec = await QDataServ.StatReset(statName);
|
||||
Log.Info($"Eseguito {statName} x {statRec.NumCall} | {statRec.AvgTime.TotalMilliseconds:N3}ms");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -168,6 +199,7 @@ namespace WebDoorCreator.API.Controllers
|
||||
public async Task<Dictionary<string, string>> TakeProcessingItems(int numItems = 10)
|
||||
{
|
||||
var actQueue = await QDataServ.TakeProcessingItems(numItems);
|
||||
Log.Debug($"Eseguito TakeProcessingItems per {numItems} items");
|
||||
return actQueue;
|
||||
}
|
||||
|
||||
@@ -175,9 +207,10 @@ namespace WebDoorCreator.API.Controllers
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private IConfiguration _configuration = null!;
|
||||
|
||||
private bool logTimingEnable = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>https://wdc.egalware.com/SRV/swagger/index.html</SiteUrlToLaunchAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<MSDeployServiceURL>https://wdc-w-iis-01.ovh:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||
<DeployIisAppPath>wdc.egalware.com/SRV</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>true</EnableMSDeployBackup>
|
||||
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
|
||||
<UserName>steamware</UserName>
|
||||
<_SavePWD>true</_SavePWD>
|
||||
<_TargetId>IISWebDeploy</_TargetId>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAs/7D3mNhw0uqUXeNq4OiHAAAAAACAAAAAAADZgAAwAAAABAAAACWZ0w5h84UFtYYB4xT+4rFAAAAAASAAACgAAAAEAAAAIcwjcdAiCDZN1OwNWoZSfQYAAAAiyiNcp/zeuC6Vt16+OALvsaO0rbkiVMVFAAAAHS264wElPIM4sYvPHMhW0YsXNe9</EncryptedPassword>
|
||||
<History>True|2024-02-15T18:34:35.8362293Z;False|2024-02-15T19:33:47.6399861+01:00;True|2024-02-13T17:40:01.6315651+01:00;False|2024-02-13T17:37:21.2072257+01:00;False|2024-02-13T17:33:33.1471911+01:00;True|2023-05-22T15:37:00.8611764+02:00;True|2023-05-11T17:35:09.5858697+02:00;True|2022-01-27T10:34:09.2346456+01:00;True|2022-01-27T10:13:36.3080675+01:00;True|2022-01-27T10:05:45.6649507+01:00;True|2022-01-26T14:34:16.5263189+01:00;True|2022-01-26T13:04:22.2336648+01:00;False|2022-01-26T13:04:06.0677616+01:00;True|2021-11-08T09:03:37.7855257+01:00;True|2021-11-08T09:03:34.8263479+01:00;True|2021-11-08T09:03:31.8889390+01:00;True|2021-10-29T16:19:33.6539408+02:00;True|2021-10-29T16:19:28.2082360+02:00;True|2021-10-26T16:12:11.7740950+02:00;True|2021-10-26T16:11:56.2014641+02:00;True|2021-10-26T16:11:22.2897842+02:00;False|2021-10-26T16:10:58.3733037+02:00;False|2021-10-26T16:10:29.4793991+02:00;True|2021-10-21T17:35:11.9761128+02:00;True|2021-10-18T20:22:00.9305399+02:00;True|2021-10-18T18:32:29.4558070+02:00;True|2021-10-18T18:32:22.8950294+02:00;True|2021-10-18T18:16:13.7563877+02:00;True|2021-10-18T18:15:48.5678387+02:00;True|2021-10-18T12:45:45.7228681+02:00;True|2021-10-18T12:14:22.3221605+02:00;True|2021-10-18T12:14:15.7373530+02:00;True|2021-10-18T12:10:43.8607301+02:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -8,6 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-OVH-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
@@ -15,6 +16,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IIS-OVH-PROD.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -38,6 +40,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Reports\Report.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"WDC.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
"Redis": "wdc-u-redis-01.ovh:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"WDC.DB": "Server=WDC-W-SQL-01\\SQLEXPRESS;Database=DCA_WebDoorCreator; User ID=steamware;Password=viadante16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
},
|
||||
"MailDest": {
|
||||
"Admin": "samuele@steamware.net",
|
||||
"ProjCheck": "samuele.locatelli@egalware.com,mara.baroni@egalware.com",
|
||||
"TimbCheck": "samuele.locatelli@egalware.com,mara.baroni@egalware.com"
|
||||
"ProjCheck": "samuele.locatelli@egalware.com",
|
||||
"TimbCheck": "samuele.locatelli@egalware.com"
|
||||
},
|
||||
"RuntimeOpt": {
|
||||
"VetoRemoveProcessing": 5
|
||||
"WaitReloadSvg": 200,
|
||||
"VetoRemoveProcessing": 5,
|
||||
"StatSampleSize": 30,
|
||||
"LogTimingEnable": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@ namespace WebDoorCreator.Core
|
||||
public static readonly string CALC_REQ_DDF_CACHE = $"{BASE_HASH}:CalcRequests:CacheDDF";
|
||||
public static readonly string CALC_REQ_SVG_CACHE = $"{BASE_HASH}:CalcRequests:CacheSVG";
|
||||
public static readonly string DOOR_TPL_LIST = $"{BASE_HASH}:Template:DoorList";
|
||||
|
||||
|
||||
// REDIS KEY dati x registrazione statistiche esecuzione
|
||||
public static readonly string STATS_DATA = $"{BASE_HASH}:CallStats";
|
||||
|
||||
// REDIS Channels messaggi x QueueMan (verso UI/srv)
|
||||
public static readonly string CALC_REQ_QUEUE = $"CalcRequest";
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Core
|
||||
{
|
||||
public class ExecStats
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Numero chiamate registrate
|
||||
/// </summary>
|
||||
public int NumCall { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Durata totale chiamate
|
||||
/// </summary>
|
||||
public TimeSpan TotalTime { get; set; } = new TimeSpan(0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Tempo medio (calcolato)
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public TimeSpan AvgTime
|
||||
{
|
||||
get
|
||||
{
|
||||
TimeSpan answ = TotalTime;
|
||||
if (NumCall > 1)
|
||||
{
|
||||
answ = TotalTime / NumCall;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Init classe
|
||||
/// </summary>
|
||||
/// <param name="numCall"></param>
|
||||
/// <param name="duration"></param>
|
||||
public ExecStats(int numCall, TimeSpan duration)
|
||||
{
|
||||
this.NumCall = numCall;
|
||||
this.TotalTime = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="ReportViewerCore.NETCore" Version="15.1.17" />
|
||||
<PackageReference Include="ToDataTable" Version="0.1.2" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using NLog.LayoutRenderers.Wrappers;
|
||||
using StackExchange.Redis;
|
||||
using System.Diagnostics;
|
||||
using WebDoorCreator.Core;
|
||||
@@ -45,6 +46,14 @@ namespace WebDoorCreator.Data.Services
|
||||
};
|
||||
// leggo conf speciali
|
||||
vetoRemoveProcSec = _configuration.GetValue<int>("RuntimeOpt:VetoRemoveProcessing");
|
||||
logTimingEnable = configuration.GetValue<bool>("RuntimeOpt:LogTimingEnable");
|
||||
statSampleSize = configuration.GetValue<int>("RuntimeOpt:StatSampleSize");
|
||||
// fix dati img missing...
|
||||
missingFilePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
|
||||
if (File.Exists(missingFilePath))
|
||||
{
|
||||
missingSvgContent = File.ReadAllText(missingFilePath);
|
||||
}
|
||||
Log.Info("QueueDataService started!");
|
||||
}
|
||||
|
||||
@@ -179,16 +188,42 @@ namespace WebDoorCreator.Data.Services
|
||||
answ = $"{rawData}";
|
||||
}
|
||||
}
|
||||
#if false
|
||||
// se non trovata --> missing!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
// 2024.02.15: se mancasse, provo a richiedere ricalcolo porta... se poi arriva, la
|
||||
// pagina in ascolto l'avrà aggiornata
|
||||
|
||||
// leggo missing standard...
|
||||
string missingFilePath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
|
||||
string missingFilePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
|
||||
if (File.Exists(missingFilePath))
|
||||
{
|
||||
answ = File.ReadAllText(missingFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce SVG dell'immagine missing...
|
||||
/// </summary>
|
||||
/// <param name="DoorId"></param>
|
||||
/// <returns></returns>
|
||||
public string DoorGetMissingSvg()
|
||||
{
|
||||
string answ = missingSvgContent;
|
||||
if(string.IsNullOrEmpty(answ))
|
||||
{
|
||||
// fix dati img missing...
|
||||
missingFilePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
|
||||
if (File.Exists(missingFilePath))
|
||||
{
|
||||
missingSvgContent = File.ReadAllText(missingFilePath);
|
||||
answ = missingSvgContent;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -209,13 +244,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
|
||||
public async Task<Dictionary<string, string>> DoorRefreshStatus()
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.LAST_DOOR_REFR_KEY);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -225,9 +262,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{item.Name}", $"{item.Value}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"DoorRefreshStatus | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("DoorRefreshStatus", sw.Elapsed, 1, 0.3);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -265,7 +305,7 @@ namespace WebDoorCreator.Data.Services
|
||||
{
|
||||
bool found = false;
|
||||
RedisKey currKey = new RedisKey(Constants.DOOR_TPL_LIST);
|
||||
var rawVal = await RedHashGetString(currKey, DoorId);
|
||||
var rawVal = await RedHashGetString(currKey, DoorId, true);
|
||||
found = !string.IsNullOrEmpty(rawVal) && (rawVal == DoorId);
|
||||
return found;
|
||||
}
|
||||
@@ -304,12 +344,18 @@ namespace WebDoorCreator.Data.Services
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_DONE);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"NumRequestDone | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("NumRequestDone", sw.Elapsed, 2, 10);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
|
||||
@@ -323,12 +369,18 @@ namespace WebDoorCreator.Data.Services
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_ERRS);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"NumRequestErrors | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("NumRequestErrors", sw.Elapsed, 2, 10);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
|
||||
@@ -342,12 +394,18 @@ namespace WebDoorCreator.Data.Services
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PEND);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"NumRequestPending | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("NumRequestPending", sw.Elapsed, 2, 10);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
|
||||
@@ -361,12 +419,18 @@ namespace WebDoorCreator.Data.Services
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"NumRequestProcessing | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("NumRequestProcessing", sw.Elapsed, 2, 10);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
|
||||
@@ -379,8 +443,11 @@ namespace WebDoorCreator.Data.Services
|
||||
public async Task<int> RedHashGetInt(RedisKey currKey, string chiave)
|
||||
{
|
||||
int result = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
var hasVal = await redisDb.HashExistsAsync(currKey, chiave);
|
||||
if (hasVal)
|
||||
{
|
||||
@@ -390,9 +457,12 @@ namespace WebDoorCreator.Data.Services
|
||||
int.TryParse($"{rawRes}", out result);
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"RedHashGetInt | {currKey} | in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashGetInt", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -401,12 +471,16 @@ namespace WebDoorCreator.Data.Services
|
||||
/// </summary>
|
||||
/// <param name="currKey">Redis Key for Hashlist</param>
|
||||
/// <param name="chiave">Requested key on list</param>
|
||||
/// <param name="doTimeLog">Execute time log processing</param>
|
||||
/// <returns>Value as string</returns>
|
||||
public async Task<string> RedHashGetString(RedisKey currKey, string chiave)
|
||||
public async Task<string> RedHashGetString(RedisKey currKey, string chiave, bool doTimeLog)
|
||||
{
|
||||
string result = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
var hasVal = await redisDb.HashExistsAsync(currKey, chiave);
|
||||
if (hasVal)
|
||||
{
|
||||
@@ -416,9 +490,12 @@ namespace WebDoorCreator.Data.Services
|
||||
result = $"{rawRes}";
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"RedHashGetString | {currKey} | in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashGetString", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -431,15 +508,48 @@ namespace WebDoorCreator.Data.Services
|
||||
public async Task<bool> RedHashRemove(RedisKey currKey, string chiave)
|
||||
{
|
||||
bool fatto = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
fatto = await redisDb.HashDeleteAsync(currKey, chiave);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"RedHashRemove | {currKey} | in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashRemove", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua upsert in HasList redis
|
||||
/// </summary>
|
||||
/// <param name="currKey">Chiave redis della Hashlist</param>
|
||||
/// <param name="chiave">Chiave nella HashList</param>
|
||||
/// <param name="valore">Valore da salvare</param>
|
||||
/// <param name="doTimeLog">Gestione log time abilitata</param>
|
||||
/// <returns>Num record nella HashList</returns>
|
||||
public async Task<long> RedHashUpsert(RedisKey currKey, string chiave, string valore, bool doTimeLog = true)
|
||||
{
|
||||
long numReq = 0;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
await redisDb.HashSetAsync(currKey, chiave, valore);
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashUpsert", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice gli errori della porta in oggetto
|
||||
/// </summary>
|
||||
@@ -462,13 +572,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
|
||||
public async Task<Dictionary<string, string>> RequestDone()
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_DONE);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -478,9 +590,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{item.Name}", $"{item.Value}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"RequestDone | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RequestDone", sw.Elapsed, 1, 10);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -491,13 +606,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns></returns>
|
||||
public async Task<Dictionary<string, string>> RequestDoneGetSingle(int DoorId)
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_DONE);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -507,9 +624,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{DoorId}", $"{rawData}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"RequestDoneGetSingle | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RequestDoneGetSingle", sw.Elapsed, 1, 0.3);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -541,13 +661,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
|
||||
public async Task<Dictionary<string, string>> RequestErr()
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_ERRS);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -557,9 +679,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{item.Name}", $"{item.Value}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"RequestErr | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RequestErr", sw.Elapsed, 1, 10);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -591,13 +716,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
|
||||
public async Task<Dictionary<string, string>> RequestPending()
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PEND);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -607,9 +734,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{item.Name}", $"{item.Value}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"RequestPending | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RequestPending", sw.Elapsed, 1, 10);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -641,13 +771,15 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
|
||||
public async Task<Dictionary<string, string>> RequestProcessing()
|
||||
{
|
||||
string source = "REDIS";
|
||||
long numReq = 0;
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
{
|
||||
@@ -657,9 +789,12 @@ namespace WebDoorCreator.Data.Services
|
||||
dictResult.Add($"{item.Name}", $"{item.Value}");
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"RequestProcessing | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RequestProcessing", sw.Elapsed, 1, 10);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -695,9 +830,11 @@ namespace WebDoorCreator.Data.Services
|
||||
public async Task<bool> ResetQueue()
|
||||
{
|
||||
bool fatto = false;
|
||||
await Task.Delay(1);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
// cerco le richieste processing
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
|
||||
var rawData = await redisDb.HashGetAllAsync(currKey);
|
||||
@@ -725,9 +862,12 @@ namespace WebDoorCreator.Data.Services
|
||||
await RequestDoneRemove(item.Name!);
|
||||
fatto = true;
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ResetQueue | REDIS EXEC in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("ResetQueue", sw.Elapsed, 1, 0.3);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -739,8 +879,11 @@ namespace WebDoorCreator.Data.Services
|
||||
{
|
||||
int num2proc = DoorIdList.Count;
|
||||
List<string> listDone = new List<string>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
// cerco le richieste processing
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
|
||||
var rawData = await redisDb.HashGetAllAsync(currKey);
|
||||
@@ -787,9 +930,11 @@ namespace WebDoorCreator.Data.Services
|
||||
DoorIdList.Remove(item);
|
||||
}
|
||||
#endif
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ResetQueueByDoorList | doors #: {num2proc} --> {DoorIdList.Count} | EXEC in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
Log.Debug($"ResetQueueByDoorList | doors #: {num2proc} --> {DoorIdList.Count} | EXEC in: {sw.Elapsed.TotalMilliseconds} ms");
|
||||
}
|
||||
return DoorIdList;
|
||||
}
|
||||
|
||||
@@ -801,8 +946,11 @@ namespace WebDoorCreator.Data.Services
|
||||
{
|
||||
bool fatto = false;
|
||||
await Task.Delay(1);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
// cerco le richieste processing
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
|
||||
RedisKey currVetoKey = new RedisKey($"{Constants.CALC_REQ_PROC}:0");
|
||||
@@ -819,9 +967,12 @@ namespace WebDoorCreator.Data.Services
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ResetQueueProcessing | REDIS EXEC in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("ResetQueueProcessing", sw.Elapsed, 1, 10);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -858,7 +1009,8 @@ namespace WebDoorCreator.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, WeekLongCache);
|
||||
// 2024.02.15 salvo in cache x 2 settimane, fare 1+ mesi?!?
|
||||
await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, DblWeekLongCache);
|
||||
}
|
||||
// elimino dalle code proc/err
|
||||
await RequestProcessingRemove(sDoorId);
|
||||
@@ -904,8 +1056,11 @@ namespace WebDoorCreator.Data.Services
|
||||
/// <returns>indice/versione del calcolo DDF</returns>
|
||||
public async Task<int> SendCalcReq(int DoorId, string FullDDF)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
string sDoorId = $"{DoorId}";
|
||||
int currVers = await DoorCalcRev(sDoorId);
|
||||
string sCurrVers = $"{currVers}";
|
||||
@@ -915,18 +1070,91 @@ namespace WebDoorCreator.Data.Services
|
||||
// salvo nell'archivio REDIS delle porte il DDF corrente (key=doorId.versNumb), potrebbe
|
||||
// venire buono anche x eventuale UNDO...
|
||||
RedisKey currDdfKey = new RedisKey($"{Constants.CALC_REQ_DDF_CACHE}:{sDoorId}:{sCurrVers}");
|
||||
await redisDb.StringSetAsync(currDdfKey, FullDDF, WeekLongCache);
|
||||
await redisDb.StringSetAsync(currDdfKey, FullDDF, DblWeekLongCache);
|
||||
|
||||
// invio sul canale dei messaggi il numero di items in coda attuali x chiedere esecuzione...
|
||||
long numPending = await NumRequestPending();
|
||||
bool answ = CalcReqPipe.saveAndSendMessage(Constants.LAST_CALC_REQ_KEY, $"{numPending}");
|
||||
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"SendCalcReq | DoorId: {DoorId} enqueued in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
Log.Debug($"SendCalcReq | DoorId: {DoorId} enqueued in: {sw.Elapsed.TotalMilliseconds} ms");
|
||||
}
|
||||
return currVers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce dati statistica richiesta
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <returns></returns>
|
||||
public async Task<ExecStats> StatGetAsync(string statName)
|
||||
{
|
||||
ExecStats answ = new ExecStats(0, new TimeSpan());
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
// cerco nella hashTable...
|
||||
var rawData = await RedHashGetString(currKey, statName, false);
|
||||
// se c'è rileggo ed aggiorno
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var currStat = JsonConvert.DeserializeObject<ExecStats>(rawData);
|
||||
if (currStat != null)
|
||||
{
|
||||
answ = currStat;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resetta dati statistica esecuzione x log restituendo i valori precedentemente contenuti
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <returns></returns>
|
||||
public async Task<ExecStats> StatReset(string statName)
|
||||
{
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
ExecStats answ = await StatGetAsync(statName);
|
||||
// ora rimuovo valore
|
||||
await RedHashRemove(currKey, statName);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua upsert dati statistica esecuzione x log
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <param name="duration">Durata esecuzione come timespan</param>
|
||||
/// <param name="evMultipl">moltiplicatore soglia x log statistica (default = 1)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> StatUpsert(string statName, TimeSpan duration, double evMultipl)
|
||||
{
|
||||
bool answ = false;
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
// cerco nella hashTable...
|
||||
var rawData = await RedHashGetString(currKey, statName, false);
|
||||
// di default inizializzo a null...
|
||||
ExecStats newStat = new ExecStats(1, duration);
|
||||
// se c'è rileggo ed aggiorno
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var currStat = JsonConvert.DeserializeObject<ExecStats>(rawData);
|
||||
if (currStat != null)
|
||||
{
|
||||
currStat.NumCall++;
|
||||
currStat.TotalTime += duration;
|
||||
newStat = currStat;
|
||||
}
|
||||
}
|
||||
// ora aggiorno su redis
|
||||
rawData = JsonConvert.SerializeObject(newStat);
|
||||
var numRec = await RedHashUpsert(currKey, statName, rawData, false);
|
||||
// verifico se da considerare superato limite sample
|
||||
answ = newStat.NumCall >= (int)(statSampleSize * evMultipl);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Queue request pending, removing from queue and putting on processing queue
|
||||
/// </summary>
|
||||
@@ -938,8 +1166,11 @@ namespace WebDoorCreator.Data.Services
|
||||
Dictionary<string, string> dictResult = new Dictionary<string, string>();
|
||||
// cerco da cache
|
||||
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PEND);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
// calcolo il totale delle richieste pending
|
||||
numReq = redisDb.HashLength(currKey);
|
||||
if (numReq > 0)
|
||||
@@ -971,9 +1202,12 @@ namespace WebDoorCreator.Data.Services
|
||||
// sblocco
|
||||
queueLock = false;
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"TakeProcessingItems | REDIS in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("TakeProcessingItems", sw.Elapsed, 1, 0.3);
|
||||
}
|
||||
return dictResult;
|
||||
}
|
||||
|
||||
@@ -982,7 +1216,9 @@ namespace WebDoorCreator.Data.Services
|
||||
#region Protected Fields
|
||||
|
||||
protected const string rKeyCalcOreFase = "Check:OreFasi";
|
||||
|
||||
protected const string rKeyFasiAct = "Check:FasiAct";
|
||||
|
||||
protected const string rKeyProjAct = "Check:ProjAct";
|
||||
|
||||
/// <summary>
|
||||
@@ -991,6 +1227,7 @@ namespace WebDoorCreator.Data.Services
|
||||
protected const int shortTTL = 60 * 5;
|
||||
|
||||
protected int idxSim = 0;
|
||||
|
||||
protected Random rnd = new Random();
|
||||
|
||||
#endregion Protected Fields
|
||||
@@ -1086,26 +1323,6 @@ namespace WebDoorCreator.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua upsert in HasList redis
|
||||
/// </summary>
|
||||
/// <param name="currKey">Chiave redis della Hashlist</param>
|
||||
/// <param name="chiave">Chiave nella HashList</param>
|
||||
/// <param name="valore">Valore da salvare</param>
|
||||
/// <returns>Num record nella HashList</returns>
|
||||
protected async Task<long> RedHashUpsert(RedisKey currKey, string chiave, string valore)
|
||||
{
|
||||
long numReq = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
await redisDb.HashSetAsync(currKey, chiave, valore);
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"RedHashUpsert | {currKey} | in: {ts.TotalMilliseconds} ms");
|
||||
return numReq;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salvataggio chiave in redis
|
||||
/// </summary>
|
||||
@@ -1116,8 +1333,7 @@ namespace WebDoorCreator.Data.Services
|
||||
protected async Task<bool> setRSV(string rKey, string rVal, int ttlSec)
|
||||
{
|
||||
bool fatto = false;
|
||||
await redisDb.StringSetAsync(rKey, rVal, TimeSpan.FromSeconds(ttlSec));
|
||||
fatto = true;
|
||||
fatto = await redisDb.StringSetAsync(rKey, rVal, TimeSpan.FromSeconds(ttlSec));
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -1131,8 +1347,7 @@ namespace WebDoorCreator.Data.Services
|
||||
protected async Task<bool> setRSV(string rKey, int rValInt, int ttlSec)
|
||||
{
|
||||
bool fatto = false;
|
||||
await redisDb.StringSetAsync(rKey, rValInt, TimeSpan.FromSeconds(ttlSec));
|
||||
fatto = true;
|
||||
fatto = await redisDb.StringSetAsync(rKey, rValInt, TimeSpan.FromSeconds(ttlSec));
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -1153,8 +1368,16 @@ namespace WebDoorCreator.Data.Services
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static JsonSerializerSettings? JSSettings;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Dimensione campione da registrare e trascrivere in log
|
||||
/// </summary>
|
||||
private static int statSampleSize = 1;
|
||||
|
||||
private readonly IEmailSender _emailSender;
|
||||
|
||||
/// <summary>
|
||||
@@ -1172,6 +1395,20 @@ namespace WebDoorCreator.Data.Services
|
||||
/// </summary>
|
||||
private int cacheTtlShort = 60 * 1;
|
||||
|
||||
/// <summary>
|
||||
/// abilitazione time log con stopwatch
|
||||
/// </summary>
|
||||
private bool logTimingEnable = false;
|
||||
|
||||
/// <summary>
|
||||
/// Path dell'immagine "missing"
|
||||
/// </summary>
|
||||
private string missingFilePath = "";
|
||||
/// <summary>
|
||||
/// Contenuto SVG dell'immagine missing
|
||||
/// </summary>
|
||||
private string missingSvgContent = "";
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
@@ -1194,6 +1431,14 @@ namespace WebDoorCreator.Data.Services
|
||||
get => TimeSpan.FromHours(24);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache di 2 settimane/15gg
|
||||
/// </summary>
|
||||
private TimeSpan DblWeekLongCache
|
||||
{
|
||||
get => TimeSpan.FromHours(24 * 15 * rnd.Next(1000, 1100) / 1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
|
||||
/// </summary>
|
||||
@@ -1269,6 +1514,60 @@ namespace WebDoorCreator.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa log statistiche:
|
||||
/// - accumula dati
|
||||
/// - se superata soglia (soglia x evMultipl) registra log
|
||||
/// </summary>
|
||||
/// <param name="statName">nome statistica</param>
|
||||
/// <param name="elapsed">durata evento tracciato</param>
|
||||
/// <param name="logLevReq">
|
||||
/// livello richiesto: 0:trace, 1:debug, 2:info, 3:warn, 4:error, 5: fatal, 6: off
|
||||
/// </param>
|
||||
/// <param name="evMultipl">moltiplicatore soglia x log statistica (default = 1)</param>
|
||||
/// <returns></returns>
|
||||
private async Task ProcStatLog(string statName, TimeSpan elapsed, int logLevReq, double evMultipl)
|
||||
{
|
||||
bool doWrite = await StatUpsert(statName, elapsed, evMultipl);
|
||||
if (doWrite)
|
||||
{
|
||||
// recupero e resetto
|
||||
ExecStats statRec = await StatReset(statName);
|
||||
string logMsg = $"Eseguito {statName} x {statRec.NumCall} | {statRec.AvgTime.TotalMilliseconds:N3}ms";
|
||||
switch (logLevReq)
|
||||
{
|
||||
case 0:
|
||||
Log.Trace(logMsg);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Log.Debug(logMsg);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Log.Info(logMsg);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Log.Warn(logMsg);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
Log.Error(logMsg);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Log.Fatal(logMsg);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
default:
|
||||
Log.Error(logMsg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,9 @@ namespace WebDoorCreator.Data.Services
|
||||
{
|
||||
dbController = new WebDoorCreatorController(configuration);
|
||||
}
|
||||
|
||||
// conf log
|
||||
logTimingEnable = configuration.GetValue<bool>("RuntimeOpt:LogTimingEnable");
|
||||
statSampleSize = configuration.GetValue<int>("RuntimeOpt:StatSampleSize");
|
||||
// conf serializzatore DDF...
|
||||
string vers = _configuration.GetValue<string>("ConfDDF:VersNumber");
|
||||
bool remDoorOp = _configuration.GetValue<bool>("ConfDDF:RemoveDoorOps");
|
||||
@@ -66,6 +68,252 @@ namespace WebDoorCreator.Data.Services
|
||||
Log.Info("WebDoorCreatorService started!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// abilitazione time log con stopwatch
|
||||
/// </summary>
|
||||
private bool logTimingEnable = false;
|
||||
/// <summary>
|
||||
/// Dimensione campione da registrare e trascrivere in log
|
||||
/// </summary>
|
||||
private static int statSampleSize = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Processa log statistiche:
|
||||
/// - accumula dati
|
||||
/// - se superata soglia (soglia x evMultipl) registra log
|
||||
/// </summary>
|
||||
/// <param name="statName">nome statistica</param>
|
||||
/// <param name="elapsed">durata evento tracciato</param>
|
||||
/// <param name="logLevReq">
|
||||
/// livello richiesto: 0:trace, 1:debug, 2:info, 3:warn, 4:error, 5: fatal, 6: off
|
||||
/// </param>
|
||||
/// <param name="evMultipl">moltiplicatore soglia x log statistica (default = 1)</param>
|
||||
/// <returns></returns>
|
||||
private async Task ProcStatLog(string statName, TimeSpan elapsed, int logLevReq, double evMultipl)
|
||||
{
|
||||
bool doWrite = await StatUpsert(statName, elapsed, evMultipl);
|
||||
if (doWrite)
|
||||
{
|
||||
// recupero e resetto
|
||||
ExecStats statRec = await StatReset(statName);
|
||||
string logMsg = $"Eseguito {statName} x {statRec.NumCall} | {statRec.AvgTime.TotalMilliseconds:N3}ms";
|
||||
switch (logLevReq)
|
||||
{
|
||||
case 0:
|
||||
Log.Trace(logMsg);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Log.Debug(logMsg);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Log.Info(logMsg);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Log.Warn(logMsg);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
Log.Error(logMsg);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Log.Fatal(logMsg);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
default:
|
||||
Log.Error(logMsg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua upsert dati statistica esecuzione x log
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <param name="duration">Durata esecuzione come timespan</param>
|
||||
/// <param name="evMultipl">moltiplicatore soglia x log statistica (default = 1)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> StatUpsert(string statName, TimeSpan duration, double evMultipl)
|
||||
{
|
||||
bool answ = false;
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
// cerco nella hashTable...
|
||||
var rawData = await RedHashGetString(currKey, statName, false);
|
||||
// di default inizializzo a null...
|
||||
ExecStats newStat = new ExecStats(1, duration);
|
||||
// se c'è rileggo ed aggiorno
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var currStat = JsonConvert.DeserializeObject<ExecStats>(rawData);
|
||||
if (currStat != null)
|
||||
{
|
||||
currStat.NumCall++;
|
||||
currStat.TotalTime += duration;
|
||||
newStat = currStat;
|
||||
}
|
||||
}
|
||||
// ora aggiorno su redis
|
||||
rawData = JsonConvert.SerializeObject(newStat);
|
||||
var numRec = await RedHashUpsert(currKey, statName, rawData, false);
|
||||
// verifico se da considerare superato limite sample
|
||||
answ = newStat.NumCall >= (int)(statSampleSize * evMultipl);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua upsert in HasList redis
|
||||
/// </summary>
|
||||
/// <param name="currKey">Chiave redis della Hashlist</param>
|
||||
/// <param name="chiave">Chiave nella HashList</param>
|
||||
/// <param name="valore">Valore da salvare</param>
|
||||
/// <param name="doTimeLog">Gestione log time abilitata</param>
|
||||
/// <returns>Num record nella HashList</returns>
|
||||
public async Task<long> RedHashUpsert(RedisKey currKey, string chiave, string valore, bool doTimeLog = true)
|
||||
{
|
||||
long numReq = 0;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
await redisDb.HashSetAsync(currKey, chiave, valore);
|
||||
numReq = await redisDb.HashLengthAsync(currKey);
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashUpsert", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return numReq;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce dati statistica richiesta
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <returns></returns>
|
||||
public async Task<ExecStats> StatGetAsync(string statName)
|
||||
{
|
||||
ExecStats answ = new ExecStats(0, new TimeSpan());
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
// cerco nella hashTable...
|
||||
var rawData = await RedHashGetString(currKey, statName, false);
|
||||
// se c'è rileggo ed aggiorno
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var currStat = JsonConvert.DeserializeObject<ExecStats>(rawData);
|
||||
if (currStat != null)
|
||||
{
|
||||
answ = currStat;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Resetta dati statistica esecuzione x log restituendo i valori precedentemente contenuti
|
||||
/// </summary>
|
||||
/// <param name="statName">Nome statistica</param>
|
||||
/// <returns></returns>
|
||||
public async Task<ExecStats> StatReset(string statName)
|
||||
{
|
||||
RedisKey currKey = new RedisKey(Constants.STATS_DATA);
|
||||
ExecStats answ = await StatGetAsync(statName);
|
||||
// ora rimuovo valore
|
||||
await RedHashRemove(currKey, statName);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get single hash record
|
||||
/// </summary>
|
||||
/// <param name="currKey">Redis Key for Hashlist</param>
|
||||
/// <param name="chiave">Requested key on list</param>
|
||||
/// <returns>Value as Int</returns>
|
||||
public async Task<int> RedHashGetInt(RedisKey currKey, string chiave)
|
||||
{
|
||||
int result = 0;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
var hasVal = await redisDb.HashExistsAsync(currKey, chiave);
|
||||
if (hasVal)
|
||||
{
|
||||
var rawRes = await redisDb.HashGetAsync(currKey, chiave);
|
||||
if (rawRes.HasValue)
|
||||
{
|
||||
int.TryParse($"{rawRes}", out result);
|
||||
}
|
||||
}
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashGetInt", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get single hash record
|
||||
/// </summary>
|
||||
/// <param name="currKey">Redis Key for Hashlist</param>
|
||||
/// <param name="chiave">Requested key on list</param>
|
||||
/// <param name="doTimeLog">Execute time log processing</param>
|
||||
/// <returns>Value as string</returns>
|
||||
public async Task<string> RedHashGetString(RedisKey currKey, string chiave, bool doTimeLog)
|
||||
{
|
||||
string result = "";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
var hasVal = await redisDb.HashExistsAsync(currKey, chiave);
|
||||
if (hasVal)
|
||||
{
|
||||
var rawRes = await redisDb.HashGetAsync(currKey, chiave);
|
||||
if (rawRes.HasValue)
|
||||
{
|
||||
result = $"{rawRes}";
|
||||
}
|
||||
}
|
||||
if (logTimingEnable && doTimeLog)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashGetString", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove for single hash record
|
||||
/// </summary>
|
||||
/// <param name="currKey">Chiave redis della Hashlist</param>
|
||||
/// <param name="chiave">Chiave nella HashList</param>
|
||||
/// <returns>Esito rimozione</returns>
|
||||
public async Task<bool> RedHashRemove(RedisKey currKey, string chiave)
|
||||
{
|
||||
bool fatto = false;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
fatto = await redisDb.HashDeleteAsync(currKey, chiave);
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("RedHashRemove", sw.Elapsed, 0, 0.3);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
@@ -1153,18 +1401,22 @@ namespace WebDoorCreator.Data.Services
|
||||
List<DoorModel>? dbResult = new List<DoorModel>();
|
||||
try
|
||||
{
|
||||
await Task.Delay(1);
|
||||
string source = "DB";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Start();
|
||||
}
|
||||
dbResult = dbController.DoorGet2Del();
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new List<DoorModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"DoorGet2Del | {source} in: {ts.TotalMilliseconds} ms");
|
||||
if (logTimingEnable)
|
||||
{
|
||||
sw.Stop();
|
||||
// gestione statistiche
|
||||
await ProcStatLog("DoorGet2Del", sw.Elapsed, 2, 1);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace WebDoorCreator.Data
|
||||
// Default seeded users
|
||||
builder.HasData(
|
||||
// SuperAdmins
|
||||
getNewTestRec("zaccaria.majid@egalware.com", "th1sIsTh3R1vrOfThNgt98"),
|
||||
getNewTestRec("samuele.locatelli@egalware.com", "th1sIsTh3R1vrOfThNgt96"),
|
||||
getNewTestRec("emmanuele.sassi@egalware.com", "th1sIsTh3R1vrOfThNgt98!"),
|
||||
// Admin
|
||||
getNewTestRec("zaccaria.majid01@egalware.com", "th1sIsTh3R1vrOfThNgt94"),
|
||||
getNewTestRec("zaccaria.majid02@egalware.com", "th1sIsTh3R1vrOfThNgt92")
|
||||
getNewTestRec("marco.locatelli@egalware.com", "th1sIsTh3R1vrOfThNgt94"),
|
||||
getNewTestRec("samuele@steamware.net", "th1sIsTh3R1vrOfThNgt92")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,10 @@ namespace WebDoorCreator.Data
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
#if false
|
||||
public WDCDataContext()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
public WDCDataContext(IConfiguration configuration)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 01A");
|
||||
Log.Trace("WDCDataContext starting 01A");
|
||||
_configuration = configuration;
|
||||
try
|
||||
{
|
||||
@@ -38,7 +33,7 @@ namespace WebDoorCreator.Data
|
||||
|
||||
public WDCDataContext(DbContextOptions<WDCDataContext> options, IConfiguration configuration) : base(options)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 01B");
|
||||
Log.Trace("WDCDataContext starting 01B");
|
||||
_configuration = configuration;
|
||||
// verifico SE devo eseguire la migration del DB IDENT...
|
||||
bool disableMigrate = _configuration.GetValue<bool>("SetupOpt:DisableWDCMigrate");
|
||||
@@ -113,7 +108,7 @@ namespace WebDoorCreator.Data
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 02");
|
||||
Log.Trace("WDCDataContext starting 02");
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("WDC.DB");
|
||||
@@ -134,6 +129,7 @@ namespace WebDoorCreator.Data
|
||||
// hierarchId eliminato
|
||||
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=WebDoorCreator;Trusted_Connection=True;");
|
||||
}
|
||||
Log.Trace("WDCDataContext starting 03");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2307.3111" />
|
||||
<PackageReference Include="MailKit" Version="3.5.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.14">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.27">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
@attribute [IgnoreAntiforgeryToken]
|
||||
@inject SignInManager<IdentityUser> SignInManager
|
||||
@functions {
|
||||
public async Task<IActionResult> OnPost()
|
||||
public async Task<IActionResult> OnPost(string returnUrl = null)
|
||||
{
|
||||
returnUrl ??= Url.Content("~/");
|
||||
if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
await SignInManager.SignOutAsync();
|
||||
}
|
||||
|
||||
return Redirect("~/");
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,10 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
|
||||
public async Task OnGetAsync(string returnUrl = null)
|
||||
{
|
||||
await CheckSuperAdmin();
|
||||
if (_configuration.GetValue<bool>("SetupOpt:CheckAdmUser"))
|
||||
{
|
||||
await CheckSuperAdmin();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ErrorMessage))
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, ErrorMessage);
|
||||
@@ -111,7 +114,7 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
private async Task CheckSuperAdmin()
|
||||
{
|
||||
//se non ci fosse --> creo samuele come superadmin
|
||||
string superUser = "zaccaria.majid01@egalware.com";
|
||||
string superUser = "samuele.locatelli@egalware.com";
|
||||
string superPwd = "viaDante16!";
|
||||
string ADMIN_ROLE = "SuperAdmin";
|
||||
var user = await _userManager.FindByEmailAsync(superUser);
|
||||
@@ -164,7 +167,7 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User logged in.");
|
||||
_logger.LogInformation($"{Input.Email} | User logged in.");
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
if (result.RequiresTwoFactor)
|
||||
|
||||
@@ -12,5 +12,8 @@
|
||||
}
|
||||
<li class="nav-item"><a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a></li>
|
||||
<li class="nav-item"><a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a></li>
|
||||
<li class="nav-item bg-dark rounded p-2"><a class="text-light text-decoration-none" id="personal-data" href="/WDC/UI/"><i class="fa-solid fa-arrow-left-long"></i> Back to Main page</a></li>
|
||||
@{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item bg-dark rounded p-2"><a class="text-light text-decoration-none" id="personal-data" href="@baseUrl"><i class="fa-solid fa-arrow-left-long"></i> Back to Main page</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -4,24 +4,26 @@
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
||||
<ul class="navbar-nav">
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/" method="post">
|
||||
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
||||
</li>
|
||||
}
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Manage/Index")" title="Manage">Hello @User.Identity?.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Logout")" asp-route-returnUrl="/" method="post">
|
||||
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Register")">Register</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Login")">Login</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -11,6 +11,16 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
{
|
||||
public partial class DoorDefinition : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public int idDoor { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public int idOrd { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
@@ -18,7 +28,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
ListBaseDoorOp = null;
|
||||
currOrder = null;
|
||||
WDCUService.EA_CurrLanguage -= WDUService_EA_CurrLanguage;
|
||||
QDataServ.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
|
||||
QDService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -26,14 +36,14 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
#region Protected Properties
|
||||
|
||||
protected bool B_doorOpUpd { get; set; } = false;
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration configuration { get; set; } = null!;
|
||||
|
||||
protected OrderStatusViewModel? currOrder { get; set; } = null;
|
||||
protected string DoorSvgContent { get; set; } = "";
|
||||
|
||||
protected string ErrCode { get; set; } = "ERRORE";
|
||||
[Parameter]
|
||||
public int idDoor { get; set; } = 0;
|
||||
[Parameter]
|
||||
public int idOrd { get; set; } = 0;
|
||||
|
||||
protected bool isDoorOpConf { get; set; } = false;
|
||||
protected bool IsErr { get; set; } = false;
|
||||
|
||||
@@ -43,12 +53,11 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
protected OrderStatusViewModel? currOrder { get; set; } = null;
|
||||
|
||||
protected int orderStat { get; set; } = 10;
|
||||
protected bool paramChanged { get; set; } = false;
|
||||
|
||||
[Inject]
|
||||
protected QueueDataService QDataServ { get; set; } = null!;
|
||||
protected QueueDataService QDService { get; set; } = null!;
|
||||
|
||||
protected string userLang { get; set; } = "EN";
|
||||
|
||||
@@ -65,8 +74,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
|
||||
protected int orderStat { get; set; } = 10;
|
||||
protected async Task catchParamChange(bool ParamChanged)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -92,7 +99,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
WaitReloadSvg = configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
//if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOrd", out var _idOrd) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idDoor", out var _idDoor))
|
||||
//{
|
||||
@@ -101,7 +108,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
//}
|
||||
await ReloadData();
|
||||
WDCUService.EA_CurrLanguage += WDUService_EA_CurrLanguage;
|
||||
QDataServ.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
|
||||
QDService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
|
||||
WDCRService.EA_UpdDoorOp += WDService_EA_DoorOpUpdated;
|
||||
}
|
||||
|
||||
@@ -112,7 +119,20 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
currOrder = null;
|
||||
await Task.Delay(1);
|
||||
// cerco img porta...
|
||||
DoorSvgContent = await QDataServ.DoorGetLastSvg(idDoor);
|
||||
DoorSvgContent = await QDService.DoorGetLastSvg(idDoor);
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(DoorSvgContent))
|
||||
{
|
||||
// richiede ricalcolo img
|
||||
DoorSvgContent = await SendRecalcReq(idDoor);
|
||||
}
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(DoorSvgContent))
|
||||
{
|
||||
// legge img vuota
|
||||
DoorSvgContent = QDService.DoorGetMissingSvg();
|
||||
}
|
||||
|
||||
// recupero altri dati
|
||||
var ListRecordDoorOp = await WDService.DoorOpGetByDoorId(idDoor);
|
||||
if (ListRecordDoorOp != null)
|
||||
@@ -132,7 +152,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
if (ListOrdersStatus != null)
|
||||
{
|
||||
currOrder = ListOrdersStatus.Where(x => x.OrderId == idOrd).FirstOrDefault();
|
||||
if(currOrder != null)
|
||||
if (currOrder != null)
|
||||
{
|
||||
orderStat = currOrder.OrderStatus;
|
||||
}
|
||||
@@ -162,6 +182,8 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private int WaitReloadSvg = 100;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
@@ -197,16 +219,16 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
doorSvgVers = doorSvgVers.Replace(".", ":");
|
||||
}
|
||||
// fix ./:
|
||||
var hasErr = await QDataServ.DoorErrExists(doorSvgVers);
|
||||
var hasErr = await QDService.DoorErrExists(doorSvgVers);
|
||||
if (hasErr)
|
||||
{
|
||||
var messErr = await QDataServ.DoorErrGet(doorSvgVers);
|
||||
var messErr = await QDService.DoorErrGet(doorSvgVers);
|
||||
IsErr = true;
|
||||
ErrCode = messErr;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoorSvgContent = await QDataServ.DoorSvgGet(doorSvgVers);
|
||||
DoorSvgContent = await QDService.DoorSvgGet(doorSvgVers);
|
||||
}
|
||||
|
||||
await Task.Run(async () => await InvokeAsync(StateHasChanged));
|
||||
@@ -214,6 +236,34 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invio richiesta ricalcolo porta
|
||||
/// </summary>
|
||||
/// <param name="DoorId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> SendRecalcReq(int DoorId)
|
||||
{
|
||||
string answ = "";
|
||||
// richiede ricalcolo img
|
||||
List<string> doorIdList = new List<string>() { $"{DoorId}" };
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
|
||||
// recupero DDF ed invio x processing
|
||||
if (DoorId > 0)
|
||||
{
|
||||
string currDDF = await WDService.DoorOpGetDDF(DoorId);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
|
||||
}
|
||||
|
||||
// attende ...
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
// riprova lettura
|
||||
answ = await QDService.DoorGetLastSvg(DoorId);
|
||||
return answ;
|
||||
}
|
||||
|
||||
private void WDService_EA_DoorOpUpdated()
|
||||
{
|
||||
B_doorOpUpd = WDCRService.isDoorOpUpd;
|
||||
|
||||
@@ -278,10 +278,16 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
.Select(x => $"{x.DoorId}")
|
||||
.ToList();
|
||||
|
||||
// faccio upsert porte nell'elenco door tipo template...
|
||||
var numTplDoor = await QDService.DoorTplListUpsert(doorIdList);
|
||||
// chiamo reset
|
||||
// solo se è template salvo nell'elenco...
|
||||
if (isTplPage)
|
||||
{
|
||||
// faccio upsert porte nell'elenco door tipo template...
|
||||
var numTplDoor = await QDService.DoorTplListUpsert(doorIdList);
|
||||
}
|
||||
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
|
||||
// se ho porte da processare --> chiamo save...
|
||||
string currDDF = "";
|
||||
int currDoorId = 0;
|
||||
|
||||
@@ -121,22 +121,16 @@
|
||||
<option>IT</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="">
|
||||
<NavLink class="nav-link text-nowrap" href=@($"{baseUrl}/Identity/Account/Manage")>
|
||||
<button class="btn btn-sm btn-success w-100 fw-bold text-light text-decoration-none text-dark" style="">@translate("UI_06")</button>
|
||||
</NavLink>
|
||||
</div>
|
||||
<NavLink href=@($"{baseUrl}/Identity/Account/Manage")>
|
||||
<button class="btn btn-sm btn-success w-100 fw-bold text-light text-decoration-none" style="">@translate("UI_06")</button>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="text-end">
|
||||
<form method="post" action="@actionUrl">
|
||||
<button type="submit" class="btnLogout">Log out <i class="fa-solid fa-arrow-right-from-bracket"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<form method="post" action="@logoutUrl">
|
||||
<button type="submit" class="btn btn-sm btn-danger text-light w-100 fw-bold">Log out <i class="fa-solid fa-arrow-right-from-bracket"></i></button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -158,7 +152,7 @@
|
||||
</div>
|
||||
<div class="text-end text-nowrap px-3 py-2 d-flex justify-content-between">
|
||||
@*<a href="Identity/Account/Register" class="text-decoration-none text-dark">@translate("UI_08") </a>*@
|
||||
<a href="Identity/Account/Login" class="text-decoration-none text-dark">@translate("UI_09") </a>
|
||||
<a href="@($"{baseUrl}/Identity/Account/Login")" class="text-decoration-none text-dark">@translate("UI_09") </a>
|
||||
</div>
|
||||
</nav>
|
||||
</NotAuthorized>
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Security.Policy;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
@@ -28,6 +29,7 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
|
||||
protected string baseUrl
|
||||
{
|
||||
// string baseUrl = Url.Content("~/");
|
||||
get => configuration.GetValue<string>("RuntimeOpt:BaseUrl");
|
||||
}
|
||||
|
||||
@@ -235,20 +237,11 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string actionUrl
|
||||
protected string logoutUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (NavManager.Uri.Contains("/WDC/UI"))
|
||||
{
|
||||
answ = $"{baseUrl}/Identity/Account/LogOut";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "/Identity/Account/LogOut";
|
||||
}
|
||||
return answ;
|
||||
return $"{baseUrl}/Identity/Account/LogOut";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,99 @@ namespace WebDoorCreator.UI.Controllers
|
||||
[ApiController]
|
||||
public class DoorImageController : ControllerBase
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public DoorImageController(IConfiguration configuration, QueueDataService cQDService, WebDoorCreatorService cWDCService)
|
||||
{
|
||||
Log.Info("Starting DoorImageController");
|
||||
_configuration = configuration;
|
||||
WaitReloadSvg = _configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
|
||||
QDService = cQDService;
|
||||
WDService = cWDCService;
|
||||
Log.Info("Avviato DoorImageController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// GET: api/DoorImage
|
||||
[HttpGet]
|
||||
public string Get()
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
|
||||
[HttpGet("GetImage.svg")]
|
||||
public async Task<IActionResult> GetImage(int DoorId)
|
||||
{
|
||||
string svgContent = await QDataServ.DoorGetLastSvg(DoorId);
|
||||
string svgContent = await QDService.DoorGetLastSvg(DoorId);
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
// richiede ricalcolo img
|
||||
svgContent = await SendRecalcReq(DoorId);
|
||||
}
|
||||
// se fosse vuoto...
|
||||
if (string.IsNullOrEmpty(svgContent))
|
||||
{
|
||||
// legge img vuota
|
||||
svgContent = QDService.DoorGetMissingSvg();
|
||||
}
|
||||
var result = System.Text.Encoding.UTF8.GetBytes(svgContent);
|
||||
return File(result, "image/svg+xml");
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private IConfiguration _configuration = null!;
|
||||
private int WaitReloadSvg = 100;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private QueueDataService QDService { get; set; } = null!;
|
||||
|
||||
private WebDoorCreatorService WDService { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio richiesta ricalcolo porta
|
||||
/// </summary>
|
||||
/// <param name="DoorId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> SendRecalcReq(int DoorId)
|
||||
{
|
||||
string answ = "";
|
||||
// richiede ricalcolo img
|
||||
List<string> doorIdList = new List<string>() { $"{DoorId}" };
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
|
||||
// recupero DDF ed invio x processing
|
||||
if (DoorId > 0)
|
||||
{
|
||||
string currDDF = await WDService.DoorOpGetDDF(DoorId);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
|
||||
}
|
||||
|
||||
// attende ...
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
// riprova lettura
|
||||
answ = await QDService.DoorGetLastSvg(DoorId);
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#if false
|
||||
[HttpGet("GetImage.png")]
|
||||
public async Task<IActionResult> GetImagePng(int DoorId)
|
||||
@@ -33,37 +118,7 @@ namespace WebDoorCreator.UI.Controllers
|
||||
result = Utils.ImageToByte2(myBmp);
|
||||
}
|
||||
return File(result, "image/png");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// GET: api/DoorImage
|
||||
[HttpGet]
|
||||
public string Get()
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
|
||||
public DoorImageController(IConfiguration configuration, QueueDataService DataService)
|
||||
{
|
||||
Log.Info("Starting DoorImageController");
|
||||
_configuration = configuration;
|
||||
QDataServ = DataService;
|
||||
Log.Info("Avviato DoorImageController");
|
||||
}
|
||||
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private QueueDataService QDataServ { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,34 @@
|
||||
<script src="~/Identity/js/site.js" asp-append-version="true"></script>
|
||||
<script src="~/lib/SiteHelper.js" asp-append-version="true"></script>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
<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({
|
||||
reconnectionOptions: {
|
||||
maxRetries: 600,
|
||||
retryIntervalMilliseconds: 1000
|
||||
},
|
||||
reconnectionHandler: {
|
||||
onConnectionDown: (options, error) => console.error(error),
|
||||
onConnectionUp: () => console.log("Client reconnected!")
|
||||
}
|
||||
}).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>
|
||||
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>https://wdc.egalware.com/UI/</SiteUrlToLaunchAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<MSDeployServiceURL>https://wdc-w-iis-01.ovh:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||
<DeployIisAppPath>wdc.egalware.com/UI</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>true</EnableMSDeployBackup>
|
||||
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
|
||||
<UserName>steamware</UserName>
|
||||
<_SavePWD>true</_SavePWD>
|
||||
<_TargetId>IISWebDeploy</_TargetId>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2024-02-13T16:56:27.4654255Z;True|2023-05-22T15:35:59.9735292+02:00;False|2023-05-22T15:33:39.4808724+02:00;True|2023-05-11T17:36:48.1468628+02:00;</History>
|
||||
<LastFailureDetails />
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAs/7D3mNhw0uqUXeNq4OiHAAAAAACAAAAAAADZgAAwAAAABAAAACQhhKbsfp+UTciHhrQH0GzAAAAAASAAACgAAAAEAAAAIwsEsbaK2BLsVBpap3Pa0oYAAAAyYg8C03gbwQgvT7iGggH24UdM5ET0UN8FAAAAHqaLNjIe/Ai9A1quKtegfN5FxtH</EncryptedPassword>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -3,125 +3,127 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.9.2401.0415</Version>
|
||||
<Version>0.9.2403.0411</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="compilerconfig.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove="compilerconfig.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-OVH-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="temp\Logo00.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo01.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo02.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo03.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="temp\Logo00.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo01.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo02.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="temp\Logo03.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
||||
<PackageReference Include="Blazored.SessionStorage" Version="2.3.0" />
|
||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2308.216" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2307.3111" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.14">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.14" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.122" />
|
||||
<PackageReference Include="YamlDotNet" Version="13.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
||||
<PackageReference Include="Blazored.SessionStorage" Version="2.3.0" />
|
||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2308.216" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2307.3111" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.27" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.27">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.14" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.122" />
|
||||
<PackageReference Include="YamlDotNet" Version="13.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WebDoorCreator.Core\WebDoorCreator.Core.csproj" />
|
||||
<ProjectReference Include="..\WebDoorCreator.Data\WebDoorCreator.Data.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WebDoorCreator.Core\WebDoorCreator.Core.csproj" />
|
||||
<ProjectReference Include="..\WebDoorCreator.Data\WebDoorCreator.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Areas\Identity\Data\" />
|
||||
<Folder Include="Reports\" />
|
||||
<Folder Include="wwwroot\DoorOpTypeImg\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Areas\Identity\Data\" />
|
||||
<Folder Include="Reports\" />
|
||||
<Folder Include="wwwroot\DoorOpTypeImg\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="compilerconfig.json" />
|
||||
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="compilerconfig.json" />
|
||||
<None Include="Properties\PublishProfiles\IIS-OVH-PROD.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="wwwroot\images\icons\angles-left-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\angles-right-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\arrows-rotate-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\calculator-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\clipboard-regular.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\clone.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\Exit.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\ExitWhite.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\file-pdf-regular.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\file.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\Plus.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\PlusWhite.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="wwwroot\images\icons\angles-left-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\angles-right-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\arrows-rotate-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\calculator-solid.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\clipboard-regular.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\clone.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\Exit.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\ExitWhite.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\file-pdf-regular.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\file.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\Plus.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\images\icons\PlusWhite.svg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Reports\ReportOrder.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Reports\ReportOrder.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</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>
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"RuntimeOpt": {
|
||||
"MaxDayCalcCache": 7,
|
||||
"BaseUrl": "/WDC/UI"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"Identity.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;",
|
||||
"WDC.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
"Redis": "wdc-u-redis-01.ovh:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"Identity.DB": "Server=WDC-W-SQL-01\\SQLEXPRESS;Database=DCA_WebDoorCreator; User ID=steamware;Password=viadante16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;",
|
||||
"WDC.DB": "Server=WDC-W-SQL-01\\SQLEXPRESS;Database=DCA_WebDoorCreator; User ID=steamware;Password=viadante16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
},
|
||||
"RuntimeOpt": {
|
||||
"MaxDayCalcCache": 28,
|
||||
"BaseUrl": "/UI"
|
||||
},
|
||||
"CompoBaseDirs": {
|
||||
"CurrCompoDir": "J:\\WebDoorSync\\CurrentComp\\Compo",
|
||||
"NewCompoDir": "J:\\WebDoorSync\\NewComp\\Compo"
|
||||
"CurrCompoDir": "U:\\WebDoorSync\\CurrentComp\\Compo",
|
||||
"NewCompoDir": "U:\\WebDoorSync\\NewComp\\Compo"
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"Identity.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;",
|
||||
"WDC.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
},
|
||||
"RuntimeOpt": {
|
||||
"MaxDayCalcCache": 7,
|
||||
"BaseUrl": "/WDC/UI"
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"Identity.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;",
|
||||
"WDC.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
//"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=12, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
//"Identity.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;",
|
||||
//"WDC.DB": "Server=SQL2016PROD;Database=DCA_WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
},
|
||||
"ExternalProviders": {
|
||||
"MailKit": {
|
||||
@@ -20,17 +17,19 @@
|
||||
"Address": "smtp-mail.outlook.com",
|
||||
"Port": "587",
|
||||
"Account": "steamwarebot@outlook.it",
|
||||
"Password": "siamoInViaNazionale93",
|
||||
"Password": "siamoInViaNazionale93!",
|
||||
"SenderEmail": "steamwarebot@outlook.it",
|
||||
"SenderName": "Steamware Email BOT"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SetupOpt": {
|
||||
"CheckAdmUser": false,
|
||||
"DisableIdentMigrate": true,
|
||||
"DisableWDCMigrate": true
|
||||
},
|
||||
"RuntimeOpt": {
|
||||
"WaitReloadSvg": 200,
|
||||
"VetoRemoveProcessing": 5,
|
||||
"MaxDayCalcCache": 7,
|
||||
"BaseUrl": "/WDC/UI",
|
||||
@@ -53,5 +52,7 @@
|
||||
"CompoBaseDirs": {
|
||||
"CurrCompoDir": "\\\\IIS04\\WebDoorSync\\CurrentComp\\Compo",
|
||||
"NewCompoDir": "\\\\IIS04\\WebDoorSync\\NewComp\\Compo"
|
||||
//"CurrCompoDir": "J:\\WebDoorSync\\CurrentComp\\Compo",
|
||||
//"NewCompoDir": "J:\\WebDoorSync\\NewComp\\Compo"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user