Compare commits

...

41 Commits

Author SHA1 Message Date
Samuele Locatelli 8107ba51b9 Merge branch 'release/RC5' 2021-08-30 09:42:01 +02:00
Samuele Locatelli b3062b04fc pulizia varia codice x classi non impiegate 2021-08-30 09:38:49 +02:00
Samuele Locatelli 3739225a28 riduzione canvas QRCode (raw fix) 2021-08-30 09:38:37 +02:00
Samuele Locatelli 2db1fbc8d6 Merge tag 'RC4' into develop
Completata migrazione QRCode js + fix vari x check e librerie
2021-08-27 13:03:02 +02:00
Samuele Locatelli 85944da9ed Merge branch 'release/RC4' 2021-08-27 13:02:40 +02:00
Samuele Locatelli a598c6793a Refresh versione delle 13 2021-08-27 13:02:18 +02:00
Samuele Locatelli bf30e006c3 Merge branch 'feature/QrCodeUpgrade' into develop 2021-08-27 13:01:51 +02:00
Samuele Locatelli e799fdf10a Rimozione check x pagina QRCode ext 2021-08-27 13:01:31 +02:00
Samuele Locatelli 34ce093ca9 Completata modifica x riprotare QRCode js (no img ext) 2021-08-27 12:56:56 +02:00
Samuele Locatelli c1d39b73e9 Integrato localmente JQuery e Popper 2021-08-27 12:42:40 +02:00
Samuele Locatelli 567b966157 COmpleto CHartJs locale + blazorise upgrade 2021-08-27 12:34:25 +02:00
Samuele Locatelli e076bc3f6b Upgrade Blazorise NuGet + ChartJs locale 2021-08-27 12:33:50 +02:00
Samuele Locatelli fd027e424f Merge tag 'FixOvhRamCpuIssue' into develop
Fix gestione ram: parameto ServerGC collector va messo a true x linux
virtual (errore RAM/CPU/Disco di OVH)
2021-08-27 12:17:46 +02:00
Samuele Locatelli 3bd8ee233b Merge branch 'hotfix/FixOvhRamCpuIssue' 2021-08-27 12:17:00 +02:00
Samuele Locatelli bb9e9ce7d5 Refresh version 2021-08-27 12:16:53 +02:00
Samuele Locatelli a5f5a55e34 Fix configurazione GC x server (su CPU fisica OK, su OVH c'erano problemi ram/disco) 2021-08-27 12:14:19 +02:00
Samuele Locatelli 2ecc7338e6 Merge tag 'RC3' into develop
Riduzione dimensione installer (èacchetti nuget, target framework, code
analysis...)
2021-08-27 11:56:36 +02:00
Samuele Locatelli 66c069fb35 Merge branch 'release/RC3' 2021-08-27 11:56:17 +02:00
Samuele Locatelli 361d4338a6 Merge branch 'feature/CodeCleanup' into develop 2021-08-27 11:55:58 +02:00
Samuele Locatelli 9a964330e3 Aggiunta conf x GarbageCollection + restrittiva sui processi 2021-08-27 11:54:13 +02:00
Samuele Locatelli 0e65410340 update Nuget AspNetCore 2021-08-27 11:53:56 +02:00
Samuele Locatelli b0e5d54061 Rimozione componenti analisi codice 2021-08-27 11:50:12 +02:00
Samuele Locatelli 9c979582d4 test sintassi pubblicazione SOLO linux 2021-08-27 11:41:52 +02:00
Samuele Locatelli 11cae94995 Update NLog 2021-08-27 11:39:45 +02:00
Samuele Locatelli 05ca047b5c Completo profili compilazione x64 Win/Linux 2021-08-27 11:39:20 +02:00
Samuele Locatelli cd533c190b Gestione profili compilazione Win/Linux x64 2021-08-27 11:39:04 +02:00
Samuele Locatelli efd84437b5 Rimozione elmah e quartz 2021-08-27 10:15:29 +02:00
Samuele Locatelli 1c36305304 Appunti log debug linux 2021-08-27 10:14:48 +02:00
Samuele Locatelli f1f1e784da Correzione jscript x generazione img-fluid 2021-08-26 19:41:35 +02:00
Samuele Locatelli 512d25f513 Merge tag 'RC2' into develop
Fix display main x spazio orizzontale (HOPE!)
2021-08-26 19:33:13 +02:00
Samuele Locatelli f1628818f3 Merge branch 'release/RC2' 2021-08-26 19:33:00 +02:00
Samuele Locatelli b57d20420b Corretto css e main class x display! 2021-08-26 19:32:36 +02:00
Samuele Locatelli cbf97a2eb6 Fix grafici x header/footer (non ancora ok) 2021-08-26 19:24:30 +02:00
Samuele Locatelli 284f7ff241 Merge tag 'RC1' into develop
Rilascio vers produzione con fix QR, fix search user, fix graph
2021-08-26 18:38:51 +02:00
Samuele Locatelli 888c7398f7 Merge branch 'release/RC1' 2021-08-26 18:38:29 +02:00
Samuele Locatelli 4926cb4715 Merge branch 'feature/DisplayFix' into develop 2021-08-26 18:37:56 +02:00
Samuele Locatelli e2c7615826 Completato revers grafici + revisione detail 2021-08-26 18:37:46 +02:00
Samuele Locatelli dc8ce10b51 Update x ricerca utenti 2021-08-26 18:02:01 +02:00
Samuele Locatelli ffb4c9872d Aggiunta paginazione utenti 2021-08-26 17:48:59 +02:00
Samuele Locatelli a415d175d9 Update gestione QR da JScript x trasportatori 2021-08-26 17:33:42 +02:00
Samuele Locatelli 60b069cd28 Merge tag 'PageAuthManRC' into develop
Fix versione page auth
2021-08-26 13:05:25 +02:00
77 changed files with 65951 additions and 951 deletions
+3 -1
View File
@@ -118,7 +118,9 @@ installer:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
# pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish -r linux-x64 --self-contained false
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
+6 -130
View File
@@ -31,112 +31,6 @@ namespace GWMS.Data.Controllers
#endregion Public Constructors
#region Private Methods
private void CreateSimData(int numDays, int stepMin, int maxHourRate)
{
// disattivazione per sicurezza
#if false
ResetController();
// generazione dati casuale
Random rnd = new Random();
foreach (var plant in GetPlants())
{
var currPlant = GetPlant(plant.PlantId);
// imposto limiti e valori attuali...
//currPlant.LevelMax = rnd.Next(24, 28) * 1000;
int simLevel = rnd.Next(1, (int)currPlant.LevelMax);
double simPress = (double)rnd.Next((int)(currPlant.PressMax - 50) * 10, (int)currPlant.PressMax * 10) / 10;
double simPressH = (double)rnd.Next((int)(currPlant.PressBHMax - 70) * 10, (int)currPlant.PressBHMax * 10) / 10;
double simPressL = (double)rnd.Next((int)(currPlant.PressBLMax - 70) * 10, (int)currPlant.PressBLMax * 10) / 10;
currPlant.LevelAct = simLevel;
currPlant.PressAct = simPress;
currPlant.PressBHAct = simPressH;
currPlant.PressBLAct = simPressL;
dbCtx.SaveChanges();
// genero random le soglie x simulare rilievi e ordini
int soglia01 = rnd.Next((int)currPlant.LevelMax * 60 / 100, (int)currPlant.LevelMax * 75 / 100);
int soglia02 = rnd.Next((int)currPlant.LevelMax * 5 / 100, (int)currPlant.LevelMax * 35 / 100);
List<PlantLogModel> LogLevels = new List<PlantLogModel>();
List<PlantLogModel> LogPressures = new List<PlantLogModel>();
List<OrderModel> LogOrders = new List<OrderModel>();
DateTime adesso = DateTime.Now;
int lastLevel = simLevel;
int lastOrder = 0;
int anticipo = 0;
double lastPress = simPress;
double lastPressH = simPressH;
double lastPressL = simPressL;
// simulo numDays gg...
for (int i = numDays * 24 * (60 / stepMin); i > 0; i--)
{
anticipo = i * stepMin;
lastLevel = lastLevel - rnd.Next(0, maxHourRate / (60 / stepMin));
// se inferiore a soglia 1 --> ordine
if (lastLevel + lastOrder < soglia01)
{
lastOrder = rnd.Next((int)currPlant.LevelMax - soglia01, (int)currPlant.LevelMax - soglia02);
LogOrders.Add(new OrderModel() { DtOrder = adesso.AddMinutes(-anticipo), OrderQty = lastOrder, PlantId = plant.PlantId, OrderCode = $"ORD{i:000000}", OrderDesc = "SIM Order", SupplierId = 1, TransporterId = 1 });
}
// se inferiore a soglia 2 --> refill
if (lastLevel < soglia02)
{
lastLevel += lastOrder;
lastOrder = 0;
}
LogLevels.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "Level", PlantId = plant.PlantId, ValNumber = lastLevel });
// pressioni!
lastPress = lastPress - (double)rnd.Next(-30, 25) / 10;
lastPressH = lastPressH - (double)rnd.Next(-25, 20) / 10;
lastPressL = lastPressL - (double)rnd.Next(-25, 20) / 10;
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "MainPress", PlantId = plant.PlantId, ValNumber = lastPress });
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "PressBH", PlantId = plant.PlantId, ValNumber = lastPressH });
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "PressBL", PlantId = plant.PlantId, ValNumber = lastPressL });
}
try
{
dbCtx
.DbSetPlantLog
.AddRange(LogLevels);
dbCtx
.DbSetPlantLog
.AddRange(LogPressures);
// salvo sul DB!
dbCtx.SaveChanges();
Log.Info($"Effettuato inserimento {LogLevels.Count} record PlantLog");
}
catch (Exception exc)
{
Log.Error($"Eccezione in salvataggio PlantLog{Environment.NewLine}{exc}");
}
try
{
dbCtx
.DbSetOrders
.AddRange(LogOrders);
// salvo sul DB!
dbCtx.SaveChanges();
Log.Info($"Effettuato inserimento {LogOrders.Count} record Orders");
}
catch (Exception exc)
{
Log.Error($"Eccezione in salvataggio Orders{Environment.NewLine}{exc}");
}
}
#endif
}
#endregion Private Methods
#region Public Methods
/// <summary>
@@ -156,6 +50,7 @@ namespace GWMS.Data.Controllers
{
// Clear database context
dbCtx.Dispose();
Log.Info("Dispose di GWMSController");
}
public List<ConfigModel> GetConfig()
@@ -469,6 +364,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawMainPressData = dbCtxMult
@@ -476,6 +372,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawBHPressData = dbCtxMult
@@ -483,6 +380,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawBLPressData = dbCtxMult
@@ -490,6 +388,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawOrderData = dbCtxMult
@@ -497,6 +396,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.PlantId == PlantId && x.ExecutionQty == 0)
.OrderByDescending(x => x.DtOrder)
.Take(maxRecords)
.OrderBy(x => x.DtOrder)
.ToList();
LevelTS = rawLevelData
@@ -604,30 +504,6 @@ namespace GWMS.Data.Controllers
return done;
}
/// <summary>
/// Rigenera intero DB se riceve ID di un plant SIM...
/// </summary>
/// <param name="PlantId"></param>
public bool RegenDB(int PlantId, int numDays, int stepMin, int maxHourRate)
{
bool answ = false;
var currPlant = GetPlant(PlantId);
if (currPlant.PlantCode.StartsWith("PIZ"))
{
Log.Info("Inizio RegenDB");
DbAdmin.resetPlantLogTable();
ResetController();
CreateSimData(numDays, stepMin, maxHourRate);
Log.Info("Dati SIM generati");
answ = true;
}
return answ;
}
public void ResetController()
{
dbCtx = new GWMSContext(_configuration);
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="row px-1 text-light">
<div class="form-row text-light">
<div class="col-5 pr-0 text-left">
GWMS <span class="small">v.@version</span>
</div>
+3 -3
View File
@@ -6,14 +6,14 @@
@inject MessageService AppMessages
@inject AuthenticationStateProvider AuthenticationStateProvider
<div class="row pt-3">
<div class="col-6 col-sm-6 col-lg-4 col-xl-3">
<div class="form-row pt-3">
<div class="col-7 col-md-6 col-lg-4 col-xl-3">
<LoginDisplay></LoginDisplay>
</div>
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
<span class="@PageIcon" aria-hidden="true"></span> @PageName
</div>
<div class="col-6 col-sm-6 col-lg-4 col-xl-3 text-right">
<div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right">
@if (ShowSearch)
{
<SearchMod></SearchMod>
+12 -2
View File
@@ -8,8 +8,13 @@
<div class="input-group-prepend">
<a title="LogOut" href="Identity/Account/LogOut" class="btn btn-sm btn-danger"><i class="fas fa-sign-out-alt"></i></a>
</div>
<a title="Manage" href="Identity/Account/Manage" class="btn btn-sm btn-outline-dark mx-0 px-1">
<i class="fas fa-user-alt"></i>&nbsp;@userName.Substring(0, 10)&nbsp;...
<a title="Gestione account @userName" href="Identity/Account/Manage" class="btn btn-sm btn-outline-dark mx-0 px-1">
<div class="d-none d-sm-block">
<i class="fas fa-user-alt"></i> @StringLim(userName, 30)
</div>
<div class="d-block d-sm-none">
<i class="fas fa-user-alt"></i> @StringLim(userName, 15)
</div>
</a>
</div>
</Authorized>
@@ -48,4 +53,9 @@
}
}
protected string StringLim(string original, int maxLen)
{
return original.Length <= maxLen ? original : $"{original.Substring(0, maxLen - 3)}...";
}
}
+28 -13
View File
@@ -20,7 +20,8 @@
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-1">
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />
<div id="qrCodeImg"></div>
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />*@
</div>
<div class="col-12 col-lg-9 align-items-center">
<div class="row">
@@ -266,6 +267,20 @@
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected async Task ReloadAllData()
@@ -290,17 +305,17 @@
return q[parmName] ?? "";
}
/// <summary>
/// Restituisce URL immagine QRCode
/// </summary>
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
/// <returns></returns>
protected string getImgUrl(object QrValue)
{
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
string answ = $"{baseUrl}{payload}";
return answ;
}
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
}
+31 -15
View File
@@ -8,6 +8,7 @@
@inject MessageService AppMService
@inject GWMSDataService DataService
@inject IConfiguration Configuration
@inject IJSRuntime JSRuntime
<div class="card">
<div class="card-header bg-info text-light">
@@ -17,10 +18,11 @@
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-2">
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />
<div class="col-12 col-lg-1">
<div id="qrCodeImg"></div>
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />*@
</div>
<div class="col-12 col-lg-8 align-items-center">
<div class="col-12 col-lg-9 align-items-center">
<div class="row">
<div class="col-8">
<div class="input-group">
@@ -138,6 +140,20 @@
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected async Task ReloadAllData()
@@ -145,17 +161,17 @@
transpList = await DataService.TransportersGetAll();
}
/// <summary>
/// Restituisce URL immagine QRCode
/// </summary>
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
/// <returns></returns>
protected string getImgUrl(object QrValue)
{
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
string answ = $"{baseUrl}{payload}";
return answ;
}
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
}
+53 -59
View File
@@ -4,63 +4,38 @@
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
@using Microsoft.JSInterop
@inject MessageService AppMService
@inject GWMSDataService DataService
@inject IConfiguration Configuration
@inject IJSRuntime JSRuntime
<div class="card">
@*<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>*@
<div class="card-body small p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-2">
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />
</div>
<div class="col-12 col-lg-8 align-items-center">
<div class="row small">
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-truck" aria-hidden="true"></span>
</span>
</div>
<DateEdit @bind-Date="_currItem.DtETA" InputMode="DateInputMode.DateTime" class="form-control" title="ETA (previsione consegna)" />
</div>
</div>
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-comment-alt" aria-hidden="true"></span>
</span>
</div>
<InputText id="OrderDesc" @bind-Value="_currItem.OrderDesc" class="form-control" title="Note Ordine (opzionali)" />
<div class="input-group-append">
<span class="input-group-text">
Note
</span>
</div>
@if (_currItem != null)
{
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-2 text-center">
<div id="qrCodeImg"></div>
@_currItem.OrderCode
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />*@
</div>
<div class="col-12 col-lg-2">
<div class="row">
@*<div class="col">
<button type="button" class="btn btn-sm btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>*@
<div class="col">
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-2">
<div class="row">
<div class="col-6">
<button type="button" class="btn btn-sm btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
<div class="col-6">
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</div>
</EditForm>
</EditForm>
}
</div>
</div>
@@ -76,7 +51,7 @@
{
get
{
return _currItem = null;
return _currItem;
}
set
{
@@ -84,6 +59,11 @@
}
}
public async void refreshQr()
{
await JSRuntime.InvokeVoidAsync("refreshQr", rawCode);
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
@@ -122,9 +102,23 @@
await DataReset.InvokeAsync(0);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected async Task ReloadAllData()
@@ -132,17 +126,17 @@
transpList = await DataService.TransportersGetAll();
}
/// <summary>
/// Restituisce URL immagine QRCode
/// </summary>
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
/// <returns></returns>
protected string getImgUrl(object QrValue)
{
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
string answ = $"{baseUrl}{payload}";
return answ;
}
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
}
+9 -12
View File
@@ -49,25 +49,22 @@
<li class="list-group-item active d-flex justify-content-between align-items-center">SERBATOIO Principale</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<div class="row">
<div class="col-12 px-0">
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
<div class="col-12 text-center small">
<span><i class="fas fa-database"></i> Livello: </span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span> <span>(@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0"))</span>
</div>
<div class="col-6 small">
@currItem.LevelAct.ToString("N0")
</div>
<div class="col-6 text-right small">
@currItem.LevelMax.ToString("N0")
</div>
<div class="col-12">
<div class="col-12 small">
<Progress>
<ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
</Progress>
</div>
<div class="col-12 px-0 mt-2">
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
</li>
@*<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
</li>*@
<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-compress-arrows-alt"></i> Pressione</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span>
</li>
+38 -21
View File
@@ -7,6 +7,7 @@ using GWMS.Data.DTO;
using Microsoft.AspNetCore.Components;
using Blazorise.Charts;
using System.Threading;
using Microsoft.Extensions.Configuration;
namespace GWMS.UI.Components
{
@@ -24,23 +25,25 @@ namespace GWMS.UI.Components
{
XAxes = new object[]
{
new {
Display = true,
//type = "timeseries",
//type = "time",
//Time = new {
// unit="day"
//}
}
},
new {
display = true,
//type = "timeseries",
//type = "time",
//Time = new {
// unit="day"
//}
}
},
YAxes = new object[]
{
new {
Display = true,
ticks= new {
suggestedMin = 0,
suggestedMax = 10000
}
display = true,
position = "right",
//text = "Kg",
ticks = new {
suggestedMin = 0,
suggestedMax = 10000
}
}
}
},
@@ -54,8 +57,14 @@ namespace GWMS.UI.Components
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 2
Animation = true,
Responsive = true,
AspectRatio = 2,
type = "line",
Legend = new
{
display = false
}
};
/// <summary>
@@ -67,6 +76,9 @@ namespace GWMS.UI.Components
#region Private Properties
[Inject]
private IConfiguration Configuration { get; set; }
[Inject]
private NavigationManager NavManager { get; set; }
@@ -119,7 +131,9 @@ namespace GWMS.UI.Components
var dataReload = Task.Run(async () =>
{
// aggiunta delay o non riesce a disegnare
Thread.Sleep(50);
int ChartWaitDelay = 150;
int.TryParse(Configuration["ChartWaitDelay"], out ChartWaitDelay);
Thread.Sleep(ChartWaitDelay);
await HandleRedraw();
});
}
@@ -134,12 +148,15 @@ namespace GWMS.UI.Components
{
int answ = 1;
int numCount = _currItem.LevelTS.Count;
// passo a 2h se > 5 gg
if (numCount > 120)
// passo a 2h se > 3 gg
if (numCount > 72)
answ = 2;
// passo a 3h se > 10 gg
else if (numCount > 240)
// passo a 3h se > 5 gg
else if (numCount > 120)
answ = 3;
// passo a 4h se > 10 gg
else if (numCount > 240)
answ = 4;
redFact = answ;
}
+1 -1
View File
@@ -61,7 +61,7 @@
return;
reportProcess();
await DataService.RegenDB(numDays, stepMin, maxHourRate);
//await DataService.RegenDB(numDays, stepMin, maxHourRate);
reportChange();
}
+10 -9
View File
@@ -19,7 +19,7 @@ using System.Globalization;
namespace GWMS.UI.Data
{
public class GWMSDataService
public class GWMSDataService : IDisposable
{
#region Private Fields
@@ -73,9 +73,9 @@ namespace GWMS.UI.Data
else
{
dbController = new GWMS.Data.Controllers.GWMSController(configuration);
StringBuilder sb = new StringBuilder();
sb.AppendLine($"DbController OK");
_logger.LogInformation(sb.ToString());
//StringBuilder sb = new StringBuilder();
//sb.AppendLine($"DbController OK");
//_logger.LogInformation(sb.ToString());
}
}
@@ -394,6 +394,12 @@ namespace GWMS.UI.Data
return answ;
}
public void Dispose()
{
// Clear database controller
dbController.Dispose();
}
public async Task<bool> HasPlantLog()
{
return await Task.FromResult(dbController.HasPlantLog());
@@ -662,11 +668,6 @@ namespace GWMS.UI.Data
{ }
}
public async Task<bool> RegenDB(int numDays, int stepMin = 30, int maxHourRate = 800)
{
return await Task.FromResult(dbController.RegenDB(1, numDays, stepMin, maxHourRate));
}
public void ResetController()
{
dbController.ResetController();
+21 -16
View File
@@ -2,10 +2,17 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.0.2108.2613</Version>
<Version>1.0.2108.3009</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
<Compile Remove="QuartzHostedService.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="bundleconfig.json" />
</ItemGroup>
@@ -13,6 +20,8 @@
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileLinux.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileWin.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
</ItemGroup>
@@ -29,25 +38,21 @@
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.4" />
<PackageReference Include="Blazorise" Version="0.9.3.7" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.7" />
<PackageReference Include="Blazorise.Charts" Version="0.9.3.7" />
<PackageReference Include="Blazorise.Components" Version="0.9.3.7" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.7" />
<PackageReference Include="ElmahCore" Version="2.0.6" />
<PackageReference Include="ElmahCore.Common" Version="2.0.6" />
<PackageReference Include="ElmahCore.Sql" Version="2.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
<PackageReference Include="Blazorise" Version="0.9.4.3" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.4.3" />
<PackageReference Include="Blazorise.Charts" Version="0.9.4.3" />
<PackageReference Include="Blazorise.Components" Version="0.9.4.3" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.4.3" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
<PackageReference Include="Quartz" Version="3.3.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" ExcludeAssets="All" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
</ItemGroup>
<ItemGroup>
+14 -1
View File
@@ -132,7 +132,20 @@
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.OrderId)">
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-pencil"></span></button></td>
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
<span class="oi oi-pencil"></span>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<div>@record.Plant.PlantCode</div>
<div class="small">@record.Plant.PlantDesc</div>
+1 -1
View File
@@ -40,7 +40,7 @@
return;
processRunning = true;
DataService.RegenDB(numDays, stepMin, maxHourRate);
//DataService.RegenDB(numDays, stepMin, maxHourRate);
processRunning = false;
}
+14 -1
View File
@@ -105,7 +105,20 @@
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.OrderId)">
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-pencil"></span></button></td>
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
<span class="oi oi-pencil"></span>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<div>@record.Plant.PlantCode</div>
<div class="small">@record.Plant.PlantDesc</div>
+19 -8
View File
@@ -8,18 +8,15 @@
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-6 pr-0 col-lg-8 h3">
<div class="col-6 pr-0 col-lg-8 h3 mb-0">
Consegne
</div>
<div class="col-6 col-lg-4">
<div class="row">
<div class="col-6 px-1">
<div class="col-6">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="@icnFiltTime"></i></button>
</div>
@*<div class="col-4 px-1">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltTransp()"><i class="fas fa-truck-moving"></i> <i class="@icnFiltTran"></i></button>
</div>*@
<div class="col-6 px-1">
<div class="col-6">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="@icnFiltDest"></i></button>
</div>
</div>
@@ -90,7 +87,7 @@
</div>
</div>
</div>
<div class="card-body p-1">
<div class="card-body">
@if (currRecord != null)
{
<OrderTranspEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" SupplierId="@currRecord.SupplierId"></OrderTranspEditor>
@@ -107,6 +104,7 @@
{
<div class="row">
<div class="col-12">
@*<div id="qrCodeImg"></div>*@
<table class="table table-sm table-striped">
<thead>
<tr>
@@ -119,7 +117,20 @@
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.OrderId)">
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-magnifying-glass"></span></button></td>
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
<i class="oi oi-magnifying-glass"></i>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-magnifying-glass"></i>
</button>
}
</td>
<td>
<div><b>@record.Plant.PlantCode</b> | @record.Plant.PlantDesc</div>
<div class="small"><span class="fas fa-comment-alt" aria-hidden="true"></span> @record.OrderDesc</div>
+3 -1
View File
@@ -1,6 +1,7 @@
@page "/UserAdmin"
@using GWMS.UI.Pages
@using GWMS.UI.Components
@if (ShowPopup)
{
@@ -168,6 +169,7 @@
</tbody>
</table>
</div>
<div class="card-footer">
<div class="card-footer p-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+105 -1
View File
@@ -27,6 +27,11 @@ namespace GWMS.UI.Pages
/// </summary>
private IdentityUser objUser = new IdentityUser();
/// <summary>
/// Collezione utenti
/// </summary>
private List<IdentityUser> RawList = new List<IdentityUser>();
/// <summary>
/// Elenco ROLES da mostrare in dropdown durante editing (1 solo? usare DB?!?)
/// </summary>
@@ -55,6 +60,10 @@ namespace GWMS.UI.Pages
#region Private Properties
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
[CascadingParameter]
private Task<AuthenticationState> authenticationStateTask { get; set; }
@@ -78,6 +87,39 @@ namespace GWMS.UI.Pages
/// </summary>
private string CurrentUserRole { get; set; } = "User";
private int currPage
{
get => _currPage;
set
{
if (_currPage != value)
{
_currPage = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
private bool isLoading { get; set; } = false;
[Inject]
private MessageService MessageService { get; set; }
private int numRecord
{
get => _numRecord;
set
{
if (_numRecord != value)
{
_numRecord = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
#endregion Private Properties
#region Protected Properties
@@ -97,8 +139,33 @@ namespace GWMS.UI.Pages
[Inject]
protected IJSRuntime JSRuntime { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (RawList != null)
{
answ = RawList.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Public Properties
public string searchVal
{
get
{
return MessageService.SearchVal;
}
}
#endregion Public Properties
#region Private Methods
private void AddNewUser()
@@ -220,6 +287,13 @@ namespace GWMS.UI.Pages
ShowPopup = true;
}
private async Task ReloadData()
{
isLoading = true;
await GetUsers();
isLoading = false;
}
private async Task SaveUser()
{
try
@@ -353,11 +427,22 @@ namespace GWMS.UI.Pages
#region Protected Methods
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = true;
AppMService.PageName = "Gestione Utenti";
AppMService.PageIcon = "fas fa-users pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
// lettura dati
await GetUsers();
await CheckSuperAdmin();
@@ -374,6 +459,7 @@ namespace GWMS.UI.Pages
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
/// <summary>
@@ -386,7 +472,16 @@ namespace GWMS.UI.Pages
// Collection to hold users
UsersList = new List<UserData>();
// get users from _UserManager
var user = _UserManager.Users.Select(x => new IdentityUser
var allData = _UserManager.Users.ToList();
if (!string.IsNullOrEmpty(searchVal))
{
RawList = allData.Where(x => x.NormalizedEmail.Contains(searchVal.ToUpper()) || x.NormalizedUserName.Contains(searchVal.ToUpper())).ToList();
}
else
{
RawList = allData;
}
var user = RawList.Skip(numRecord * (currPage - 1)).Take(numRecord).Select(x => new IdentityUser
{
Id = x.Id,
UserName = x.UserName,
@@ -411,6 +506,15 @@ namespace GWMS.UI.Pages
}
}
public async void OnSeachUpdated()
{
await GetUsers();
await InvokeAsync(() =>
{
StateHasChanged();
});
}
public string ShowClaims(List<System.Security.Claims.Claim> ClaimList)
{
string answ = string.Join(",", ClaimList);
+26 -3
View File
@@ -19,6 +19,7 @@
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="font-awesome/css/fontawesome.min.css" />
<link rel="stylesheet" href="Chart.js/Chart.min.css" />
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
@@ -41,9 +42,9 @@
</div>
<!-- inside of body section and after the div/app tag -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script src="jquery/jquery.min.js"></script>
<script src="Chart.js/Chart.min.js"></script>
<script src="popper.js/umd/popper.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="_content/Blazorise/blazorise.js"></script>
@@ -55,5 +56,27 @@
<script src="font-awesome/js/all.min.js"></script>
<script src="_framework/blazor.server.js"></script>
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript">
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
//var qrcode = new QRCode("qrCodeImg");
function displayQr(elementName, rawData) {
try {
if (elementName != "" && rawData != "") {
//qrcode = new QRCode(document.getElementById(elementName));
new QRCode(document.getElementById(elementName),
{
text: rawData,
width: 300,
height: 300
});
//qrcode.makeCode(rawData);
}
}
catch
{ }
}
</script>
</body>
</html>
@@ -0,0 +1,12 @@
<?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+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAAD+ZfytfJJzf+XzD0ShcSagAAAAAASAAACgAAAAEAAAAAhSlOT4SIk7WdUrN1YS1qMYAAAAGI+89iBgQqaMJeEi4KxlVpTh9PMYTidkFAAAAO7so25722o8lxnn313D6J0eV2MV</EncryptedPassword>
<History>False|2021-06-23T12:54:39.3412623Z;</History>
</PropertyGroup>
</Project>
@@ -0,0 +1,11 @@
<?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+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAAAwZbVLPZ+eVCZgVc7GoE8CAAAAAASAAACgAAAAEAAAAEmDwlS8G30J/kR5K+eX8B4YAAAAZ14uy/TVGN4ui4QHWpgdmwaMob7VeTSiFAAAAC/61bXCe/Mgyo7S2QBvJRJ2GUiZ</EncryptedPassword>
</PropertyGroup>
</Project>
@@ -0,0 +1,10 @@
<?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>
<History>True|2021-06-23T13:11:40.1591388Z;</History>
</PropertyGroup>
</Project>
@@ -0,0 +1,22 @@
<?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>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>5f0dbab0-122f-4a81-be73-161bbefeef59</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\GWMS.UI.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/GWMS</DeployIisAppPath>
<TargetFramework>net5.0</TargetFramework>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
@@ -0,0 +1,7 @@
<?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">
</Project>
@@ -0,0 +1,22 @@
<?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>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>5f0dbab0-122f-4a81-be73-161bbefeef59</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\GWMS.UI.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/GWMS</DeployIisAppPath>
<TargetFramework>net5.0</TargetFramework>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
@@ -0,0 +1,7 @@
<?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">
</Project>
@@ -0,0 +1,11 @@
<?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+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAADTQmYF8PrkLa4Xb9E/zxuXAAAAAASAAACgAAAAEAAAADLKIlcnZuaCFkaVmfe382YYAAAADxGWDujdGKLnZ+ycw0Vb2K2g5K0dRHB8FAAAAHB9B2k06W3L+M48vPfUvedJRpJX</EncryptedPassword>
</PropertyGroup>
</Project>
-42
View File
@@ -1,42 +0,0 @@
using Microsoft.Extensions.Hosting;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace GWMS.UI
{
public class QuartzHostedService : IHostedService
{
#region Private Fields
private readonly IScheduler _scheduler;
#endregion Private Fields
#region Public Constructors
public QuartzHostedService(IScheduler scheduler)
{
_scheduler = scheduler;
}
#endregion Public Constructors
#region Public Methods
public async Task StartAsync(CancellationToken cancellationToken)
{
await _scheduler?.Start(cancellationToken);
}
public async Task StopAsync(CancellationToken cancellationToken)
{
await _scheduler?.Shutdown(cancellationToken);
}
#endregion Public Methods
}
}
+3 -3
View File
@@ -11,11 +11,11 @@
</div>
<CascadingValue Name="ShowSearch" Value=@ShowSearch>
<div class="main">
<div class="top-row px-0">
<div class="main mr-1">
<div class="top-row">
<CmpTop></CmpTop>
</div>
<div class="content pt-1 pt-lg-2 px-2 mb-5">
<div class="content pt-1 pt-lg-2 mb-5">
@Body
</div>
<div class="fixed-bottom bottom-row">
+1 -28
View File
@@ -16,9 +16,9 @@
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
height: 3.5rem;
align-items: center;
/*justify-content: space-evenly;
display: flex;*/
align-items: center;
}
.top-row ::deep a, .top-row .btn-link {
@@ -34,37 +34,10 @@
.bottom-row {
color: #dedede;
background-color: #000000;
/*border-bottom: 1px solid #313131;*/
/*justify-content: flex-end;*/
height: 2rem;
/*display: flex;*/
align-items: center;
}
.bottom-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}
.bottom-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
/*
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
.top-row.auth {
justify-content: space-between;
}
.top-row a, .top-row .btn-link {
margin-left: 0;
}
}*/
@media (min-width: 641px) {
.page {
flex-direction: row;
+9 -12
View File
@@ -1,7 +1,6 @@
using Blazorise;
using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome;
using ElmahCore.Mvc;
using GWMS.Data;
using GWMS.UI.Areas.Identity;
using GWMS.UI.Data;
@@ -23,8 +22,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -79,9 +76,9 @@ namespace GWMS.UI
});
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
// Registrazione Elmah:
// https://github.com/ElmahCore/ElmahCore
app.UseElmah();
//// Registrazione Elmah:
//// https://github.com/ElmahCore/ElmahCore
//app.UseElmah();
// fix forwarders
app.UseForwardedHeaders(new ForwardedHeadersOptions
@@ -132,18 +129,18 @@ namespace GWMS.UI
string connStringDB = DbConfig.CONNECTION_STRING;
string connStringRedis = Configuration.GetConnectionString("Redis");
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
var qrCodeUri = new Uri(Configuration["ZCodeUrl"]);
string qrCodeAddr = qrCodeUri.Host;
//var qrCodeUri = new Uri(Configuration["ZCodeUrl"]);
//string qrCodeAddr = qrCodeUri.Host;
// healthchecks
services.AddHealthChecks()
.AddMySql(connStringDB, "MySql instance")
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => Health.Checks.PingCheck(dbServerAddr))
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => Health.Checks.PingCheck(redisSrvAddr))
.AddAsyncCheck($"QrCode PING ({qrCodeAddr})", () => Health.Checks.PingCheck(qrCodeAddr))
//.AddAsyncCheck($"QrCode PING ({qrCodeAddr})", () => Health.Checks.PingCheck(qrCodeAddr))
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded) // 512 MB max allocated memory
.AddRedis(Configuration.GetConnectionString("Redis"), "Redis", failureStatus: HealthStatus.Degraded)
.AddUrlGroup(new Uri(Configuration["ZCodeUrl"]), name: $"QrCode Gen ({Configuration["ZCodeUrl"]})", failureStatus: HealthStatus.Degraded)
//.AddUrlGroup(new Uri(Configuration["ZCodeUrl"]), name: $"QrCode Gen ({Configuration["ZCodeUrl"]})", failureStatus: HealthStatus.Degraded)
.AddAsyncCheck($"MySql Root User", () => Health.Checks.DbUserRoot("MySql"))
.AddAsyncCheck($"MySql App Users", () => Health.Checks.DbUserApp(DbConfig.DATABASE_NAME))
.AddAsyncCheck($"MySql Identity", () => Health.Checks.DbIdentity(DbConfig.DATABASE_NAME))
@@ -218,8 +215,8 @@ namespace GWMS.UI
.AddBootstrapProviders()
.AddFontAwesomeIcons();
// Elmah
services.AddElmah();
//// Elmah
//services.AddElmah();
//string elmaConn = "Data Source=SQL2016DEV;Initial Catalog=Elmah;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=SHERPA.BBM;";
//services.AddElmah<SqlErrorLog>(options =>
//{
+1
View File
@@ -34,6 +34,7 @@
"IntervalMin": 60,
"MaxLogRecord": 360,
"ZCodeUrl": "https://qrcode.steamware.net/",
"ChartWaitDelay": 10,
"logo": "img/LogoPizzaferri.jpg",
"ExternalProviders": {
"MailKit": {
+24 -12
View File
@@ -1,14 +1,26 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "font-awesome@5.15.4",
"destination": "wwwroot/font-awesome/"
},
{
"library": "bootstrap@4.6.0",
"destination": "wwwroot/bootstrap/"
}
]
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "font-awesome@5.15.4",
"destination": "wwwroot/font-awesome/"
},
{
"library": "bootstrap@4.6.0",
"destination": "wwwroot/bootstrap/"
},
{
"library": "Chart.js@2.8.0",
"destination": "wwwroot/Chart.js/"
},
{
"library": "popper.js@1.16.1",
"destination": "wwwroot/popper.js/"
},
{
"library": "jquery@3.5.1",
"destination": "wwwroot/jquery/"
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+47
View File
@@ -0,0 +1,47 @@
/*
* DOM element rendering detection
* https://davidwalsh.name/detect-node-insertion
*/
@keyframes chartjs-render-animation {
from { opacity: 0.99; }
to { opacity: 1; }
}
.chartjs-render-monitor {
animation: chartjs-render-animation 0.001s;
}
/*
* DOM element resizing detection
* https://github.com/marcj/css-element-queries
*/
.chartjs-size-monitor,
.chartjs-size-monitor-expand,
.chartjs-size-monitor-shrink {
position: absolute;
direction: ltr;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: hidden;
pointer-events: none;
visibility: hidden;
z-index: -1;
}
.chartjs-size-monitor-expand > div {
position: absolute;
width: 1000000px;
height: 1000000px;
left: 0;
top: 0;
}
.chartjs-size-monitor-shrink > div {
position: absolute;
width: 200%;
height: 200%;
left: 0;
top: 0;
}
+14680
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10872
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+16 -1
View File
@@ -98,4 +98,19 @@ link da approfondire
- https://github.com/parallelbgls/Modbus.Net
- http://easymodbustcp.net/en/
- https://sourceforge.net/p/easymodbustcp/wiki/Home/
- https://techitmore.com/dotnet/modbus-tcp-communication-in-net-c/
- https://techitmore.com/dotnet/modbus-tcp-communication-in-net-c/
## Appunti
### Linux debug
Questa applicazione viene distribuita (localmente in ufficio ed in ovh x cliente finale) su macchina Linux, tramite dotnetcore.
In particolare su linux x debug dei messaggi di log usare il comando
journalctl -fu kestrel-app-gwms.service
## Versioni
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GWMS - Gas Warehouse Management System</i>
<h4>Versione: 1.0.2108.2613</h4>
<h4>Versione: 1.0.2108.3009</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.0.2108.2613
1.0.2108.3009
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.2108.2613</version>
<version>1.0.2108.3009</version>
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
<mandatory>false</mandatory>