Fix vari login
This commit is contained in:
@@ -15,10 +15,13 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
<div class="row w-100 slideMen">
|
||||
<div class="p-0">
|
||||
<SlideMenu MenuItems="@CurrMenuItems"></SlideMenu>
|
||||
@if (!HideMenu)
|
||||
{
|
||||
<div class="row w-100 slideMen">
|
||||
<div class="p-0">
|
||||
<SlideMenu MenuItems="@CurrMenuItems"></SlideMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,3 @@
|
||||
using EgwCoreLib.Utils;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
@@ -30,6 +29,13 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
protected string CurrOprTknRedis { get; set; } = null!;
|
||||
|
||||
protected DateTime expDT { get; set; } = DateTime.Now;
|
||||
|
||||
protected bool HideMenu
|
||||
{
|
||||
get => NavMan.Uri.Contains("reg-new-device");
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected ListSelectDataSrv MDataService { get; set; } = null!;
|
||||
|
||||
@@ -42,6 +48,9 @@ namespace MP_TAB_SERV.Components
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDService { get; set; } = null!;
|
||||
|
||||
@@ -49,6 +58,33 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task DoLogIn(string decodValue)
|
||||
{
|
||||
// decifro i valori..
|
||||
var decrVal = MsgServ.DecryptData(decodValue);
|
||||
var opData = JsonConvert.DeserializeObject<userTknDTO>(decrVal);
|
||||
if (opData != null)
|
||||
{
|
||||
var rigaOpr = await TDService.OperatoreSearch(opData.currOpr.MatrOpr, opData.currOpr.authKey);
|
||||
if (rigaOpr != null)
|
||||
{
|
||||
userTknDTO newUserTkn = new userTknDTO()
|
||||
{
|
||||
currOpr = rigaOpr,
|
||||
expTime = expDT
|
||||
};
|
||||
|
||||
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
|
||||
string hash = TDService.EncryptData(jsonTkn);
|
||||
MsgServ.RigaOper = rigaOpr;
|
||||
await MsgServ.SetLastMatrOprAsync(rigaOpr.MatrOpr);
|
||||
await MsgServ.SetCurrOperDtoAsync(hash);
|
||||
await TDService.OperatoreSetRedis(rigaOpr.MatrOpr, hash);
|
||||
NavMan.NavigateTo("status-map");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ForceReload()
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
@@ -56,10 +92,15 @@ namespace MP_TAB_SERV.Components
|
||||
Log.Info("Start ForceReload");
|
||||
ResetClass = "btn-warning";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
var currToken = await MsgServ.GetCurrOperDtoAsync();
|
||||
var lastOpr = await MsgServ.GetLastMatrOprAsync();
|
||||
// reset cache varie
|
||||
await MsgServ.ClearLocalStor();
|
||||
await MsgServ.ClearSessionStor();
|
||||
await MDataService.FlushCache();
|
||||
// salvo di nuovo opr
|
||||
await MsgServ.SetLastMatrOprAsync(lastOpr);
|
||||
await MsgServ.SetCurrOperDtoAsync(currToken);
|
||||
// reload MStor
|
||||
await ReloadMemStor();
|
||||
// calcolo tempo esecuzione
|
||||
@@ -74,57 +115,21 @@ namespace MP_TAB_SERV.Components
|
||||
NavMan.NavigateTo("/", true);
|
||||
}
|
||||
|
||||
protected async Task logIn(string decodValue)
|
||||
{
|
||||
// decifro i valori..
|
||||
var decrVal = MsgServ.DecryptData(decodValue);
|
||||
var opData = JsonConvert.DeserializeObject<userTknDTO>(decrVal);
|
||||
if (opData != null)
|
||||
{
|
||||
var rigaOpr = await TDService.OperatoreSearch(opData.currOpr.MatrOpr, opData.currOpr.authKey);
|
||||
//if (rigaOpr == null)
|
||||
//{
|
||||
// var deHash = TDService.DecryptData(authKey);
|
||||
// rigaOpr = await TDService.OperatoreSearch(matrOpr, deHash);
|
||||
//}
|
||||
if (rigaOpr != null)
|
||||
{
|
||||
userTknDTO newUserTkn = new userTknDTO()
|
||||
{
|
||||
currOpr = rigaOpr,
|
||||
expTime = expDT
|
||||
};
|
||||
|
||||
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
|
||||
string hash = TDService.EncryptData(jsonTkn);
|
||||
MsgServ.RigaOper = rigaOpr;
|
||||
await MsgServ.setCurrOperDtoAsync(hash);
|
||||
await TDService.OperatoreSetRedis(rigaOpr.MatrOpr, hash);
|
||||
NavMan.NavigateTo("status-map");
|
||||
}
|
||||
}
|
||||
}
|
||||
protected DateTime expDT { get; set; } = DateTime.Now;
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
int expDays = SMServ.GetConfInt("cookieDayExpire");
|
||||
expDT = DateTime.Now.AddDays(expDays);
|
||||
|
||||
CurrOprTknLS = await MsgServ.getCurrOperDtoAsync();
|
||||
CurrOprTknLS = await MsgServ.GetCurrOperDtoAsync();
|
||||
var decodedUrl = Uri.UnescapeDataString(CurrOprTknLS);
|
||||
|
||||
// verifico se non avessi dati operatore
|
||||
if (MsgServ.RigaOper == null)
|
||||
{
|
||||
await logIn(decodedUrl);
|
||||
await DoLogIn(decodedUrl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
CurrOprTknRedis = await TDService.OperatoreGetRedis(MatrOpr);
|
||||
if (CurrOprTknRedis == "")
|
||||
{
|
||||
|
||||
@@ -972,12 +972,10 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string _baseLang { get; set; } = "IT";
|
||||
|
||||
|
||||
private string baseLang
|
||||
{
|
||||
get => _baseLang;
|
||||
set { MServ.UserPrefGet("Lang"); }
|
||||
get => MServ.UserPrefGet("Lang");
|
||||
}
|
||||
|
||||
private bool cancelSetupEnabled
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2311.1415</Version>
|
||||
<Version>6.16.2311.1417</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
@@ -20,7 +20,7 @@
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2310.2417" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2310.2417" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
|
||||
<PackageReference Include="ZXingBlazor" Version="0.1.6" />
|
||||
<PackageReference Include="ZXingBlazor" Version="1.0.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,27 +4,43 @@
|
||||
<div class="text-center">
|
||||
<span class="fs-2 fw-bold">QR-Scan USER LOGIN</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex justify-content-center w-100">
|
||||
<div class="d-flex justify-content-center input-group w-50">
|
||||
<button class="btn btn-sm btn-info fw-bold" @onclick="()=>btnMode()"><i class="fa-solid fa-qrcode"></i> Scan</button>
|
||||
<input type="text" class="form-control" />
|
||||
<button class="btn btn-success fw-bold"> GO <i class="fa-solid fa-circle-arrow-right"></i> </button>
|
||||
</div>
|
||||
<button class="btn btn-sm btn-info fw-bold w-100" @onclick="()=>ToggleCodeScan()"><i class="fa-solid fa-qrcode"></i> Scan</button>
|
||||
</div>
|
||||
|
||||
@if (ShowScanBarcode)
|
||||
{
|
||||
|
||||
<BarcodeReader ScanResult="(e) => ScanDoneHandler(e)"
|
||||
ShowScanBarcode="@ShowScanBarcode"
|
||||
Close="ToggleCodeScan"
|
||||
ScanBtnTitle="Scan"
|
||||
ResetBtnTitle="Reset"
|
||||
CloseBtnTitle="Close"
|
||||
SelectDeviceBtnTitle="Select Device"></BarcodeReader>
|
||||
UseBuiltinDiv="false"
|
||||
@ref="barcodeReaderCustom"
|
||||
SelectDeviceBtnTitle="Select Device">
|
||||
</BarcodeReader>
|
||||
|
||||
<div @ref="barcodeReaderCustom.Element" class="d-flex justify-content-center">
|
||||
@* <div style="width: 480px; max-width: 100%"> *@
|
||||
<div class="col-12 col-md-8 col-lg-6">
|
||||
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="startButton">Scan</button>
|
||||
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="resetButton">Reset</button>
|
||||
<button class="btn btn-outline-success p-2 m-1 w-25" @onclick="() => ToggleCodeScan()">Close</button>
|
||||
|
||||
<div data-action="sourceSelectPanel" style="display:none">
|
||||
<label for="sourceSelect">Source:</label>
|
||||
<select data-action="sourceSelect" style="max-width:100%" class="form-control">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<video id="video" playsinline autoplay class="w-100 h-100 border rounded shadow"></video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@if (oprsList.Count > 0)
|
||||
{
|
||||
<div class="mb-1">
|
||||
@@ -44,24 +60,17 @@
|
||||
|
||||
<div class="d-flex justify-content-between my-2">
|
||||
<div class="pe-2 col-6">
|
||||
<button class="btn btn-sm btn-primary w-100" @onclick="()=>logIn()">Log In</button>
|
||||
<button class="btn btn-sm btn-primary w-100" @onclick="()=>DoLogIn()">Log In</button>
|
||||
</div>
|
||||
<div class="ps-2 col-6">
|
||||
<button class="btn btn-sm btn-warning w-100">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (rigaOpr != null)
|
||||
{
|
||||
<div>@($"{MsgServ.UserAuthKey} {MsgServ.MatrOpr}")</div>
|
||||
}
|
||||
|
||||
@*@if (done)
|
||||
@if (!string.IsNullOrEmpty(txtError))
|
||||
{
|
||||
<div>Logged In</div>
|
||||
<div class="alert alert-danger fs-3">
|
||||
@txtError
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>Not logged in</div>
|
||||
}*@
|
||||
|
||||
|
||||
@@ -1,18 +1,61 @@
|
||||
using EgwCoreLib.Utils;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
//using MongoDB.Bson.IO;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
using ZXingBlazor.Components;
|
||||
|
||||
namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
public partial class RegNewDevice
|
||||
{
|
||||
[Inject]
|
||||
protected TabDataService TDService { get; set; } = null!;
|
||||
#region Protected Fields
|
||||
|
||||
protected int expDays = 1;
|
||||
|
||||
protected DateTime vetoScan = DateTime.Now;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string _authKey { get; set; } = "";
|
||||
|
||||
protected int _matrOpr { get; set; } = 0;
|
||||
|
||||
protected string authKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return _authKey;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_authKey != value)
|
||||
{
|
||||
_authKey = value;
|
||||
DoLogIn().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string CurrOprTknLS { get; set; } = null!;
|
||||
|
||||
protected string CurrOprTknRedis { get; set; } = null!;
|
||||
|
||||
protected DateTime expDT { get; set; } = DateTime.Now;
|
||||
|
||||
protected int matrOpr
|
||||
{
|
||||
get
|
||||
{
|
||||
return _matrOpr;
|
||||
}
|
||||
set => _matrOpr = value;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
@@ -22,62 +65,31 @@ namespace MP_TAB_SERV.Pages
|
||||
|
||||
protected List<AnagOperatoriModel> oprsList { get; set; } = new List<AnagOperatoriModel>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected AnagOperatoriModel rigaOpr { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task ToggleCodeScan()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
//var currOpr = await TDService.LoginOperatore(matrOpr, authKey);
|
||||
//if (currOpr.MatrOpr != 0)
|
||||
//{
|
||||
// MsgServ.RigaOper = currOpr;
|
||||
//}
|
||||
TDService.ConfigGetVal("cookieDayExpire", ref expDays);
|
||||
|
||||
expDT = DateTime.Now.AddDays(expDays);
|
||||
|
||||
//CurrOprTknLS = await MsgServ.getCurrOperDtoAsync();
|
||||
//var decodedUrl = Uri.UnescapeDataString(CurrOprTknLS);
|
||||
//CurrOprTknRedis = await TDService.OperatoreGetRedis(decodedUrl);
|
||||
|
||||
//if (CurrOprTknRedis != "")
|
||||
//{
|
||||
// NavMan.NavigateTo("status-map");
|
||||
//}
|
||||
|
||||
//if (MsgServ.RigaOper != null)
|
||||
//{
|
||||
// NavMan.NavigateTo("status-map", true);
|
||||
//}
|
||||
oprsList = await TDService.ElencoOperatori();
|
||||
ShowScanBarcode = !ShowScanBarcode;
|
||||
}
|
||||
|
||||
protected int expDays = 1;
|
||||
protected int _matrOpr { get; set; } = 0;
|
||||
protected int matrOpr
|
||||
protected string txtError = "";
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
protected string Traduci(string lemma)
|
||||
{
|
||||
get
|
||||
{
|
||||
//_matrOpr = MsgServ.MatrOpr;
|
||||
return _matrOpr;
|
||||
}
|
||||
set => _matrOpr = value;
|
||||
return SMServ.Traduci($"EN_{lemma}".ToUpper());
|
||||
}
|
||||
protected string _authKey { get; set; } = "";
|
||||
protected string authKey
|
||||
{
|
||||
get
|
||||
{
|
||||
//_authKey = MsgServ.UserAuthKey;
|
||||
return _authKey;
|
||||
}
|
||||
set => _authKey = value;
|
||||
}
|
||||
protected AnagOperatoriModel rigaOpr { get; set; } = null!;
|
||||
protected string CurrOprTknLS { get; set; } = null!;
|
||||
protected string CurrOprTknRedis { get; set; } = null!;
|
||||
|
||||
protected DateTime expDT { get; set; } = DateTime.Now;
|
||||
protected async Task logIn()
|
||||
protected async Task DoLogIn()
|
||||
{
|
||||
rigaOpr = await TDService.OperatoreSearch(matrOpr, authKey);
|
||||
if (rigaOpr == null)
|
||||
@@ -85,7 +97,7 @@ namespace MP_TAB_SERV.Pages
|
||||
var deHash = TDService.DecryptData(authKey);
|
||||
rigaOpr = await TDService.OperatoreSearch(matrOpr, deHash);
|
||||
}
|
||||
if (rigaOpr != null)
|
||||
if (rigaOpr != null && rigaOpr.MatrOpr > 0)
|
||||
{
|
||||
userTknDTO newUserTkn = new userTknDTO()
|
||||
{
|
||||
@@ -96,21 +108,27 @@ namespace MP_TAB_SERV.Pages
|
||||
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
|
||||
string hash = TDService.EncryptData(jsonTkn);
|
||||
MsgServ.RigaOper = rigaOpr;
|
||||
await MsgServ.setCurrOperDtoAsync(hash);
|
||||
await MsgServ.SetCurrOperDtoAsync(hash);
|
||||
await MsgServ.SetLastMatrOprAsync(rigaOpr.MatrOpr);
|
||||
await TDService.OperatoreSetRedis(matrOpr, hash);
|
||||
NavMan.NavigateTo("status-map");
|
||||
}
|
||||
//StateHasChanged();
|
||||
else
|
||||
{
|
||||
txtError = Traduci("UserPwdMismatch");
|
||||
authKey = "";
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task btnMode()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
ShowScanBarcode = !ShowScanBarcode;
|
||||
txtError = "";
|
||||
matrOpr = await MsgServ.GetLastMatrOprAsync();
|
||||
TDService.ConfigGetVal("cookieDayExpire", ref expDays);
|
||||
expDT = DateTime.Now.AddDays(expDays);
|
||||
oprsList = await TDService.ElencoOperatori();
|
||||
}
|
||||
|
||||
protected DateTime vetoScan = DateTime.Now;
|
||||
|
||||
protected async Task ScanDoneHandler(string value)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
@@ -137,64 +155,20 @@ namespace MP_TAB_SERV.Pages
|
||||
authKey = Uri_authKey;
|
||||
}
|
||||
}
|
||||
await logIn();
|
||||
await DoLogIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool ShowScanBarcode { get; set; } = false;
|
||||
|
||||
protected BarcodeReader barcodeReaderCustom { get; set; } = null!;
|
||||
|
||||
//private async Task ProcessBarcode(string Barcode)
|
||||
//{
|
||||
// if (OrderCode != Barcode)
|
||||
// {
|
||||
// await InvokeAsync(() =>
|
||||
// {
|
||||
// OrderCode = Barcode;
|
||||
// });
|
||||
// var ordine = await DataService.OrderGetByCode(Barcode);
|
||||
// if (ordine != null)
|
||||
// {
|
||||
// if (ordine.DtExecEnd > ordine.DtOrder)
|
||||
// {
|
||||
// await InvokeAsync(() =>
|
||||
// {
|
||||
// errorDescription = "Errore: ordine già completato";
|
||||
// });
|
||||
// await Task.Run(() =>
|
||||
// {
|
||||
// Thread.Sleep(3000);
|
||||
// forceReset();
|
||||
// });
|
||||
// }
|
||||
// else if (ordine.PlantId != SelPlantId)
|
||||
// {
|
||||
// await InvokeAsync(() =>
|
||||
// {
|
||||
// errorDescription = "Errore: ordine destinato ad altro impianto";
|
||||
// });
|
||||
#endregion Private Properties
|
||||
|
||||
// await Task.Run(() =>
|
||||
// {
|
||||
// Thread.Sleep(3000);
|
||||
// forceReset();
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // salvo...
|
||||
// MessageService.SelPlantId = $"{SelPlantId}";
|
||||
// MessageService.SelOrderCode = Barcode;
|
||||
// // rimando a pagina load....
|
||||
// NavManager.NavigateTo($"GasStationLoad");
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// errorDescription = "Errore: ordine non trovato";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -85,9 +85,9 @@
|
||||
<i class="fa-solid fa-gear"></i> ABOUT PAGE
|
||||
</button>
|
||||
<hr />
|
||||
<button class="w-100 btn btn-danger">
|
||||
<a class="w-100 btn btn-danger" href="logout">
|
||||
<i class="fa-solid fa-right-from-bracket"></i> LOGOUT
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@if (Width > 1021)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2311.1415</h4>
|
||||
<h4>Versione: 6.16.2311.1417</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2311.1415
|
||||
6.16.2311.1417
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2311.1415</version>
|
||||
<version>6.16.2311.1417</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -7,41 +7,17 @@
|
||||
<div class="page">
|
||||
|
||||
<main>
|
||||
@*<div class="top-row d-flex justify-content-between text-light">
|
||||
<div class="col-4">
|
||||
<span>
|
||||
<button class="btn btn-sm @ResetClass" @onclick="() => ForceReload()" title="Update"><i class="fa-solid fa-rotate"></i></button>
|
||||
Username
|
||||
</span>
|
||||
<sub>[999]</sub>
|
||||
</div>
|
||||
<div class="col-4 text-center d-flex justify-content-center">
|
||||
<a href="status-map" class="text-decoration-none text-light">
|
||||
<i class="fa-solid fa-house"></i>
|
||||
MapoTAB2
|
||||
|
||||
<img src="images/LogoSteamware.png" style="height: 1rem" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
<div class="row w-100 slideMen">
|
||||
<div class="p-0">
|
||||
<SlideMenu MenuItems="@CurrMenuItems"></SlideMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<CmpTop CurrMenuItems="@CurrMenuItems"></CmpTop>
|
||||
|
||||
|
||||
<article class="content pt-1 d-flex mb-5">
|
||||
<div class="" id="mainBody">
|
||||
@Body
|
||||
</div>
|
||||
<div class="sidebar" id="barLat">
|
||||
<NavMenu MenuItems="@CurrMenuItems"></NavMenu>
|
||||
</div>
|
||||
@if (!HideMenu)
|
||||
{
|
||||
<div class="sidebar" id="barLat">
|
||||
<NavMenu MenuItems="@CurrMenuItems"></NavMenu>
|
||||
</div>
|
||||
}
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Components.Routing;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MP_TAB_SERV.Shared
|
||||
{
|
||||
@@ -36,11 +35,16 @@ namespace MP_TAB_SERV.Shared
|
||||
/// </summary>
|
||||
protected List<LinkMenu> CurrMenuItems { get; set; } = new List<LinkMenu>();
|
||||
|
||||
protected bool HideMenu
|
||||
{
|
||||
get => NavMan.Uri.Contains("reg-new-device");
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected ListSelectDataSrv MDataService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MServ { get; set; } = null!;
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService MStor { get; set; } = null!;
|
||||
|
||||
@@ -416,33 +416,6 @@ namespace MP.Data.Services
|
||||
}
|
||||
|
||||
private AnagOperatoriModel? _rigaOper;
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// AnagOperatoriModel answ = new AnagOperatoriModel();
|
||||
// string rawData = "";
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// rawData = await getCurrOperDtoAsync();
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// var decodedUrl = Uri.UnescapeDataString(rawData);
|
||||
// var decrData = DecryptData(decodedUrl);
|
||||
// answ = JsonConvert.DeserializeObject<AnagOperatoriModel>(decodedUrl);
|
||||
// return answ;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// var serVal = JsonConvert.SerializeObject(value);
|
||||
// var encData = EncryptData(serVal);
|
||||
// var escdata = Uri.EscapeDataString(encData);
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// await setCurrOperDtoAsync(escdata);
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// }
|
||||
//}
|
||||
public string EncryptData(string rawData)
|
||||
{
|
||||
return SteamCrypto.EncryptString(rawData, Constants.passPhrase);
|
||||
@@ -527,7 +500,7 @@ namespace MP.Data.Services
|
||||
/// Restituisce il record OperatoreDTO da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> getCurrOperDtoAsync()
|
||||
public async Task<string> GetCurrOperDtoAsync()
|
||||
{
|
||||
string answ = "";
|
||||
var result = await localStorage.GetItemAsync<string>("currTkn");
|
||||
@@ -539,11 +512,39 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce ultima matrOpr registrata da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetLastMatrOprAsync()
|
||||
{
|
||||
int answ = -1;
|
||||
var result = await localStorage.GetItemAsync<string>("lastMatrOpr");
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
answ = int.Parse(result);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Salva matrOpr nel localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SetLastMatrOprAsync(int matrOpr)
|
||||
{
|
||||
bool answ = false;
|
||||
await localStorage.SetItemAsync("lastMatrOpr", matrOpr);
|
||||
answ = true;
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// scrive il record OperatoreDTO nel localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setCurrOperDtoAsync(string currTkn)
|
||||
public async Task<bool> SetCurrOperDtoAsync(string currTkn)
|
||||
{
|
||||
bool answ = false;
|
||||
await localStorage.SetItemAsync("currTkn", currTkn);
|
||||
@@ -551,244 +552,9 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#if false
|
||||
public event Action EA_DateChanged = null!;
|
||||
public event Action EA_CalModeChanged = null!;
|
||||
|
||||
public event Action EA_TimbUpd = null!;
|
||||
#endif
|
||||
|
||||
#if false
|
||||
public RegAttivitaModel? clonedRA { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Calcola HASH del codice impiego = payload utente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string HashDip
|
||||
{
|
||||
get
|
||||
{
|
||||
DataValidator cDV = new DataValidator(_rigaOper);
|
||||
string hash = cDV.HashDip;
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if false
|
||||
public bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (_rigaOper != null && _rigaOper.Attivo != null)
|
||||
{
|
||||
answ = (bool)_rigaOper.Attivo;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isRicTimb { get; set; } = false;
|
||||
|
||||
public CalendarModeEnum.modoControllo modoCal { get; set; } = CalendarModeEnum.modoControllo.showCalendar;
|
||||
#endif
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Indica ultima azione compiuta
|
||||
/// </summary>
|
||||
public string LastAction
|
||||
{
|
||||
get => lastAction;
|
||||
set
|
||||
{
|
||||
if (lastAction != value)
|
||||
{
|
||||
lastAction = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il prossimo stato timbratura sia entrata
|
||||
/// </summary>
|
||||
public bool NextIsEntrata
|
||||
{
|
||||
get => nextIsEntrata;
|
||||
set
|
||||
{
|
||||
if (nextIsEntrata != value)
|
||||
{
|
||||
nextIsEntrata = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string PageIcon
|
||||
{
|
||||
get => _pageIcon;
|
||||
set
|
||||
{
|
||||
if (_pageIcon != value)
|
||||
{
|
||||
_pageIcon = value;
|
||||
ReportPageUpd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string PageName
|
||||
{
|
||||
get => _pageName;
|
||||
set
|
||||
{
|
||||
if (_pageName != value)
|
||||
{
|
||||
_pageName = value;
|
||||
ReportPageUpd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool PayloadOk { get; set; } = false;
|
||||
public RegAttivitaModel? recordRA { get; set; } = null;
|
||||
#endif
|
||||
#if false
|
||||
public string SearchVal
|
||||
{
|
||||
get => _searchVal;
|
||||
set
|
||||
{
|
||||
if (_searchVal != value)
|
||||
{
|
||||
_searchVal = value;
|
||||
|
||||
if (EA_DipUpdated != null)
|
||||
{
|
||||
EA_DipUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int selWeekNum { get; set; } = 0;
|
||||
public int selYear { get; set; } = DateTime.Today.Year;
|
||||
|
||||
public bool ShowSearch
|
||||
{
|
||||
get => showSearch;
|
||||
set
|
||||
{
|
||||
if (showSearch != value)
|
||||
{
|
||||
showSearch = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime targetDate { get; set; } = DateTime.Today;
|
||||
public DateTime targetDateMancTimb { get; set; }
|
||||
#endif
|
||||
#if false
|
||||
|
||||
public void ReportDateChange()
|
||||
{
|
||||
if (EA_DateChanged != null)
|
||||
{
|
||||
EA_DateChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public void setModeCalendar()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showCalendar;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public void setModeGauge()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showGauge;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public void setModeProj()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showProj;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public void setModeTempRil()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showTempRil;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public void setModeRichTimb()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showTimbr;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public void setModeShowWeek()
|
||||
{
|
||||
modoCal = CalendarModeEnum.modoControllo.showWeek;
|
||||
if (EA_CalModeChanged != null)
|
||||
{
|
||||
EA_CalModeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public void ReportTimbratura()
|
||||
{
|
||||
if (EA_TimbUpd != null)
|
||||
{
|
||||
EA_TimbUpd?.Invoke();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if false
|
||||
private string _pageIcon = "";
|
||||
private string _pageName = "";
|
||||
#endif
|
||||
#if false
|
||||
private string _searchVal = "";
|
||||
private bool showSearch;
|
||||
#endif
|
||||
|
||||
#if false
|
||||
private string lastAction { get; set; } = "";
|
||||
private bool nextIsEntrata { get; set; } = true;
|
||||
#endif
|
||||
|
||||
#if false
|
||||
private void ReportPageUpd()
|
||||
{
|
||||
if (EA_PageUpdated != null)
|
||||
{
|
||||
EA_PageUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void ReportSearch()
|
||||
{
|
||||
if (EA_DipUpdated != null)
|
||||
{
|
||||
EA_DipUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user