Compare commits
168 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cae5693e7 | |||
| ea1e37055b | |||
| 221f7c03fd | |||
| 885b4b78b2 | |||
| 37986b0bcb | |||
| 670b71841d | |||
| 225ee35143 | |||
| 93906b747e | |||
| 4cde37cd5f | |||
| 1ed9ab4af9 | |||
| f612613977 | |||
| 96366e26e7 | |||
| 2ac91927dc | |||
| 6400e37944 | |||
| 1d9f550a02 | |||
| db7d0466f2 | |||
| 3fd9ef8383 | |||
| 795b60ee86 | |||
| f7182715e5 | |||
| 7547cc7035 | |||
| 99ee856340 | |||
| b02b9ccbf7 | |||
| 71e5fa0674 | |||
| ad772b8160 | |||
| 8737eefd31 | |||
| 9d0c29358d | |||
| 49f6114b67 | |||
| b723109f4e | |||
| 852d17ed0e | |||
| 4329ab8552 | |||
| ecb40ab66f | |||
| 1d82e2ba05 | |||
| e1dc3215a1 | |||
| e7665ff1e0 | |||
| e1addcf11b | |||
| 85259f334c | |||
| 7bda460b7b | |||
| 56aea1cc2c | |||
| 716cdc4a61 | |||
| 69c02fdb8a | |||
| 613339b662 | |||
| 4f4a0ec2b4 | |||
| f273aaaf5a | |||
| a0bbf356a9 | |||
| facd44c6f5 | |||
| e534651bf3 | |||
| 74b08ceefc | |||
| e798a764de | |||
| 30529d0825 | |||
| 7bebc6e8ea | |||
| 6b82975b9d | |||
| f5298172e6 | |||
| 2a9a1f4882 | |||
| 6f513809de | |||
| 9ef952de54 | |||
| 67b8464c5f | |||
| fbdddc0eee | |||
| 88b4e8686d | |||
| cedbd9931e | |||
| 43187d8d29 | |||
| d0f8a94d36 | |||
| fd91e8fe19 | |||
| df73a17126 | |||
| a38b0aa9cb | |||
| 316c028c86 | |||
| dcb51b7763 | |||
| aeb52a3576 | |||
| 452e316851 | |||
| a45a7390c3 | |||
| c020e5fff3 | |||
| 366ed08fb4 | |||
| 9465c859f9 | |||
| f4b6112a77 | |||
| 474f480198 | |||
| 931abece6f | |||
| 5b5d04cd5f | |||
| c202b7d387 | |||
| 69179e4af0 | |||
| 7b28b543e8 | |||
| 71f1cb1246 | |||
| 01a50dbfec | |||
| bff4251fbe | |||
| 7b6443e4d4 | |||
| ce122ba296 | |||
| 101429cf11 | |||
| 7cad7d00e7 | |||
| ba447558d4 | |||
| 337a4252f9 | |||
| c8098edb97 | |||
| cc9a1a8342 | |||
| d860bbbed5 | |||
| a5b134e32b | |||
| da742620b0 | |||
| 7bc955365f | |||
| 706a9bce17 | |||
| ab5757d0bd | |||
| 2fa5a0df16 | |||
| cba8ceb688 | |||
| 7b007f6ca5 | |||
| a67691278b | |||
| 7d3e1533fd | |||
| 084973df66 | |||
| 179565d47d | |||
| c35eb00002 | |||
| 16248e2346 | |||
| 9bf93c4996 | |||
| 82248f1068 | |||
| b0c37aa79f | |||
| 967a4e0e2f | |||
| 361854f5b5 | |||
| 52d65add22 | |||
| b868660ed9 | |||
| 2bbfa4b6bf | |||
| 118e43f0c2 | |||
| 726df4d36c | |||
| 68204acddd | |||
| 2b2e258020 | |||
| 17bbaf2136 | |||
| b2fd3a39fa | |||
| f843aff337 | |||
| 13afc6464f | |||
| eb64db41da | |||
| 65e54aefbe | |||
| e44d1e04a2 | |||
| fa948fd5d0 | |||
| 30fa3b8444 | |||
| 35815c3a56 | |||
| 4585ac4bf8 | |||
| 70cd621f80 | |||
| 145a0f5c7e | |||
| 9bac691032 | |||
| ba7d395d20 | |||
| 3c07a3ae26 | |||
| ca5731d2e6 | |||
| f8426f304a | |||
| b9414c7a48 | |||
| 6c9c3d8d85 | |||
| 5df108a979 | |||
| f15b1694f7 | |||
| 30e37531a2 | |||
| 215383c630 | |||
| 5df5391030 | |||
| 530faf053f | |||
| 592034c9d4 | |||
| 2a2e31d087 | |||
| 419150a41f | |||
| fc4be10caa | |||
| 2413b27678 | |||
| 95ff88ac11 | |||
| 54d7e594f1 | |||
| 7900141bda | |||
| 13953a86d6 | |||
| 7f0ee8ad7f | |||
| 788112e54e | |||
| 0e8ec13e68 | |||
| 67fe028cb6 | |||
| 55f4ee077d | |||
| cc6b195aa3 | |||
| 06b06db04d | |||
| f3810fa708 | |||
| cd32764c1e | |||
| 6a03d1e107 | |||
| 3e51ab18d2 | |||
| 9218ac7d5b | |||
| c699d8e2e5 | |||
| 6da0285af3 | |||
| 0b5d4f4909 | |||
| b26f18575f |
+21
-10
@@ -99,6 +99,9 @@ WDC.Api:staging:
|
||||
stage: staging
|
||||
tags:
|
||||
- win
|
||||
environment:
|
||||
name: staging
|
||||
url: https://iis01.egalware.com/WDC/SRV/
|
||||
variables:
|
||||
APP_NAME: WebDoorCreator.API
|
||||
SOL_NAME: WebDoorCreator.UI
|
||||
@@ -111,6 +114,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
|
||||
@@ -118,7 +123,7 @@ WDC.UI:staging:
|
||||
- win
|
||||
environment:
|
||||
name: staging
|
||||
url: https://iis01.egalware.com/GPW/WDC.UI
|
||||
url: https://iis01.egalware.com/WDC/UI/
|
||||
variables:
|
||||
APP_NAME: WebDoorCreator.UI
|
||||
SOL_NAME: WebDoorCreator.UI
|
||||
@@ -139,7 +144,7 @@ WDC.Api:deploy:
|
||||
- win
|
||||
environment:
|
||||
name: production
|
||||
url: https://seriate.egalware.com/GPW/WDC.UI
|
||||
url: https://wdc.egalware.com/SRV/
|
||||
variables:
|
||||
APP_NAME: WebDoorCreator.API
|
||||
SOL_NAME: WebDoorCreator.UI
|
||||
@@ -151,15 +156,18 @@ 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 IIS01
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-IIS01.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 OVH IIS02
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-IIS02.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
|
||||
|
||||
WDC.UI:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
environment:
|
||||
name: production
|
||||
url: https://wdc.egalware.com/UI/
|
||||
variables:
|
||||
APP_NAME: WebDoorCreator.UI
|
||||
SOL_NAME: WebDoorCreator.UI
|
||||
@@ -171,10 +179,13 @@ 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 IIS01
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-IIS01.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 OVH IIS02
|
||||
- dotnet publish -p:PublishProfile=IIS-OVH-IIS02.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:
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>WebDoorCreator - Egalware</i>
|
||||
<h4>Version: 0.9.2401.0415</h4>
|
||||
<h4>Version: 0.9.2505.1316</h4>
|
||||
<br /> Release note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2401.0415
|
||||
0.9.2505.1316
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2401.0415</version>
|
||||
<version>0.9.2505.1316</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())
|
||||
@@ -56,16 +71,6 @@ namespace WebDoorCreator.API.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
#if false
|
||||
var mySvg = SvgDocument.FromSvg<SvgDocument>(svgContent);
|
||||
//result = System.Text.Encoding.UTF8.GetBytes(svgContent);
|
||||
var myBmp = mySvg.Draw();
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
|
||||
result= stream.ToArray();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return File(result, "image/png");
|
||||
}
|
||||
@@ -73,7 +78,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 +99,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;
|
||||
}
|
||||
|
||||
@@ -165,9 +196,10 @@ namespace WebDoorCreator.API.Controllers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("TakeNextItems")]
|
||||
public async Task<Dictionary<string, string>> TakeProcessingItems(int numItems = 10)
|
||||
public async Task<Dictionary<string, CalcReqtDTO>> 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,95 @@
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using NLog;
|
||||
using System.Net.NetworkInformation;
|
||||
using WebDoorCreator.Data;
|
||||
|
||||
namespace WebDoorCreator.API.Health
|
||||
{
|
||||
public class Checks
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public static async Task<HealthCheckResult> ConfigCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check Config table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetConfig
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check Config table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> DoorsCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check DOOR table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetDoor
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check DOOR table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> OrdersCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check ORDER table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetOrders
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check ORDER table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> PingCheck(string hostName)
|
||||
{
|
||||
var description = $"Ping to {hostName}";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (var thePing = new Ping())
|
||||
{
|
||||
var pingResult = await thePing.SendPingAsync(hostName);
|
||||
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime);
|
||||
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString());
|
||||
if (pingResult.Status == IPStatus.Success)
|
||||
{
|
||||
description += $" - {pingResult.RoundtripTime}ms";
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
using HealthChecks.UI.Client;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.CodeAnalysis.FlowAnalysis;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using StackExchange.Redis;
|
||||
using StackExchange.Redis.Extensions.Core.Configuration;
|
||||
using StackExchange.Redis.Extensions.Newtonsoft;
|
||||
@@ -14,6 +18,7 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// configuration setup
|
||||
ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
// Redis
|
||||
var connStringRedis = configuration.GetConnectionString("Redis");
|
||||
if (string.IsNullOrEmpty(connStringRedis))
|
||||
@@ -30,6 +35,67 @@ builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
// APP MAIN setup
|
||||
string connectionString = configuration.GetConnectionString("WDC.DB") ?? "";
|
||||
string dbServerAddr = "127.0.0.1";
|
||||
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
{
|
||||
connectionString = "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.SRV;";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (connectionString.Contains("Server"))
|
||||
{
|
||||
bool trovato = false;
|
||||
var dbTokens = connectionString.Split(";");
|
||||
int numTok = dbTokens.Count();
|
||||
int idx = 0;
|
||||
while (!trovato && idx < numTok)
|
||||
{
|
||||
if (dbTokens[idx].StartsWith("Server="))
|
||||
{
|
||||
// rimuovo la chaive Server...
|
||||
dbServerAddr = dbTokens[idx].Replace("Server=", "");
|
||||
// se ci fosse un nome (tipo \\sqlexpress) rimuovo...
|
||||
if (dbServerAddr.Contains("\\"))
|
||||
{
|
||||
int sIdx = dbServerAddr.IndexOf("\\");
|
||||
dbServerAddr = dbServerAddr.Substring(0, sIdx);
|
||||
}
|
||||
trovato = true;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// healthchecks
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddSqlServer(connectionString, healthQuery: "SELECT 1;", name: "SqlServer", failureStatus: HealthStatus.Degraded, tags: new string[] { "DB", "MsSql" })
|
||||
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => WebDoorCreator.API.Health.Checks.PingCheck(dbServerAddr))
|
||||
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => WebDoorCreator.API.Health.Checks.PingCheck(redisSrvAddr))
|
||||
// 512 MB max allocated memory
|
||||
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded)
|
||||
.AddRedis(connStringRedis, "Redis", failureStatus: HealthStatus.Degraded)
|
||||
.AddAsyncCheck($"Config Table", () => WebDoorCreator.API.Health.Checks.ConfigCount(configuration))
|
||||
.AddAsyncCheck($"Orders Table", () => WebDoorCreator.API.Health.Checks.OrdersCount(configuration))
|
||||
.AddAsyncCheck($"Doors Table", () => WebDoorCreator.API.Health.Checks.DoorsCount(configuration))
|
||||
;
|
||||
|
||||
#if false
|
||||
builder.Services
|
||||
.AddHealthChecksUI(s =>
|
||||
{
|
||||
s.AddHealthCheckEndpoint("WDC_API_HC", "health");
|
||||
s.SetEvaluationTimeInSeconds(60);
|
||||
s.SetMinimumSecondsBetweenFailureNotifications(120);
|
||||
s.SetApiMaxActiveRequests(5);
|
||||
s.SetHeaderText("WDC.API Health Check Status");
|
||||
})
|
||||
.AddInMemoryStorage();
|
||||
#endif
|
||||
|
||||
// abilitazione x email management con MailKit
|
||||
//builder.Services.AddTransient<IEmailSender, MailKitEmailSender>();
|
||||
builder.Services.AddSingleton<IEmailSender, MailKitEmailSender>();
|
||||
@@ -74,24 +140,24 @@ if (app.Environment.IsDevelopment() || app.Environment.IsStaging())
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
|
||||
//// cultura IT...
|
||||
//var supportedCultures = new[]{
|
||||
// new CultureInfo("it-IT")
|
||||
// };
|
||||
//app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
//{
|
||||
// DefaultRequestCulture = new RequestCulture("it-IT"),
|
||||
// SupportedCultures = supportedCultures,
|
||||
// FallBackToParentCultures = false
|
||||
//});
|
||||
//CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
|
||||
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
// config healthcheck: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks
|
||||
// prende tutti i predicati
|
||||
app.MapHealthChecks("/health", new HealthCheckOptions
|
||||
{
|
||||
Predicate = _ => true,
|
||||
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
|
||||
});
|
||||
|
||||
// nasconde tutti i dettagli
|
||||
app.MapHealthChecks("/health/live", new HealthCheckOptions
|
||||
{
|
||||
Predicate = _ => false
|
||||
});
|
||||
|
||||
app.Run();
|
||||
|
||||
@@ -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/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-04-19T17:27:31.3742108Z;False|2024-04-19T16:51:43.3272308+02:00;False|2024-04-19T16:41:46.2086401+02:00;False|2024-04-19T16:41:31.3019711+02:00;False|2024-04-19T16:08:22.4275238+02:00;False|2024-04-19T16:05:18.6039531+02:00;False|2024-04-19T15:59:02.0838144+02:00;True|2024-02-15T19:34:35.8362293+01:00;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>
|
||||
@@ -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/swagger/index.html</SiteUrlToLaunchAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<MSDeployServiceURL>https://wdc-w-iis-02.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-04-19T17:27:31.3742108Z;False|2024-04-19T16:51:43.3272308+02:00;False|2024-04-19T16:41:46.2086401+02:00;False|2024-04-19T16:41:31.3019711+02:00;False|2024-04-19T16:08:22.4275238+02:00;False|2024-04-19T16:05:18.6039531+02:00;False|2024-04-19T15:59:02.0838144+02:00;True|2024-02-15T19:34:35.8362293+01:00;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>
|
||||
@@ -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/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>Default Web Site/WDC/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+sBAAAANAh+Q4GwYESjv9I3Vz/gKgAAAAACAAAAAAADZgAAwAAAABAAAAAZCj4Je1goQrORLePgnlVVAAAAAASAAACgAAAAEAAAAGZfY+EFaA+HwqpXWVf0/JgYAAAAz5wRfMtrjB7GbijGZUlW6g9q8ulJwQecFAAAADgQDtnMlYLrSQDGZI7Dg2OKfUhu</EncryptedPassword>
|
||||
<History>True|2024-04-19T17:25:01.4640398Z;False|2024-04-19T19:21:34.3241722+02:00;False|2024-04-19T19:15:31.0848527+02:00;False|2024-04-19T19:11:09.2511710+02:00;False|2024-04-19T19:09:49.4254115+02:00;False|2024-04-19T19:08:44.7222054+02:00;False|2024-04-19T19:01:26.7064709+02:00;False|2024-04-19T18:59:58.4177224+02:00;False|2024-04-19T18:59:10.9459272+02:00;False|2024-04-19T16:51:43.3272308+02:00;False|2024-04-19T16:41:46.2086401+02:00;False|2024-04-19T16:41:31.3019711+02:00;False|2024-04-19T16:08:22.4275238+02:00;False|2024-04-19T16:05:18.6039531+02:00;False|2024-04-19T15:59:02.0838144+02:00;True|2024-02-15T19:34:35.8362293+01:00;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,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-OVH-IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-OVH-IIS02.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-OVH-PROD-test.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
@@ -15,13 +18,26 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IIS-OVH-IIS02.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS-OVH-PROD-test.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS-OVH-IIS01.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="6.0.4" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="6.0.2" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.System" Version="6.0.5" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="6.0.5" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.5" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.5" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.5" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.29" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="6.0.29" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.3" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.122" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="9.1.0" />
|
||||
@@ -38,6 +54,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;"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"Redis": "nkcredis.steamware.net:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
|
||||
"WDC.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;"
|
||||
"Redis": "redis.ufficio:26379,serviceName=devel, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false",
|
||||
"WDC.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.SRV;"
|
||||
},
|
||||
"ExternalProviders": {
|
||||
"MailKit": {
|
||||
@@ -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,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
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' 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_LOCKID As String = "LockId"
|
||||
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
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
+627
-159
@@ -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,230 @@ 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, CalcReqtDTO) = currWDC.queueList(1)
|
||||
If LastRequest.Count > 0 Then
|
||||
MyThreadData.SetThreadOperation(ThreadOperations.FoundRequest)
|
||||
|
||||
' ToDo !!!
|
||||
' gestione cablata x soli svg...
|
||||
' da qui implementazione svg/3dm...
|
||||
If LastRequest.First().Value.MimeType = "3dm" Then
|
||||
End If
|
||||
|
||||
Dim ConvItem As KeyValuePair(Of String, String)
|
||||
ConvItem = New KeyValuePair(Of String, String)(LastRequest.First().Key, LastRequest.First().Value.DDF)
|
||||
MyThreadData.SetCurrRequest(ConvItem)
|
||||
|
||||
' vecchia versione
|
||||
'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
|
||||
Try
|
||||
File.Delete(sFile)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
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)
|
||||
' !!! ToDo: inserire TIPO di richiesta secondo quanto ricevuto....
|
||||
' invio risposta
|
||||
currRes.Validated = MyThreadData.nProcResult = 0 AndAlso bOk
|
||||
currRes.DoorIdVers = Item.Key
|
||||
' per ora cablato a svg, prendere da MimeType richiesta...
|
||||
currRes.MimeType = "svg"
|
||||
|
||||
' se NON fosse validato --> messo il messaggio...
|
||||
If (currRes.Validated) Then
|
||||
currRes.RawContent = 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 +1260,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 +1314,151 @@ 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)
|
||||
'Dim sLockId As String = ""
|
||||
'EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
|
||||
'If Not String.IsNullOrEmpty(sLockId) Then
|
||||
' Dim x = EgtSetLockId(sLockId)
|
||||
'End If
|
||||
'' 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>
|
||||
|
||||
@@ -24,10 +24,14 @@ namespace WebDoorCreator.Core
|
||||
public static readonly string CALC_REQ_ERRS = $"{BASE_HASH}:CalcRequests:Errors";
|
||||
public static readonly string CALC_REQ_PEND = $"{BASE_HASH}:CalcRequests:Pending";
|
||||
public static readonly string CALC_REQ_PROC = $"{BASE_HASH}:CalcRequests:Processing";
|
||||
public static readonly string CALC_REQ_TYPE = $"{BASE_HASH}:CalcRequests:Type";
|
||||
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 CALC_REQ_VETO_REC = $"{BASE_HASH}:CalcRequests:VetoRecalc";
|
||||
public static readonly string DOOR_TPL_LIST = $"{BASE_HASH}:Template:DoorList";
|
||||
|
||||
|
||||
// REDIS KEY dati x registrazione statistiche esecuzione
|
||||
public static readonly string STATS_DATA = $"{BASE_HASH}:CallStats";
|
||||
|
||||
// REDIS Channels messaggi x QueueMan (verso UI/srv)
|
||||
public static readonly string CALC_REQ_QUEUE = $"CalcRequest";
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Core
|
||||
{
|
||||
public class ExecStats
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Numero chiamate registrate
|
||||
/// </summary>
|
||||
public int NumCall { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Durata totale chiamate
|
||||
/// </summary>
|
||||
public TimeSpan TotalTime { get; set; } = new TimeSpan(0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Tempo medio (calcolato)
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public TimeSpan AvgTime
|
||||
{
|
||||
get
|
||||
{
|
||||
TimeSpan answ = TotalTime;
|
||||
if (NumCall > 1)
|
||||
{
|
||||
answ = TotalTime / NumCall;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Init classe
|
||||
/// </summary>
|
||||
/// <param name="numCall"></param>
|
||||
/// <param name="duration"></param>
|
||||
public ExecStats(int numCall, TimeSpan duration)
|
||||
{
|
||||
this.NumCall = numCall;
|
||||
this.TotalTime = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.14" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.27" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="ReportViewerCore.NETCore" Version="15.1.17" />
|
||||
<PackageReference Include="ToDataTable" Version="0.1.2" />
|
||||
|
||||
@@ -158,7 +158,6 @@ namespace WebDoorCreator.Data.Controllers
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
//Log.Info("Dispose di GWMSController");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -930,6 +929,11 @@ namespace WebDoorCreator.Data.Controllers
|
||||
.Database
|
||||
.ExecuteSqlRaw("exec dbo.stp_ListVal_Import");
|
||||
|
||||
// stored x pulizia folder rimaste in giro
|
||||
storedRes = localDbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("exec dbo.stp_ListVal_FixDix");
|
||||
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace WebDoorCreator.Data.DDF
|
||||
{
|
||||
string outDdf = "";
|
||||
try
|
||||
{
|
||||
{
|
||||
DoorOpsDTO CurrentDoorOp = new DoorOpsDTO();
|
||||
EdgesDto CurrentEdges = new EdgesDto();
|
||||
SizeDto CurrentSize = new SizeDto();
|
||||
@@ -46,10 +46,13 @@ namespace WebDoorCreator.Data.DDF
|
||||
FinishingDto CurrentFinishing = new FinishingDto();
|
||||
DDFDto CurrentConf = new DDFDto();
|
||||
ListValuesModel CurrentCompoOrder = new ListValuesModel();
|
||||
Dictionary<string, List<Dictionary<string, string>>> dictDoorOP = new Dictionary<string, List<Dictionary<string, string>>>();
|
||||
Dictionary<string, Dictionary<string, string>> dictBaseDoorOp = new Dictionary<string, Dictionary<string, string>>();
|
||||
Dictionary<string, Dictionary<string, string>> dictBaseSwing = new Dictionary<string, Dictionary<string, string>>();
|
||||
// per prima cosa popolo gli oggetti di appoggio...
|
||||
dictDoorOP = new Dictionary<string, List<Dictionary<string, string>>>();
|
||||
var i = 0;
|
||||
foreach (var item in listOp.Where(x=>x.ObjectId != "Size" && x.ObjectId != "Profiles" && x.ObjectId != "Swing" && x.ObjectId != "Properties" && x.ObjectId != "Finishing"))
|
||||
foreach (var item in listOp.Where(x => x.ObjectId != "Size" && x.ObjectId != "Profiles" && x.ObjectId != "Swing" && x.ObjectId != "Properties" && x.ObjectId != "Finishing"))
|
||||
{
|
||||
var deserialized = JsonConvert.DeserializeObject<Dictionary<string, string>>(item.JsoncActVal!);
|
||||
if (deserialized != null)
|
||||
@@ -122,7 +125,7 @@ namespace WebDoorCreator.Data.DDF
|
||||
}
|
||||
i++;
|
||||
}
|
||||
CurrentSize.size = dictBaseDoorOp;
|
||||
CurrentSize.size = dictBaseDoorOp;
|
||||
string sizeSer = CurrentSize.GetSerialized(RemDoorOp);
|
||||
//dictBaseDoorOp.Clear();
|
||||
foreach (var item in listOp.Where(x => x.ObjectId == "Swing"))
|
||||
@@ -148,9 +151,6 @@ namespace WebDoorCreator.Data.DDF
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected Dictionary<string, List<Dictionary<string, string>>> dictDoorOP { get; set; } = new Dictionary<string, List<Dictionary<string, string>>>();
|
||||
protected Dictionary<string, Dictionary<string, string>> dictBaseDoorOp { get; set; } = new Dictionary<string, Dictionary<string, string>>();
|
||||
protected Dictionary<string, Dictionary<string, string>> dictBaseSwing { get; set; } = new Dictionary<string, Dictionary<string, string>>();
|
||||
protected List<string> FootRows { get; set; } = new List<string>();
|
||||
protected string FormatVers { get; set; } = "0";
|
||||
protected List<string> HeadRows { get; set; } = new List<string>();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Data.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto contenitore richiesta calcolo
|
||||
/// </summary>
|
||||
public class CalcReqtDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// DDF file content (origin)
|
||||
/// </summary>
|
||||
public string DDF { get; set; } = "";
|
||||
/// <summary>
|
||||
/// MimeType (out) requested: svg / 3dm...
|
||||
/// </summary>
|
||||
public string MimeType { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,13 @@ namespace WebDoorCreator.Data.DTO
|
||||
/// </summary>
|
||||
public string ErrorMsg { get; set; } = "";
|
||||
/// <summary>
|
||||
/// SVG generated
|
||||
/// Object RAW generated output ( was SvgGen )
|
||||
/// </summary>
|
||||
public string SvgGen { get; set; } = "";
|
||||
public string RawContent { get; set; } = "";
|
||||
/// <summary>
|
||||
/// MimeType: svg / 3dm...
|
||||
/// </summary>
|
||||
public string MimeType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Artifats path (ex 3d zip/pack)
|
||||
/// </summary>
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace WebDoorCreator.Data.DTO
|
||||
}
|
||||
if (item.Contains("Separator"))
|
||||
{
|
||||
//sb.Remove(item);
|
||||
sb.AppendLine(" ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace WebDoorCreator.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||
/// </summary>
|
||||
/// <param name="memKey">Chiave REDIS x salvare valore</param>
|
||||
/// <param name="message"></param>
|
||||
public bool saveAndSendMessage(string memKey, string message)
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -119,12 +124,6 @@ namespace WebDoorCreator.Data
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||
/// </summary>
|
||||
/// <param name="memKey">Chiave REDIS x salvare valore</param>
|
||||
/// <param name="message"></param>
|
||||
}
|
||||
|
||||
public class PubSubEventArgs : EventArgs
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -15,11 +15,11 @@ namespace WebDoorCreator.Data
|
||||
// Default seeded users
|
||||
builder.HasData(
|
||||
// SuperAdmins
|
||||
getNewTestRec("zaccaria.majid@egalware.com", "th1sIsTh3R1vrOfThNgt98"),
|
||||
getNewTestRec("samuele.locatelli@egalware.com", "th1sIsTh3R1vrOfThNgt96"),
|
||||
getNewTestRec("emmanuele.sassi@egalware.com", "th1sIsTh3R1vrOfThNgt98!"),
|
||||
// Admin
|
||||
getNewTestRec("zaccaria.majid01@egalware.com", "th1sIsTh3R1vrOfThNgt94"),
|
||||
getNewTestRec("zaccaria.majid02@egalware.com", "th1sIsTh3R1vrOfThNgt92")
|
||||
getNewTestRec("marco.locatelli@egalware.com", "th1sIsTh3R1vrOfThNgt94"),
|
||||
getNewTestRec("samuele@steamware.net", "th1sIsTh3R1vrOfThNgt92")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,10 @@ namespace WebDoorCreator.Data
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
#if false
|
||||
public WDCDataContext()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
public WDCDataContext(IConfiguration configuration)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 01A");
|
||||
Log.Trace("WDCDataContext starting 01A");
|
||||
_configuration = configuration;
|
||||
try
|
||||
{
|
||||
@@ -38,7 +33,7 @@ namespace WebDoorCreator.Data
|
||||
|
||||
public WDCDataContext(DbContextOptions<WDCDataContext> options, IConfiguration configuration) : base(options)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 01B");
|
||||
Log.Trace("WDCDataContext starting 01B");
|
||||
_configuration = configuration;
|
||||
// verifico SE devo eseguire la migration del DB IDENT...
|
||||
bool disableMigrate = _configuration.GetValue<bool>("SetupOpt:DisableWDCMigrate");
|
||||
@@ -113,7 +108,7 @@ namespace WebDoorCreator.Data
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
Log.Info("WDCDataContext starting 02");
|
||||
Log.Trace("WDCDataContext starting 02");
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("WDC.DB");
|
||||
@@ -134,6 +129,7 @@ namespace WebDoorCreator.Data
|
||||
// hierarchId eliminato
|
||||
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=WebDoorCreator;Trusted_Connection=True;");
|
||||
}
|
||||
Log.Trace("WDCDataContext starting 03");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2307.3111" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2402.2411" />
|
||||
<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>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.SDK
|
||||
{
|
||||
/// Oggetto contenitore richiesta calcolo
|
||||
/// </summary>
|
||||
public class CalcReqtDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// DDF file content (origin)
|
||||
/// </summary>
|
||||
public string DDF { get; set; } = "";
|
||||
/// <summary>
|
||||
/// MimeType (out) requested: svg / 3dm...
|
||||
/// </summary>
|
||||
public string MimeType { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,13 @@ namespace WebDoorCreator.SDK
|
||||
/// </summary>
|
||||
public string ErrorMsg { get; set; } = "";
|
||||
/// <summary>
|
||||
/// SVG generated
|
||||
/// Object RAW generated output ( was SvgGen )
|
||||
/// </summary>
|
||||
public string SvgGen { get; set; } = "";
|
||||
public string RawContent { get; set; } = "";
|
||||
/// <summary>
|
||||
/// MimeType: svg / 3dm...
|
||||
/// </summary>
|
||||
public string MimeType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Articat path (ex 3d zip/pack)
|
||||
/// </summary>
|
||||
|
||||
@@ -125,9 +125,9 @@ namespace WebDoorCreator.SDK
|
||||
/// <summary>
|
||||
/// Elenco degli item da processare, nel formato DoorId, Vers
|
||||
/// </summary>
|
||||
public Dictionary<string, string> queueList(int maxNum)
|
||||
public Dictionary<string, CalcReqtDTO> queueList(int maxNum)
|
||||
{
|
||||
Dictionary<string, string> returnData = new Dictionary<string, string>();
|
||||
Dictionary<string, CalcReqtDTO> returnData = new Dictionary<string, CalcReqtDTO>();
|
||||
Dictionary<string, string> parList = new Dictionary<string, string>()
|
||||
{
|
||||
{ "numItems", $"{maxNum}" }
|
||||
@@ -135,7 +135,7 @@ namespace WebDoorCreator.SDK
|
||||
var rawData = callUrlGet(urlTakeNextItems, parList);
|
||||
if (!string.IsNullOrEmpty(rawData) && rawData != "ERR")
|
||||
{
|
||||
returnData = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
|
||||
returnData = JsonConvert.DeserializeObject<Dictionary<string, CalcReqtDTO>>(rawData);
|
||||
}
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CalcReqDTO.cs" />
|
||||
<Compile Include="CalcResultDTO.cs" />
|
||||
<Compile Include="ProcStats.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
@attribute [IgnoreAntiforgeryToken]
|
||||
@inject SignInManager<IdentityUser> SignInManager
|
||||
@functions {
|
||||
public async Task<IActionResult> OnPost()
|
||||
public async Task<IActionResult> OnPost(string returnUrl = null)
|
||||
{
|
||||
returnUrl ??= Url.Content("~/");
|
||||
if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
await SignInManager.SignOutAsync();
|
||||
}
|
||||
|
||||
return Redirect("~/");
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,10 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
|
||||
public async Task OnGetAsync(string returnUrl = null)
|
||||
{
|
||||
await CheckSuperAdmin();
|
||||
if (_configuration.GetValue<bool>("SetupOpt:CheckAdmUser"))
|
||||
{
|
||||
await CheckSuperAdmin();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ErrorMessage))
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, ErrorMessage);
|
||||
@@ -111,7 +114,7 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
private async Task CheckSuperAdmin()
|
||||
{
|
||||
//se non ci fosse --> creo samuele come superadmin
|
||||
string superUser = "zaccaria.majid01@egalware.com";
|
||||
string superUser = "samuele.locatelli@egalware.com";
|
||||
string superPwd = "viaDante16!";
|
||||
string ADMIN_ROLE = "SuperAdmin";
|
||||
var user = await _userManager.FindByEmailAsync(superUser);
|
||||
@@ -164,7 +167,7 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
|
||||
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User logged in.");
|
||||
_logger.LogInformation($"{Input.Email} | User logged in.");
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
if (result.RequiresTwoFactor)
|
||||
|
||||
@@ -12,5 +12,8 @@
|
||||
}
|
||||
<li class="nav-item"><a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a></li>
|
||||
<li class="nav-item"><a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a></li>
|
||||
<li class="nav-item bg-dark rounded p-2"><a class="text-light text-decoration-none" id="personal-data" href="/WDC/UI/"><i class="fa-solid fa-arrow-left-long"></i> Back to Main page</a></li>
|
||||
@{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item bg-dark rounded p-2"><a class="text-light text-decoration-none" id="personal-data" href="@baseUrl"><i class="fa-solid fa-arrow-left-long"></i> Back to Main page</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
@model RegisterModel
|
||||
@inject WebDoorCreator.UI.Data.WDCVocabularyService WDCVService
|
||||
@inject WebDoorCreator.UI.Data.WDCUserService WDCUService
|
||||
@*@{
|
||||
ViewData["Title"] = traduci("UI_10");
|
||||
}*@
|
||||
|
||||
|
||||
<div class="d-flex justify-content-center">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
<div>
|
||||
@if (B_doorOpUpd || true)
|
||||
@if (B_doorOpUpd)
|
||||
{
|
||||
<button class="btn btn-success" @onclick="() => refreshSVG()"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
<a class="btn btn-warning" href="https://iis01.egalware.com/Test3D/Doors041122/EXB_0267100040/EXB_0267100040.html" target="_blank"><i class="fa-solid fa-cube"></i></a>
|
||||
<button class="btn btn-success mx-1" @onclick="() => refreshSVG()"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
|
||||
@if (IsErr)
|
||||
{
|
||||
<button class="btn btn-danger" @onclick="() => toggleErrors(true)"><i class="fa-solid fa-triangle-exclamation"></i></button>
|
||||
<button class="btn btn-danger mx-1" @onclick="() => toggleErrors(true)"><i class="fa-solid fa-triangle-exclamation"></i></button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-secondary"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
<button class="btn btn-secondary"><i class="fa-solid fa-cube"></i></button>
|
||||
<button class="btn btn-secondary mx-1"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
}
|
||||
@if (IsErr)
|
||||
{
|
||||
<button class="btn btn-secondary mx-1" disabled><i class="fa-solid fa-cube"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
@* <button class="btn btn-warning" href="https://iis01.egalware.com/Test3D/Doors041122/EXB_0267100040/EXB_0267100040.html" target="_blank"><i class="fa-solid fa-cube"></i></button> *@
|
||||
<button class="btn btn-warning mx-1" @onclick="() => open3D()"><i class="fa-solid fa-cube"></i></button>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.DTO;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static WebDoorCreator.UI.Components.SvgComp.DoorSvgObj;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.Buttons
|
||||
{
|
||||
@@ -26,6 +27,10 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
[CascadingParameter]
|
||||
public bool IsErr { get; set; } = false;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_CalcRunning { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
@@ -83,15 +88,6 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
await refreshSVG();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua Richiesta visione porta 3D
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task doReq3D()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
@@ -99,6 +95,7 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
|
||||
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
|
||||
var footRows = config.GetSection("ConfDDF:Footer").Get<List<string>>();
|
||||
WaitOpen3d = config.GetValue<int>("ServerConf:WaitOpen3d");
|
||||
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
|
||||
WDCRService.EA_UpdDoorOp += WDCRService_EA_UpdDoorOp;
|
||||
}
|
||||
@@ -109,11 +106,71 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apertura visualizzatore 3D della porta in oggetto
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task open3D()
|
||||
{
|
||||
await EC_CalcRunning.InvokeAsync(true);
|
||||
// inserisco richiesta calcolo
|
||||
await sendCalcReqForType("3dm");
|
||||
// apro link in nuova pagina...
|
||||
//var url = $"api/Report/GetOrderReport?OrderId={orderId}&Format=PDF";
|
||||
var url = $"https://iis01.egalware.com/Test3D/TJSD/index_2.html?src=Door2.3dm";
|
||||
//var url = $"https://iis01.egalware.com/Test3D/TJSD/index_2.html?src=D{idDoor:000000000000}.3dm";
|
||||
// chiamo apertura via jscript in target _blank
|
||||
|
||||
// attendo per apertura WaitOpen3d ms
|
||||
await Task.Delay(WaitOpen3d);
|
||||
await EC_CalcRunning.InvokeAsync(false);
|
||||
await Task.Delay(50);
|
||||
await JSRuntime.InvokeAsync<object>("open", url, "_blank");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua generazione DDF + refresh SVG
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task refreshSVG()
|
||||
{
|
||||
// vuoto = svg
|
||||
await sendCalcReqForType("");
|
||||
}
|
||||
|
||||
protected async Task toggleErrors(bool show)
|
||||
{
|
||||
showModal = show;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// tempo attesa apertura pagina 3d x tempo calcolo e ritorno
|
||||
/// </summary>
|
||||
private int WaitOpen3d = 500;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool showModal { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// salva ddf serializzato ed invia richiesta calcolo specifica
|
||||
/// </summary>
|
||||
/// <param name="mType"></param>
|
||||
/// <returns></returns>
|
||||
private async Task sendCalcReqForType(string mType)
|
||||
{
|
||||
List<DoorOpModel>? listOpAll = await WDCService.DoorOpGetByDoorId(idDoor);
|
||||
if (listOpAll != null)
|
||||
@@ -135,7 +192,7 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
|
||||
string currDdf = currDdfConv.GetSerialized(listOp);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDataServ.SendCalcReq(idDoor, currDdf);
|
||||
int currVers = await QDataServ.SendCalcReq(idDoor, currDdf, mType);
|
||||
|
||||
if (currVers > 0)
|
||||
{
|
||||
@@ -145,22 +202,6 @@ namespace WebDoorCreator.UI.Components.Buttons
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task toggleErrors(bool show)
|
||||
{
|
||||
showModal = show;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool showModal { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void WDCRService_EA_UpdDoorOp()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@if (currVal == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingDataSmall></EgwCoreLib.Razor.LoadingDataSmall>
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
background: #FFF;
|
||||
transform: translate(1.6rem, -1rem);
|
||||
}
|
||||
.btnPDFSuccess {
|
||||
.btnPdfSuccess {
|
||||
border-radius: 50%;
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
border: 5px solid #00838F;
|
||||
background: #8E44AD;
|
||||
background: #44AD8E;
|
||||
transform: translate(25px, 12px);
|
||||
}
|
||||
.btnPDFPending {
|
||||
.btnPdfPending {
|
||||
border-radius: 50%;
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
transform: translate(1.6rem, -1rem);
|
||||
}
|
||||
|
||||
.btnPDFSuccess {
|
||||
.btnPdfSuccess {
|
||||
.btnGen;
|
||||
background: #8E44AD;
|
||||
background: #44AD8E;
|
||||
transform: translate(@xDelta, @yDelta);
|
||||
}
|
||||
|
||||
.btnPDFPending {
|
||||
.btnPdfPending {
|
||||
.btnGen;
|
||||
background: #F1C40F;
|
||||
transform: translate(@xDelta, @yDelta);
|
||||
|
||||
@@ -1 +1 @@
|
||||
.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#b71c1c;transform:translate(25px,-12px);}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#fff;transform:translate(1.6rem,-1rem);}.btnPDFSuccess{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#8e44ad;transform:translate(25px,12px);}.btnPDFPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#f1c40f;transform:translate(25px,12px);}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#03a9f4;transform:translate(1.6rem,1rem);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;}
|
||||
.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#b71c1c;transform:translate(25px,-12px);}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#fff;transform:translate(1.6rem,-1rem);}.btnPdfSuccess{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#44ad8e;transform:translate(25px,12px);}.btnPdfPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#f1c40f;transform:translate(25px,12px);}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#03a9f4;transform:translate(1.6rem,1rem);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;}
|
||||
@@ -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;
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
<div class="" style="height:100%; width:100%; background: linear-gradient(#AFCFD1, #92B2C4);min-height: 50rem;">
|
||||
<ButtonsDoorDef></ButtonsDoorDef>
|
||||
@if (!string.IsNullOrEmpty(@SvgContent))
|
||||
<ButtonsDoorDef EC_CalcRunning="SetCalcRunning"></ButtonsDoorDef>
|
||||
@if (isRecalc)
|
||||
{
|
||||
<div style="align-items: center;display: flex;flex-wrap: wrap;justify-content: center;">
|
||||
<div style="width: @doorW; max-height: 30rem;">
|
||||
@svgPreview
|
||||
<LoadingData DisplayMode="LoadingData.SpinMode.Growl" DisplaySize="LoadingData.CtrlSize.Large" Title="Render 3DM"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(@SvgContent))
|
||||
{
|
||||
<div style="align-items: center;display: flex;flex-wrap: wrap;justify-content: center;">
|
||||
<div style="width: @doorW; max-height: 30rem;">
|
||||
@svgPreview
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using NLog;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.DoorDef
|
||||
{
|
||||
@@ -7,8 +8,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
[Parameter]
|
||||
public string doorW { get; set; } = "";
|
||||
|
||||
@@ -16,22 +15,41 @@ namespace WebDoorCreator.UI.Components.DoorDef
|
||||
public string SvgContent
|
||||
{
|
||||
get => _svgContent;
|
||||
set
|
||||
{
|
||||
_svgContent = value;
|
||||
}
|
||||
set { _svgContent = value; }
|
||||
}
|
||||
protected string _svgContent { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string _svgContent { get; set; } = "";
|
||||
|
||||
protected MarkupString svgPreview
|
||||
{
|
||||
get => (MarkupString)SvgContent;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task SetCalcRunning(bool isRunning)
|
||||
{
|
||||
isRecalc = isRunning;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Variabile stato recalc x mostrare attesa..
|
||||
/// </summary>
|
||||
private bool isRecalc = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<div class=" py-1">
|
||||
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> RecalcSVGs()" ObjId="Svg" ItemName="Recalc all the SVGs" ItemCount="0" ShowPlus="true" PlusOpacity="0%" BgColorFrom='@hexConverter("#2ECC71", 5)' BgColorTo="#2ECC71" ImagePath="images/icons/arrows-rotate-solid.svg"></HwSvgObj>
|
||||
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="()=> RecalcSVGs(false)" ObjId="Svg" ItemName="Recalc all the SVGs" ItemCount="0" ShowPlus="true" PlusOpacity="0%" BgColorFrom='@hexConverter("#2ECC71", 5)' BgColorTo="#2ECC71" ImagePath="images/icons/arrows-rotate-solid.svg"></HwSvgObj>
|
||||
</div>
|
||||
@if (isAddNew)
|
||||
{
|
||||
@@ -124,7 +124,7 @@
|
||||
<div class="row">
|
||||
@if (DoorsList == null || DoorsList.Count == 0)
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -7,10 +7,11 @@ using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Components.SvgComp;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static WebDoorCreator.UI.Data.WDCRefreshService;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.DoorMan
|
||||
{
|
||||
public partial class DoorList
|
||||
public partial class DoorList:IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -55,6 +56,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
|
||||
protected List<DoorOpModel> doorOps2Add = new List<DoorOpModel>();
|
||||
|
||||
protected string[] hexVals = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
@@ -149,6 +152,7 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
var door = DoorsList?.Where(x => x.DoorId == doorId).FirstOrDefault();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await E_CurrDoor.InvokeAsync(door);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +257,25 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string hexConverter(string hexColor, int delta)
|
||||
{
|
||||
string answ = "";
|
||||
if (hexColor != "" && hexColor != null)
|
||||
{
|
||||
var noHash = hexColor.Substring(1, hexColor.Length - 1);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (var val in noHash)
|
||||
{
|
||||
sb.Append(newHexVal(val, delta));
|
||||
}
|
||||
|
||||
answ = $"#{sb.ToString()}";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task modalClose(bool isClose)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -260,15 +283,62 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected string newHexVal(char str2Check, int delta)
|
||||
{
|
||||
string answ = "";
|
||||
int runIdx = 0;
|
||||
foreach (var item in hexVals)
|
||||
{
|
||||
if (item.ToLower() == str2Check.ToString().ToLower())
|
||||
{
|
||||
int currValIndex = Array.IndexOf(hexVals, item);
|
||||
runIdx = currValIndex + delta;
|
||||
runIdx = runIdx <= 15 ? runIdx : 15;
|
||||
answ = hexVals[runIdx];
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
WaitReloadSvg = Configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
|
||||
WDCRService.EA_OrderChanged += WDCRService_EA_OrderChanged;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
if (!actFilter.Equals(lastFilt))
|
||||
{
|
||||
lastFilt = actFilter.clone();
|
||||
await ReloadData();
|
||||
}
|
||||
}
|
||||
[Inject]
|
||||
protected WDCRefreshService WDCRService { get; set; } = null!;
|
||||
public void Dispose()
|
||||
{
|
||||
WDCRService.EA_OrderChanged -= WDCRService_EA_OrderChanged;
|
||||
}
|
||||
private async void WDCRService_EA_OrderChanged(object? sender, EventArgs e)
|
||||
{
|
||||
// recupero dati
|
||||
OrdEventArgs currArgs = (OrdEventArgs)e;
|
||||
// se ordine corrente --> rileggo pagina...
|
||||
if ( currArgs != null && currArgs.OrderId == currOrderId)
|
||||
{
|
||||
await ReloadData();
|
||||
#if false
|
||||
// ricarico...
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione ricalcolo SVG
|
||||
/// </summary>
|
||||
protected async void RecalcSVGs()
|
||||
protected async void RecalcSVGs(bool force)
|
||||
{
|
||||
isRecalc = true;
|
||||
// recupero elenco porte come list interi...
|
||||
@@ -278,26 +348,40 @@ 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
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
// se ho porte da processare --> chiamo save...
|
||||
string currDDF = "";
|
||||
int currDoorId = 0;
|
||||
int currVers = 0;
|
||||
foreach (var item in list2Proc)
|
||||
// solo se è template salvo nell'elenco...
|
||||
if (isTplPage)
|
||||
{
|
||||
currDoorId = 0;
|
||||
currVers = 0;
|
||||
int.TryParse(item, out currDoorId);
|
||||
if (currDoorId > 0)
|
||||
// faccio upsert porte nell'elenco door tipo template...
|
||||
var numTplDoor = await QDService.DoorTplListUpsert(doorIdList);
|
||||
}
|
||||
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
|
||||
if (force)
|
||||
{
|
||||
// se ho porte da processare --> chiamo save...
|
||||
string currDDF = "";
|
||||
int currDoorId = 0;
|
||||
int currVers = 0;
|
||||
foreach (var item in list2Proc)
|
||||
{
|
||||
currDDF = await WDService.DoorOpGetDDF(currDoorId);
|
||||
// versione corrente del DDF generato
|
||||
currVers = await QDService.SendCalcReq(currDoorId, currDDF);
|
||||
currDoorId = 0;
|
||||
currVers = 0;
|
||||
int.TryParse(item, out currDoorId);
|
||||
if (currDoorId > 0)
|
||||
{
|
||||
currDDF = await WDService.DoorOpGetDDF(currDoorId);
|
||||
// versione corrente del DDF generato
|
||||
currVers = await QDService.SendCalcReq(currDoorId, currDDF);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// attesa prima di ricaricare 200/500 ms...
|
||||
await Task.Delay(DoorsList.Count * (WaitReloadSvg / 3) * rnd.Next(900, 1200) / 1000);
|
||||
}
|
||||
}
|
||||
isRecalc = false;
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
@@ -367,17 +451,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
if (DoorsList != null)
|
||||
{
|
||||
var currDoor = DoorsList.FirstOrDefault();
|
||||
if (currDoor?.OrderNav != null)
|
||||
{
|
||||
//orderStatus = currDoor.OrderNav.Status;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,7 +477,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
var door = DoorsList.Where(x => x.DoorId == doorId).FirstOrDefault();
|
||||
if (door != null)
|
||||
{
|
||||
//currDoor = door;
|
||||
await E_CurrDoorModal.InvokeAsync(door);
|
||||
}
|
||||
}
|
||||
@@ -438,6 +510,14 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private DoorsSelectFilter lastFilt = new DoorsSelectFilter() { CurrPage = -1 };
|
||||
private Random rnd = new Random();
|
||||
private int WaitReloadSvg = 100;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
@@ -474,44 +554,5 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
protected string[] hexVals = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
|
||||
|
||||
protected string newHexVal(char str2Check, int delta)
|
||||
{
|
||||
string answ = "";
|
||||
int runIdx = 0;
|
||||
foreach (var item in hexVals)
|
||||
{
|
||||
if (item.ToLower() == str2Check.ToString().ToLower())
|
||||
{
|
||||
int currValIndex = Array.IndexOf(hexVals, item);
|
||||
runIdx = currValIndex + delta;
|
||||
runIdx = runIdx <= 15 ? runIdx : 15;
|
||||
answ = hexVals[runIdx];
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string hexConverter(string hexColor, int delta)
|
||||
{
|
||||
string answ = "";
|
||||
if (hexColor != "" && hexColor != null)
|
||||
{
|
||||
|
||||
var noHash = hexColor.Substring(1, hexColor.Length - 1);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (var val in noHash)
|
||||
{
|
||||
sb.Append(newHexVal(val, delta));
|
||||
}
|
||||
|
||||
answ = $"#{sb.ToString()}";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
@if (!CurrDoor.Equals(CurrDoorClone))
|
||||
{
|
||||
<button class="btn btn-secondary" type="button" @onclick="()=>ReloadData()">Cancel <i class="fa-solid fa-rotate-left"></i></button>
|
||||
<button class="btn btn-success" type="button" @onclick="()=>UpdateDoor(true)">Update <i class="fa-solid fa-check"></i></button>
|
||||
<button class="btn btn-success" type="button" @onclick="()=>UpdateDoor()">Update <i class="fa-solid fa-check"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -11,9 +11,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
protected DoorModel CurrDoor { get; set; } = new DoorModel();
|
||||
protected DoorModel CurrDoorClone { get; set; } = new DoorModel();
|
||||
|
||||
[Parameter]
|
||||
public int CurrDoorId { get; set; } = 0;
|
||||
|
||||
@@ -25,41 +22,19 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
[Parameter]
|
||||
public EventCallback<bool> E_isChange { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool isTplPage { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int OrderId { get; set; } = 0;
|
||||
|
||||
public List<OrderModel> OrdersCompList { get; set; } = new List<OrderModel>();
|
||||
|
||||
[Parameter]
|
||||
public string UserName { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public int OrderStatus { get; set; } = 10;
|
||||
[Parameter]
|
||||
public bool isTplPage { get; set; } = false;
|
||||
|
||||
protected int DoorQty
|
||||
{
|
||||
get => CurrDoor.Quantity;
|
||||
set
|
||||
{
|
||||
if (value >= 0)
|
||||
{
|
||||
CurrDoor.Quantity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected decimal DoorUnitCost
|
||||
{
|
||||
get => CurrDoor.UnitCost;
|
||||
set
|
||||
{
|
||||
if (value >= 0)
|
||||
{
|
||||
CurrDoor.UnitCost = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
[Parameter]
|
||||
public string UserName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -76,7 +51,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!;
|
||||
|
||||
protected DoorModel CurrDoor { get; set; } = new DoorModel();
|
||||
protected DoorModel CurrDoorClone { get; set; } = new DoorModel();
|
||||
protected DDFDto CurrentConf { get; set; } = new DDFDto();
|
||||
|
||||
protected int doorQty
|
||||
@@ -85,8 +61,32 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
set => CurrDoor.Quantity = value;
|
||||
}
|
||||
|
||||
protected int DoorQty
|
||||
{
|
||||
get => CurrDoor.Quantity;
|
||||
set
|
||||
{
|
||||
if (value >= 0)
|
||||
{
|
||||
CurrDoor.Quantity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string DoorSvgContent { get; set; } = "";
|
||||
|
||||
protected decimal DoorUnitCost
|
||||
{
|
||||
get => CurrDoor.UnitCost;
|
||||
set
|
||||
{
|
||||
if (value >= 0)
|
||||
{
|
||||
CurrDoor.UnitCost = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsErr { get; set; } = false;
|
||||
|
||||
[Inject]
|
||||
@@ -108,6 +108,9 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
get => WDCUService.userRole;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected WDCRefreshService WDCRService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCUserService WDCUService { get; set; } = null!;
|
||||
|
||||
@@ -118,28 +121,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void modDoorQty(bool isAdd)
|
||||
{
|
||||
if (isAdd)
|
||||
{
|
||||
DoorQty++;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoorQty--;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateDoor(bool isAdd)
|
||||
{
|
||||
//var done = await WDService.DoorModQty(doorQty, CurrDoor.OrderId, CurrDoor.DoorId, isAdd);
|
||||
var done = await WDService.DoorUpsert(CurrDoor);
|
||||
if (done)
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clona la porta selezionata con annesse door operations
|
||||
/// </summary>
|
||||
@@ -178,11 +159,27 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
var done = await WDService.DoorUpsert(CurrDoor);
|
||||
if (done)
|
||||
{
|
||||
// chiamo update ordine...
|
||||
WDCRService.ReportOrderChanged(OrderId);
|
||||
await ReloadData();
|
||||
// chiudo modale
|
||||
await closeModal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void modDoorQty(bool isAdd)
|
||||
{
|
||||
if (isAdd)
|
||||
{
|
||||
DoorQty++;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoorQty--;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -309,6 +306,17 @@ namespace WebDoorCreator.UI.Components.DoorMan
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateDoor()
|
||||
{
|
||||
var done = await WDService.DoorUpsert(CurrDoor);
|
||||
if (done)
|
||||
{
|
||||
// chiamo update ordine...
|
||||
WDCRService.ReportOrderChanged(OrderId);
|
||||
await ReloadData();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
{
|
||||
<select @bind="@TypeSel" class="form-select">
|
||||
<option value="*">-- All Types --</option>
|
||||
@foreach (var item in ListType)
|
||||
@foreach (var item in ListType.OrderBy(x => x))
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
@@ -65,23 +65,33 @@
|
||||
@if (files2Chk.Where(x => x.Value.action).ToList().Count > 0)
|
||||
{
|
||||
<div class="w-100 text-center">
|
||||
<button @onclick="()=>doSave()" class="btn btn-success btn-lg">Save</button>
|
||||
<button @onclick="()=>doSave()" class="btn btn-success btn-lg px-3">Apply Changes</button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
@if (searchRecords != null && searchRecords.Count() > 0)
|
||||
{
|
||||
<div class="text-nowrap">
|
||||
<div class="btn-group w-50" role="group">
|
||||
<button type="button" class="btn btn-sm col-3 btn-secondary" disabled>FILTER BY: </button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnAddCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.add)">Add</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnUpdCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.mod)">Update</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnRemCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.rem)">Delete</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
@if (numTplMissing > 0)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-success" @onclick="()=>fixMissing()" title="Fix missing components template file">FIX @tplMissing missing</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-outline-success" @onclick="()=>updateNumMissing()" title="Check missing template">@tplMissing missing</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (searchRecords != null && searchRecords.Count() > 0 && !isLoading)
|
||||
{
|
||||
<div class="text-nowrap btn-group w-75" role="group">
|
||||
<button type="button" class="btn btn-sm col-3 btn-outline-dark" disabled>Show:</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnCssAdd" @onclick="()=>filtBtnToggle(Core.Enum.fileStatus.add)">Add</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnCssUpd" @onclick="()=>filtBtnToggle(Core.Enum.fileStatus.mod)">Update</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnCssRem" @onclick="()=>filtBtnToggle(Core.Enum.fileStatus.rem)">Delete</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -137,7 +147,8 @@ else if (files2Chk != null && files2Chk.Count() > 0)
|
||||
<td class="col-5" colspan="4" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"></td>
|
||||
}
|
||||
<td class="col-2 text-center">
|
||||
<button class="btn @btnCssClass(item.Value.status, item.Value.action)" @onclick="()=>changeDoAct(item)" disabled="@(item.Value.status== Core.Enum.fileStatus.rem)">@btnTxt(item.Value.status) <i class="@btnIcon(item.Value.status)"></i></button>
|
||||
<button class="btn @btnCssClass(item.Value.status, item.Value.action)" @onclick="()=>changeDoAct(item)">@btnTxt(item.Value.status) <i class="@btnIcon(item.Value.status)"></i></button>
|
||||
@* <button class="btn @btnCssClass(item.Value.status, item.Value.action)" @onclick="()=>changeDoAct(item)" disabled="@(item.Value.status== Core.Enum.fileStatus.rem)">@btnTxt(item.Value.status) <i class="@btnIcon(item.Value.status)"></i></button> *@
|
||||
</td>
|
||||
@if (item.Value.status == Core.Enum.fileStatus.rem || item.Value.status == Core.Enum.fileStatus.mod)
|
||||
{
|
||||
@@ -164,7 +175,7 @@ else if (files2Chk != null && files2Chk.Count() > 0)
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (files2Chk == null || files2Chk.Count() == 0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using k8s.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using NLog;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
@@ -19,6 +20,30 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static string getFolder(string key)
|
||||
{
|
||||
string answ = "";
|
||||
if (key.Contains("\\"))
|
||||
{
|
||||
answ = key.Split("\\")[1];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public static string getType(string key)
|
||||
{
|
||||
string answ = "";
|
||||
if (key.Contains("\\"))
|
||||
{
|
||||
answ = key.Split("\\")[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
@@ -31,7 +56,7 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
protected bool _showAdd { get; set; } = true;
|
||||
|
||||
protected bool _showDel { get; set; } = false;
|
||||
protected bool _showRem { get; set; } = true;
|
||||
|
||||
protected bool _showUpd { get; set; } = true;
|
||||
|
||||
@@ -42,9 +67,24 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
protected double expTime { get; set; } = 6;
|
||||
|
||||
protected bool isLoading { get; set; } = false;
|
||||
protected bool isDrawing { get; set; } = false;
|
||||
protected string filtBtnCssAdd
|
||||
{
|
||||
get => showAdd ? "btn-primary" : "btn-secondary";
|
||||
}
|
||||
|
||||
protected string filtBtnCssRem
|
||||
{
|
||||
get => showRem ? "btn-danger" : "btn-secondary";
|
||||
}
|
||||
|
||||
protected string filtBtnCssUpd
|
||||
{
|
||||
get => showUpd ? "btn-warning" : "btn-secondary";
|
||||
}
|
||||
|
||||
protected bool isDrawing { get; set; } = false;
|
||||
protected bool isLoading { get; set; } = false;
|
||||
protected List<string> ListType { get; set; } = new List<string>();
|
||||
protected int numSteps { get; set; } = 4;
|
||||
|
||||
protected bool show { get; set; } = false;
|
||||
@@ -65,10 +105,10 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
get => NumFileNew > 0;
|
||||
}
|
||||
|
||||
protected bool showDel
|
||||
protected bool showRem
|
||||
{
|
||||
get => _showDel;
|
||||
set => _showDel = value;
|
||||
get => _showRem;
|
||||
set => _showRem = value;
|
||||
}
|
||||
|
||||
protected bool showUpd
|
||||
@@ -77,10 +117,33 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
set => _showUpd = value;
|
||||
}
|
||||
|
||||
protected string tplMissing
|
||||
{
|
||||
get => numTplMissing >= 0 ? $"{numTplMissing}" : "???";
|
||||
}
|
||||
|
||||
protected string txtDx { get; set; } = "";
|
||||
|
||||
protected string txtSx { get; set; } = "";
|
||||
|
||||
protected string TypeSel
|
||||
{
|
||||
get => _typeSel;
|
||||
set
|
||||
{
|
||||
if (_typeSel != value)
|
||||
{
|
||||
_typeSel = value;
|
||||
ReloadData().ConfigureAwait(false);
|
||||
//var pUpd = Task.Run(async () =>
|
||||
//{
|
||||
// await InvokeAsync(ReloadData);
|
||||
//});
|
||||
//pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected WebDoorCreatorService WDCService { get; set; } = null!;
|
||||
|
||||
@@ -153,10 +216,10 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
protected async Task doSave()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
//var sb = new StringBuilder();
|
||||
sendDataVal = 0;
|
||||
isDrawing = true;
|
||||
isLoading = true;
|
||||
sendDataVal = 0;
|
||||
await Task.Delay(1);
|
||||
var updTask1 = Task.Run(() =>
|
||||
{
|
||||
files2Save = searchRecords.Where(x => x.Value.action).ToDictionary(x => x.Key, x => x.Value);
|
||||
@@ -177,14 +240,17 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
if (item.Value.status == Core.Enum.fileStatus.add)
|
||||
{
|
||||
File.Copy($"{rootPathNew}\\{item.Key}", $"{rootPathCur}\\{item.Key}");
|
||||
Log.Info($"Add new Compo: {rootPathNew}\\{item.Key}");
|
||||
}
|
||||
else if (item.Value.status == Core.Enum.fileStatus.mod)
|
||||
{
|
||||
ReplaceFile($"{rootPathNew}\\{item.Key}", $"{rootPathCur}\\{item.Key}");
|
||||
Log.Info($"Updated Compo: {rootPathNew}\\{item.Key}");
|
||||
}
|
||||
else if (item.Value.status == Core.Enum.fileStatus.rem)
|
||||
{
|
||||
File.Delete($"{rootPathCur}\\{item.Key}");
|
||||
Log.Info($"Removed Compo: {rootPathNew}\\{item.Key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,6 +262,11 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
await WDCService.ListValuesLuaNgeInsert(rootPathCur);
|
||||
});
|
||||
await updTask2;
|
||||
Log.Info($"DB Updated for Compo changes!");
|
||||
sendDataVal = 45;
|
||||
// svuoto cache!
|
||||
await WDCService.FlushCustomPattern("Cache");
|
||||
sendDataVal = 50;
|
||||
await doScan(true, true);
|
||||
sendDataVal = 90;
|
||||
}
|
||||
@@ -208,12 +279,16 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
/// <returns></returns>
|
||||
protected async Task doScan(bool scanCur, bool scanNew)
|
||||
{
|
||||
files2Chk.Clear();
|
||||
searchRecords.Clear();
|
||||
ListType = new List<string>();
|
||||
Log.Info($"Component scan started by user {WDCUService.userId}");
|
||||
isDrawing = true;
|
||||
isLoading = true;
|
||||
files2Chk.Clear();
|
||||
searchRecords.Clear();
|
||||
stats2show.Clear();
|
||||
stats2show.Add(Core.Enum.fileStatus.add);
|
||||
stats2show.Add(Core.Enum.fileStatus.mod);
|
||||
stats2show.Add(Core.Enum.fileStatus.rem);
|
||||
ListType = new List<string>();
|
||||
Log.Info($"Component scan started by user {WDCUService.userId}");
|
||||
sendDataVal = 0;
|
||||
var updTask1 = Task.Run(async () =>
|
||||
await WDCService.populateHws()
|
||||
@@ -256,11 +331,10 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
{
|
||||
item.Value.status = Core.Enum.fileStatus.rem;
|
||||
searchRecords.Add(item.Key, item.Value);
|
||||
checkItemType(item);
|
||||
}
|
||||
|
||||
searchRecords = searchRecords.Where(x => x.Value.status > 0).ToDictionary(x => x.Key, x => x.Value);
|
||||
stats2show.Add(Core.Enum.fileStatus.add);
|
||||
stats2show.Add(Core.Enum.fileStatus.mod);
|
||||
searchRecords = searchRecords.Where(x => x.Value.status != Core.Enum.fileStatus.none).ToDictionary(x => x.Key, x => x.Value);
|
||||
await ReloadData();
|
||||
sendDataVal = 100;
|
||||
isLoading = false;
|
||||
@@ -272,63 +346,7 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
Log.Info($"Component scan COMPLETED");
|
||||
}
|
||||
|
||||
private void checkItemType(KeyValuePair<string, FileDTO> item)
|
||||
{
|
||||
string type = getType(item.Key);
|
||||
if (!ListType.Contains(type))
|
||||
{
|
||||
ListType.Add(type);
|
||||
}
|
||||
}
|
||||
|
||||
public static string getType(string key)
|
||||
{
|
||||
string answ = "";
|
||||
if (key.Contains("\\"))
|
||||
{
|
||||
answ = key.Split("\\")[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
public static string getFolder(string key)
|
||||
{
|
||||
string answ = "";
|
||||
if (key.Contains("\\"))
|
||||
{
|
||||
answ = key.Split("\\")[1];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string filtBtnAddCss()
|
||||
{
|
||||
string answ = "";
|
||||
if (showAdd)
|
||||
{
|
||||
answ = "btn-primary";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string filtBtnRemCss()
|
||||
{
|
||||
string answ = "";
|
||||
if (showDel)
|
||||
{
|
||||
answ = "btn-danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task filtBtnSet(Core.Enum.fileStatus fileStat)
|
||||
protected async Task filtBtnToggle(Core.Enum.fileStatus fileStat)
|
||||
{
|
||||
switch (fileStat)
|
||||
{
|
||||
@@ -357,12 +375,12 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
break;
|
||||
|
||||
case Core.Enum.fileStatus.rem:
|
||||
showDel = !showDel;
|
||||
if (showDel && !stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
showRem = !showRem;
|
||||
if (showRem && !stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
{
|
||||
stats2show.Add(Core.Enum.fileStatus.rem);
|
||||
}
|
||||
else if (!showDel && stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
else if (!showRem && stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
{
|
||||
stats2show.Remove(Core.Enum.fileStatus.rem);
|
||||
}
|
||||
@@ -371,18 +389,16 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected string filtBtnUpdCss()
|
||||
/// <summary>
|
||||
/// Sistema i componenti missing creando file (vuoti) corrispondenti a quanto trovato sul DB
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task fixMissing()
|
||||
{
|
||||
string answ = "";
|
||||
if (showUpd)
|
||||
{
|
||||
answ = "btn-warning";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
isLoading = true;
|
||||
bool done = await WDCService.CompoFixMissing(rootPathCur);
|
||||
numTplMissing = await WDCService.CompoCountMissing(rootPathCur);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
@@ -390,22 +406,6 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected string TypeSel
|
||||
{
|
||||
get => _typeSel;
|
||||
set
|
||||
{
|
||||
if (_typeSel != value)
|
||||
{
|
||||
_typeSel = value;
|
||||
ReloadData().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
private string _typeSel { get; set; } = "*";
|
||||
|
||||
protected List<string> ListType { get; set; } = new List<string>();
|
||||
|
||||
protected async Task ReloadData()
|
||||
{
|
||||
isDrawing = true;
|
||||
@@ -465,24 +465,28 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica numero template missing x eventuale fix con creazione nuovi file vuoti
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task updateNumMissing()
|
||||
{
|
||||
isLoading = true;
|
||||
numTplMissing = await WDCService.CompoCountMissing(rootPathCur);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private Dictionary<string, FileDTO> files2Chk = new Dictionary<string, FileDTO>();
|
||||
|
||||
private Dictionary<string, FileDTO> files2Save = new Dictionary<string, FileDTO>();
|
||||
|
||||
private string scanMsg = "CLICK TO SCAN";
|
||||
|
||||
private Dictionary<string, FileDTO> searchRecords = new Dictionary<string, FileDTO>();
|
||||
|
||||
private int sendDataMaxVal = 100;
|
||||
|
||||
private int sendDataVal = 0;
|
||||
|
||||
private List<Core.Enum.fileStatus> stats2show = new List<Core.Enum.fileStatus>();
|
||||
|
||||
private string titleMsg = "Scanning directories";
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -490,8 +494,8 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
#region Private Properties
|
||||
|
||||
private bool _selUns { get; set; } = false;
|
||||
|
||||
private int _totalCount { get; set; } = -1;
|
||||
private string _typeSel { get; set; } = "*";
|
||||
|
||||
private int currPage
|
||||
{
|
||||
@@ -519,6 +523,8 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
set => actFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private int numTplMissing { get; set; } = -1;
|
||||
|
||||
private string rootPathCur
|
||||
{
|
||||
get => configuration.GetValue<string>("CompoBaseDirs:CurrCompoDir");
|
||||
@@ -556,6 +562,15 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void checkItemType(KeyValuePair<string, FileDTO> item)
|
||||
{
|
||||
string type = getType(item.Key);
|
||||
if (!ListType.Contains(type))
|
||||
{
|
||||
ListType.Add(type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera i dati files current,
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
protected Dictionary<string, Dictionary<string, string>>? vocLemmasTEMP { get; set; } = null;
|
||||
protected Dictionary<string, string> vocLemmasTEMP2Dict { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
protected bool showList { get; set; } = false;
|
||||
protected bool showList { get; set; } = true;//false;
|
||||
protected bool isLoading { get; set; } = false;
|
||||
protected async override Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
@@ -22,17 +22,13 @@
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<!--Hiding to non-SuperAdmin users the option to manage the application -->
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, CompAdmin" Context="MenuHide">
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin, CompAdmin" Context="MenuHide">
|
||||
<Authorized>
|
||||
<div class="nav-item px-1 align-items-center">
|
||||
<NavLink class="nav-link text-nowrap" href="UserAdmin">
|
||||
<span class="bi bi-people pe-2" aria-hidden="true"></span> @translate("UI_02")
|
||||
</NavLink>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<AuthorizeView Roles="SuperAdmin" Context="MenuHide">
|
||||
<Authorized>
|
||||
<div class="nav-item px-1 align-items-center">
|
||||
<NavLink class="nav-link text-nowrap" href="TemplateMan">
|
||||
<span class="fa-solid fa-paint-roller pe-2" aria-hidden="true"></span> Template Management
|
||||
@@ -45,8 +41,7 @@
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<!--help finale-->
|
||||
<AuthorizeView Roles="SuperAdmin" Context="MenuHide">
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin" Context="MenuHide">
|
||||
<Authorized>
|
||||
<div class="nav-item px-1 align-items-center">
|
||||
<NavLink class="nav-link text-nowrap" href="SuperAdmin">
|
||||
@@ -55,6 +50,7 @@
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<!--help finale-->
|
||||
<AuthorizeView Context="MenuHide">
|
||||
<Authorized>
|
||||
<div class="nav-item px-1 align-items-center">
|
||||
@@ -121,22 +117,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 +148,7 @@
|
||||
</div>
|
||||
<div class="text-end text-nowrap px-3 py-2 d-flex justify-content-between">
|
||||
@*<a href="Identity/Account/Register" class="text-decoration-none text-dark">@translate("UI_08") </a>*@
|
||||
<a href="Identity/Account/Login" class="text-decoration-none text-dark">@translate("UI_09") </a>
|
||||
<a href="@($"{baseUrl}/Identity/Account/Login")" class="text-decoration-none text-dark">@translate("UI_09") </a>
|
||||
</div>
|
||||
</nav>
|
||||
</NotAuthorized>
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Security.Policy;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
@@ -28,6 +29,7 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
|
||||
protected string baseUrl
|
||||
{
|
||||
// string baseUrl = Url.Content("~/");
|
||||
get => configuration.GetValue<string>("RuntimeOpt:BaseUrl");
|
||||
}
|
||||
|
||||
@@ -235,20 +237,11 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string actionUrl
|
||||
protected string logoutUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (NavManager.Uri.Contains("/WDC/UI"))
|
||||
{
|
||||
answ = $"{baseUrl}/Identity/Account/LogOut";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "/Identity/Account/LogOut";
|
||||
}
|
||||
return answ;
|
||||
return $"{baseUrl}/Identity/Account/LogOut";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@if (isLoading)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingDataSmall></EgwCoreLib.Razor.LoadingDataSmall>
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -101,6 +101,11 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
[Inject]
|
||||
protected WDCVocabularyService WDVService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
[Inject]
|
||||
protected WDCUserService WDCUService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -225,6 +230,14 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
JsoncConfigVal = jsonDef,
|
||||
JsoncActVal = jsonAct
|
||||
};
|
||||
|
||||
// se debug + superadmin --> auto confirm
|
||||
if (autoApprove)
|
||||
{
|
||||
doorOpToAdd.userConfirm = UserId;
|
||||
doorOpToAdd.DtConfirm = DateTime.Now;
|
||||
}
|
||||
|
||||
listOp.Add(doorOpToAdd);
|
||||
// salvo Door OP associate
|
||||
bool fatto = await WDCService.DoorOpInsert(DoorId, listOp);
|
||||
@@ -239,6 +252,7 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool autoApprove = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gestione update da oggetto sottostante
|
||||
@@ -261,12 +275,26 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
DoorOp2ModList.Add(currItem);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Blazor: get query parm from the URL
|
||||
/// </summary>
|
||||
/// <param name="parmName"></param>
|
||||
/// <returns></returns>
|
||||
protected string GetQueryParm(string parmName)
|
||||
{
|
||||
var uriBuilder = new UriBuilder(NavMan.Uri);
|
||||
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
return q[parmName] ?? "";
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
var currMode = GetQueryParm("currMode");
|
||||
if (!string.IsNullOrEmpty(currMode) && WDCUService.userRole == "SuperAdmin")
|
||||
{
|
||||
autoApprove = currMode.Equals("debug");
|
||||
}
|
||||
WDCRefresh.EA_ConfDoorOp += WDCRefresh_EA_ConfDoorOp;
|
||||
//return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
|
||||
@@ -9,9 +9,11 @@ else
|
||||
<div class="text-center d-flex justify-content-between px-2 mb-3">
|
||||
@if (DoorOpInst.userConfirm != "" && DoorOpInst.DtConfirm != null)
|
||||
{
|
||||
<button class="btnPDFSuccess">
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
<NavLink href="@pathFinder(DoorOpInst.DoorOpId, false)" target="_blank" title="Review PDF">
|
||||
<button class="btnPdfSuccess">
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
</NavLink>
|
||||
}
|
||||
<div>
|
||||
<h5>@($"{@getTrad(DoorOpInst.ObjectId)} #{instanceN}")</h5>
|
||||
@@ -158,8 +160,8 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
<NavLink href="@pathFinder(DoorOpInst.DoorOpId)" target="_blank">
|
||||
<button class="btnPDFPending">
|
||||
<NavLink href="@pathFinder(DoorOpInst.DoorOpId, true)" target="_blank">
|
||||
<button class="btnPdfPending">
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
</NavLink>
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
@@ -90,6 +91,10 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
protected List<ListValuesModel>? listValuesFiles { get; set; } = null!;
|
||||
protected List<ListValuesModel>? listValuesFname { get; set; } = null!;
|
||||
protected List<ListValuesModel>? listValuesHW { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
protected List<string> ordListVal { get; set; } = new List<string>();
|
||||
|
||||
[Inject]
|
||||
@@ -142,6 +147,9 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
[Inject]
|
||||
protected WebDoorCreatorService WDCService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCUserService WDCUService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCVocabularyService WDVService { get; set; } = null!;
|
||||
|
||||
@@ -199,6 +207,12 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
// salvo i NUOVI valori...
|
||||
DoorOpInst.CurrVals = dictValCurr;
|
||||
DoorOpInst.GraphicParams = graphicParams;
|
||||
// se debug + superadmin --> auto confirm
|
||||
if (autoApprove && string.IsNullOrEmpty(DoorOpInst.userConfirm))
|
||||
{
|
||||
DoorOpInst.userConfirm = WDCUService.userId;
|
||||
DoorOpInst.DtConfirm = DateTime.Now;
|
||||
}
|
||||
// salvo!
|
||||
List<DoorOpModel> doorOpUpd = new List<DoorOpModel>() { DoorOpInst };
|
||||
await WDCService.DoorOpUpdate(doorOpUpd);
|
||||
@@ -211,6 +225,18 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Blazor: get query parm from the URL
|
||||
/// </summary>
|
||||
/// <param name="parmName"></param>
|
||||
/// <returns></returns>
|
||||
protected string GetQueryParm(string parmName)
|
||||
{
|
||||
var uriBuilder = new UriBuilder(NavMan.Uri);
|
||||
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
return q[parmName] ?? "";
|
||||
}
|
||||
|
||||
protected string getTrad(string objId)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -235,6 +261,12 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
hasChanged = currSer != origSer;
|
||||
if (hasChanged)
|
||||
{
|
||||
// se debug + superadmin --> auto confirm
|
||||
if (autoApprove && string.IsNullOrEmpty(DoorOpInst.userConfirm))
|
||||
{
|
||||
DoorOpInst.userConfirm = WDCUService.userId;
|
||||
DoorOpInst.DtConfirm = DateTime.Now;
|
||||
}
|
||||
DoorOpInst.JsoncActVal = JsonConvert.SerializeObject(dictValCurr);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
@@ -256,6 +288,11 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
var currMode = GetQueryParm("currMode");
|
||||
if (!string.IsNullOrEmpty(currMode) && WDCUService.userRole == "SuperAdmin")
|
||||
{
|
||||
autoApprove = currMode.Equals("debug");
|
||||
}
|
||||
string vers = config.GetValue<string>("ConfDDF:VersNumber");
|
||||
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
|
||||
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
|
||||
@@ -328,6 +365,7 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private bool autoApprove = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -350,9 +388,9 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
await SetSelectedData();
|
||||
}
|
||||
|
||||
private string pathFinder(int id)
|
||||
private string pathFinder(int id, bool reqConf)
|
||||
{
|
||||
string answ = $"HwPdfConfirm?doorOpId={id}&doorId={DoorOpInst.DoorId}&objectId={DoorOpInst.ObjectId}";
|
||||
string answ = $"HwPdfConfirm?doorOpId={id}&doorId={DoorOpInst.DoorId}&objectId={DoorOpInst.ObjectId}&reqConf={reqConf}";
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -385,11 +423,11 @@ namespace WebDoorCreator.UI.Components.Hardware
|
||||
|
||||
if (tempListFilesTempl!.Count != 0)
|
||||
{
|
||||
listValuesFiles = tempListFilesTempl.Where(x => x.Value.Contains(folderName)).ToList();
|
||||
listValuesFiles = tempListFilesTempl.Where(x => x.Value.Contains($"{folderName}\\")).ToList();
|
||||
}
|
||||
else if (tempListFilesSh!.Count != 0)
|
||||
{
|
||||
listValuesFiles = tempListFilesSh!.Where(x => x.Value.Contains(folderName)).ToList();
|
||||
listValuesFiles = tempListFilesSh!.Where(x => x.Value.Contains($"{folderName}\\")).ToList();
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.btnPDF {
|
||||
border-radius: 50%;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
border: 2px solid #00838F;
|
||||
z-index: 99999;
|
||||
}
|
||||
@@ -30,15 +30,16 @@
|
||||
background: #FFF;
|
||||
/*transform: translate(1.6rem, -1rem);*/
|
||||
}
|
||||
.btnPDFSuccess {
|
||||
.btnPdfSuccess {
|
||||
border-radius: 50%;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
border: 2px solid #00838F;
|
||||
z-index: 99999;
|
||||
background: #8E44AD;
|
||||
background: #44AD8E;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btnPDFPending {
|
||||
.btnPdfPending {
|
||||
border-radius: 50%;
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
@@ -46,7 +47,7 @@
|
||||
z-index: 99999;
|
||||
background: #F1C40F;
|
||||
}
|
||||
.btnPDFSuccess > i {
|
||||
.btnPdfSuccess > i {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.btnHighlight {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
.btnPDF {
|
||||
border-radius: 50%;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
border: 2px solid #00838F;
|
||||
z-index: 99999;
|
||||
}
|
||||
@@ -29,18 +29,19 @@
|
||||
/*transform: translate(1.6rem, -1rem);*/
|
||||
}
|
||||
|
||||
.btnPDFSuccess {
|
||||
.btnPdfSuccess {
|
||||
.btnPDF;
|
||||
background: #8E44AD;
|
||||
background: #44AD8E;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.btnPDFPending {
|
||||
.btnPdfPending {
|
||||
.btnGen;
|
||||
background: #F1C40F;
|
||||
//transform: translate(20.3rem, 1rem);
|
||||
}
|
||||
|
||||
.btnPDFSuccess > i {
|
||||
.btnPdfSuccess > i {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
.btnPDF{border-radius:50%;width:1.5rem;height:1.5rem;border:2px solid #00838f;z-index:99999;}.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#b71c1c;}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#fff;}.btnPDFSuccess{border-radius:50%;width:1.5rem;height:1.5rem;border:2px solid #00838f;z-index:99999;background:#8e44ad;}.btnPDFPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#f1c40f;}.btnPDFSuccess>i{font-size:.8rem;}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#03a9f4;transform:translate(10.3rem,-8rem);}.btnCancel{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);}.btnSave{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;}.blue{background:#3652d9;}.grey{background:#7f8c8d;opacity:50%;}.circle{width:1rem;height:1rem;border-radius:50%;box-shadow:0 0 1px 1px #0000001a;}.pulse{animation:pulse-animation 2s infinite;}@keyframes pulse-animation{0%{box-shadow:0 0 0 0 rgba(0,0,0,.2);}100%{box-shadow:0 0 0 20px rgba(0,0,0,0);}}
|
||||
.btnPDF{border-radius:50%;width:1.6rem;height:1.6rem;border:2px solid #00838f;z-index:99999;}.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#b71c1c;}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#fff;}.btnPdfSuccess{border-radius:50%;width:1.6rem;height:1.6rem;border:2px solid #00838f;z-index:99999;background:#44ad8e;color:#fff;}.btnPdfPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#f1c40f;}.btnPdfSuccess>i{font-size:.8rem;}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#03a9f4;transform:translate(10.3rem,-8rem);}.btnCancel{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);}.btnSave{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;}.blue{background:#3652d9;}.grey{background:#7f8c8d;opacity:50%;}.circle{width:1rem;height:1rem;border-radius:50%;box-shadow:0 0 1px 1px #0000001a;}.pulse{animation:pulse-animation 2s infinite;}@keyframes pulse-animation{0%{box-shadow:0 0 0 0 rgba(0,0,0,.2);}100%{box-shadow:0 0 0 20px rgba(0,0,0,0);}}
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="p-5">
|
||||
<DoorList currOrderId="@OrderView!.OrderId" orderTotCost="@OrderView!.TotCost" E_CurrDoor="SetCurrDoor" E_CurrDoorModal="SetCurrDoorModal" updateRecordCount="UpdateTotCount" actFilter="@currFilter"></DoorList>
|
||||
<DoorList currOrderId="@CurrOrdId" orderTotCost="@OrderView!.TotCost" E_CurrDoor="SetCurrDoor" E_CurrDoorModal="SetCurrDoorModal" updateRecordCount="UpdateTotCount" actFilter="@currFilter"></DoorList>
|
||||
<div class="mt-4">
|
||||
<EgwCoreLib.Razor.DataPager @ref="pagerDoors" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" PageSizeList="@pageSizeList" />
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using EgwCoreLib.Razor;
|
||||
using Blazored.SessionStorage;
|
||||
using EgwCoreLib.Razor;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.DTO;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static WebDoorCreator.UI.Data.WDCRefreshService;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.Order
|
||||
{
|
||||
@@ -23,6 +25,16 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
[Parameter]
|
||||
public OrderStatusViewModel? OrderView { get; set; }
|
||||
|
||||
protected int CurrOrdId { get; set; } = 0;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if (OrderView != null)
|
||||
{
|
||||
CurrOrdId = OrderView.OrderId;
|
||||
}
|
||||
}
|
||||
|
||||
public string userId
|
||||
{
|
||||
get
|
||||
@@ -33,6 +45,12 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected DataPager? pagerDoors = null!;
|
||||
@@ -47,7 +65,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
protected DoorsSelectFilter currFilter { get; set; } = new DoorsSelectFilter();
|
||||
|
||||
/// <summary>
|
||||
/// Unit� di misura selezionata
|
||||
/// Unita' di misura selezionata
|
||||
/// </summary>
|
||||
protected string currMeaUnit { get; set; } = "mm";
|
||||
|
||||
@@ -103,9 +121,17 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
currPage = newNum;
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 16;
|
||||
string rawVal = await sessStorage.GetItemAsStringAsync("doorsSelFilt");
|
||||
if (!string.IsNullOrEmpty(rawVal))
|
||||
{
|
||||
currFilter = await sessStorage.GetItemAsync<DoorsSelectFilter>("doorsSelFilt");
|
||||
}
|
||||
else
|
||||
{
|
||||
numRecord = 16;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task SetCurrDoor(DoorModel door)
|
||||
@@ -144,7 +170,10 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
private int currPage
|
||||
{
|
||||
get => currFilter.CurrPage;
|
||||
set => currFilter.CurrPage = value;
|
||||
set
|
||||
{
|
||||
currFilter.CurrPage = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
@@ -152,7 +181,15 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
private int numRecord
|
||||
{
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
set
|
||||
{
|
||||
if (currFilter.NumRec != value)
|
||||
{
|
||||
currFilter.NumRec = value;
|
||||
currPage = 1;
|
||||
InvokeAsync(() => sessStorage.SetItemAsync<DoorsSelectFilter>("doorsSelFilt", currFilter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string searchValue
|
||||
@@ -161,6 +198,9 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
set => currFilter.searchValue = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private ISessionStorageService sessStorage { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -39,11 +39,11 @@ else
|
||||
@if (isEdit && item.OrderId == currOrderId)
|
||||
{
|
||||
<button class="btn btn-sm btn-success" @onclick="()=>editConfirm()" title="Save Order"><i class="fa-regular fa-floppy-disk"></i> Save</button>
|
||||
<button class="btn btn-sm btn-secondary" @onclick="()=>editCancel()" title="Save Order"><i class="fa-solid fa-rotate-left"></i> Cancel</button>
|
||||
<button class="btn btn-sm btn-secondary" @onclick="()=>editCancel()" title="Cancel Order"><i class="fa-solid fa-rotate-left"></i> Cancel</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-primary me-1" @onclick="()=>setOrd2Show(item.OrderId)" title="Order detail"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<button class="btn btn-sm btn-primary me-1" @onclick="()=>setOrd2Show(item.OrderId, true)" title="Order detail"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin, DcaOrdMan, DcaProj" Context="OrderEdit">
|
||||
<Authorized>
|
||||
@if (item.OrderStatus < 30 || WDCUService.userRole == "DcaAdmin" || WDCUService.userRole == "SuperAdmin")
|
||||
|
||||
@@ -7,6 +7,7 @@ using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static WebDoorCreator.Core.Enum;
|
||||
using static WebDoorCreator.UI.Data.WDCRefreshService;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.Order
|
||||
{
|
||||
@@ -76,7 +77,9 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
|
||||
protected string currUser { get; set; } = "";
|
||||
|
||||
protected bool isEdit { get; set; } = false;
|
||||
|
||||
protected bool isModRole { get; set; } = false;
|
||||
|
||||
[Inject]
|
||||
@@ -89,8 +92,11 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
protected bool ordByCode { get; set; } = false;
|
||||
|
||||
protected bool ordByDate { get; set; } = false;
|
||||
|
||||
protected int screenX { get; set; } = 0;
|
||||
|
||||
protected int screenY { get; set; } = 0;
|
||||
|
||||
protected List<string>? userClaims
|
||||
@@ -185,21 +191,6 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string getOrderStatusLabel(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.Label;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
protected string getOrderStatusColor(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -216,6 +207,22 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string getOrderStatusLabel(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.Label;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
@@ -224,7 +231,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
|
||||
if (localOrdId != 0)
|
||||
{
|
||||
await setOrd2Show(localOrdId);
|
||||
await setOrd2Show(localOrdId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,16 +274,27 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
return $"api/Report/GetOrderReport?OrderId={orderId}&Format=PDF";
|
||||
}
|
||||
|
||||
protected async Task setOrd2Show(int orderId)
|
||||
protected async Task setOrd2Show(int orderId, bool doSave)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (ListOrdersStatus == null && !isLoading)
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay(200);
|
||||
}
|
||||
if (ListOrdersStatus != null)
|
||||
{
|
||||
var chosenOrd = ListOrdersStatus.Where(x => x.OrderId == orderId).FirstOrDefault();
|
||||
if (chosenOrd != null)
|
||||
{
|
||||
Ord2Show = chosenOrd;
|
||||
await localStorage.SetItemAsync("OrderId", orderId);
|
||||
if (doSave)
|
||||
{
|
||||
await localStorage.SetItemAsync("OrderId", orderId);
|
||||
}
|
||||
await E_SetOrd2Show.InvokeAsync(chosenOrd);
|
||||
}
|
||||
}
|
||||
@@ -321,10 +339,15 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
#region Private Fields
|
||||
|
||||
private DateTime dateLimit = new DateTime(2000, 1, 1);
|
||||
private bool isLoading = false;
|
||||
private Dictionary<int, string> ListCompany = new Dictionary<int, string>();
|
||||
|
||||
private List<OrderStatusViewModel>? ListOrdersStatus = null;
|
||||
|
||||
private List<ListValuesModel>? ListValuesAll = null;
|
||||
|
||||
private List<OrderStatusViewModel>? SearchRecords = null;
|
||||
|
||||
private bool sortAsc = true;
|
||||
|
||||
private string sortField = "";
|
||||
@@ -406,6 +429,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
ListOrdersStatus = null;
|
||||
var domani = DateTime.Today.AddDays(1);
|
||||
|
||||
@@ -502,7 +526,6 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case "OrdStatus":
|
||||
if (sortAsc)
|
||||
{
|
||||
@@ -514,7 +537,6 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case "Qty":
|
||||
if (sortAsc)
|
||||
{
|
||||
@@ -533,8 +555,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<EgwCoreLib.Razor.DataPager @ref="pagerOrderHP" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
<EgwCoreLib.Razor.DataPager @ref="pagerOrderHP" PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.SessionStorage;
|
||||
using EgwCoreLib.Razor;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static WebDoorCreator.UI.Data.WDCRefreshService;
|
||||
|
||||
namespace WebDoorCreator.UI.Components.Order
|
||||
{
|
||||
@@ -12,12 +14,12 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[CascadingParameter]
|
||||
public bool isTplPage { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<AspNetUsers> E_currUser { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
public bool isTplPage { get; set; } = false;
|
||||
|
||||
public string userId
|
||||
{
|
||||
get
|
||||
@@ -26,8 +28,6 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected WDCVocabularyService WDCVService { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
WDCUService.EA_UserCurrCompany -= OnNewUserCurrComp;
|
||||
}
|
||||
|
||||
|
||||
public async void OnNewUserCurrComp()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -52,12 +53,21 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
#region Protected Fields
|
||||
|
||||
protected string _doorExtCode = "";
|
||||
|
||||
protected int _doorQuantity = 0;
|
||||
|
||||
protected string _orderCodExt = "";
|
||||
|
||||
protected string _orderDescr = "";
|
||||
|
||||
protected bool cloneReq = false;
|
||||
|
||||
protected string Lingua = "EN";
|
||||
|
||||
protected bool newOrdReq = false;
|
||||
|
||||
protected int ordIdOrig = 0;
|
||||
|
||||
protected DataPager? pagerOrderHP = null!;
|
||||
|
||||
#endregion Protected Fields
|
||||
@@ -65,12 +75,19 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
#region Protected Properties
|
||||
|
||||
protected DoorModel? currDoor { get; set; } = null;
|
||||
|
||||
protected DoorModel? currDoorModal { get; set; } = null;
|
||||
protected int currParentId { get; set; } = 0;
|
||||
|
||||
protected OrderSelectFilter currFilter { get; set; } = new OrderSelectFilter();
|
||||
|
||||
protected int CurrLevel { get; set; } = 1;
|
||||
|
||||
protected int currOrderId { get; set; } = 0;
|
||||
|
||||
protected int currParentId { get; set; } = 0;
|
||||
|
||||
protected AspNetUsers? currUser { get; set; } = null;
|
||||
|
||||
protected bool doorChange { get; set; } = false;
|
||||
|
||||
protected string doorExtCode
|
||||
@@ -86,7 +103,9 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
}
|
||||
|
||||
protected List<DoorModel>? DoorsList { get; set; } = null;
|
||||
|
||||
protected string goToDefPage { get; set; } = "";
|
||||
|
||||
protected bool isModRole { get; set; } = false;
|
||||
|
||||
[Inject]
|
||||
@@ -125,47 +144,21 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
|
||||
protected List<UsersViewModel>? UsersList { get; set; } = null;
|
||||
|
||||
[Inject]
|
||||
protected WDCVocabularyService VocService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCUserService WDCUService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WebDoorCreatorService WDService { get; set; } = null!;
|
||||
protected WDCVocabularyService WDCVService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCVocabularyService VocService { get; set; } = null!;
|
||||
protected WebDoorCreatorService WDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
private List<ListValuesModel>? ListValuesAll = null;
|
||||
#region Protected Methods
|
||||
protected string translate(string lemma)
|
||||
{
|
||||
return VocService.Traduci(WDCUService.currLanguage ?? "EN", lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Traduzione condizionale
|
||||
/// </summary>
|
||||
/// <param name="condition">valore condizione</param>
|
||||
/// <param name="lemmaCF">lemma caso FALSE</param>
|
||||
/// <param name="lemmaCT">lemma caso TRUE</param>
|
||||
/// <returns></returns>
|
||||
protected string translOpt(bool condition, string lemmaCF, string lemmaCT)
|
||||
{
|
||||
string answ = "";
|
||||
if (condition)
|
||||
{
|
||||
answ = VocService.Traduci(WDCUService.currLanguage ?? "EN", lemmaCT);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = VocService.Traduci(WDCUService.currLanguage ?? "EN", lemmaCF);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected string Lingua = "EN";
|
||||
|
||||
protected async Task addNewOrder(string userName, bool saveAsTemplate)
|
||||
{
|
||||
@@ -282,16 +275,61 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
currDoor = null;
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
protected void SetNumRec(int newNum)
|
||||
{
|
||||
currPage = 1;
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
protected void ForceReloadPage(int newNum)
|
||||
protected void SetPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
|
||||
protected string getOrderStatusColor(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.DefaultVal;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string getOrderStatusLabel(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.Label;
|
||||
}
|
||||
}
|
||||
|
||||
return answ.ToUpper();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
string rawVal = await sessStorage.GetItemAsStringAsync("ordSelFilt");
|
||||
if (!string.IsNullOrEmpty(rawVal))
|
||||
{
|
||||
currFilter = await sessStorage.GetItemAsync<OrderSelectFilter>("ordSelFilt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -300,6 +338,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
WDCUService.EA_UserCurrCompany += OnNewUserCurrComp;
|
||||
}
|
||||
|
||||
|
||||
protected async Task ReloadData()
|
||||
{
|
||||
DoorsList = await WDService.DoorGetByOrderId(currOrderId);
|
||||
@@ -388,6 +427,32 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected string translate(string lemma)
|
||||
{
|
||||
return VocService.Traduci(WDCUService.currLanguage ?? "EN", lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Traduzione condizionale
|
||||
/// </summary>
|
||||
/// <param name="condition">valore condizione</param>
|
||||
/// <param name="lemmaCF">lemma caso FALSE</param>
|
||||
/// <param name="lemmaCT">lemma caso TRUE</param>
|
||||
/// <returns></returns>
|
||||
protected string translOpt(bool condition, string lemmaCF, string lemmaCT)
|
||||
{
|
||||
string answ = "";
|
||||
if (condition)
|
||||
{
|
||||
answ = VocService.Traduci(WDCUService.currLanguage ?? "EN", lemmaCT);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = VocService.Traduci(WDCUService.currLanguage ?? "EN", lemmaCF);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
{
|
||||
totalCount = newTotCount;
|
||||
@@ -395,6 +460,12 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<ListValuesModel>? ListValuesAll = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int currPage
|
||||
@@ -423,7 +494,14 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
private int numRecord
|
||||
{
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
set
|
||||
{
|
||||
if (currFilter.NumRec != value)
|
||||
{
|
||||
currFilter.NumRec = value;
|
||||
InvokeAsync(() => sessStorage.SetItemAsync<OrderSelectFilter>("ordSelFilt", currFilter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int orderStatus
|
||||
@@ -438,39 +516,11 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
set => currFilter.searchValue = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private ISessionStorageService sessStorage { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
protected string getOrderStatusLabel(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.Label;
|
||||
}
|
||||
}
|
||||
|
||||
return answ.ToUpper();
|
||||
}
|
||||
protected string getOrderStatusColor(int orderStat)
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
if (ListValuesAll != null)
|
||||
{
|
||||
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
|
||||
if (currOrdStat != null)
|
||||
{
|
||||
answ = currOrdStat.DefaultVal;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task doCalcSVG(int orderId)
|
||||
@@ -515,6 +565,7 @@ namespace WebDoorCreator.UI.Components.Order
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
currFilter = newParams;
|
||||
await sessStorage.SetItemAsync<OrderSelectFilter>("ordSelFilt", newParams);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<rect x="0" y="0" width="100%" height="100%" fill="#34495E"></rect>
|
||||
<image href="@ImagePath" height="100%" width="100%" clip-path="url(#theClippingPath)"></image>
|
||||
<path d="@PathLineData" stroke="@LineColor" stroke-width="@LineWidth" fill="none" />
|
||||
<g transform="translate(0,@(ObjH/4))">
|
||||
<g transform="translate(0,@(ObjH/8))">
|
||||
<foreignObject width="@(ObjW/2)" height="@(ObjH/2)">
|
||||
<div class="row text-white text-center">
|
||||
<div style="@TitleStyle" class="text-uppercase">
|
||||
@@ -18,11 +18,23 @@
|
||||
</div>
|
||||
@if (isLogged)
|
||||
{
|
||||
<div class="mt-5">
|
||||
<button class="btn btn-lg btn-primary rounded-pill p-3 px-4 text-uppercase" @onclick="() => raiseEvent()">
|
||||
<div class="mt-5" style="font-size: 30px;">
|
||||
@* <button class="btn btn-lg btn-primary rounded-pill p-3 px-4 text-uppercase" @onclick="() => raiseEvent(null)">
|
||||
@ButtonText
|
||||
</button>
|
||||
</div>
|
||||
</button> *@
|
||||
@if (ButtonsList != null && ButtonsList.Count > 0)
|
||||
{
|
||||
foreach (var item in ButtonsList)
|
||||
{
|
||||
<button class="mx-2 my-3 @item.Css" @onclick="() => raiseEvent(item.RetPage)" title="@item.Title">
|
||||
@item.Text <i class="@item.Icon"></i>
|
||||
@* <div class="small">
|
||||
@item.BtnDescript
|
||||
</div> *@
|
||||
</button>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</foreignObject>
|
||||
|
||||
@@ -19,7 +19,10 @@ namespace WebDoorCreator.UI.Components.SvgComp
|
||||
public string ButtonText { get; set; } = "Button Text";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ExeFunct { get; set; }
|
||||
public List<ButtonData> ButtonsList { get; set; } = new List<ButtonData>();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_ExeFunct { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string ImagePath { get; set; } = "images/DOORBG.png";
|
||||
@@ -72,6 +75,18 @@ namespace WebDoorCreator.UI.Components.SvgComp
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ButtonData
|
||||
{
|
||||
public string Css { get; set; } = "btn btn-lg btn-primary rounded-pill p-3 px-4 text-uppercase";
|
||||
public string Text { get; set; } = "Button";
|
||||
public string Title { get; set; } = "Button Suggestion";
|
||||
public string Descript { get; set; } = "...";
|
||||
public string Icon { get; set; } = "fa fa-home";
|
||||
public string RetPage { get; set; } = "home";
|
||||
}
|
||||
|
||||
|
||||
protected List<PointData> PathLine { get; set; } = null!;
|
||||
|
||||
protected string PathLineData
|
||||
@@ -97,7 +112,7 @@ namespace WebDoorCreator.UI.Components.SvgComp
|
||||
|
||||
protected void execFunc()
|
||||
{
|
||||
EC_ExeFunct.InvokeAsync(true);
|
||||
EC_ExeFunct.InvokeAsync("");
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
@@ -157,9 +172,10 @@ namespace WebDoorCreator.UI.Components.SvgComp
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
protected async Task raiseEvent()
|
||||
protected async Task raiseEvent(string? retPage)
|
||||
{
|
||||
await EC_ExeFunct.InvokeAsync(true);
|
||||
retPage = retPage ?? "Home";
|
||||
await EC_ExeFunct.InvokeAsync(retPage);
|
||||
}
|
||||
|
||||
#endregion Protected Classes
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
@if (DoorsList == null || DoorsList.Count == 0)
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -11,14 +11,113 @@ namespace WebDoorCreator.UI.Controllers
|
||||
[ApiController]
|
||||
public class DoorImageController : ControllerBase
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public DoorImageController(IConfiguration configuration, QueueDataService cQDService, WebDoorCreatorService cWDCService)
|
||||
{
|
||||
Log.Trace("Starting DoorImageController");
|
||||
_configuration = configuration;
|
||||
WaitReloadSvg = _configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
|
||||
QDService = cQDService;
|
||||
WDService = cWDCService;
|
||||
Log.Trace("Avviato DoorImageController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
private Random rnd = new Random();
|
||||
|
||||
#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))
|
||||
{
|
||||
string vetoReq = await QDService.DoorProcVetoGetAsync(DoorId);
|
||||
if (string.IsNullOrEmpty(vetoReq))
|
||||
{
|
||||
await QDService.DoorProcVetoSetAsync(DoorId, WaitReloadSvg * 20);
|
||||
// richiede ricalcolo img
|
||||
await SendRecalcReq(DoorId);
|
||||
|
||||
// attende ...
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
// riprova lettura
|
||||
svgContent = await QDService.DoorGetLastSvg(DoorId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// attesa causale per vedere SE riesce a leggere ugualmente...faccio rand (4..10)*wait reload...
|
||||
await Task.Delay(WaitReloadSvg * rnd.Next(4, 10));
|
||||
// riprovo lettura
|
||||
svgContent = await QDService.DoorGetLastSvg(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 SendRecalcReq(int DoorId)
|
||||
{
|
||||
if (DoorId > 0)
|
||||
{
|
||||
// richiede ricalcolo img
|
||||
List<string> doorIdList = new List<string>() { $"{DoorId}" };
|
||||
// chiamo reset richieste
|
||||
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
|
||||
// recupero DDF ed invio x processing
|
||||
string currDDF = await WDService.DoorOpGetDDF(DoorId);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
|
||||
await Task.Delay(WaitReloadSvg);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#if false
|
||||
[HttpGet("GetImage.png")]
|
||||
public async Task<IActionResult> GetImagePng(int DoorId)
|
||||
@@ -33,37 +132,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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebDoorCreator.Data;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace WebDoorCreator.UI.Data
|
||||
{
|
||||
@@ -7,35 +10,30 @@ namespace WebDoorCreator.UI.Data
|
||||
{
|
||||
#region Public Events
|
||||
|
||||
public event Action EA_UpdDoorOp = null!;
|
||||
public event EventHandler EA_ConfDoorOp = delegate { };
|
||||
|
||||
public event EventHandler EA_OrderChanged = delegate { };
|
||||
|
||||
public event Action EA_UpdDoorOp = null!;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
|
||||
public bool isDoorOpUpd
|
||||
{
|
||||
get => _isDoorOpUpd;
|
||||
set
|
||||
{
|
||||
_isDoorOpUpd = value;
|
||||
reportDoorOpUpd();
|
||||
_isDoorOpUpd = value;
|
||||
reportDoorOpUpd();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
#region Public Methods
|
||||
|
||||
protected void reportDoorOpUpd()
|
||||
{
|
||||
if (EA_UpdDoorOp != null)
|
||||
{
|
||||
EA_UpdDoorOp?.Invoke();
|
||||
}
|
||||
}
|
||||
public void ReportDoorOpConf(int doorId, int doorOpId, string objId)
|
||||
{
|
||||
DOPEventArgs currOpr = new DOPEventArgs()
|
||||
@@ -50,19 +48,63 @@ namespace WebDoorCreator.UI.Data
|
||||
EA_ConfDoorOp(this, currOpr);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReportOrderChanged(int orderId)
|
||||
{
|
||||
OrdEventArgs currOpr = new OrdEventArgs()
|
||||
{
|
||||
OrderId = orderId
|
||||
};
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (EA_OrderChanged != null)
|
||||
{
|
||||
EA_OrderChanged(this, currOpr);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class DOPEventArgs : EventArgs
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public int DoorId { get; set; } = 0;
|
||||
public int DoorOpId { get; set; } = 0;
|
||||
public string ObjectId { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class OrdEventArgs : EventArgs
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public int OrderId { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void reportDoorOpUpd()
|
||||
{
|
||||
if (EA_UpdDoorOp != null)
|
||||
{
|
||||
EA_UpdDoorOp?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool _isDoorOpUpd { get; set; } = false;
|
||||
private bool _isDoorOpConf { get; set; } = false;
|
||||
#endregion Private Properties
|
||||
private bool _isDoorOpUpd { get; set; } = false;
|
||||
|
||||
public class DOPEventArgs : EventArgs
|
||||
{
|
||||
public int DoorId { get; set; } = 0;
|
||||
public int DoorOpId { get; set; } = 0;
|
||||
public string ObjectId { get; set; } = "";
|
||||
}
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using NLog;
|
||||
using System.Net.NetworkInformation;
|
||||
using WebDoorCreator.Data;
|
||||
using WebDoorCreator.UI.Components.Users;
|
||||
|
||||
namespace WebDoorCreator.UI.Health
|
||||
{
|
||||
public class Checks
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public static async Task<HealthCheckResult> ConfigCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check Config table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetConfig
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check Config table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> DoorsCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check DOOR table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetDoor
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check DOOR table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> OrdersCount(IConfiguration _config)
|
||||
{
|
||||
string description = "Try check ORDER table";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_config))
|
||||
{
|
||||
var dbCount = localDbCtx
|
||||
.DbSetOrders
|
||||
.Count();
|
||||
if (dbCount > 0)
|
||||
{
|
||||
description = $"Check ORDER table, found {dbCount} records";
|
||||
healthCheckData.Add("Count", dbCount);
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
return HealthCheckResult.Unhealthy(description + $" NO RECORD found", null, healthCheckData);
|
||||
}
|
||||
|
||||
public static async Task<HealthCheckResult> PingCheck(string hostName)
|
||||
{
|
||||
var description = $"Ping to {hostName}";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
using (var thePing = new Ping())
|
||||
{
|
||||
var pingResult = await thePing.SendPingAsync(hostName);
|
||||
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime);
|
||||
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString());
|
||||
if (pingResult.Status == IPStatus.Success)
|
||||
{
|
||||
description += $" - {pingResult.RoundtripTime}ms";
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
}
|
||||
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
@page "/ForceReload"
|
||||
|
||||
<h3>Refreshing Data</h3>
|
||||
<LoadingData Title="Reloading Data" DisplayMode="LoadingData.SpinMode.Growl" DisplaySize="LoadingData.CtrlSize.Large"></LoadingData>
|
||||
|
||||
<LoadingData></LoadingData>
|
||||
|
||||
<ProgressDisplay Title="@titleMsg" CurrVal="@currVal" NextVal="@nextVal" MaxVal="@maxVal" ExpTimeMSec="100"></ProgressDisplay>
|
||||
@@ -23,12 +23,31 @@ namespace WebDoorCreator.UI.Pages
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
currVal = 0;
|
||||
nextVal = 1;
|
||||
await Task.Delay(100);
|
||||
currVal++;
|
||||
nextVal++;
|
||||
await WDService.FlushCustomPattern("Cache");
|
||||
await Task.Delay(1);
|
||||
currVal++;
|
||||
nextVal++;
|
||||
await Task.Delay(200);
|
||||
currVal++;
|
||||
nextVal++;
|
||||
await WDCVService.ReloadVoc();
|
||||
currVal++;
|
||||
nextVal++;
|
||||
await Task.Delay(200);
|
||||
currVal++;
|
||||
nextVal++;
|
||||
NavManager.NavigateTo("OrdersHomePage", true);
|
||||
}
|
||||
|
||||
private int currVal = 0;
|
||||
private int nextVal = 1;
|
||||
private int maxVal = 6;
|
||||
private string titleMsg = "Clearing cache...";
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,24 @@
|
||||
@if (currDoorOp != null)
|
||||
{
|
||||
<div>
|
||||
<div class="col-10 text-center mb-2">
|
||||
Please press
|
||||
<button class="btn btn-outline-dark" style="cursor: pointer;" @onclick="()=>doConfirm()">
|
||||
CONFIRM
|
||||
</button>
|
||||
after reading the whole Document
|
||||
<div class="col-12 text-center mb-2">
|
||||
@if (reqConf)
|
||||
{
|
||||
<button class="btn btn-outline-dark" style="cursor: pointer;" @onclick="()=>doConfirm()">
|
||||
Press <b>HERE to CONFIRM</b> after reading the whole Document
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-outline-primary" style="cursor: pointer;" @onclick="()=>doClose()">
|
||||
Press <b>here</b> to close the Document
|
||||
</button>
|
||||
|
||||
}
|
||||
</div>
|
||||
<div class="bg-light p-1">
|
||||
@* <b>@docUrl</b> *@
|
||||
<PdfDisplay Width="100%" PdfUrl="@docUrl" HeightList="@heightList"></PdfDisplay>
|
||||
</div>
|
||||
<embed src="Docs/1001.pdf" width="100%" height="800px" />
|
||||
</div>
|
||||
}
|
||||
@@ -1,27 +1,48 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Microsoft.JSInterop;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace WebDoorCreator.UI.Pages
|
||||
{
|
||||
public partial class HwPdfConfirm
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected int doorId = 0;
|
||||
|
||||
protected string objectId = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<DoorOpModel> allDoorOps { get; set; } = new List<DoorOpModel>();
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!;
|
||||
protected DoorOpModel currDoorOp { get; set; } = new DoorOpModel();
|
||||
|
||||
protected int doorOpId { get; set; } = 0;
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected QueueDataService QDataServ { get; set; } = null!;
|
||||
|
||||
protected bool reqConf { get; set; } = false;
|
||||
|
||||
protected string userLang
|
||||
{
|
||||
get => WDCUService.currLanguage ?? "EN";
|
||||
@@ -33,12 +54,17 @@ namespace WebDoorCreator.UI.Pages
|
||||
|
||||
[Inject]
|
||||
protected WDCUserService WDCUService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WDCRefreshService WDRService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected WebDoorCreatorService WDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected bool checkIfConf()
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -63,6 +89,14 @@ namespace WebDoorCreator.UI.Pages
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task doClose()
|
||||
{
|
||||
// ora chiudo!
|
||||
await Task.Delay(50);
|
||||
await JSRuntime.InvokeVoidAsync("window.close");
|
||||
await Task.Delay(50);
|
||||
}
|
||||
|
||||
protected async Task doConfirm()
|
||||
{
|
||||
currDoorOp.userConfirm = WDCUService.userId;
|
||||
@@ -71,12 +105,32 @@ namespace WebDoorCreator.UI.Pages
|
||||
var doorOps2Save = new List<DoorOpModel>() { currDoorOp };
|
||||
|
||||
var done = await WDService.DoorOpUpdate(doorOps2Save);
|
||||
|
||||
if (done)
|
||||
{
|
||||
// ricalcola!
|
||||
await refreshSVG();
|
||||
// piccola attesa..
|
||||
await Task.Delay(50);
|
||||
// riporto update...
|
||||
WDRService.ReportDoorOpConf(doorId, doorOpId, objectId);
|
||||
// ora chiudo!
|
||||
await Task.Delay(50);
|
||||
await JSRuntime.InvokeVoidAsync("window.close");
|
||||
await Task.Delay(50);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
string vers = config.GetValue<string>("ConfDDF:VersNumber");
|
||||
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
|
||||
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
|
||||
var footRows = config.GetSection("ConfDDF:Footer").Get<List<string>>();
|
||||
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -91,6 +145,10 @@ namespace WebDoorCreator.UI.Pages
|
||||
{
|
||||
int.TryParse(sDoorId, out doorId);
|
||||
}
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("reqConf", out var sReqConf))
|
||||
{
|
||||
reqConf = bool.Parse(sReqConf);
|
||||
}
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("doorOpId", out var sDoorOpId))
|
||||
{
|
||||
doorOpId = int.Parse(sDoorOpId);
|
||||
@@ -98,14 +156,66 @@ namespace WebDoorCreator.UI.Pages
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua generazione DDF + refresh SVG
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task refreshSVG()
|
||||
{
|
||||
List<DoorOpModel>? listOpAll = await WDService.DoorOpGetByDoorId(doorId);
|
||||
if (listOpAll != null)
|
||||
{
|
||||
List<string> ordListVal = new List<string>();
|
||||
List<DoorOpModel> listOp = listOpAll.Where(x => x.userConfirm != "" && x.DtConfirm != null).ToList();
|
||||
if (listOp != null)
|
||||
{
|
||||
// chiamo metodo x avere DDF serializzato
|
||||
var CurrentCompoOrder = await WDService.ListValuesGetAll("*", "Hardware");
|
||||
if (CurrentCompoOrder != null)
|
||||
{
|
||||
foreach (var item in CurrentCompoOrder.OrderBy(x => x.Ordinal).ToList())
|
||||
{
|
||||
ordListVal.Add(item.TableName);
|
||||
}
|
||||
}
|
||||
|
||||
listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList();
|
||||
|
||||
string currDdf = currDdfConv.GetSerialized(listOp);
|
||||
// versione corrente del DDF generato
|
||||
int currVers = await QDataServ.SendCalcReq(doorId, currDdf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ReloadData()
|
||||
{
|
||||
currDoorOp = await WDService.DoorOpGetById(doorOpId);
|
||||
docUrl = "Docs/1001.pdf";
|
||||
if (currDoorOp != null)
|
||||
{
|
||||
allDoorOps = await WDService.DoorOpGetByDoorId(currDoorOp.DoorId);
|
||||
if (currDoorOp.CurrVals.ContainsKey("template"))
|
||||
{
|
||||
docUrl = $"docs/{objectId}/{currDoorOp.CurrVals["template"]}.pdf";
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
// fin finale caratteri! space Stripe: " " --> "_"
|
||||
docUrl = docUrl.Replace(" ", "_").Replace(@"\", "/");
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string docUrl = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private Dictionary<string, string> heightList { get; set; } = new Dictionary<string, string>() { { "200", "200px" }, { "400", "400px" }, { "600", "600px" }, { "800", "800px" }, { "1000", "1000px" }, { "1200", "1200px" }, { "1400", "1400px" } };
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="shadow-lg">
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<HomeCard ObjH="1080" ObjW="1920" StartPoint="850" LineWidth="18" TitleText="Web Door Creator" BodyText="The new way to create doors" ImagePath="images/HeroSecDoor.png" EC_ExeFunct="changePage" ButtonText="@translate("UI_00")" isLogged="true"></HomeCard>
|
||||
<HomeCard ObjH="1080" ObjW="1920" StartPoint="850" LineWidth="18" TitleText="Web Door Creator" BodyText="The new way to create doors" ImagePath="images/HeroSecDoor.png" EC_ExeFunct="changePage" ButtonText="@translate("UI_00")" isLogged="true" ButtonsList="@BtnList"></HomeCard>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<HomeCard ObjH="1080" ObjW="1920" StartPoint="850" LineWidth="18" TitleText="Web Door Creator" BodyText="The new way to create doors" ImagePath="images/HeroSecDoor.png" EC_ExeFunct="changePage" ButtonText="@translate("UI_00")" isLogged="false"></HomeCard>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebDoorCreator.UI.Components.SvgComp;
|
||||
using WebDoorCreator.UI.Data;
|
||||
|
||||
namespace WebDoorCreator.UI.Pages
|
||||
@@ -21,7 +22,46 @@ namespace WebDoorCreator.UI.Pages
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task changePage(bool newPage)
|
||||
protected List<HomeCard.ButtonData> BtnList { get; set; } = new List<HomeCard.ButtonData>();
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
BtnList = new List<HomeCard.ButtonData>();
|
||||
BtnList.Add(new HomeCard.ButtonData
|
||||
{
|
||||
Text = "Import Orders",
|
||||
Css = "btn btn-lg btn-primary rounded-pill py-3 px-5 text-uppercase fs-3",
|
||||
Icon = "fa-regular fa-file-code",
|
||||
Title = "Go To Import page for third-party order import",
|
||||
Descript = "Import from CSV, XML, Json",
|
||||
RetPage = "ImportOrders"
|
||||
});
|
||||
BtnList.Add(new HomeCard.ButtonData
|
||||
{
|
||||
Text = "Manage Orders",
|
||||
Css = "btn btn-lg btn-primary rounded-pill py-3 px-5 text-uppercase fs-3",
|
||||
Icon = "fa-solid fa-cart-shopping",
|
||||
Title = "Go To Order Management page",
|
||||
Descript = "",
|
||||
RetPage = "OrdersHomePage"
|
||||
});
|
||||
BtnList.Add(new HomeCard.ButtonData
|
||||
{
|
||||
Text = "Design Doors",
|
||||
Css = "btn btn-lg btn-primary rounded-pill py-3 px-5 text-uppercase fs-3",
|
||||
Icon = "fa-solid fa-door-open",
|
||||
Title = "Go To Door Design Page",
|
||||
Descript = "",
|
||||
RetPage = "DoorDesignPage"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Route to desider page
|
||||
/// </summary>
|
||||
/// <param name="newPage"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task changePage(string newPage)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
NavManager.NavigateTo("OrdersHomePage");
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
@page "/ModeSelector"
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<div class="card shadow" style="width: 20rem; height:22rem;">
|
||||
<div class="card-header d-flex py-3 fs-1 justify-content-evenly">
|
||||
<div class="px-2">
|
||||
<i class="fa-regular fa-file-excel"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-file-csv"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-regular fa-file-code"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Order Import</h5>
|
||||
<p class="card-text">Order import from external third party programs for standard-featured doors.</p>
|
||||
<p>Format recognized: CSV, XML and Json.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="#" class="btn btn-primary">Go To Order Import</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="card shadow" style="width: 20rem; height:22rem;">
|
||||
<div class="card-header d-flex py-3 fs-1 justify-content-evenly">
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-cart-shopping"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-cart-plus"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-cart-arrow-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Order Manage</h5>
|
||||
<p class="card-text">Create and manage orders choosing from door models and template available on the platform or already defined.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="#" class="btn btn-primary">Go To Order Manager</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="card shadow" style="width: 20rem; height:22rem;">
|
||||
<div class="card-header d-flex py-3 fs-1 justify-content-evenly">
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-door-open"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-dungeon"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-door-closed"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Door Modeling</h5>
|
||||
<p class="card-text">Create your unique door model, validate the design and get 2D and 3D preview.</p>
|
||||
<p>Choose materials, hardware, special working, ...</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="#" class="btn btn-primary">Go To Door Modeler</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="card shadow" style="width: 20rem; height:22rem;">
|
||||
<div class="card-header d-flex py-3 fs-1 justify-content-evenly">
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-gears"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-users-gear"></i>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Advanced Tasks</h5>
|
||||
<p class="card-text">Manage advanced task like template and catalog management, advanced search, ....</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="#" class="btn btn-primary">Go To Advanced.</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -1,48 +1,54 @@
|
||||
@page "/SuperAdmin"
|
||||
@using WebDoorCreator.UI.Components
|
||||
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin">
|
||||
<Authorized>
|
||||
<div class="d-flex justify-content-around">
|
||||
<div class="btn-group">
|
||||
<button @onclick="() => SetMode(AdminMode.Company)" class="btn px-5 @cssMode(AdminMode.Company)">Company</button>
|
||||
@*<button @onclick="() => SetMode(AdminMode.Interface)" class="btn px-5 @cssMode(AdminMode.Interface)">Interface</button>*@
|
||||
<button @onclick="() => SetMode(AdminMode.Component)" class="btn px-5 @cssMode(AdminMode.Component)">Components</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-around">
|
||||
<div class="btn-group">
|
||||
<button @onclick="() => SetMode(AdminMode.Company)" class="btn px-5 @cssMode(AdminMode.Company)">Company</button>
|
||||
<AuthorizeView Roles="SuperAdmin">
|
||||
<Authorized>
|
||||
<button @onclick="() => SetMode(AdminMode.Interface)" class="btn px-5 @cssMode(AdminMode.Interface)">Interface</button>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<button @onclick="() => SetMode(AdminMode.Component)" class="btn px-5 @cssMode(AdminMode.Component)">Components</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cardShadow mt-2 p-2">
|
||||
<div class="cardShadow mt-2 p-2">
|
||||
|
||||
@if (CurrMode == AdminMode.Company)
|
||||
{
|
||||
<div class="p-2">
|
||||
@if (CurrMode == AdminMode.Company)
|
||||
{
|
||||
<div class="p-2">
|
||||
<AuthorizeView Roles="SuperAdmin">
|
||||
<Authorized>
|
||||
<div class="mb-3 text-end">
|
||||
<button type="button" class="btn btn-sm btn-success" @onclick="()=>clearFields()" data-bs-toggle="modal" data-bs-target="#newCompModal">
|
||||
<i class="fa-solid fa-plus"></i> Add new company
|
||||
</button>
|
||||
</div>
|
||||
<CompanyList E_currCompany="catchCurrComp"></CompanyList>
|
||||
</div>
|
||||
}
|
||||
else if (CurrMode == AdminMode.Interface)
|
||||
{
|
||||
<div class="p-2">
|
||||
<VocRefresh lang="EN"></VocRefresh>
|
||||
</div>
|
||||
}
|
||||
else if (CurrMode == AdminMode.Component)
|
||||
{
|
||||
@*<HwMan></HwMan>*@
|
||||
<div class="p-2">
|
||||
<CompoCompare updateRecordCount="UpdateTotCount" actFilter="@currFilter"></CompoCompare>
|
||||
<div>
|
||||
<EgwCoreLib.Razor.DataPager @ref="pagerCompoFiles" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<CompanyList E_currCompany="catchCurrComp"></CompanyList>
|
||||
</div>
|
||||
}
|
||||
else if (CurrMode == AdminMode.Interface)
|
||||
{
|
||||
<div class="p-2">
|
||||
<VocRefresh lang="EN"></VocRefresh>
|
||||
</div>
|
||||
}
|
||||
else if (CurrMode == AdminMode.Component)
|
||||
{
|
||||
@*<HwMan></HwMan>*@
|
||||
<div class="p-2">
|
||||
<CompoCompare updateRecordCount="UpdateTotCount" actFilter="@currFilter"></CompoCompare>
|
||||
<div>
|
||||
<EgwCoreLib.Razor.DataPager @ref="pagerCompoFiles" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@*
|
||||
@*
|
||||
<div class="">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="pb-0 d-flex justify-content-start">
|
||||
@@ -87,8 +93,6 @@
|
||||
}
|
||||
</div>
|
||||
</div>*@
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
|
||||
<!-- Modal Company -->
|
||||
|
||||
@@ -9,7 +9,7 @@ using WebDoorCreator.UI.Data;
|
||||
|
||||
namespace WebDoorCreator.UI.Pages
|
||||
{
|
||||
[Authorize(Roles = "SuperAdmin")]
|
||||
[Authorize(Roles = "SuperAdmin, DcaAdmin")]
|
||||
public partial class SuperAdmin
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@page "/TemplateMan"
|
||||
|
||||
<AuthorizeView Roles="SuperAdmin" Context="MenuHide">
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin, CompAdmin" Context="MenuHide">
|
||||
<Authorized>
|
||||
<CascadingValue Value="true">
|
||||
<OrdersDoorsDoorDef></OrdersDoorsDoorDef>
|
||||
|
||||
@@ -120,7 +120,7 @@ else
|
||||
<button class="input-group-text" @onclick="resetSearch"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, CompAdmin">
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin, CompAdmin">
|
||||
<Authorized>
|
||||
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
|
||||
<select class="form-select" @bind="@FiltUserRole">
|
||||
@@ -136,7 +136,7 @@ else
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<AuthorizeView Roles="SuperAdmin, Admin, CompAdmin">
|
||||
<AuthorizeView Roles="SuperAdmin, DcaAdmin, CompAdmin">
|
||||
<Authorized>
|
||||
<span class="input-group-text"><i class="fa-solid fa-building"></i></span>
|
||||
@if (@context.User.IsInRole("SuperAdmin") || @context.User.IsInRole("DcaAdmin"))
|
||||
|
||||
@@ -12,7 +12,7 @@ using NLog;
|
||||
|
||||
namespace WebDoorCreator.UI.Pages
|
||||
{
|
||||
[Authorize(Roles = "SuperAdmin, Admin, CompAdmin")]
|
||||
[Authorize(Roles = "SuperAdmin, DcaAdmin, CompAdmin")]
|
||||
public partial class UserAdmin : ComponentBase, IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - WebDoorCreator.UI</title>
|
||||
@*<link rel="stylesheet" href="~/css/bootstrap/bootstrap.min.css" />*@
|
||||
<link rel="stylesheet" href="~/lib/bootstrap-icons/font/bootstrap-icons.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/font-awesome/css/all.min.css" />
|
||||
@*<link rel="stylesheet" href="~/css/site.css" />*@
|
||||
<link rel="shortcut icon" href="images/favicon.ico" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" href="~/css/site.min.css" />
|
||||
<link rel="stylesheet" href="~/WebDoorCreator.UI.styles.css" />
|
||||
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
|
||||
|
||||
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/Identity/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/Identity/css/site.css" />
|
||||
@@ -34,25 +32,6 @@
|
||||
</environment>
|
||||
</head>
|
||||
<body>
|
||||
@*<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow">
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
||||
@{
|
||||
var result = Engine.FindView(ViewContext, "_LoginPartial", isMainPage: false);
|
||||
}
|
||||
@if (result.Success)
|
||||
{
|
||||
await Html.RenderPartialAsync("_LoginPartial");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("The default Identity UI layout requires a partial view '_LoginPartial' " +
|
||||
"usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration " +
|
||||
$"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
|
||||
}
|
||||
</div>
|
||||
</nav>
|
||||
</header>*@
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
An error has occurred. This application may no longer respond until reloaded.
|
||||
@@ -67,50 +46,38 @@
|
||||
@RenderBody()
|
||||
</div>
|
||||
|
||||
@*<div class="fixed-bottom bottom-row px-2">
|
||||
<div class="row bg-dark text-light">
|
||||
<div class="col-5 pe-0 text-left">
|
||||
<b>Web Door Creator @(DateTime.Today.Year)</b>
|
||||
</div>
|
||||
<div class="col-7 ps-0 text-end">
|
||||
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | Powered by: <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="~/images/LogoEgw.png" /> Egalware </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
@*<footer class="footer border-top pl-3 text-muted">
|
||||
<div class="d-flex justify-content-between w-100 px-4">
|
||||
© 2023 - WebDoorCreator.UI
|
||||
</div>
|
||||
</footer>*@
|
||||
|
||||
@*<environment include="Development">
|
||||
<script src="/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/Identity/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
|
||||
<script src="~/Identity/js/site.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"
|
||||
asp-fallback-src="~/Identity/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2">
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-src="~/Identity/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj">
|
||||
</script>
|
||||
<script src="~/Identity/js/site.js" asp-append-version="true"></script>
|
||||
</environment>*@
|
||||
|
||||
<script src="~/Identity/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/js/bootstrap.bundle.js"></script>
|
||||
<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>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.SessionStorage;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using HealthChecks.UI.Client;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.UI;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using StackExchange.Redis;
|
||||
using System.Globalization;
|
||||
using System.Text.Json.Serialization;
|
||||
@@ -16,19 +17,80 @@ using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Areas.Identity;
|
||||
using WebDoorCreator.UI.Data;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
// configuration setup
|
||||
ConfigurationManager configuration = builder.Configuration;
|
||||
Microsoft.Extensions.Configuration.ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
// AspNetCore Identity setup
|
||||
var connectionString = builder.Configuration.GetConnectionString("Identity.DB");
|
||||
|
||||
// REDIS setup
|
||||
string connStringRedis = configuration.GetConnectionString("Redis");
|
||||
if (string.IsNullOrEmpty(connStringRedis))
|
||||
{
|
||||
connStringRedis = "localhost:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false";
|
||||
}
|
||||
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||
// avvio oggetto shared x redis...
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
// AspNetCore Identity setup
|
||||
var connectionString = configuration.GetConnectionString("Identity.DB");
|
||||
string dbServerAddr = "127.0.0.1";
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
{
|
||||
connectionString = "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.SRV;";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (connectionString.Contains("Server"))
|
||||
{
|
||||
bool trovato = false;
|
||||
var dbTokens = connectionString.Split(";");
|
||||
int numTok = dbTokens.Count();
|
||||
int idx = 0;
|
||||
while (!trovato && idx < numTok)
|
||||
{
|
||||
if (dbTokens[idx].StartsWith("Server="))
|
||||
{
|
||||
// rimuovo la chaive Server...
|
||||
dbServerAddr = dbTokens[idx].Replace("Server=", "");
|
||||
// se ci fosse un nome (tipo \\sqlexpress) rimuovo...
|
||||
if (dbServerAddr.Contains("\\"))
|
||||
{
|
||||
int sIdx = dbServerAddr.IndexOf("\\");
|
||||
dbServerAddr = dbServerAddr.Substring(0, sIdx);
|
||||
}
|
||||
trovato = true;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// healthchecks
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddSqlServer(connectionString, healthQuery: "SELECT 1;", name: "SqlServer", failureStatus: HealthStatus.Degraded, tags: new string[] { "DB", "MsSql" })
|
||||
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => WebDoorCreator.UI.Health.Checks.PingCheck(dbServerAddr))
|
||||
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => WebDoorCreator.UI.Health.Checks.PingCheck(redisSrvAddr))
|
||||
// 512 MB max allocated memory
|
||||
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded)
|
||||
.AddRedis(connStringRedis, "Redis", failureStatus: HealthStatus.Degraded)
|
||||
.AddAsyncCheck($"Config Table", () => WebDoorCreator.UI.Health.Checks.ConfigCount(configuration))
|
||||
.AddAsyncCheck($"Orders Table", () => WebDoorCreator.UI.Health.Checks.OrdersCount(configuration))
|
||||
.AddAsyncCheck($"Doors Table", () => WebDoorCreator.UI.Health.Checks.DoorsCount(configuration))
|
||||
;
|
||||
|
||||
#if false
|
||||
builder.Services
|
||||
.AddHealthChecksUI(s =>
|
||||
{
|
||||
s.AddHealthCheckEndpoint("WDC_UI_HC", "health");
|
||||
s.SetEvaluationTimeInSeconds(60);
|
||||
s.SetMinimumSecondsBetweenFailureNotifications(120);
|
||||
s.SetApiMaxActiveRequests(5);
|
||||
s.SetHeaderText("WDC.UI Health Check Status");
|
||||
})
|
||||
.AddInMemoryStorage();
|
||||
#endif
|
||||
|
||||
// abilitazione x email management con MailKit
|
||||
builder.Services.AddTransient<IEmailSender, MailKitEmailSender>();
|
||||
builder.Services.Configure<MailKitEmailSenderOptions>(options =>
|
||||
@@ -102,6 +164,22 @@ app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
// gestione static files: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.0
|
||||
string BasePathPdf = configuration.GetValue<string>("ServerConf:BasePathPdf") ?? configuration.GetValue<string>("OptConf:BasePathPdf") ?? "";
|
||||
if (!string.IsNullOrEmpty(BasePathPdf))
|
||||
{
|
||||
// verifico esista folder disegni
|
||||
if (Directory.Exists(BasePathPdf))
|
||||
{
|
||||
// gestione cartella x PDF
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(BasePathPdf),
|
||||
RequestPath = "/docs",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthentication();
|
||||
@@ -109,6 +187,23 @@ app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
app.MapBlazorHub();
|
||||
|
||||
// config healthcheck: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks
|
||||
// prende tutti i predicati
|
||||
app.MapHealthChecks("/health", new HealthCheckOptions
|
||||
{
|
||||
Predicate = _ => true,
|
||||
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
|
||||
});
|
||||
// opzionalmente si puo' aggiungere richiesta AUTH
|
||||
//.RequireAuthorization();
|
||||
|
||||
// nasconde tutti i dettagli
|
||||
app.MapHealthChecks("/health/live", new HealthCheckOptions
|
||||
{
|
||||
Predicate = _ => false
|
||||
});
|
||||
|
||||
app.MapFallbackToPage("/_Host");
|
||||
|
||||
app.Run();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user