COmpletata gestione LAND:
- gestione backup conf app OK - gestione tab salvate come json OK - gestione IOB OK - gestione zip + pwd OK - gestione upload OK (debug su DEV, poi in prod)
This commit is contained in:
@@ -28,6 +28,118 @@ namespace MP.AppAuth.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagCauSca
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagraficaCausaliScarto> AnagCauSca()
|
||||
{
|
||||
List<AnagraficaCausaliScarto> dbResult = new List<AnagraficaCausaliScarto>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagCauSca
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagClassiTempo
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagClassiTempo> AnagClassiTempo()
|
||||
{
|
||||
List<AnagClassiTempo> dbResult = new List<AnagClassiTempo>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagClassiTempo
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagraficaEventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagraficaEventi> AnagEventi()
|
||||
{
|
||||
List<AnagraficaEventi> dbResult = new List<AnagraficaEventi>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagEventi
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagraficaIngressi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagraficaIngressi> AnagIngressi()
|
||||
{
|
||||
List<AnagraficaIngressi> dbResult = new List<AnagraficaIngressi>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagIngressi
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagMicroStati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagraficaMicroStati> AnagMicroStati()
|
||||
{
|
||||
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagMicroStati
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagraficaStati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagraficaStati> AnagStati()
|
||||
{
|
||||
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagStati
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x ListValues
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ListValues> ListValues()
|
||||
{
|
||||
List<ListValues> dbResult = new List<ListValues>();
|
||||
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetListValue
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete Record AnagKeyValue
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.AppAuth.Models
|
||||
{
|
||||
[Table("AnagraficaEventi")]
|
||||
public partial class AnagraficaEventi
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Nome { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string TabAzione { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Azione { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string KeyEvento { get; set; } = "";
|
||||
|
||||
public bool EventoTablet { get; set; } = false;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string NoteEvento { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string CssClass { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Icon { get; set; } = "";
|
||||
|
||||
public Int16 OrdEventi { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.AppAuth.Models
|
||||
{
|
||||
[Table("AnagraficaStati")]
|
||||
public partial class AnagraficaStati
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
public int IdxStato { get; set; } = 0;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Descrizione { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Semaforo { get; set; } = "";
|
||||
|
||||
public int Priorita { get; set; } = 0;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string ClasseTempo { get; set; } = "";
|
||||
|
||||
public bool ShowArticolo { get; set; } = false;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string KeyStato { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string NoteStato { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.AppAuth.Models
|
||||
{
|
||||
public partial class ListValue
|
||||
[Table("ListValues")]
|
||||
public partial class ListValues
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -54,23 +54,25 @@ namespace MP.AppAuth
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<AnagArticoli> AnagArticolis { get; set; }
|
||||
public virtual DbSet<AnagClassiTempo> AnagClassiTempos { get; set; }
|
||||
public virtual DbSet<AnagraficaCausaliScarto> AnagraficaCausaliScartos { get; set; }
|
||||
public virtual DbSet<AnagraficaFlussi> AnagraficaFlussis { get; set; }
|
||||
public virtual DbSet<AnagraficaIngressi> AnagraficaIngressis { get; set; }
|
||||
public virtual DbSet<AnagraficaMicroStati> AnagraficaMicroStatis { get; set; }
|
||||
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatoris { get; set; }
|
||||
public virtual DbSet<AnagArticoli> DbSetAnagArticoli { get; set; }
|
||||
public virtual DbSet<AnagraficaEventi> DbSetAnagEventi { get; set; }
|
||||
public virtual DbSet<AnagClassiTempo> DbSetAnagClassiTempo { get; set; }
|
||||
public virtual DbSet<AnagraficaCausaliScarto> DbSetAnagCauSca { get; set; }
|
||||
public virtual DbSet<AnagraficaFlussi> DbSetAnagFlussi { get; set; }
|
||||
public virtual DbSet<AnagraficaIngressi> DbSetAnagIngressi { get; set; }
|
||||
public virtual DbSet<AnagraficaMicroStati> DbSetAnagMicroStati { get; set; }
|
||||
public virtual DbSet<AnagraficaStati> DbSetAnagStati { get; set; }
|
||||
public virtual DbSet<AnagraficaOperatori> DbSetAnagOperatori { get; set; }
|
||||
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
|
||||
public virtual DbSet<DatiMacchine> DatiMacchines { get; set; }
|
||||
public virtual DbSet<DatiMacchine> DbSetDatiMacchine { get; set; }
|
||||
public virtual DbSet<AnagKeyValueModel> DbSetAnagKeyValues { get; set; }
|
||||
public virtual DbSet<FamigliaTipoIngressi> FamigliaTipoIngressis { get; set; }
|
||||
public virtual DbSet<FamiglieMacchine> FamiglieMacchines { get; set; }
|
||||
public virtual DbSet<KeepAlive> KeepAlives { get; set; }
|
||||
public virtual DbSet<LinkMenuJqm> LinkMenuJqms { get; set; }
|
||||
public virtual DbSet<ListValue> ListValues { get; set; }
|
||||
public virtual DbSet<Macchine> Macchines { get; set; }
|
||||
public virtual DbSet<UpdMan> UpdMan { get; set; }
|
||||
public virtual DbSet<FamigliaTipoIngressi> DbSetFamTipoIngressi { get; set; }
|
||||
public virtual DbSet<FamiglieMacchine> DbSetFamMacchine { get; set; }
|
||||
public virtual DbSet<KeepAlive> DbSetKeepAlive { get; set; }
|
||||
public virtual DbSet<LinkMenuJqm> DbSetLinkMenuJqm { get; set; }
|
||||
public virtual DbSet<ListValues> DbSetListValue { get; set; }
|
||||
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
||||
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
|
||||
public virtual DbSet<VocabolarioModel> DbSetVocabolario { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
@@ -401,7 +403,7 @@ namespace MP.AppAuth
|
||||
entity.Property(e => e.TipoLink).HasMaxLength(50);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ListValue>(entity =>
|
||||
modelBuilder.Entity<ListValues>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.TableName, e.FieldName, e.Value });
|
||||
|
||||
@@ -457,7 +459,7 @@ namespace MP.AppAuth
|
||||
entity.HasKey(e => e.AppName)
|
||||
.HasName("PK_UpdateMan");
|
||||
|
||||
entity.ToTable("UpdMan");
|
||||
entity.ToTable("DbSetUpdMan");
|
||||
|
||||
entity.Property(e => e.AppName).HasMaxLength(50);
|
||||
|
||||
|
||||
@@ -66,6 +66,106 @@ namespace MP.Land.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Lista Causali Scarto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaCausaliScarto>> AnagCauSca()
|
||||
{
|
||||
List<AnagraficaCausaliScarto> dbResult = new List<AnagraficaCausaliScarto>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagCauSca();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagCauSca: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista AnagClassiTempo
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagClassiTempo>> AnagClassiTempo()
|
||||
{
|
||||
List<AnagClassiTempo> dbResult = new List<AnagClassiTempo>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagClassiTempo();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagClassiTempo: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista AnagEventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaEventi>> AnagEventi()
|
||||
{
|
||||
List<AnagraficaEventi> dbResult = new List<AnagraficaEventi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagEventi();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagEventi: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista AnagEventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaIngressi>> AnagIngressi()
|
||||
{
|
||||
List<AnagraficaIngressi> dbResult = new List<AnagraficaIngressi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagIngressi();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagIngressi: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista AnagEventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaMicroStati>> AnagMicroStati()
|
||||
{
|
||||
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagMicroStati();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagMicroStati: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista AnagStati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaStati>> AnagStati()
|
||||
{
|
||||
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagStati();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagStati: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagraficaGruppi>> AnagGruppiAll()
|
||||
{
|
||||
List<AnagraficaGruppi> dbResult = new List<AnagraficaGruppi>();
|
||||
@@ -78,6 +178,22 @@ namespace MP.Land.Data
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ListValues
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ListValues>> ListValues()
|
||||
{
|
||||
List<ListValues> dbResult = new List<ListValues>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.ListValues();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per ListValues: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<AnagraficaGruppi>> AnagGruppiFilt(string codTipo)
|
||||
{
|
||||
List<AnagraficaGruppi> dbResult = new List<AnagraficaGruppi>();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.16.2410.1815</Version>
|
||||
<Version>6.16.2410.1818</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.AppAuth;
|
||||
using MP.Land.Data;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -55,29 +58,21 @@ namespace MP.Land.Pages
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected int numDone = 0;
|
||||
|
||||
protected int numTot = 0;
|
||||
|
||||
protected int totalCount = 0;
|
||||
|
||||
protected long TotalMb = 0;
|
||||
|
||||
protected UpdateMan updateManAuth = new UpdateMan("SWDownloader", "viaD@nte16");
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected AppAuthService AppDService { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected MessageService AppMService { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration Configuration { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected AppAuthService DataService { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected LicenseService LicServ { get; set; } = null!;
|
||||
|
||||
@@ -116,11 +111,11 @@ namespace MP.Land.Pages
|
||||
// init progress...
|
||||
showProgress = true;
|
||||
showUpdate = true;
|
||||
outMessages = $"Iniziato download per {numTot} packages";
|
||||
outMessages = $"Iniziato download per {numSteps} packages";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
percLoading = 0;
|
||||
TotalMb = 0;
|
||||
numDone = 0;
|
||||
numApp = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
// ciclo su tutti quelli con licenza valida...
|
||||
@@ -136,7 +131,6 @@ namespace MP.Land.Pages
|
||||
authList.Add(item);
|
||||
}
|
||||
}
|
||||
numTot = authList.Count;
|
||||
foreach (var item in authList)
|
||||
{
|
||||
ScaricaSingolo(item);
|
||||
@@ -144,7 +138,7 @@ namespace MP.Land.Pages
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
outMessages = $"Effettuato download di {numDone} update | {CalcSize(TotalMb)} in {ts.TotalSeconds:N2} s";
|
||||
outMessages = $"Effettuato download di {numApp} update | {CalcSize(TotalMb)} in {ts.TotalSeconds:N2} s";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await Task.Delay(1000);
|
||||
showProgress = false;
|
||||
@@ -170,7 +164,7 @@ namespace MP.Land.Pages
|
||||
{
|
||||
// importante altrimenti NON mostra update UI
|
||||
await Task.Delay(1);
|
||||
ListRecords = await DataService.UpdManList();
|
||||
ListRecords = await AppDService.UpdManList();
|
||||
totalCount = ListRecords.Count();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
@@ -183,18 +177,18 @@ namespace MP.Land.Pages
|
||||
// init progress...
|
||||
showProgress = true;
|
||||
showUpdate = true;
|
||||
outMessages = $"Inizio preparazione per upload configurazioni di {numTot} packages";
|
||||
outMessages = $"Inizio preparazione per upload configurazioni di {numSteps} packages";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
percLoading = 0;
|
||||
TotalMb = 0;
|
||||
numDone = 0;
|
||||
int numIOB = 0;
|
||||
numApp = 0;
|
||||
numIOB = 0;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
// ciclo su tutti quelli con licenza valida...
|
||||
List<AppAuth.Models.UpdMan> rawList = ListRecords
|
||||
.Where(x => !string.IsNullOrEmpty(x.LicenseKey)).ToList();
|
||||
List<AppAuth.Models.UpdMan> authList = new List<AppAuth.Models.UpdMan>();
|
||||
authList = new List<AppAuth.Models.UpdMan>();
|
||||
|
||||
// ciclo SOLO tra quelli davvero autorizzati...
|
||||
foreach (var item in rawList)
|
||||
@@ -204,21 +198,19 @@ namespace MP.Land.Pages
|
||||
authList.Add(item);
|
||||
}
|
||||
}
|
||||
// numero app + IOB + DB + ZIP
|
||||
numTot = authList.Count + 3;
|
||||
|
||||
// recupero conf files
|
||||
foreach (var item in authList)
|
||||
{
|
||||
// cerco i file di conf e li copio
|
||||
RecuperaConf(item);
|
||||
await Task.Delay(10);
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
// recupero i file IOB
|
||||
RecuperaIobConf();
|
||||
// salvo Tab Db come json
|
||||
SaveDbConfAsJson();
|
||||
await SaveDbConfAsJson();
|
||||
|
||||
// ora creo il file zip
|
||||
PrepareZip();
|
||||
@@ -228,26 +220,66 @@ namespace MP.Land.Pages
|
||||
// concludo!
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
outMessages = $"Effettuato Upload backup configurazioni per {numDone} app + {numIOB} IOB | {CalcSize(TotalMb)} | {ts.TotalSeconds:N2} s";
|
||||
outMessages = $"Effettuato Upload backup configurazioni | NumApp: {numApp} | NumTab: {numTab} | NumIob: {numIOB} | {CalcSize(TotalMb)} | {ts.TotalSeconds:N2} s";
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await Task.Delay(1000);
|
||||
showProgress = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
protected long WriteTabJson<T>(string filePath, List<T> dataList)
|
||||
{
|
||||
long size = 0;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(dataList, Formatting.Indented);
|
||||
File.WriteAllText(filePath, rawData);
|
||||
FileInfo fInfo = new FileInfo(filePath);
|
||||
size = fInfo.Length;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante WriteTabJson{Environment.NewLine}{exc}");
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe logger
|
||||
/// </summary>
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private List<MP.AppAuth.Models.UpdMan> ListRecords;
|
||||
private int numApp = 0;
|
||||
private int numIOB = 0;
|
||||
private int numTab = 0;
|
||||
private int totalCount = 0;
|
||||
|
||||
private long TotalMb = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
#region Private Properties
|
||||
|
||||
#if DEBUG
|
||||
private DirectoryInfo AppDir => new DirectoryInfo(Path.Combine("\\\\iis01.egalware.com", "c$\\inetpub\\wwwroot\\MP\\LAND"));
|
||||
|
||||
private List<AppAuth.Models.UpdMan> authList { get; set; } = new List<AppAuth.Models.UpdMan>();
|
||||
|
||||
/// <summary>
|
||||
/// Numero complessivo files processati
|
||||
/// </summary>
|
||||
private int numDone => numApp + numTab + numIOB;
|
||||
|
||||
/// <summary>
|
||||
/// Numero Step da eseguire... numapp + (9 * DB) + IOB
|
||||
/// </summary>
|
||||
private int numSteps => authList.Count + 9 + numIOB;
|
||||
|
||||
#if DEBUG
|
||||
#else
|
||||
private DirectoryInfo AppDir => new DirectoryInfo(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
|
||||
#endif
|
||||
@@ -317,10 +349,10 @@ namespace MP.Land.Pages
|
||||
file.CopyTo(fileDestPath, true);
|
||||
size += file.Length;
|
||||
}
|
||||
numDone++;
|
||||
percLoading = 100 * numDone / numTot;
|
||||
numApp++;
|
||||
percLoading = 100 * numDone / numSteps;
|
||||
TotalMb += size;
|
||||
outMessages = $"Configurazioni preparate: {numDone}/{numTot} | {CalcSize(TotalMb)}";
|
||||
outMessages = $"File preparati: {numDone}/{numSteps} | {CalcSize(TotalMb)}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,8 +362,9 @@ namespace MP.Land.Pages
|
||||
/// </summary>
|
||||
private void RecuperaIobConf()
|
||||
{
|
||||
numIOB = 0;
|
||||
long size = 0;
|
||||
|
||||
// calcolo path vari
|
||||
string dstDir = Path.Combine(AppDir.FullName, "temp", "orig", "IOB");
|
||||
if (!Directory.Exists(dstDir))
|
||||
{
|
||||
@@ -350,11 +383,12 @@ namespace MP.Land.Pages
|
||||
string fileDestPath = Path.Combine(dstDir, file.Name);
|
||||
file.CopyTo(fileDestPath, true);
|
||||
size += file.Length;
|
||||
numIOB++;
|
||||
}
|
||||
numDone++;
|
||||
percLoading = 100 * numDone / numTot;
|
||||
numApp++;
|
||||
percLoading = 100 * numDone / numSteps;
|
||||
TotalMb += size;
|
||||
outMessages = $"Configurazioni preparate: {numDone}/{numTot} | {CalcSize(TotalMb)}";
|
||||
outMessages = $"File preparati: {numDone}/{numSteps} | {CalcSize(TotalMb)}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +396,7 @@ namespace MP.Land.Pages
|
||||
/// Salvataggio tabelle di configurazione specifica come tracciati json
|
||||
/// </summary>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void SaveDbConfAsJson()
|
||||
private async Task SaveDbConfAsJson()
|
||||
{
|
||||
long size = 0;
|
||||
|
||||
@@ -371,30 +405,55 @@ namespace MP.Land.Pages
|
||||
{
|
||||
Directory.CreateDirectory(dstDir);
|
||||
}
|
||||
// va fatta 1:1 per ogni tabella
|
||||
|
||||
#if false
|
||||
string srcIobDir = Path.Combine(AppDir.Parent.FullName, "IO", "fileUpload");
|
||||
// recupero elenco files tipo appsettings*.json
|
||||
if (Directory.Exists(srcIobDir))
|
||||
{
|
||||
var dirInfo = new DirectoryInfo(srcIobDir);
|
||||
// recupero files CORE
|
||||
List<FileInfo> fileList = dirInfo.GetFiles().ToList();
|
||||
// procedo!
|
||||
foreach (var file in fileList)
|
||||
{
|
||||
string fileDestPath = Path.Combine(dstDir, file.Name);
|
||||
file.CopyTo(fileDestPath, true);
|
||||
size += file.Length;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// AnagKeyVal
|
||||
var anagKeyVal = await AppDService.AnagKeyValList();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagKeyVal.json"), anagKeyVal);
|
||||
numTab++;
|
||||
|
||||
numDone++;
|
||||
percLoading = 100 * numDone / numTot;
|
||||
// AnagCausaliScarto
|
||||
var anagCS = await AppDService.AnagCauSca();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagCausaliScarto.json"), anagCS);
|
||||
numTab++;
|
||||
|
||||
// AnagClassiTempo
|
||||
var anagCT = await AppDService.AnagClassiTempo();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagClassiTempo.json"), anagCT);
|
||||
numTab++;
|
||||
|
||||
// AnagEventi
|
||||
var anagEvt = await AppDService.AnagEventi();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagEventi.json"), anagEvt);
|
||||
numTab++;
|
||||
|
||||
// AnagIngressi
|
||||
var anagIn = await AppDService.AnagIngressi();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagIngressi.json"), anagIn);
|
||||
numTab++;
|
||||
|
||||
// AnagMicroStati
|
||||
var anagMSt = await AppDService.AnagIngressi();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagMicroStati.json"), anagMSt);
|
||||
numTab++;
|
||||
|
||||
// AnagStati
|
||||
var anagSta = await AppDService.AnagStati();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "AnagStati.json"), anagSta);
|
||||
numTab++;
|
||||
|
||||
// Config
|
||||
var confData = await AppDService.ConfigList();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "Config.json"), confData);
|
||||
numTab++;
|
||||
|
||||
// ListValues
|
||||
var listVal = await AppDService.ListValues();
|
||||
size += WriteTabJson(Path.Combine(dstDir, "ListValues.json"), listVal);
|
||||
numTab++;
|
||||
|
||||
percLoading = 100 * numDone / numSteps;
|
||||
TotalMb += size;
|
||||
outMessages = $"Configurazioni preparate: {numDone}/{numTot} | {CalcSize(TotalMb)}";
|
||||
outMessages = $"File preparati: {numDone}/{numSteps} | {CalcSize(TotalMb)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -412,10 +471,10 @@ namespace MP.Land.Pages
|
||||
{
|
||||
size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
|
||||
}
|
||||
numDone++;
|
||||
percLoading = 100 * numDone / numTot;
|
||||
numApp++;
|
||||
percLoading = 100 * numApp / numSteps;
|
||||
TotalMb += size;
|
||||
outMessages = $"Scaricati {numDone}/{numTot} packages | {CalcSize(TotalMb)}";
|
||||
outMessages = $"Scaricati {numApp}/{numSteps} packages | {CalcSize(TotalMb)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo Tablet MAPO - DotNet6</i>
|
||||
<h4>Versione: 6.16.2410.1815</h4>
|
||||
<h4>Versione: 6.16.2410.1818</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2410.1815
|
||||
6.16.2410.1818
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2410.1815</version>
|
||||
<version>6.16.2410.1818</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user