Merge branch 'feature/MP-CORE-LAND' into develop
This commit is contained in:
@@ -34,19 +34,21 @@ namespace MP.AppAuth.Controllers
|
||||
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
|
||||
{
|
||||
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagOpr
|
||||
.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal))
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagOpr
|
||||
.ToList();
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagOpr
|
||||
.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal))
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagOpr
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
// ritorno
|
||||
return dbResult;
|
||||
@@ -93,11 +95,12 @@ namespace MP.AppAuth.Controllers
|
||||
public List<Models.UpdMan> UpdManGetAll()
|
||||
{
|
||||
List<Models.UpdMan> dbResult = new List<Models.UpdMan>();
|
||||
|
||||
dbResult = dbCtx
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetUpdMan
|
||||
.ToList();
|
||||
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
@@ -108,11 +111,12 @@ namespace MP.AppAuth.Controllers
|
||||
public List<Models.Vocabolario> VocabolarioGetAll()
|
||||
{
|
||||
List<Models.Vocabolario> dbResult = new List<Models.Vocabolario>();
|
||||
|
||||
dbResult = dbCtx
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetVocabolario
|
||||
.ToList();
|
||||
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.AppAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper x estrarre dati sintetici su HW, Software, librerie installate...
|
||||
/// </summary>
|
||||
public class HwSwInfo
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Assembly di base
|
||||
/// </summary>
|
||||
protected Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Istanza base
|
||||
/// </summary>
|
||||
public HwSwInfo()
|
||||
{
|
||||
assembly = Assembly.GetExecutingAssembly();
|
||||
}
|
||||
|
||||
public HwSwInfo(Assembly targetAssembly)
|
||||
{
|
||||
assembly = targetAssembly;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Singleton!
|
||||
/// </summary>
|
||||
public static HwSwInfo man = new HwSwInfo();
|
||||
#endif
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Statistiche IIS
|
||||
/// </summary>
|
||||
public string IISStats
|
||||
{
|
||||
get
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
using (var iis = Process.GetCurrentProcess())
|
||||
{
|
||||
//Process iis = Process.GetCurrentProcess();
|
||||
sb.AppendLine(string.Format("UPTIME: {0}", ToDateString(DateTime.Now - iis.StartTime)));
|
||||
sb.AppendLine(string.Format("Priority: {0}", iis.PriorityClass));
|
||||
sb.AppendLine(string.Format("Physical Memory Used: {0}", memFormat(iis.WorkingSet64)));
|
||||
sb.AppendLine(string.Format("Virtual Memory Used: {0}", memFormat(iis.VirtualMemorySize64)));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Versioni di ogni libreria compresa
|
||||
/// </summary>
|
||||
public string librariesVers
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
|
||||
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
|
||||
{
|
||||
answ += referencedAssemblyName.FullName + Environment.NewLine;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nome MainAssembly
|
||||
/// </summary>
|
||||
public string mainAssembly
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = assembly.FullName;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Num di librerie inserite
|
||||
/// </summary>
|
||||
public int numLibraries
|
||||
{
|
||||
get
|
||||
{
|
||||
int numLib = 0; ;
|
||||
try
|
||||
{
|
||||
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
|
||||
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
|
||||
{
|
||||
numLib++;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return numLib;
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Dati sui server redis...
|
||||
///// </summary>
|
||||
//public string redisServersData
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// try
|
||||
// {
|
||||
// var servData = memLayer.ML.redServInfo();
|
||||
// foreach (var item in servData)
|
||||
// {
|
||||
// sb.AppendLine(string.Format("Server: {0} | {1} | {2}", item, item.Version, item.ServerType));
|
||||
// // da completare con altre info?!?
|
||||
// var srvInfo = item.Info();
|
||||
// // esporto un pò di info x gruppo...
|
||||
// foreach (IGrouping<string, System.Collections.Generic.KeyValuePair<string, string>> capitolo in srvInfo)
|
||||
// {
|
||||
// sb.AppendLine("----------------------------------------------");
|
||||
// sb.AppendLine(string.Format("Capitolo: {0}", capitolo.Key));
|
||||
// sb.AppendLine("----------------------------------------------");
|
||||
// foreach (var kvp in capitolo)
|
||||
// {
|
||||
// sb.AppendLine(string.Format("{0}:{1}", kvp.Key, kvp.Value));
|
||||
// }
|
||||
|
||||
// sb.AppendLine();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception exc)
|
||||
// {
|
||||
// Log.Error($"Errore in redisServersData{Environment.NewLine}{exc}");
|
||||
// }
|
||||
// return sb.ToString();
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Runtime assembly
|
||||
/// </summary>
|
||||
public string runtimeImg
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = assembly.ImageRuntimeVersion;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statistiche server
|
||||
/// </summary>
|
||||
public string ServerStats
|
||||
{
|
||||
get
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try
|
||||
{
|
||||
// calcoli preliminari
|
||||
|
||||
// compongo output
|
||||
sb.AppendLine(string.Format("NAME: {0}", Environment.MachineName));
|
||||
sb.AppendLine(System.Runtime.InteropServices.RuntimeInformation.OSDescription);
|
||||
sb.AppendLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
|
||||
sb.AppendLine(string.Format("OS 64bit: {0} | PROC 64bit: {1}", Environment.Is64BitOperatingSystem, Environment.Is64BitProcess));
|
||||
//sb.AppendLine(string.Format("SYS UPTIME: {0}", ToDateString(uptime)));
|
||||
sb.AppendLine(string.Format("CPU: {0}", Environment.ProcessorCount));
|
||||
//sb.AppendLine(string.Format("RAM: {0}", memFormat(computer.TotalPhysicalMemory)));
|
||||
//sb.AppendLine(string.Format("Virtual Memory: {0}", memFormat(computer.TotalVirtualMemory)));
|
||||
//sb.AppendLine(string.Format("Available RAM: {0}", memFormat(computer.AvailablePhysicalMemory)));
|
||||
//sb.AppendLine(string.Format("Available Virtual Memory: {0}", memFormat(computer.AvailableVirtualMemory)));
|
||||
sb.AppendLine(string.Format("DIR: {0}", Environment.CurrentDirectory));
|
||||
sb.AppendLine(string.Format("USER: {0} | USER: {1}", Environment.UserDomainName, Environment.UserName));
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in ServerStats{Environment.NewLine}{exc}");
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Singleton!
|
||||
/// </summary>
|
||||
public static HwSwInfo man(Assembly targetAssembly)
|
||||
{
|
||||
HwSwInfo answ = new HwSwInfo(targetAssembly);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Formatta un numero da int a size in Kb/Mb/Gb/Tb
|
||||
/// </summary>
|
||||
/// <param name="rawSize"></param>
|
||||
/// <returns></returns>
|
||||
public string memFormat(double rawSize)
|
||||
{
|
||||
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
|
||||
int order = 0;
|
||||
while (rawSize >= 1024 && order < sizes.Length - 1)
|
||||
{
|
||||
order++;
|
||||
rawSize = rawSize / 1024;
|
||||
}
|
||||
|
||||
// Adjust the format string to your preferences. For example "{0:0.#}{1}" would
|
||||
// show a single decimal place, and no space.
|
||||
return String.Format("{0:0.##} {1}", rawSize, sizes[order]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stringa timing in gg, ore, ... da timespan
|
||||
/// </summary>
|
||||
/// <param name="time"></param>
|
||||
/// <returns></returns>
|
||||
public string ToDateString(TimeSpan time)
|
||||
{
|
||||
return string.Format("{0}gg, {1:00}:{2:00}:{3:00} (h:m:s)", time.Days, time.Hours, time.Minutes, time.Seconds);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -42,11 +42,9 @@
|
||||
{
|
||||
<div class="input-group input-group-sm">
|
||||
<select @bind="@PageSize" class="form-control form-control-sm">
|
||||
<option value="5">5</option>
|
||||
<option value="2">2</option>
|
||||
<option value="4">4</option>
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace MP.Land.Components
|
||||
|
||||
protected int _numPage { get; set; } = 1;
|
||||
|
||||
protected int _numRecord { get; set; } = 10;
|
||||
protected int _numRecord { get; set; } = 4;
|
||||
|
||||
protected int percLoading { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@inject MessageService MessageService
|
||||
|
||||
<div class="input-group input-group-sm">
|
||||
<DebounceInput id="sVal" class="form-control" placeholder="@("Ricerca (min " + _minChar + " char)")" autocomplete="off" @ref="debInput" @bind-Value="@_searchVal" @bind-Value:event="OnInput" DebounceTime="@_debMsec" MinLength="@_minChar" OnValueChanged="e => { searchVal = e; }" ForceNotifyByEnter="true" ForceNotifyOnBlur="true" />
|
||||
<DebounceInput id="sVal" class="form-control" placeholder="@("Ricerca libera")" autocomplete="off" @ref="debInput" @bind-Value="@_searchVal" @bind-Value:event="OnInput" DebounceTime="@_debMsec" MinLength="@_minChar" OnValueChanged="e => { searchVal = e; }" ForceNotifyByEnter="true" ForceNotifyOnBlur="true" />
|
||||
|
||||
<div class="input-group-append">
|
||||
<button @onclick="reset" class="btn btn-success input-group-text">reset</button>
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
@code {
|
||||
private string _searchVal = "";
|
||||
private int _debMsec = 200;
|
||||
private int _minChar = 2;
|
||||
private int _debMsec = 300;
|
||||
private int _minChar = 0;
|
||||
private DebounceInput debInput;
|
||||
|
||||
[Parameter]
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<div class="card border-secondary">
|
||||
<div class="card-header py-2 font-weight-bold bg-secondary">
|
||||
<div class="card">
|
||||
<div class="card-header py-2 font-weight-bold">
|
||||
<div class="row">
|
||||
<div class="col-4 col-md-4">
|
||||
<div class="badge badge-pill badge-light px-2 py-1">
|
||||
<div class="badge badge-pill badge-dark px-2 py-1">
|
||||
<div class="px-1">
|
||||
<span>EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></span>
|
||||
</div>
|
||||
</div>
|
||||
@*<img src="img/LogoBluGreen.png" class="img-fluid" width="32" /> EgalWare*@
|
||||
</div>
|
||||
<div class="col-8 text-right text-light">
|
||||
<div class="col-8 text-right">
|
||||
<h4 class="py-0 mb-0">@Environment</h4>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,9 +28,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-muted py-1 bg-secondary">
|
||||
Card login MAPO-TAB
|
||||
</div>
|
||||
@*<div class="card-footer text-muted py-1">
|
||||
Card login MAPO-TAB
|
||||
</div>*@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@@ -41,7 +40,11 @@
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
||||
if (!firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
|
||||
@@ -127,12 +127,12 @@ namespace MP.Land.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList()
|
||||
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
|
||||
{
|
||||
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagOpGetAll("");
|
||||
dbResult = dbController.AnagOpGetAll(searchVal);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagOperList: {ts.TotalMilliseconds} ms");
|
||||
|
||||
@@ -1,341 +0,0 @@
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MP.FileData;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
using MP.FileData.Controllers;
|
||||
using MP.FileData.DTO;
|
||||
|
||||
namespace MP.Land.Data
|
||||
{
|
||||
public class FileArchDataService : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static ILogger<FileArchDataService> _logger;
|
||||
|
||||
private static List<FileData.DatabaseModels.MacchinaModel> ElencoMacchine = new List<FileData.DatabaseModels.MacchinaModel>();
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private readonly IDistributedCache distributedCache;
|
||||
|
||||
private readonly IMemoryCache memoryCache;
|
||||
|
||||
/// <summary>
|
||||
/// Durata assoluta massima della cache
|
||||
/// </summary>
|
||||
private int chAbsExp = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Durata della cache in modalità inattiva (non acceduta) prima di venire rimossa
|
||||
/// NON estende oltre il tempo massimo di validità della cache (chAbsExp)
|
||||
/// </summary>
|
||||
private int chSliExp = 5;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static string connStringBBM = "";
|
||||
|
||||
protected static string connStringFatt = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
public static FileData.Controllers.FileController dbController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public FileArchDataService(IConfiguration configuration, ILogger<FileArchDataService> logger, IMemoryCache memoryCache, IDistributedCache distributedCache)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
// conf cache
|
||||
this.memoryCache = memoryCache;
|
||||
this.distributedCache = distributedCache;
|
||||
// conf DB
|
||||
string connStr = _configuration.GetConnectionString("MP.Land");
|
||||
if (string.IsNullOrEmpty(connStr))
|
||||
{
|
||||
_logger.LogError("ConnString empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
dbController = new FileData.Controllers.FileController(configuration);
|
||||
_logger.LogInformation("DbController OK");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private DistributedCacheEntryOptions cacheOpt
|
||||
{
|
||||
get
|
||||
{
|
||||
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp));
|
||||
}
|
||||
}
|
||||
|
||||
private DistributedCacheEntryOptions cacheOptLong
|
||||
{
|
||||
get
|
||||
{
|
||||
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp * 10)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal Task FileApprove(FileData.DatabaseModels.FileModel currItem)
|
||||
{
|
||||
return Task.FromResult(dbController.FileModApprove(currItem));
|
||||
}
|
||||
|
||||
internal Task FileDelete(FileData.DatabaseModels.FileModel currItem)
|
||||
{
|
||||
return Task.FromResult(dbController.FileDelete(currItem));
|
||||
}
|
||||
|
||||
internal Task FileReject(FileData.DatabaseModels.FileModel currItem)
|
||||
{
|
||||
return Task.FromResult(dbController.FileModReject(currItem));
|
||||
}
|
||||
|
||||
internal Task FileUpdate(FileData.DatabaseModels.FileModel updItem)
|
||||
{
|
||||
return Task.FromResult(dbController.FileUpdate(updItem));
|
||||
}
|
||||
|
||||
internal void ResetController()
|
||||
{
|
||||
dbController.ResetController();
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
public async Task<int> FileCountFilt(SelectData CurrFilter)
|
||||
{
|
||||
int numCount = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
numCount = dbController.FileCountFilt(CurrFilter.IdxMacchina, CurrFilter.OnlyActive, CurrFilter.OnlyMod, CurrFilter.OnlyNoTag, CurrFilter.FileName, CurrFilter.Tag, CurrFilter.SearchVal);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per FileCountFilt: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(numCount);
|
||||
}
|
||||
|
||||
public Task<FileData.DatabaseModels.FileModel> FileGetByKey(int FileId)
|
||||
{
|
||||
return Task.FromResult(dbController.FileGetByKey(FileId));
|
||||
}
|
||||
|
||||
public async Task<List<FileData.DatabaseModels.FileModel>> FileGetFilt(SelectData CurrFilter)
|
||||
{
|
||||
List<FileData.DatabaseModels.FileModel> dbResult = new List<FileData.DatabaseModels.FileModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.FileGetFilt(CurrFilter.IdxMacchina, CurrFilter.OnlyActive, CurrFilter.OnlyMod, CurrFilter.OnlyNoTag, CurrFilter.FileName, CurrFilter.Tag, CurrFilter.SearchVal, CurrFilter.NumSkip, CurrFilter.PageSize).ToList();
|
||||
//dbResult = dbController.FileGetFilt(CurrFilter.IdxMacchina, CurrFilter.OnlyActive, CurrFilter.OnlyMod, CurrFilter.FirstRecord, CurrFilter.PageSize * 10, CurrFilter.SearchVal).ToList();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per FileGetFilt: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<ArchiveStatusDTO>> GetArchiveStatus()
|
||||
{
|
||||
List<ArchiveStatusDTO> dbResult = new List<ArchiveStatusDTO>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.GetArchiveStatus();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per GetArchiveStatus: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public Task<FileData.DatabaseModels.MacchinaModel> MacchinaGetByKey(string idxMacchina)
|
||||
{
|
||||
return Task.FromResult(dbController.MacchinaGetByKey(idxMacchina));
|
||||
}
|
||||
|
||||
public Task<List<FileData.DatabaseModels.MacchinaModel>> MacchineGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.MacchineGetAll().ToList());
|
||||
}
|
||||
|
||||
public async Task<List<AutocompleteModel>> MachineList()
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
answ.AddRange(dbController.MacchineGetAll().Select(x => new AutocompleteModel { LabelField = $"{x.IdxMacchina} | {x.Nome} {x.Descrizione} ", ValueField = x.IdxMacchina }).ToList());
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public void rollBackEdit(object item)
|
||||
{
|
||||
dbController.RollBackEntity(item);
|
||||
}
|
||||
|
||||
public async Task<List<FileData.DatabaseModels.TagModel>> TagGetFilt(string SearchVal)
|
||||
{
|
||||
return await Task.FromResult(dbController.TagGetFilt(SearchVal, 200).ToList());
|
||||
}
|
||||
|
||||
public Task<List<AutocompleteModel>> TagGetSearch(string searchVal, int numRecord)
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
if (numRecord > -1)
|
||||
{
|
||||
answ.AddRange(dbController.TagGetFilt(searchVal, numRecord).Select(x => new AutocompleteModel { LabelField = $"{x.TagId}", ValueField = x.TagId }).ToList());
|
||||
}
|
||||
return Task.FromResult(answ);
|
||||
}
|
||||
|
||||
#if false
|
||||
protected string getCacheKey(string TableName, SelectData CurrFilter)
|
||||
{
|
||||
string answ = $"{TableName}:M_{CurrFilter.IdxMacchina}:A_{CurrFilter.CodArticolo}:K_{CurrFilter.KeyRichiesta}:O_{CurrFilter.IdxOdl}:D_{CurrFilter.DateStart:yyyyMMddHHmm}_{CurrFilter.DateEnd:yyyyMMddHHmm}";
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string getCacheKeyPaged(string TableName, SelectData CurrFilter)
|
||||
{
|
||||
string answ = $"{TableName}:M_{CurrFilter.IdxMacchina}:A_{CurrFilter.CodArticolo}:K_{CurrFilter.KeyRichiesta}:O_{CurrFilter.IdxOdl}:D_{CurrFilter.DateStart:yyMMddHHmm}_{CurrFilter.DateEnd:yyMMddHHmm}:R_{CurrFilter.FirstRecord}_{CurrFilter.FirstRecord + CurrFilter.NumRecord}";
|
||||
return answ;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna intero archivio scansionando dati x tutte le macchine che hanno un path valido
|
||||
/// </summary>
|
||||
/// <param name="numDayPre">Numero giorni x ricerca all'indietro da data corrente / 0 = nessun limite</param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> updateAllArchive(int numDayPre, bool forceTag)
|
||||
{
|
||||
int checkDone = 0;
|
||||
var listaMacchine = await MacchineGetAll();
|
||||
foreach (var item in listaMacchine.Where(x => !string.IsNullOrEmpty(x.BasePath)).ToList())
|
||||
{
|
||||
checkDone += await updateMachineArchive(item.IdxMacchina, numDayPre, forceTag, false);
|
||||
}
|
||||
|
||||
return await Task.FromResult(checkDone);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna archivio di una amcchina scansionando path relativo
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">Codice macchina</param>
|
||||
/// <param name="numDayPre">Numero giorni x ricerca all'indietro da data corrente / 0 = nessun limite</param>
|
||||
/// <param name="forceTag">Forza la riverifica dei tags (x update da setup)</param>
|
||||
/// <param name="fullLog">Scrittura log verboso macchina</param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> updateMachineArchive(string idxMacchina, int numDayPre, bool forceTag, bool fullLog)
|
||||
{
|
||||
int checkDone = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string ruleName = "Rule00.json";
|
||||
try
|
||||
{
|
||||
var macchina = MacchinaGetByKey(idxMacchina).Result;
|
||||
if (macchina != null && !string.IsNullOrEmpty(macchina.BasePath))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(macchina.RuleName))
|
||||
{
|
||||
ruleName = macchina.RuleName;
|
||||
// gestione confRule...
|
||||
SearchRules currRule = new SearchRules();
|
||||
try
|
||||
{
|
||||
string rawData = File.ReadAllText(FileController.rulePath(ruleName));
|
||||
currRule = JsonConvert.DeserializeObject<SearchRules>(rawData);
|
||||
//Log.Info($"Conf rule acquisito da file {ruleName}:{Environment.NewLine}{rawData}");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in deserializzazione conf rule{Environment.NewLine}{exc}");
|
||||
}
|
||||
|
||||
// se NON deserializzato inizializzo hard-coded
|
||||
if (currRule.Name == "ND")
|
||||
{
|
||||
// fare: lettura conf rule x recupero tag x singola macchina
|
||||
//$"\\b{fileName}" + @".{0,2}\([\w\d\s.]+\)";
|
||||
|
||||
Dictionary<string, string> confReplace = new Dictionary<string, string>();
|
||||
confReplace.Add("(", " ");
|
||||
confReplace.Add(")", " ");
|
||||
|
||||
Dictionary<string, string> fileExtReplace = new Dictionary<string, string>();
|
||||
fileExtReplace.Add(".P-2", "");
|
||||
// hard coded + salvataggio conf x creare json
|
||||
currRule = new SearchRules()
|
||||
{
|
||||
Name = "Commento Filename",
|
||||
Mode = SearchMode.StringOnFile,
|
||||
MaxChar2Search = 100,
|
||||
ReplaceCR = true,
|
||||
RegExPattern = "\\b{{fileName}}" + @".{0,2}\([\w\d\s./]+\)",
|
||||
RegExRepFileName = true,
|
||||
FileNameExtReplace = fileExtReplace,
|
||||
ExcludedTags = new List<string>() { "M4", "M5", "M4+A", "M4+B", "M5+A", "M5+B" },
|
||||
OutReplace = confReplace,
|
||||
OutExcludeFileName = true
|
||||
};
|
||||
if (fullLog)
|
||||
{
|
||||
// serializzo
|
||||
string rawRule = JsonConvert.SerializeObject(currRule, Formatting.Indented);
|
||||
Log.Trace($"Conf rule generato:{Environment.NewLine}{rawRule}");
|
||||
}
|
||||
}
|
||||
checkDone = dbController.CheckFileArchived(macchina.IdxMacchina, macchina.BasePath, numDayPre, "*.*", forceTag, currRule);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in updateMachineArchive{Environment.NewLine}{exc}{Environment.NewLine}{exc.InnerException}");
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Info($"Effettuato update archivio file MACCHINA | last {numDayPre} days | {checkDone} checked | {ts.TotalMilliseconds} ms");
|
||||
|
||||
return await Task.FromResult(checkDone);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ namespace MP.Land.Data
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private SelectData _fileFilter = SelectData.Init(5, 15);
|
||||
private string _pageIcon;
|
||||
private string _pageName;
|
||||
private string _searchVal = "";
|
||||
private SelectData _selFilter = SelectData.Init(4, 15);
|
||||
private bool showSearch;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -34,19 +34,6 @@ namespace MP.Land.Data
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public SelectData File_Filter
|
||||
{
|
||||
get => _fileFilter;
|
||||
set
|
||||
{
|
||||
if (_fileFilter != value)
|
||||
{
|
||||
_fileFilter = value;
|
||||
ReportFilter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string PageIcon
|
||||
{
|
||||
get => _pageIcon;
|
||||
@@ -86,6 +73,19 @@ namespace MP.Land.Data
|
||||
}
|
||||
}
|
||||
|
||||
public SelectData SelFilter
|
||||
{
|
||||
get => _selFilter;
|
||||
set
|
||||
{
|
||||
if (_selFilter != value)
|
||||
{
|
||||
_selFilter = value;
|
||||
ReportFilter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowSearch
|
||||
{
|
||||
get => showSearch;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace MP.Land.Data
|
||||
public bool OnlyMod { get; set; } = false;
|
||||
public bool OnlyNoTag { get; set; } = false;
|
||||
public int PageNum { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 10;
|
||||
public int PageSize { get; set; } = 4;
|
||||
public string SearchVal { get; set; } = "";
|
||||
public string Tag { get; set; } = "";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>1.1.2109.2020</Version>
|
||||
<Version>1.1.2109.2117</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+26
-12
@@ -3,23 +3,37 @@
|
||||
|
||||
@inject MessageService AppMService
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8 offset-2">
|
||||
<div class="row mx-2">
|
||||
<div class="col-12 col-lg-8 offset-lg-2">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h2>@Titolo</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-6">
|
||||
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
||||
<div class="row">
|
||||
<div class="col-4"></div>
|
||||
<div class="col-4">
|
||||
<h2>@Titolo</h2>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="badge badge-pill badge-dark px-4 py-2">
|
||||
<div class="px-1">
|
||||
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3"></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">@Messaggio</h4>
|
||||
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
|
||||
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot">visita il link</a> sul nostro sito.</p>
|
||||
<div class="row">
|
||||
<div class="col-lg-3"></div>
|
||||
<div class="col-12 col-lg-6 py-3">
|
||||
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="col-lg-3"></div>
|
||||
<div class="col-12">
|
||||
<h4 class="card-title">@Messaggio</h4>
|
||||
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
|
||||
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot" target="_blank">visita il link</a> sul nostro sito.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
@inject MessageService AppMService
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8 offset-2">
|
||||
<div class="row mx-2">
|
||||
<div class="col-12 col-lg-8 offset-lg-2">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<div class="row">
|
||||
@@ -21,17 +21,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-6 py-3">
|
||||
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="col-3"></div>
|
||||
</div>
|
||||
<div class="card-body px-3">
|
||||
<h4 class="card-title">@Messaggio</h4>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-3"></div>
|
||||
<div class="col-12 col-lg-6 py-3">
|
||||
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
||||
</div>
|
||||
<div class="col-lg-3"></div>
|
||||
<div class="col-12">
|
||||
<h4 class="card-title">@Messaggio</h4>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<h4>Sede Operativa</h4>
|
||||
<address>
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
@page "/SysInfo"
|
||||
@using MP.AppAuth
|
||||
@using MP.Land.Data
|
||||
@using Microsoft.Extensions.Configuration
|
||||
|
||||
@inject MessageService AppMService
|
||||
@inject IConfiguration Configuration
|
||||
|
||||
<div class="row mx-2">
|
||||
<div class="col-12 col-lg-8 offset-lg-2">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<div class="row">
|
||||
<div class="col-4"></div>
|
||||
<div class="col-4">
|
||||
<h2>@Titolo</h2>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="badge badge-pill badge-dark px-4 py-2">
|
||||
<div class="px-1">
|
||||
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div id="accordion">
|
||||
<div class="card">
|
||||
<div class="card-header text-uppercase btn btn-block" id="heading04">
|
||||
<h5 class="mb-0">
|
||||
<asp:LinkButton runat="server" ID="lbtGrp01" class="collapsed" data-toggle="collapse" data-target="#collapse04" aria-expanded="true" aria-controls="collapse04">
|
||||
Global data
|
||||
</asp:LinkButton>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapse04" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">Environment</h5>
|
||||
</div>
|
||||
<p class="mb-1">@Environment</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">Main DB Conf</h5>
|
||||
</div>
|
||||
<p class="mb-1">@DbNameExample</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">.net framework</h5>
|
||||
</div>
|
||||
<p class="mb-1">@currHwSwInfo.runtimeImg</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">Main Assembly</h5>
|
||||
</div>
|
||||
<p class="mb-1">@currHwSwInfo.mainAssembly</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header text-uppercase btn btn-block" id="heading01">
|
||||
<h5 class="mb-0">
|
||||
<asp:LinkButton runat="server" ID="LinkButton1" class="collapsed" data-toggle="collapse" data-target="#collapse01" aria-expanded="true" aria-controls="collapse01">
|
||||
Stats (Server, IIS, APP)
|
||||
</asp:LinkButton>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapse01" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">Server Stats</h5>
|
||||
</div>
|
||||
<p class="mb-1">
|
||||
<pre>@currHwSwInfo.ServerStats</pre>
|
||||
</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">IIS Stats</h5>
|
||||
</div>
|
||||
<p class="mb-1">
|
||||
<pre>@currHwSwInfo.IISStats</pre>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header text-uppercase btn btn-block" id="heading05">
|
||||
<h5 class="mb-0">
|
||||
<asp:LinkButton runat="server" ID="lbtGrp02" class="collapsed" data-toggle="collapse" data-target="#collapse05" aria-expanded="false" aria-controls="collapse05">
|
||||
Other Libraries
|
||||
</asp:LinkButton>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapse05" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">Elenco librerie</h5>
|
||||
<span>@currHwSwInfo.numLibraries</span>
|
||||
</div>
|
||||
<p class="mb-1">
|
||||
<pre style="width: 100%; white-space: pre-wrap;">@currHwSwInfo.librariesVers</pre>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
|
||||
// imposto i vari dati da mostrare a video senza indicare come bypassare...
|
||||
protected string Titolo = "MAPO System Info";
|
||||
protected string Messaggio = "HW & SW details";
|
||||
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
|
||||
protected string DbNameExample
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = Configuration["ConnectionStrings:DefaultConnection"];
|
||||
if (answ.IndexOf(";User ID=") > 0)
|
||||
{
|
||||
answ = answ.Substring(0, answ.IndexOf(";User ID="));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected string Environment
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = Configuration["Environment"];
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
//string connStr = memLayer.ML.confReadString("DbConfConnectionString");
|
||||
//currHwSwInfo = currHwSwInfo;
|
||||
}
|
||||
@@ -25,4 +25,7 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer p-1">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -9,11 +9,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Land.Pages
|
||||
{
|
||||
public partial class UserQr
|
||||
public partial class UserQr : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private List<AnagraficaOperatori> ListRecords;
|
||||
private List<AnagraficaOperatori> SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -29,8 +30,32 @@ namespace MP.Land.Pages
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppMService.SelFilter.PageNum;
|
||||
}
|
||||
set
|
||||
{
|
||||
AppMService.SelFilter.PageNum = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppMService.SelFilter.PageSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
AppMService.SelFilter.PageSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Properties
|
||||
@@ -53,27 +78,43 @@ namespace MP.Land.Pages
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
#region Private Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
private async void OnSeachUpdated()
|
||||
{
|
||||
AppMService.ShowSearch = false;
|
||||
AppMService.PageName = "User Card";
|
||||
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
||||
//AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
//AppMService.EA_FilterUpdated += OnFilterUpdated;
|
||||
ListRecords = null;
|
||||
currPage = 1;
|
||||
await Task.Delay(1);
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadAllData();
|
||||
AppMService.ShowSearch = true;
|
||||
AppMService.PageName = "User Card";
|
||||
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
||||
await ReloadData();
|
||||
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
}
|
||||
|
||||
protected async Task ReloadAllData()
|
||||
protected async Task PagerReloadNum(int newNum)
|
||||
{
|
||||
isLoading = true;
|
||||
//MacList = await DataService.MacchineGetAll();
|
||||
ListRecords = null;
|
||||
numRecord = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task PagerReloadPage(int newNum)
|
||||
{
|
||||
ListRecords = null;
|
||||
currPage = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task ReloadData()
|
||||
@@ -81,9 +122,12 @@ namespace MP.Land.Pages
|
||||
isLoading = true;
|
||||
// importante altrimenti NON mostra update UI
|
||||
await Task.Delay(1);
|
||||
ListRecords = await DataService.AnagOperList();
|
||||
totalCount = ListRecords.Count();
|
||||
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
|
||||
totalCount = SearchRecords.Count();
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
@@ -97,5 +141,14 @@ namespace MP.Land.Pages
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
<link href="MP.Land.styles.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<component type="typeof(App)" render-mode="ServerPrerendered" />
|
||||
<component type="typeof(App)" render-mode="Server" />
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
@@ -46,18 +46,24 @@
|
||||
|
||||
<script type="text/javascript" src="~/lib/qrcode.js"></script>
|
||||
<script type="text/javascript">
|
||||
function clearContent(elementID) {
|
||||
console.log(elementID);
|
||||
document.getElementById(elementID).innerHTML = "";
|
||||
}
|
||||
// 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) {
|
||||
console.log(elementName);
|
||||
try {
|
||||
if (elementName != "" && rawData != "") {
|
||||
//qrcode = new QRCode(document.getElementById(elementName));
|
||||
new QRCode(document.getElementById(elementName),
|
||||
qrcode = new QRCode(document.getElementById(elementName),
|
||||
{
|
||||
text: rawData,
|
||||
width: 300,
|
||||
height: 300
|
||||
width: 200,
|
||||
height: 200
|
||||
});
|
||||
//qrcode = new QRCode(document.getElementById(elementName));
|
||||
//qrcode.clear();
|
||||
//qrcode.makeCode(rawData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 1.1.2109.2020</h4>
|
||||
<h4>Versione: 1.1.2109.2117</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2109.2020
|
||||
1.1.2109.2117
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2109.2020</version>
|
||||
<version>1.1.2109.2117</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
<span class="fas fa-download fa-2x pr-2" aria-hidden="true"></span> Update Manager
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="ConfImport">
|
||||
<span class="fas fa-file-import fa-2x pr-2" aria-hidden="true"></span> Config Import
|
||||
</NavLink>
|
||||
</li>
|
||||
@*<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="ConfImport">
|
||||
<span class="fas fa-file-import fa-2x pr-2" aria-hidden="true"></span> Config Import
|
||||
</NavLink>
|
||||
</li>*@
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="About">
|
||||
<span class="fas fa-info-circle fa-2x pr-2" aria-hidden="true"></span> About
|
||||
|
||||
Reference in New Issue
Block a user