63 Commits

Author SHA1 Message Date
Samuele Locatelli 9bf93c4996 reorg config vari 2024-03-04 11:34:13 +01:00
Samuele Locatelli 82248f1068 fix calcolo url logout 2024-03-04 11:34:06 +01:00
Samuele Locatelli b0c37aa79f Merge tag 'BasePathIdentityFix02' into develop
Fix logout (spero...)
2024-03-04 11:22:31 +01:00
Samuele Locatelli 967a4e0e2f Merge branch 'release/BasePathIdentityFix02' 2024-03-04 11:22:23 +01:00
Samuele Locatelli 361854f5b5 Try fix action x logout 2024-03-04 11:22:10 +01:00
Samuele Locatelli 52d65add22 Update x login partial 2024-03-04 11:16:41 +01:00
Samuele Locatelli b868660ed9 Merge tag 'BasePathIdentityFix01' into develop
Fix base path (da testare)
2024-03-04 11:08:41 +01:00
Samuele Locatelli 2bbfa4b6bf Merge branch 'release/BasePathIdentityFix01' 2024-03-04 11:08:32 +01:00
Samuele Locatelli 118e43f0c2 Fix base URL 2024-03-04 11:07:54 +01:00
Samuele Locatelli 726df4d36c Merge branch 'main' into develop 2024-03-04 10:56:38 +01:00
Samuele Locatelli 68204acddd Merge branch 'develop' 2024-03-04 10:56:24 +01:00
Samuele Locatelli 2b2e258020 Update nuget EFCore a 6.0.27 2024-03-04 10:51:52 +01:00
Samuele Locatelli 17bbaf2136 Update login page 2024-03-04 10:48:46 +01:00
Samuele Locatelli b2fd3a39fa Update email settings 2024-03-04 10:47:16 +01:00
Samuele Locatelli f843aff337 Fix user menu nav 2024-03-04 10:44:38 +01:00
Samuele Locatelli 13afc6464f Merge branch 'release/UpdateLoginLogoutPage01' 2024-02-21 11:30:03 +01:00
Samuele Locatelli eb64db41da Update pagine login/logout 2024-02-21 11:29:15 +01:00
Samuele Locatelli 65e54aefbe Merge tag 'FixreloadLayout01' into develop
Fix modifiche reload page x javascript di base blazor
2024-02-19 19:29:11 +01:00
Samuele Locatelli e44d1e04a2 Merge branch 'release/FixreloadLayout01' 2024-02-19 19:28:40 +01:00
Samuele Locatelli fa948fd5d0 Fix gestione reload page 2024-02-19 19:28:11 +01:00
Samuele Locatelli 30fa3b8444 Merge tag 'TestForceRecalcSvg01' into develop
Gestione ricalcolo porte quando missing: inserita, testata
2024-02-16 18:07:15 +01:00
Samuele Locatelli 35815c3a56 Merge branch 'release/TestForceRecalcSvg01' 2024-02-16 18:06:56 +01:00
Samuele Locatelli 4585ac4bf8 Aggiunta e testata rilettura DDF + SVG da missing 2024-02-16 18:05:43 +01:00
Samuele Locatelli 70cd621f80 Bozza modifiche x richeista ricalcolo porta (se missing) 2024-02-16 17:09:58 +01:00
Samuele Locatelli 145a0f5c7e Merge tag 'FixLogVerboseSrv01' into develop
Fix log verboso su SRV
2024-02-16 16:03:19 +01:00
Samuele Locatelli 9bac691032 Merge branch 'release/FixLogVerboseSrv01' 2024-02-16 16:03:03 +01:00
Samuele Locatelli ba7d395d20 Review livelli out info x richieste + frequenti 2024-02-16 15:55:33 +01:00
Samuele Locatelli 3c07a3ae26 Update logging x SRV e WebDoorCreatorService 2024-02-16 15:50:13 +01:00
Samuele Locatelli ca5731d2e6 Deduplica log avvio QueueController 2024-02-16 15:40:17 +01:00
Samuele Locatelli f8426f304a Update log... 2024-02-16 15:21:17 +01:00
Samuele Locatelli b9414c7a48 fix loog statistiche e log 2024-02-16 14:51:31 +01:00
Samuele Locatelli 6c9c3d8d85 Riscrittura metodi log QueueController e QueueDataService 2024-02-16 14:38:01 +01:00
Samuele Locatelli 5df108a979 Merge tag 'TestOvhDeploy04' into develop
completo merge con update json conf
2024-02-16 08:35:31 +01:00
Samuele Locatelli f15b1694f7 Merge branch 'release/TestOvhDeploy04' 2024-02-16 08:35:23 +01:00
Samuele Locatelli 30e37531a2 update conf 2024-02-16 08:34:23 +01:00
Samuele Locatelli 215383c630 Merge tag 'TestOvhDeploy04' into develop
Test deploy post fix DB num (11 --> 12)
2024-02-16 08:34:07 +01:00
Samuele Locatelli 5df5391030 Merge branch 'release/TestOvhDeploy04' 2024-02-16 08:33:44 +01:00
Samuele Locatelli 530faf053f Nuovo test deploy OVH 2024-02-16 08:33:26 +01:00
Samuele Locatelli 592034c9d4 Merge tag 'TestOvhDeploy03' into develop
mancava modifica utente deploy oltre a pwd...
2024-02-15 18:42:10 +01:00
Samuele Locatelli 2a2e31d087 Merge branch 'release/TestOvhDeploy03' 2024-02-15 18:42:00 +01:00
Samuele Locatelli 419150a41f modifica user deploy WDC 2024-02-15 18:41:46 +01:00
Samuele Locatelli fc4be10caa Merge tag 'TestOvhDeploy02' into develop
fix variabile x upload su OVH/WDC
2024-02-15 18:39:12 +01:00
Samuele Locatelli 2413b27678 Merge branch 'release/TestOvhDeploy02' 2024-02-15 18:39:01 +01:00
Samuele Locatelli 95ff88ac11 modifica variabile x pwd OVH 2024-02-15 18:38:39 +01:00
Samuele Locatelli 54d7e594f1 Merge tag 'TestOvhDeploy01' into develop
primo test deploy su OVH da CI/CD
2024-02-15 18:36:31 +01:00
Samuele Locatelli 7900141bda Merge branch 'release/TestOvhDeploy01' 2024-02-15 18:36:19 +01:00
Samuele Locatelli 13953a86d6 Merge commit '06b06db04dea2f591ca4c75c7b763a2e7d540876' into develop 2024-02-15 18:31:14 +01:00
Samuele Locatelli 7f0ee8ad7f Test CI/CD verso prod da testare 2024-02-15 18:30:40 +01:00
Samuele Locatelli 788112e54e impostata modifica x ricalcolo file svg missing 2024-02-15 18:26:19 +01:00
Samuele Locatelli 0e8ec13e68 refresh conf UI x nuovo prod json 2024-02-15 17:40:26 +01:00
Samuele Locatelli 67fe028cb6 Pulizia conf utenti 2024-02-15 17:40:05 +01:00
Samuele Locatelli 55f4ee077d Update x API SRV su WDC-OVH 2024-02-15 17:33:59 +01:00
Samuele Locatelli cc6b195aa3 Aggiunta conf x deploy su WDC-OVH 2024-02-15 17:33:21 +01:00
Emmanuele Sassi 06b06db04d Merge remote-tracking branch 'origin/develop' into ProcPipeComm 2024-01-05 09:20:55 +01:00
Emmanuele Sassi f3810fa708 - gestiti mutex con nome da ini per distinguere istanze
- spostata inizializzazione oggetto web in load
- corretti errori i n avvio per oggetti non inizializzati
- spostata path dell'Engine in file ini
2024-01-05 09:20:16 +01:00
Emmanuele Sassi cd32764c1e - resi configurabili ip e url per chiamate rest 2023-06-12 16:38:22 +02:00
Emmanuele Sassi 6a03d1e107 Merge remote-tracking branch 'origin/develop' into ProcPipeComm 2023-06-06 10:53:43 +02:00
Emmanuele Sassi 3e51ab18d2 WebDoorCreator.CamSrv 2.5f1 :
- aggiunto numero di processi da avviare in ini
- aggiunta possibilita' di partenza processi all'avvio in ini
- aggiunto timer per reset della lista dei process
- gestita chiusura dell'ambiente egt
2023-06-06 10:53:23 +02:00
Emmanuele Sassi 9218ac7d5b WebDoorCreator.CamSrv 2.5e1 :
- aggiornata EgtUILib
- corretto colore di sfondo start e estop
2023-05-30 08:51:02 +02:00
Emmanuele Sassi c699d8e2e5 Merge remote-tracking branch 'origin/develop' into ProcPipeComm 2023-05-30 08:35:14 +02:00
Emmanuele Sassi 6da0285af3 - aggiunta EgtUILib per log
- aggiunta gestione istanze
- aggiunto controllo licenza su applicazione
- aggiunto bottone per killare tutti i process
2023-05-30 08:34:54 +02:00
Emmanuele Sassi 0b5d4f4909 Merge remote-tracking branch 'origin/develop' into ProcPipeComm 2023-05-29 10:24:12 +02:00
Emmanuele Sassi b26f18575f - gestite pipe
- gestito riavvio processo
2023-05-29 10:23:48 +02:00
43 changed files with 2107 additions and 644 deletions
+13 -9
View File
@@ -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
Binary file not shown.
+1 -1
View File
@@ -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
View File
@@ -1 +1 @@
0.9.2401.0415
0.9.2403.0411
+1 -1
View File
@@ -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;"
}
}
+6 -3
View File
@@ -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
}
}
+10
View File
@@ -10,17 +10,27 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Debug|x64.ActiveCfg = Debug|x64
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Debug|x64.Build.0 = Debug|x64
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Release|Any CPU.Build.0 = Release|Any CPU
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Release|x64.ActiveCfg = Release|x64
{96266312-9739-4F12-A6C2-16C1CAFDDA6E}.Release|x64.Build.0 = Release|x64
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Debug|x64.ActiveCfg = Debug|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Debug|x64.Build.0 = Debug|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Release|Any CPU.Build.0 = Release|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Release|x64.ActiveCfg = Release|Any CPU
{4A07ADFC-CA24-4135-BA97-3B8E5D49BC09}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+44
View File
@@ -0,0 +1,44 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Public Module ConstIni
' massimo numero di istanze del programma ammesse
Public Const MAX_INST As Integer = 32
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "WebDoorCreator.CamSrv.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_KEY As String = "Key"
' File di log generale
Public Const GENLOG_FILE_NAME As String = "WebDoorCreator.CamSrv#.txt"
Public Const INI_FILE_NAME As String = "WebDoorCreator.CamSrv.ini"
Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence"
Public Const K_NETKEY As String = "NetKey"
Public Const K_USERLEVEL As String = "UserLevel"
Public Const K_MAXINST As String = "MaxInstances"
Public Const K_INSTANCES As String = "Instances"
Public Const K_COMMANDLOG As String = "CommandLog"
Public Const K_STARTINSTANCES As String = "StartInstances"
Public Const K_PROCESSPATH As String = "ProcessPath"
Public Const K_PROCESSATSTART As String = "ProcessAtStart"
Public Const K_BASEURL As String = "BaseUrl"
Public Const K_BASEIP As String = "BaseIp"
Public Const K_MUTEXNAME As String = "MutexName"
End Module
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: AssemblyVersion("2.5.6.1")>
<Assembly: AssemblyFileVersion("2.5.6.1")>
+93 -74
View File
@@ -49,22 +49,24 @@ Partial Class ProcMan
Me.ThreadCurrentStatusList = New System.Windows.Forms.ListView()
Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader2 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader4 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader3 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.chkStatAggr = New System.Windows.Forms.CheckBox()
Me.btnExportStats = New System.Windows.Forms.Button()
Me.chkAutoRestart = New System.Windows.Forms.CheckBox()
Me.TimerCheck = New System.Windows.Forms.Timer(Me.components)
Me.ColumnHeader3 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader4 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.Button1 = New System.Windows.Forms.Button()
Me.TimerResetProcessing = New System.Windows.Forms.Timer(Me.components)
Me.StatusStrip1.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'btnTestPing
'
Me.btnTestPing.Location = New System.Drawing.Point(17, 16)
Me.btnTestPing.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.btnTestPing.Location = New System.Drawing.Point(19, 20)
Me.btnTestPing.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnTestPing.Name = "btnTestPing"
Me.btnTestPing.Size = New System.Drawing.Size(100, 28)
Me.btnTestPing.Size = New System.Drawing.Size(112, 35)
Me.btnTestPing.TabIndex = 0
Me.btnTestPing.Text = "Test Ping"
Me.btnTestPing.UseVisualStyleBackColor = True
@@ -72,39 +74,39 @@ Partial Class ProcMan
'lblpingTest
'
Me.lblpingTest.AutoSize = True
Me.lblpingTest.Location = New System.Drawing.Point(153, 22)
Me.lblpingTest.Location = New System.Drawing.Point(172, 28)
Me.lblpingTest.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.lblpingTest.Name = "lblpingTest"
Me.lblpingTest.Size = New System.Drawing.Size(28, 16)
Me.lblpingTest.Size = New System.Drawing.Size(36, 20)
Me.lblpingTest.TabIndex = 1
Me.lblpingTest.Text = "???"
'
'lblTestAlive
'
Me.lblTestAlive.AutoSize = True
Me.lblTestAlive.Location = New System.Drawing.Point(365, 22)
Me.lblTestAlive.Location = New System.Drawing.Point(411, 28)
Me.lblTestAlive.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.lblTestAlive.Name = "lblTestAlive"
Me.lblTestAlive.Size = New System.Drawing.Size(28, 16)
Me.lblTestAlive.Size = New System.Drawing.Size(36, 20)
Me.lblTestAlive.TabIndex = 3
Me.lblTestAlive.Text = "???"
'
'btnTestAlive
'
Me.btnTestAlive.Location = New System.Drawing.Point(229, 16)
Me.btnTestAlive.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.btnTestAlive.Location = New System.Drawing.Point(258, 20)
Me.btnTestAlive.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnTestAlive.Name = "btnTestAlive"
Me.btnTestAlive.Size = New System.Drawing.Size(100, 28)
Me.btnTestAlive.Size = New System.Drawing.Size(112, 35)
Me.btnTestAlive.TabIndex = 2
Me.btnTestAlive.Text = "Test Alive"
Me.btnTestAlive.UseVisualStyleBackColor = True
'
'btnResetQueue
'
Me.btnResetQueue.Location = New System.Drawing.Point(17, 201)
Me.btnResetQueue.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.btnResetQueue.Location = New System.Drawing.Point(19, 251)
Me.btnResetQueue.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnResetQueue.Name = "btnResetQueue"
Me.btnResetQueue.Size = New System.Drawing.Size(100, 28)
Me.btnResetQueue.Size = New System.Drawing.Size(112, 35)
Me.btnResetQueue.TabIndex = 6
Me.btnResetQueue.Text = "Reset Q"
Me.btnResetQueue.UseVisualStyleBackColor = True
@@ -114,41 +116,41 @@ Partial Class ProcMan
Me.txtOut.BackColor = System.Drawing.SystemColors.ControlDarkDark
Me.txtOut.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtOut.ForeColor = System.Drawing.Color.Yellow
Me.txtOut.Location = New System.Drawing.Point(16, 240)
Me.txtOut.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.txtOut.MinimumSize = New System.Drawing.Size(79, 147)
Me.txtOut.Location = New System.Drawing.Point(18, 300)
Me.txtOut.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtOut.MinimumSize = New System.Drawing.Size(88, 183)
Me.txtOut.Multiline = True
Me.txtOut.Name = "txtOut"
Me.txtOut.Size = New System.Drawing.Size(99, 173)
Me.txtOut.Size = New System.Drawing.Size(111, 215)
Me.txtOut.TabIndex = 7
Me.txtOut.Text = "---"
'
'btnQueueStatus
'
Me.btnQueueStatus.Location = New System.Drawing.Point(17, 79)
Me.btnQueueStatus.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.btnQueueStatus.Location = New System.Drawing.Point(19, 99)
Me.btnQueueStatus.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnQueueStatus.Name = "btnQueueStatus"
Me.btnQueueStatus.Size = New System.Drawing.Size(100, 28)
Me.btnQueueStatus.Size = New System.Drawing.Size(112, 35)
Me.btnQueueStatus.TabIndex = 8
Me.btnQueueStatus.Text = "Stato Queue"
Me.btnQueueStatus.UseVisualStyleBackColor = True
'
'StartProcess
'
Me.StartProcess.Location = New System.Drawing.Point(17, 23)
Me.StartProcess.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.StartProcess.Location = New System.Drawing.Point(19, 29)
Me.StartProcess.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.StartProcess.Name = "StartProcess"
Me.StartProcess.Size = New System.Drawing.Size(100, 28)
Me.StartProcess.Size = New System.Drawing.Size(112, 35)
Me.StartProcess.TabIndex = 9
Me.StartProcess.Text = "Start"
Me.StartProcess.UseVisualStyleBackColor = True
'
'StopProcess
'
Me.StopProcess.Location = New System.Drawing.Point(325, 22)
Me.StopProcess.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.StopProcess.Location = New System.Drawing.Point(366, 28)
Me.StopProcess.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.StopProcess.Name = "StopProcess"
Me.StopProcess.Size = New System.Drawing.Size(100, 28)
Me.StopProcess.Size = New System.Drawing.Size(112, 35)
Me.StopProcess.TabIndex = 10
Me.StopProcess.Text = "Stop"
Me.StopProcess.UseVisualStyleBackColor = True
@@ -157,17 +159,17 @@ Partial Class ProcMan
'
Me.StatusStrip1.ImageScalingSize = New System.Drawing.Size(20, 20)
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsProgBar})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 526)
Me.StatusStrip1.Location = New System.Drawing.Point(0, 659)
Me.StatusStrip1.Name = "StatusStrip1"
Me.StatusStrip1.Padding = New System.Windows.Forms.Padding(1, 0, 19, 0)
Me.StatusStrip1.Size = New System.Drawing.Size(736, 22)
Me.StatusStrip1.Padding = New System.Windows.Forms.Padding(1, 0, 21, 0)
Me.StatusStrip1.Size = New System.Drawing.Size(828, 26)
Me.StatusStrip1.TabIndex = 11
Me.StatusStrip1.Text = "StatusStrip1"
'
'tsProgBar
'
Me.tsProgBar.Name = "tsProgBar"
Me.tsProgBar.Size = New System.Drawing.Size(133, 14)
Me.tsProgBar.Size = New System.Drawing.Size(150, 18)
Me.tsProgBar.Step = 1
'
'txtQueue
@@ -175,42 +177,42 @@ Partial Class ProcMan
Me.txtQueue.BackColor = System.Drawing.SystemColors.ControlDarkDark
Me.txtQueue.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!)
Me.txtQueue.ForeColor = System.Drawing.SystemColors.Window
Me.txtQueue.Location = New System.Drawing.Point(17, 114)
Me.txtQueue.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.txtQueue.Location = New System.Drawing.Point(19, 142)
Me.txtQueue.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtQueue.Multiline = True
Me.txtQueue.Name = "txtQueue"
Me.txtQueue.Size = New System.Drawing.Size(99, 78)
Me.txtQueue.Size = New System.Drawing.Size(111, 96)
Me.txtQueue.TabIndex = 12
Me.txtQueue.Text = "Q Status:"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(132, 30)
Me.Label1.Location = New System.Drawing.Point(148, 38)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(35, 16)
Me.Label1.Size = New System.Drawing.Size(44, 20)
Me.Label1.TabIndex = 13
Me.Label1.Text = "num:"
'
'txtNumThread
'
Me.txtNumThread.Location = New System.Drawing.Point(171, 26)
Me.txtNumThread.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.txtNumThread.Location = New System.Drawing.Point(192, 32)
Me.txtNumThread.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtNumThread.Name = "txtNumThread"
Me.txtNumThread.Size = New System.Drawing.Size(41, 22)
Me.txtNumThread.Size = New System.Drawing.Size(46, 26)
Me.txtNumThread.TabIndex = 14
Me.txtNumThread.Text = "1"
Me.txtNumThread.Text = "0"
Me.txtNumThread.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'lblRunning
'
Me.lblRunning.AutoSize = True
Me.lblRunning.Location = New System.Drawing.Point(221, 30)
Me.lblRunning.Location = New System.Drawing.Point(249, 38)
Me.lblRunning.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.lblRunning.MinimumSize = New System.Drawing.Size(100, 0)
Me.lblRunning.MinimumSize = New System.Drawing.Size(112, 0)
Me.lblRunning.Name = "lblRunning"
Me.lblRunning.Size = New System.Drawing.Size(100, 16)
Me.lblRunning.Size = New System.Drawing.Size(112, 20)
Me.lblRunning.TabIndex = 15
Me.lblRunning.Text = "running: -"
Me.lblRunning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
@@ -226,10 +228,10 @@ Partial Class ProcMan
'
Me.LISTThreadStatus.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.chThread, Me.chTime, Me.chOther})
Me.LISTThreadStatus.HideSelection = False
Me.LISTThreadStatus.Location = New System.Drawing.Point(17, 59)
Me.LISTThreadStatus.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.LISTThreadStatus.Location = New System.Drawing.Point(19, 74)
Me.LISTThreadStatus.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.LISTThreadStatus.Name = "LISTThreadStatus"
Me.LISTThreadStatus.Size = New System.Drawing.Size(536, 173)
Me.LISTThreadStatus.Size = New System.Drawing.Size(602, 215)
Me.LISTThreadStatus.TabIndex = 16
Me.LISTThreadStatus.UseCompatibleStateImageBehavior = False
Me.LISTThreadStatus.View = System.Windows.Forms.View.Details
@@ -259,11 +261,11 @@ Partial Class ProcMan
Me.GroupBox1.Controls.Add(Me.StopProcess)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.StartProcess)
Me.GroupBox1.Location = New System.Drawing.Point(157, 79)
Me.GroupBox1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.GroupBox1.Location = New System.Drawing.Point(177, 99)
Me.GroupBox1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.GroupBox1.Size = New System.Drawing.Size(563, 438)
Me.GroupBox1.Padding = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.GroupBox1.Size = New System.Drawing.Size(633, 548)
Me.GroupBox1.TabIndex = 17
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Threads"
@@ -272,10 +274,10 @@ Partial Class ProcMan
'
Me.ThreadCurrentStatusList.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2, Me.ColumnHeader4, Me.ColumnHeader3})
Me.ThreadCurrentStatusList.HideSelection = False
Me.ThreadCurrentStatusList.Location = New System.Drawing.Point(17, 257)
Me.ThreadCurrentStatusList.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.ThreadCurrentStatusList.Location = New System.Drawing.Point(19, 321)
Me.ThreadCurrentStatusList.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.ThreadCurrentStatusList.Name = "ThreadCurrentStatusList"
Me.ThreadCurrentStatusList.Size = New System.Drawing.Size(536, 173)
Me.ThreadCurrentStatusList.Size = New System.Drawing.Size(602, 215)
Me.ThreadCurrentStatusList.TabIndex = 18
Me.ThreadCurrentStatusList.UseCompatibleStateImageBehavior = False
Me.ThreadCurrentStatusList.View = System.Windows.Forms.View.Details
@@ -290,25 +292,37 @@ Partial Class ProcMan
Me.ColumnHeader2.Text = "Thread Status"
Me.ColumnHeader2.Width = 100
'
'ColumnHeader4
'
Me.ColumnHeader4.DisplayIndex = 3
Me.ColumnHeader4.Text = "Thread Phase"
Me.ColumnHeader4.Width = 100
'
'ColumnHeader3
'
Me.ColumnHeader3.DisplayIndex = 2
Me.ColumnHeader3.Text = "Process Status"
Me.ColumnHeader3.Width = 100
'
'chkStatAggr
'
Me.chkStatAggr.AutoSize = True
Me.chkStatAggr.Checked = True
Me.chkStatAggr.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkStatAggr.Location = New System.Drawing.Point(435, 26)
Me.chkStatAggr.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.chkStatAggr.Location = New System.Drawing.Point(489, 32)
Me.chkStatAggr.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.chkStatAggr.Name = "chkStatAggr"
Me.chkStatAggr.Size = New System.Drawing.Size(91, 20)
Me.chkStatAggr.Size = New System.Drawing.Size(111, 24)
Me.chkStatAggr.TabIndex = 17
Me.chkStatAggr.Text = "Aggr Stats"
Me.chkStatAggr.UseVisualStyleBackColor = True
'
'btnExportStats
'
Me.btnExportStats.Location = New System.Drawing.Point(612, 16)
Me.btnExportStats.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.btnExportStats.Location = New System.Drawing.Point(688, 20)
Me.btnExportStats.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btnExportStats.Name = "btnExportStats"
Me.btnExportStats.Size = New System.Drawing.Size(100, 28)
Me.btnExportStats.Size = New System.Drawing.Size(112, 35)
Me.btnExportStats.TabIndex = 18
Me.btnExportStats.Text = "Export Stats"
Me.btnExportStats.UseVisualStyleBackColor = True
@@ -316,10 +330,10 @@ Partial Class ProcMan
'chkAutoRestart
'
Me.chkAutoRestart.AutoSize = True
Me.chkAutoRestart.Location = New System.Drawing.Point(465, 21)
Me.chkAutoRestart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.chkAutoRestart.Location = New System.Drawing.Point(523, 26)
Me.chkAutoRestart.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.chkAutoRestart.Name = "chkAutoRestart"
Me.chkAutoRestart.Size = New System.Drawing.Size(99, 20)
Me.chkAutoRestart.Size = New System.Drawing.Size(122, 24)
Me.chkAutoRestart.TabIndex = 19
Me.chkAutoRestart.Text = "AutoRestart"
Me.chkAutoRestart.UseVisualStyleBackColor = True
@@ -328,23 +342,26 @@ Partial Class ProcMan
'
Me.TimerCheck.Interval = 30000
'
'ColumnHeader3
'Button1
'
Me.ColumnHeader3.DisplayIndex = 2
Me.ColumnHeader3.Text = "Process Status"
Me.ColumnHeader3.Width = 100
Me.Button1.Location = New System.Drawing.Point(688, 65)
Me.Button1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(112, 35)
Me.Button1.TabIndex = 20
Me.Button1.Text = "Kill All Procs"
Me.Button1.UseVisualStyleBackColor = True
'
'ColumnHeader4
'TimerResetProcessing
'
Me.ColumnHeader4.DisplayIndex = 3
Me.ColumnHeader4.Text = "Thread Phase"
Me.ColumnHeader4.Width = 100
Me.TimerResetProcessing.Interval = 3000
'
'ProcMan
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(736, 548)
Me.ClientSize = New System.Drawing.Size(828, 685)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.chkAutoRestart)
Me.Controls.Add(Me.btnExportStats)
Me.Controls.Add(Me.GroupBox1)
@@ -358,7 +375,7 @@ Partial Class ProcMan
Me.Controls.Add(Me.lblpingTest)
Me.Controls.Add(Me.btnTestPing)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "ProcMan"
Me.Text = "MainForm"
Me.StatusStrip1.ResumeLayout(False)
@@ -401,4 +418,6 @@ Partial Class ProcMan
Friend WithEvents ColumnHeader2 As ColumnHeader
Friend WithEvents ColumnHeader3 As ColumnHeader
Friend WithEvents ColumnHeader4 As ColumnHeader
Friend WithEvents Button1 As Button
Friend WithEvents TimerResetProcessing As Timer
End Class
+3
View File
@@ -129,6 +129,9 @@
<metadata name="TimerCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>354, 17</value>
</metadata>
<metadata name="TimerResetProcessing.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>511, 22</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
+602 -159
View File
@@ -1,8 +1,10 @@
Imports System.IO
Imports System.Net.NetworkInformation
Imports System.Reflection
Imports System.Text
Imports System.Threading
Imports WebDoorCreator.SDK
Imports EgtUILib
Public Class ProcMan
@@ -46,8 +48,10 @@ Public Class ProcMan
Dim codPost As String = "WRK001"
Dim sEgtEnginePath As String = ""
' nome macchina calcolo
Dim currWDC As WDC = New WDC(baseIp, baseUrl, codPost)
Dim currWDC As WDC
Dim idxSim As Integer = 0
@@ -57,6 +61,17 @@ Public Class ProcMan
Dim m_ExecutionThread As Thread
Dim m_LastCrashedProcTime As DateTime
Private m_StatList As New List(Of ThreadStat)
Public Enum ProgramStatuses As Integer
START = 1
[STOP] = 2
End Enum
Dim m_ProgramStatus As ProgramStatuses = ProgramStatuses.STOP
'Private m_MaxCamInstances As Integer = 8
Private m_MaxCamInstances As Integer = 1
@@ -65,6 +80,9 @@ Public Class ProcMan
Dim ThreadList As Thread()
Dim ThreadDataList As ThreadData()
Dim HistoryThreadDataList As New List(Of ThreadStat)
Dim m_bCheckOrder As Boolean = True
Dim m_bPingOk As Boolean = False
Dim m_bAliveOk As Boolean = False
@@ -82,6 +100,52 @@ Public Class ProcMan
Private Class ThreadData
Public Enum ProcComm As Integer
Null = 0
WaitingAnswer = 1
AnswerReceived = 2
End Enum
Private m_CurrRequest As KeyValuePair(Of String, String)
Public ReadOnly Property CurrRequest As KeyValuePair(Of String, String)
Get
Return m_CurrRequest
End Get
End Property
Friend Sub SetCurrRequest(value As KeyValuePair(Of String, String))
m_CurrRequest = value
End Sub
Private m_sDdfPath As String
Public ReadOnly Property sDdfPath As String
Get
Return m_sDdfPath
End Get
End Property
Friend Sub SetDdfPath(value As String)
m_sDdfPath = value
End Sub
Private m_WaitProcAnswer As ProcComm = ProcComm.Null
Public ReadOnly Property WaitProcAnswer As ProcComm
Get
Return m_WaitProcAnswer
End Get
End Property
Friend Sub SetWaitProcAnswer(value As ProcComm)
m_WaitProcAnswer = value
End Sub
Private m_nProcResult As Integer
Public ReadOnly Property nProcResult As Integer
Get
Return m_nProcResult
End Get
End Property
Friend Sub SetProcResult(value As Integer)
m_nProcResult = value
End Sub
Private m_ThreadOperation As ThreadOperations
Public ReadOnly Property ThreadOperation As ThreadOperations
Get
@@ -102,10 +166,105 @@ Public Class ProcMan
m_Process = value
End Sub
Private m_ThreadStat As ThreadStat
Public ReadOnly Property ThreadStat As ThreadStat
Get
Return m_ThreadStat
End Get
End Property
Friend Sub SetThreadStat(value As ThreadStat)
m_ThreadStat = value
End Sub
End Class
Public Class ThreadStat
Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_StartThread As DateTime
Public ReadOnly Property StartThread As DateTime
Get
Return m_StartThread
End Get
End Property
Private m_StopThread As DateTime
Public ReadOnly Property StopThread As DateTime
Get
Return m_StopThread
End Get
End Property
Friend Sub SetStopThread(value As DateTime)
m_StopThread = value
End Sub
Private m_ProcExecutionList As New List(Of ProcStat)
Public ReadOnly Property ProcExecutionList As List(Of ProcStat)
Get
Return m_ProcExecutionList
End Get
End Property
Sub New(nIndex As Integer)
m_nIndex = nIndex
End Sub
Sub New(nIndex As Integer, StartThread As DateTime)
MyClass.New(nIndex)
m_StartThread = StartThread
End Sub
End Class
Public Class ProcStat
Private m_StartProc As DateTime
Public ReadOnly Property StartProc As DateTime
Get
Return m_StartProc
End Get
End Property
Private m_StopProc As DateTime
Public ReadOnly Property StopProc As DateTime
Get
Return m_StopProc
End Get
End Property
Friend Sub SetStopProc(value As DateTime)
m_StopProc = value
End Sub
Private m_nDoneRequests As Integer = 0
Public ReadOnly Property nDoneRequests As Integer
Get
Return m_nDoneRequests
End Get
End Property
Friend Sub IncrementDoneRequest()
m_nDoneRequests += 1
End Sub
Sub New(StartProc As DateTime)
m_StartProc = StartProc
End Sub
End Class
#Region "Private Methods"
Private Sub Form_Shown() Handles MyBase.Shown
If GetPrivateProfileInt(S_GENERAL, K_PROCESSATSTART, 1, m_IniFilePath) = 1 Then
startAllThreads()
End If
End Sub
Private Sub UpdateThreadCurrentStatus()
synchronizationContext.Post(New SendOrPostCallback(
Sub(o)
@@ -121,15 +280,16 @@ Public Class ProcMan
' ThreadProcessState = ThreadDataList(ThreadIndex).Process.HasExited
'End If
ThreadCurrentStatusList.Items.Add(New ListViewItem(New String() {ThreadIndex,
ThreadList(ThreadIndex).ThreadState.ToString(),
If(Not IsNothing(ThreadList(ThreadIndex)), ThreadList(ThreadIndex).ThreadState.ToString(), ""),
ThreadProcessState,
ThreadDataList(ThreadIndex).ThreadOperation.ToString()}))
If(Not IsNothing(ThreadDataList(ThreadIndex)), ThreadDataList(ThreadIndex).ThreadOperation.ToString(), "")}))
Else
ThreadCurrentStatusList.Items.Add(New ListViewItem(New String() {ThreadIndex,
"nothing"}))
End If
Next
End If
ThreadCurrentStatusList.EndUpdate()
lblpingTest.Text = m_bPingOk.ToString()
lblTestAlive.Text = m_bAliveOk.ToString()
@@ -161,6 +321,7 @@ Public Class ProcMan
End Sub
Private Sub DisplayQueueStatus()
If IsNothing(currWDC) Then Return
Dim queueStatus As New Dictionary(Of String, Long)
queueStatus = currWDC.queueStatus
Dim sb As StringBuilder
@@ -175,12 +336,12 @@ Public Class ProcMan
Private Sub ExecutionProcess()
' recupero Id dei DDF
Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf"
Dim sCurrDdfDir As String = ""
Dim nDdfId As Integer = 1
Dim bStopMainProcess As Boolean = False
Dim n30SecCounter As Integer = 0
Dim nStartingProc As Integer = 0
While Not bStopMainProcess
bStopMainProcess = m_bStopProcess
Dim bOk As Boolean = False
@@ -252,32 +413,80 @@ Public Class ProcMan
End If
' se qualche processo in stop, lo faccio ripartire
For ThreadIndex = 0 To ThreadList.Count - 1
Dim Thread = ThreadList(ThreadIndex)
If Not IsNothing(Thread) Then
If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse
Thread.ThreadState = ThreadState.Suspended Then
Thread.Abort()
Thread.Sleep(500)
While Not Thread.ThreadState = ThreadState.Aborted
Thread.Sleep(100)
End While
Thread = Nothing
If ThreadIndex < ThreadList.Count Then
Dim Thread = ThreadList(ThreadIndex)
If Not IsNothing(Thread) Then
If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse
Thread.ThreadState = ThreadState.Suspended OrElse IsNothing(ThreadDataList(ThreadIndex).Process) OrElse (Not IsNothing(ThreadDataList(ThreadIndex).Process) AndAlso ThreadDataList(ThreadIndex).Process.HasExited) Then
Dim nActiveProc As Integer = 0
If ThreadIndex < ThreadDataList.Count Then
Dim CurrThreadStat As ThreadStat = ThreadDataList(ThreadIndex).ThreadStat
Dim CurrProcess As ProcStat = Nothing
If Not IsNothing(CurrThreadStat) Then
CurrProcess = CurrThreadStat.ProcExecutionList(CurrThreadStat.ProcExecutionList.Count - 1)
If Not IsNothing(CurrProcess) AndAlso CurrProcess.StopProc = DateTime.MinValue Then CurrProcess.SetStopProc(DateTime.Now)
If CurrThreadStat.StopThread = DateTime.MinValue Then CurrThreadStat.SetStopThread(DateTime.Now)
End If
' verifico se posso rilanciarlo
For nIndex As Integer = 0 To m_MaxCamInstances - 1
If nIndex < ThreadDataList.Count Then
Dim IndexThreadStat As ThreadStat = ThreadDataList(nIndex).ThreadStat
If Not IsNothing(IndexThreadStat) Then
If IndexThreadStat.ProcExecutionList.Count > 0 Then
Dim IndexProcess As ProcStat = IndexThreadStat.ProcExecutionList(IndexThreadStat.ProcExecutionList.Count - 1)
Dim random As New Random()
Dim nRandWait As Integer = random.Next(15, 30)
Dim RandTimeSpan As TimeSpan = TimeSpan.FromSeconds(nRandWait)
'EgtOutLog("nIndex: " & nIndex)
'EgtOutLog("Now: " & DateTime.Now)
'EgtOutLog("Stop process: " & IndexProcess.StopProc)
'EgtOutLog("nRandWait: " & nRandWait)
'EgtOutLog("RandTimeSpan: " & RandTimeSpan.ToString)
If Not IsNothing(IndexProcess) AndAlso Not IsNothing(CurrProcess) AndAlso (IndexProcess.StopProc = DateTime.MinValue OrElse (DateTime.Now - IndexProcess.StopProc) < TimeSpan.FromSeconds(nRandWait)) Then
nActiveProc += 1
'EgtOutLog("ActiveProc + 1")
End If
End If
End If
End If
Next
End If
'EgtOutLog("Conto processi attivi: " & nActiveProc)
If nActiveProc + nStartingProc + 1 <= Math.Max(2, m_MaxCamInstances) Then
nStartingProc += 1
'EgtOutLog("Ne lancio un altro")
' lo chiudo e rilancio
If ThreadIndex < ThreadDataList.Count Then
If Not IsNothing(ThreadDataList(ThreadIndex).Process) AndAlso Not ThreadDataList(ThreadIndex).Process.HasExited Then ThreadDataList(ThreadIndex).Process.Kill()
Thread.Sleep(500)
Thread.Abort()
Thread.Sleep(500)
While Not Thread.ThreadState = ThreadState.Aborted
Thread.Sleep(100)
End While
Thread = Nothing
Dim ThreadId As Integer = ThreadIndex
ThreadList(ThreadIndex) = New Thread(Sub()
ThreadFunction(ThreadId)
End Sub)
ThreadList(ThreadIndex).SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
ThreadList(ThreadIndex).Start()
End If
nStartingProc -= 1
End If
End If
Else
Dim ThreadId As Integer = ThreadIndex
Thread = New Thread(Sub()
ThreadFunction(ThreadId)
End Sub)
Thread.SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
Thread.Start()
If ThreadIndex < ThreadList.Count Then
ThreadList(ThreadIndex) = New Thread(Sub()
ThreadFunction(ThreadId)
End Sub)
ThreadList(ThreadIndex).SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
ThreadList(ThreadIndex).Start()
End If
End If
Else
Dim ThreadId As Integer = ThreadIndex
ThreadList(ThreadIndex) = New Thread(Sub()
ThreadFunction(ThreadId)
End Sub)
ThreadList(ThreadIndex).SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
ThreadList(ThreadIndex).Start()
End If
Next
If n30SecCounter <= 30 Then
@@ -327,12 +536,22 @@ Public Class ProcMan
'Thread.Sleep(100)
'startAllThreads()
End If
lblRunning.Text = $"threads: {ThreadCount()}/{m_MaxCamInstances}"
Dim nRunningProcess As Integer = 0
If Not IsNothing(ThreadDataList) Then
For ThreadIndex = 0 To ThreadDataList.Count - 1
Dim CurrThread As ThreadData = ThreadDataList(ThreadIndex)
If Not IsNothing(CurrThread) Then
If CurrThread.ThreadStat.StopThread = DateTime.MinValue Then
nRunningProcess += 1
End If
End If
Next
End If
lblRunning.Text = $"threads: {ThreadCount()}/{m_MaxCamInstances}/{nRunningProcess}"
lblRunning.Invalidate()
DisplayQueueStatus()
' colore btn start / stop...
If m_bStopProcess Then
If m_ProgramStatus = ProgramStatuses.STOP Then
StartProcess.BackColor = ButtonBase.DefaultBackColor
StartProcess.ForeColor = ButtonBase.DefaultForeColor
@@ -355,6 +574,7 @@ Public Class ProcMan
End Sub
Private Sub startAllThreads()
If m_ProgramStatus = ProgramStatuses.START Then Return
m_bStopProcess = False
m_bExecutionThreadStoped = False
m_ExecutionThread = New Thread(Sub()
@@ -364,6 +584,9 @@ Public Class ProcMan
m_ExecutionThread.SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
m_ExecutionThread.Start()
m_ProgramStatus = ProgramStatuses.START
#If False Then
'' recupero Id dei DDF
'Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf"
@@ -606,9 +829,14 @@ Public Class ProcMan
' avvio il timer di refresh
TimerProgBar.Enabled = True
TimerProgBar.Start()
TimerResetProcessing.Enabled = True
TimerResetProcessing.Start()
End Sub
Private Sub stopAllThreads()
If m_ProgramStatus = ProgramStatuses.STOP Then Return
m_bStopProcess = True
While Not m_bExecutionThreadStoped
Thread.Sleep(100)
@@ -621,9 +849,7 @@ Public Class ProcMan
m_ExecutionThread = Nothing
End If
ThreadList = Nothing
' fix timer
TimerProgBar.Enabled = False
TimerProgBar.Stop()
m_ProgramStatus = ProgramStatuses.STOP
End Sub
Private Sub StopProcess_Click(sender As Object, e As EventArgs) Handles StopProcess.Click
@@ -647,143 +873,210 @@ Public Class ProcMan
Private Sub ThreadFunction(ThreadIndex As Integer)
Dim MyThreadData As New ThreadData
ThreadDataList(ThreadIndex) = MyThreadData
Dim sExePath As String = "c:\EgtProg\EgtEngine\EgtEngineR32.exe"
Dim sCurrDdfDir As String = "c:\EgtData\WebDoor\Ddf"
Dim CurrThreadStat As New ThreadStat(ThreadIndex, DateTime.Now)
HistoryThreadDataList.Add(CurrThreadStat)
MyThreadData.SetThreadStat(CurrThreadStat)
Dim sDrive As String = "c" ' If(ThreadIndex Mod 2 = 0, "A", "B")
Dim sCurrDdfDir As String = sDrive & ":\EgtData\WebDoor\Ddf"
Dim stopWatch As New Stopwatch()
Dim lExeTime As Long = 0
Dim lOtherTime As Long = 0
While Not m_bStopProcess
MyThreadData.SetThreadOperation(ThreadOperations.WaitingData)
' se c'e' qualcosa da processare
If currWDC.numTask2proc > 0 Then
Dim LastRequest As Dictionary(Of String, String) = currWDC.queueList(1)
If LastRequest.Count > 0 Then
MyThreadData.SetThreadOperation(ThreadOperations.FoundRequest)
Dim Item As KeyValuePair(Of String, String) = LastRequest.First()
Dim bOk As Boolean = Not IsNothing(Item)
If bOk Then
' avvio processo
Dim Proc As Process = New Process()
Proc.StartInfo.FileName = sEgtEnginePath
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = True
Proc.StartInfo.Arguments = ThreadIndex.ToString() & " """ & sDrive & ":\EgtData\WebDoor\TestPipe.lua"""
Proc.StartInfo.UseShellExecute = False
Proc.StartInfo.CreateNoWindow = True
AddHandler Proc.OutputDataReceived, AddressOf Thread_OutputDataReceived
' avvio cronometro
'stopWatch.Reset()
stopWatch.Restart()
' svuoto vecchio set file della porta richiesta
Dim fileList As String() = Directory.GetFiles(sCurrDdfDir, Item.Key + ".*")
' elimino vecchi
If Not IsNothing(fileList) Then
For Each sFile In fileList
File.Delete(sFile)
Next
End If
If Proc.Start() Then
Dim CurrPocStat As New ProcStat(DateTime.Now)
CurrThreadStat.ProcExecutionList.Add(CurrPocStat)
Proc.BeginOutputReadLine()
MyThreadData.SetProcess(Proc)
' scrivo ddf
MyThreadData.SetThreadOperation(ThreadOperations.WritingDdf)
Dim sDdfPath As String = sCurrDdfDir & "\" & Item.Key & ".ddf"
Try
File.WriteAllText(sDdfPath, Item.Value)
Catch ex As Exception
bOk = False
End Try
If bOk Then
MyThreadData.SetThreadOperation(ThreadOperations.ProcessingDdf)
' eseguo calcolo
Dim Proc As Process = New Process()
MyThreadData.SetProcess(Proc)
Proc.StartInfo.FileName = sExePath
Proc.StartInfo.Arguments = """C:\EgtData\WebDoor\Main.lua""" & " """ & sDdfPath & """"
Proc.StartInfo.UseShellExecute = False
If Proc.Start() Then
While Not Proc.HasExited
Thread.Sleep(1)
End While
MyThreadData.SetProcess(Nothing)
' salvo exe time...
stopWatch.Stop()
lExeTime = stopWatch.ElapsedMilliseconds
stopWatch.Restart()
Dim procResults As New List(Of CalcResultDTO)
Dim currRes As New CalcResultDTO
Dim fContent As String = ""
MyThreadData.SetThreadOperation(ThreadOperations.ReadingSvg)
' verifico esistenza file svg e lo carico
bOk = GetFileContent(Path.ChangeExtension(sDdfPath, "svg"), fContent)
' invio risposta
currRes.Validated = Proc.ExitCode = 0 AndAlso bOk
currRes.DoorIdVers = Item.Key
' se NON fosse validato --> messo il messaggio...
If (currRes.Validated) Then
currRes.SvgGen = fContent
Else
bOk = GetFileContent(Path.ChangeExtension(sDdfPath, "txt"), fContent)
currRes.ErrorMsg = fContent
End If
MyThreadData.SetThreadOperation(ThreadOperations.SendResult)
procResults.Add(currRes)
Dim respPut As String = currWDC.SendProcResults(procResults)
stopWatch.Stop()
lOtherTime = stopWatch.ElapsedMilliseconds
' aggiorno thread display...
UpdateThreadList(Item.Key, lExeTime, lOtherTime)
' cambio nomi file generati in old
Dim OldSvg As String = Path.ChangeExtension(sDdfPath, "svg")
Dim NewSvg As String = Path.GetDirectoryName(sDdfPath) & "\" & Path.GetFileNameWithoutExtension(sDdfPath) & "_old.svg"
Try
File.Delete(NewSvg)
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "txt"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "log"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "nge"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "ddf"))
Catch ex As Exception
End Try
Try
File.Move(OldSvg, NewSvg)
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "txt"), Path.ChangeExtension(NewSvg, "txt"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "log"), Path.ChangeExtension(NewSvg, "log"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "nge"), Path.ChangeExtension(NewSvg, "nge"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "ddf"), Path.ChangeExtension(NewSvg, "ddf"))
Catch ex As Exception
End Try
Dim nProc0Wait As Integer = 0
' ciclo per leggere coda ed eseguire
While Not m_bStopProcess AndAlso Not Proc.HasExited
Select Case MyThreadData.WaitProcAnswer
Case ThreadData.ProcComm.Null
MyThreadData.SetThreadOperation(ThreadOperations.WaitingData)
' se c'e' qualcosa da processare
Dim nNumTaskToProcess As Integer = 0
If ThreadIndex = 0 Then
nNumTaskToProcess = currWDC.numTask2proc
If nNumTaskToProcess > 0 Then
If Not m_bCheckOrder Then m_bCheckOrder = True
Else
If m_bCheckOrder Then m_bCheckOrder = False
Thread.Sleep(100)
End If
ElseIf m_bCheckOrder Then
nNumTaskToProcess = currWDC.numTask2proc
If nNumTaskToProcess = 0 Then
m_bCheckOrder = False
End If
stopWatch.Stop()
End If
End If
End If
If m_bCheckOrder Then
Dim LastRequest As Dictionary(Of String, String) = currWDC.queueList(1)
If LastRequest.Count > 0 Then
MyThreadData.SetThreadOperation(ThreadOperations.FoundRequest)
MyThreadData.SetCurrRequest(LastRequest.First())
Dim Item As KeyValuePair(Of String, String) = MyThreadData.CurrRequest
Dim bOk As Boolean = Not IsNothing(Item)
If bOk Then
' avvio cronometro
'stopWatch.Reset()
stopWatch.Restart()
' svuoto vecchio set file della porta richiesta
Dim fileList As String() = Directory.GetFiles(sCurrDdfDir, Item.Key + ".*")
' elimino vecchi
If Not IsNothing(fileList) Then
For Each sFile In fileList
File.Delete(sFile)
Next
End If
' scrivo ddf
MyThreadData.SetThreadOperation(ThreadOperations.WritingDdf)
MyThreadData.SetDdfPath(sCurrDdfDir & "\" & Item.Key & ".ddf")
Dim sDdfPath As String = MyThreadData.sDdfPath
Try
File.WriteAllText(sDdfPath, Item.Value)
Catch ex As Exception
bOk = False
End Try
If bOk Then
MyThreadData.SetThreadOperation(ThreadOperations.ProcessingDdf)
Proc.StandardInput.WriteLine(ThreadIndex & "," & sDdfPath)
MyThreadData.SetWaitProcAnswer(ThreadData.ProcComm.WaitingAnswer)
End If
End If
Else
Thread.Sleep(100)
End If
Else
Thread.Sleep(100)
End If
Case ThreadData.ProcComm.WaitingAnswer
Thread.Sleep(10)
Case ThreadData.ProcComm.AnswerReceived
Dim Item As KeyValuePair(Of String, String) = MyThreadData.CurrRequest
Dim sDdfPath As String = MyThreadData.sDdfPath
Dim bOk As Boolean = True
' salvo exe time...
stopWatch.Stop()
lExeTime = stopWatch.ElapsedMilliseconds
stopWatch.Restart()
Dim procResults As New List(Of CalcResultDTO)
Dim currRes As New CalcResultDTO
Dim fContent As String = ""
MyThreadData.SetThreadOperation(ThreadOperations.ReadingSvg)
' verifico esistenza file svg e lo carico
bOk = GetFileContent(Path.ChangeExtension(sDdfPath, "svg"), fContent)
' invio risposta
currRes.Validated = MyThreadData.nProcResult = 0 AndAlso bOk
currRes.DoorIdVers = Item.Key
' se NON fosse validato --> messo il messaggio...
If (currRes.Validated) Then
currRes.SvgGen = fContent
Else
bOk = GetFileContent(Path.ChangeExtension(sDdfPath, "txt"), fContent)
currRes.ErrorMsg = fContent
End If
MyThreadData.SetThreadOperation(ThreadOperations.SendResult)
procResults.Add(currRes)
Dim respPut As String = currWDC.SendProcResults(procResults)
stopWatch.Stop()
lOtherTime = stopWatch.ElapsedMilliseconds
CurrPocStat.IncrementDoneRequest()
' aggiorno thread display...
UpdateThreadList(Item.Key, lExeTime, lOtherTime)
' cambio nomi file generati in old
Dim OldSvg As String = Path.ChangeExtension(sDdfPath, "svg")
Dim NewSvg As String = Path.GetDirectoryName(sDdfPath) & "\" & Path.GetFileNameWithoutExtension(sDdfPath) & "_old.svg"
Try
File.Delete(NewSvg)
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "txt"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "log"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "nge"))
Catch ex As Exception
End Try
Try
File.Delete(Path.ChangeExtension(NewSvg, "ddf"))
Catch ex As Exception
End Try
Try
File.Move(OldSvg, NewSvg)
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "txt"), Path.ChangeExtension(NewSvg, "txt"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "log"), Path.ChangeExtension(NewSvg, "log"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "nge"), Path.ChangeExtension(NewSvg, "nge"))
Catch ex As Exception
End Try
Try
File.Move(Path.ChangeExtension(OldSvg, "ddf"), Path.ChangeExtension(NewSvg, "ddf"))
Catch ex As Exception
End Try
MyThreadData.SetWaitProcAnswer(ThreadData.ProcComm.Null)
End Select
End While
CurrPocStat.SetStopProc(DateTime.Now)
If m_bStopProcess Then
Proc.StandardInput.WriteLine("quit")
End If
End While
End If
CurrThreadStat.SetStopThread(DateTime.Now)
MyThreadData.SetProcess(Nothing)
MyThreadData.SetThreadOperation(ThreadOperations.Closed)
End Sub
Private Sub Thread_OutputDataReceived(sender As Object, e As DataReceivedEventArgs)
Dim sResult As String = e.Data
If Not String.IsNullOrWhiteSpace(sResult) AndAlso sResult.StartsWith("#42315#,") Then
Dim Results() As String = sResult.Split(","c)
If Results.Count >= 2 Then
Dim nIndex As Integer = -1
Dim nResult As Integer = -1
If Integer.TryParse(Results(1), nIndex) AndAlso nIndex >= 0 Then
If Integer.TryParse(Results(2), nResult) AndAlso nResult >= 0 Then
ThreadDataList(nIndex).SetProcResult(nResult)
End If
ThreadDataList(nIndex).SetWaitProcAnswer(ThreadData.ProcComm.AnswerReceived)
End If
End If
End If
End Sub
Private Sub TimerProgBar_Tick(sender As Object, e As EventArgs) Handles TimerProgBar.Tick
' esegue refresh prog bar
performBarAdvance()
@@ -947,7 +1240,17 @@ Public Class ProcMan
Private Sub ProcMan_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
' forzo chiusura threads!
stopAllThreads()
If m_ProgramStatus = ProgramStatuses.START Then stopAllThreads()
EgtExit()
' fix timer
TimerProgBar.Stop()
TimerProgBar.Enabled = False
TimerResetProcessing.Stop()
TimerResetProcessing.Enabled = False
TimerUI.Stop()
TimerUI.Enabled = False
TimerCheck.Stop()
TimerCheck.Enabled = False
End Sub
Private Sub chkAutoRestart_CheckedChanged(sender As Object, e As EventArgs) Handles chkAutoRestart.CheckedChanged
@@ -991,6 +1294,146 @@ Public Class ProcMan
startAllThreads()
End Sub
Private Sub ProcMan_Load(sender As Object, e As EventArgs) Handles MyBase.Load
m_IniFilePath = AppDomain.CurrentDomain.BaseDirectory & INI_FILE_NAME
ManageInstance()
' Imposto tipo di chiave
EgtSetLockType(KEY_TYPE.HW)
' Leggo e imposto chiave di protezione
Dim sLicFileName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName, m_IniFilePath)
Dim sLicFile As String = AppDomain.CurrentDomain.BaseDirectory & sLicFileName
Dim sKey As String = String.Empty
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_IniFilePath) = 1)
EgtSetNetHwKey(bNetHwKey)
' Recupero livello e opzioni della chiave
Dim nKeyLevel As Integer = 0
Dim nKeyOptions As Integer = 0
Dim bKey As Boolean = EgtGetKeyLevel(9935, 2505, 1, nKeyLevel) And
EgtGetKeyOptions(9935, 2505, 1, nKeyOptions)
' Inizializzazione generale di EgtInterface
m_sLogFile = AppDomain.CurrentDomain.BaseDirectory & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & m_nInstance.ToString() & ")" & vbLf &
My.Application.Info.Title.ToString() & " ver. " &
My.Application.Info.Version.Major.ToString() &
"." & My.Application.Info.Version.Minor.ToString() &
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
My.Application.Info.Version.Revision.ToString()
EgtInit(0, m_sLogFile, sLogMsg)
If Not bKey Then
MessageBox.Show("No licences available!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End
End If
' leggo sorgente richieste rest da ini
GetPrivateProfileString(S_GENERAL, K_BASEIP, "", baseIp, m_IniFilePath)
GetPrivateProfileString(S_GENERAL, K_BASEURL, "", baseUrl, m_IniFilePath)
' inizializzo oggetto web
currWDC = New WDC(baseIp, baseUrl, codPost)
txtNumThread.Text = GetPrivateProfileInt(S_GENERAL, K_STARTINSTANCES, 1, m_IniFilePath).ToString()
' recupero path EgtEngine
GetPrivateProfileString(S_GENERAL, K_PROCESSPATH, "", sEgtEnginePath, m_IniFilePath)
MyBase.Text = baseUrl
End Sub
Dim m_objMutex As Mutex
Dim m_bFirstInstance As Boolean
Dim m_nInstance As Integer
Dim m_IniFilePath As String = ""
Dim m_sLogFile As String = ""
Private Sub ManageInstance()
Dim bCreated As Boolean
Try
Dim sMutexName As String = "Global\WebDoorCreator.CamSrv"
GetPrivateProfileString(S_GENERAL, K_MUTEXNAME, sMutexName, sMutexName, m_IniFilePath)
m_objMutex = New Mutex(False, sMutexName, bCreated)
Catch
bCreated = False
End Try
m_bFirstInstance = bCreated
If bCreated Then
' Prima istanza
m_nInstance = 1
' Aggiorno stato istanze attive
WritePrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString(), m_IniFilePath)
Else
' Leggo il massimo numero di istanze ammesse
Const MAX_INST As Integer = 32
Dim nMaxInst As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXINST, 1, m_IniFilePath)
nMaxInst = Math.Max(1, Math.Min(nMaxInst, MAX_INST))
' Cerco il primo indice di istanza libero
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0, m_IniFilePath)
m_nInstance = 1
Dim nMask As Integer = 1
While (nTmp And nMask) <> 0 And m_nInstance <= MAX_INST
m_nInstance += 1
nMask *= 2
End While
' Se l'indice supera il massimo
If m_nInstance > nMaxInst Then
' porto in primo piano la prima istanza
Dim bFound As Boolean = False
' processi del programma a 32 bit
Dim localProc As Process() = Process.GetProcessesByName("WebDoorCreator.CamSrv")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
ShowWindow(p.MainWindowHandle, 1)
Exit For
End If
Next
' se non trovati processi a 32 bit provo a 64 bit
If Not bFound Then
localProc = Process.GetProcessesByName("IcarusR64")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
ShowWindow(p.MainWindowHandle, SW.RESTORE)
Exit For
End If
Next
End If
' esco dal programma
End
End If
' Aggiorno stato istanze attive
nTmp += (1 << (m_nInstance - 1))
WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString(), m_IniFilePath)
End If
End Sub
Friend Function GetMaxInstances() As Integer
' Leggo il massimo numero di istanze ammesse
Dim nMaxInst As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXINST, 1, m_IniFilePath)
Return 1 ' Max(1, Min(nMaxInst, MAX_INST))
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' chiudo tutti i processi EgtEngine
' processi del programma a 32 bit
Dim localProc As Process() = Process.GetProcessesByName("EgtEngineR32")
For Each p As Process In localProc
p.Kill()
Next
localProc = Process.GetProcessesByName("EgtEngineR64")
For Each p As Process In localProc
p.Kill()
Next
End Sub
Private Sub TimerResetProcessing_Tick(sender As Object, e As EventArgs) Handles TimerResetProcessing.Tick
If Not IsNothing(currWDC) Then
currWDC.ResetQueueProcessing()
End If
End Sub
#End Region
End Class
@@ -50,7 +50,32 @@
<PropertyGroup>
<ApplicationIcon>Resources\Temp.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\Debug\</OutputPath>
<DocumentationFile>WebDoorCreator.CamSrv.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\Release\</OutputPath>
<DocumentationFile>WebDoorCreator.CamSrv.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib, Version=2.5.5.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ExtLib\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\DemoServer\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
@@ -96,6 +121,7 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConstIni.vb" />
<Compile Include="ProcMan.vb">
<SubType>Form</SubType>
</Compile>
+3 -1
View File
@@ -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";
+50
View File
@@ -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" />
+426 -127
View File
@@ -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)
{
+3 -3
View File
@@ -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")
);
}
+4 -8
View File
@@ -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> &nbsp; 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> &nbsp; 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") &nbsp; &nbsp;</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
}
}
}
+28 -1
View File
@@ -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>
+111 -109
View File
@@ -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"
+5 -4
View File
@@ -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"
}
}