diff --git a/MP-PROG.sln b/MP-PROG.sln index a75cf2d1..461319fe 100644 --- a/MP-PROG.sln +++ b/MP-PROG.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31229.75 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35327.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Prog", "MP.Prog\MP.Prog.csproj", "{3223DDE4-564E-4D58-8A94-E368B9778C67}" EndProject diff --git a/MP.Prog/Components/ArchiveEdit.razor b/MP.Prog/Components/ArchiveEdit.razor new file mode 100644 index 00000000..86e29700 --- /dev/null +++ b/MP.Prog/Components/ArchiveEdit.razor @@ -0,0 +1,36 @@ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
\ No newline at end of file diff --git a/MP.Prog/Components/ArchiveEdit.razor.cs b/MP.Prog/Components/ArchiveEdit.razor.cs new file mode 100644 index 00000000..acda4a75 --- /dev/null +++ b/MP.Prog/Components/ArchiveEdit.razor.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Components; +using MP.FileData.DatabaseModels; +using System.Threading.Tasks; + +namespace MP.Prog.Components +{ + public partial class ArchiveEdit + { + + [Parameter] + public MacchinaModel CurrRec { get; set; } + + + protected async void DoCancel() + { + await Task.Delay(1); + } + protected async void DoSave() + { + await Task.Delay(1); + } + + } +} \ No newline at end of file diff --git a/MP.Prog/Components/ArchiveStatus.razor b/MP.Prog/Components/ArchiveStatus.razor index 2a8f5230..5845088c 100644 --- a/MP.Prog/Components/ArchiveStatus.razor +++ b/MP.Prog/Components/ArchiveStatus.razor @@ -1,17 +1,29 @@ 
-
- -
-
- @if (showProgress) - { -
-
-
- } -
+ @if (SelRecord != null) + { + + } + else + { +
+ +
+
+ @if (showProgress) + { +
+
+
+ } +
+
+ +
+ }
@if (ListRecords == null) { @@ -49,48 +61,76 @@ - + - - - - + + + + + @foreach (var record in ListRecords) { - - - - - - - - - + @if (!string.IsNullOrEmpty(record.BasePath)) + { + + + + + + + + + + + } }
+ + Macchina PathTagsSenza TagModificatiTot FileTagsSenza TagModificatiTot File
- @if (!string.IsNullOrEmpty(record.BasePath)) - { - - } - - @record.Nome - -
@record.BasePath
-
- @record.TotalTags - - @record.NoTags - - @record.NumChanged - - - @record.TotFile - -
+ @if (SelRecord == null) + { + + } + else + { + + } + + @record.Nome + +
@record.BasePath
+
+ @record.TotalTags + + @record.NoTags + + @record.NumChanged + + + @record.TotFile + + + @if (SelRecord == null) + { + + } + else + { + + } +
diff --git a/MP.Prog/Components/ArchiveStatus.razor.cs b/MP.Prog/Components/ArchiveStatus.razor.cs index 45738a1a..8e08c289 100644 --- a/MP.Prog/Components/ArchiveStatus.razor.cs +++ b/MP.Prog/Components/ArchiveStatus.razor.cs @@ -1,4 +1,6 @@ using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Configuration; +using MP.FileData.DatabaseModels; using MP.FileData.DTO; using MP.Prog.Data; using NLog; @@ -25,7 +27,10 @@ namespace MP.Prog.Components #region Protected Properties [Inject] - protected FileArchDataService DataService { get; set; } + protected FileArchDataService FDService { get; set; } + + [Inject] + protected IConfiguration Configuration { get; set; } protected int percLoading { get; set; } = 0; protected bool showProgress { get; set; } = false; @@ -58,6 +63,31 @@ namespace MP.Prog.Components setupMessages = new List(); } + protected async Task SelEdit(string idxMacc) + { + // recupero macchina e mando a edit! + SelRecord = await FDService.MacchinaGetByKey(idxMacc); + } + + protected void ResetSel() + { + SelRecord = null; + } + + protected void AddNew() + { + DateTime adesso = DateTime.Now; + SelRecord = new MacchinaModel() + { + IdxMacchina = $"ID_{adesso:yyMMd_HHmmss}", + RuleName = "Rule05.json", + Nome = "Nuova Folder", + Descrizione = "Nuova folder", + BasePath = Configuration.GetValue("ServerConf:FolderBasePath"), + ImgUrl = "Steamware.png", + Note = "" + }; + } protected async Task ForceCheck(int maxHour) { setupMessages.Add("Inizio Analisi Archivio..."); @@ -89,15 +119,12 @@ namespace MP.Prog.Components //sw.Restart(); await Task.Delay(1); numChecks = 0; - ListRecords = await DataService.GetArchiveStatus(); + ListRecords = await FDService.GetArchiveStatus(); totalCount = ListRecords.Count; await Task.Delay(1); setupMessages = new List(); showProgress = false; percLoading = 0; - //sw.Stop(); - //var elapsTime = sw.Elapsed; - //Log.Trace($"ArchiveStatus | ReloadData | # rec: {ListRecords.Count} | {elapsTime.TotalMilliseconds}ms"); } #endregion Protected Methods @@ -106,6 +133,7 @@ namespace MP.Prog.Components private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); private List ListRecords; + private MacchinaModel? SelRecord { get; set; } = null; private int numChecks = 0; @@ -127,7 +155,7 @@ namespace MP.Prog.Components sw.Restart(); // recupero elenco macchine percLoading += 100 / numMacchine; - numChecks = await DataService.updateMachineArchive(idxMacchina, numDays, true, false); + numChecks = await FDService.updateMachineArchive(idxMacchina, numDays, true, false); await Task.Delay(1); setupMessages.Add($"{idxMacchina}: {numChecks} files"); await InvokeAsync(StateHasChanged); @@ -140,7 +168,7 @@ namespace MP.Prog.Components private async Task verificaTutte(int numDays) { // recupero elenco macchine - var listaMacchine = await DataService.MacchineGetAll(); + var listaMacchine = await FDService.MacchineGetAll(); int numMacchine = listaMacchine.Count(); foreach (var item in listaMacchine.Where(x => !string.IsNullOrEmpty(x.BasePath)).ToList()) { diff --git a/MP.Prog/Components/FileEditor.razor b/MP.Prog/Components/FileEditor.razor index bf4c6c06..1d7e286d 100644 --- a/MP.Prog/Components/FileEditor.razor +++ b/MP.Prog/Components/FileEditor.razor @@ -11,10 +11,10 @@ {
- +
- +
} @@ -23,7 +23,7 @@ {
- +
@@ -33,7 +33,7 @@
- +
diff --git a/MP.Prog/Conf/Rule05.json b/MP.Prog/Conf/Rule05.json new file mode 100644 index 00000000..11c042fe --- /dev/null +++ b/MP.Prog/Conf/Rule05.json @@ -0,0 +1,42 @@ +{ + "ExcludedTags": [ ], + "ExcludedFileExt": [ + ".bak", + ".bck" + ], + "FileNameExtReplace": { + }, + "MaxChar2Search": 0, + "Mode": 2, + "Name": "Tag da Tag2Collect", + "OutExcludeFileName": true, + "OutReplace": { + }, + "RegExPattern": "", + "RegExRepFileName": false, + "ReplaceCR": false, + "Tag2Collect": [ + "CNCTYPE=", + "VENDOR=", + "MODEL=", + "MPIP=", + "Customer=", + "HostOS=", + "HostName=", + "HostAddr=", + "IP=", + "AUTO_CHANGE_ODL=", + "AUTO_SNAPSHOT_DOSSIER=", + "\"CodApp\":", + "\"CodModulo\":", + "\"BaseAddr\":", + "\"BaseUrl\":", + "\"Host\":", + "\"Port\":", + "\"UseSSL\":", + "\"UseStartTls\":", + "\"QrJumpPath\":", + "\"Environment\":", + "\"appVers\":" + ] +} \ No newline at end of file diff --git a/MP.Prog/Data/FileArchDataService.cs b/MP.Prog/Data/FileArchDataService.cs index 4c0ac100..f6e5472c 100644 --- a/MP.Prog/Data/FileArchDataService.cs +++ b/MP.Prog/Data/FileArchDataService.cs @@ -90,6 +90,12 @@ namespace MP.Prog.Data return await Task.FromResult(dbResult); } + public async Task FlushRedisCache() + { + RedisValue pattern = new RedisValue($"{redisBaseAddr}:*"); + bool answ = await ExecFlushRedisPattern(pattern); + } + public async Task> GetArchiveStatus() { List dbResult = new List(); @@ -284,12 +290,18 @@ namespace MP.Prog.Data #region Protected Fields protected static string connStringBBM = ""; + protected static string connStringFatt = ""; #endregion Protected Fields #region Private Fields + /// + /// gestione key Redis + /// + private const string redisBaseAddr = "MP:PROG"; + private static IConfiguration _configuration; private static ILogger _logger; @@ -313,7 +325,6 @@ namespace MP.Prog.Data /// private IConnectionMultiplexer redisConn; - //ISubscriber sub = redis.GetSubscriber(); /// /// Oggetto DB redis da impiegare x chiamate R/W /// @@ -350,5 +361,36 @@ namespace MP.Prog.Data } #endregion Private Properties + + #region Private Methods + + /// + /// Esegue flush memoria redis dato pattern + /// + /// + /// + private async Task ExecFlushRedisPattern(RedisValue pattern) + { + bool answ = false; + var listEndpoints = redisConn.GetEndPoints(); + foreach (var endPoint in listEndpoints) + { + //var server = redisConnAdmin.GetServer(listEndpoints[0]); + var server = redisConn.GetServer(endPoint); + if (server != null) + { + var keyList = server.Keys(redisDb.Database, pattern); + foreach (var item in keyList) + { + await redisDb.KeyDeleteAsync(item); + } + answ = true; + } + } + + return answ; + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.Prog/MP.Prog.csproj b/MP.Prog/MP.Prog.csproj index b4b1a161..322d4bf8 100644 --- a/MP.Prog/MP.Prog.csproj +++ b/MP.Prog/MP.Prog.csproj @@ -3,7 +3,7 @@ net6.0 MP.Prog - 6.16.2409.0409 + 6.16.2410.2109 @@ -17,6 +17,8 @@ + + diff --git a/MP.Prog/Pages/Archive.razor.cs b/MP.Prog/Pages/Archive.razor.cs index f13d76d2..2fcf8f70 100644 --- a/MP.Prog/Pages/Archive.razor.cs +++ b/MP.Prog/Pages/Archive.razor.cs @@ -436,7 +436,7 @@ namespace MP.Prog.Pages // importante altrimenti NON mostra update UI await Task.Delay(1); totalCount = await DataService.FileCountFilt(AppMService.File_Filter); - //SearchRecords = await DataService.FileGetFilt(AppMService.File_Filter); + //SearchRecords = await FDService.FileGetFilt(AppMService.File_Filter); //// faccio paginazione SOLO NELLA DECINA attuale... (quindi non tutte le pagine ma solo subset) //ListRecords = SearchRecords.Skip(numRecord * (currPage % 10 - 1)).Take(numRecord).ToList(); diff --git a/MP.Prog/Pages/ForceReload.razor b/MP.Prog/Pages/ForceReload.razor new file mode 100644 index 00000000..504b69ff --- /dev/null +++ b/MP.Prog/Pages/ForceReload.razor @@ -0,0 +1,5 @@ +@page "/ForceReload" + + + + diff --git a/MP.Prog/Pages/ForceReload.razor.cs b/MP.Prog/Pages/ForceReload.razor.cs new file mode 100644 index 00000000..8080ccad --- /dev/null +++ b/MP.Prog/Pages/ForceReload.razor.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Components; +using MP.Prog.Data; +using System.Threading.Tasks; + +namespace MP.Prog.Pages +{ + public partial class ForceReload + { + #region Protected Properties + + [Inject] + protected FileArchDataService FDService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + await Task.Delay(10); + await FDService.FlushRedisCache(); + message = "Reset done, now redirect!"; + + await Task.Delay(100); + + // passo a pagina home + NavManager.NavigateTo("Home", true); + } + + #endregion Protected Methods + + #region Private Fields + + private string message = ""; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/MP.Prog/Pages/Index.razor b/MP.Prog/Pages/Index.razor index bb3e55ab..a2d9b822 100644 --- a/MP.Prog/Pages/Index.razor +++ b/MP.Prog/Pages/Index.razor @@ -1,4 +1,5 @@ @page "/" +@page "/Home" @using MP.Prog.Data @inject MessageService AppMService diff --git a/MP.Prog/Pages/Setup.razor b/MP.Prog/Pages/Setup.razor index 6ae5a7a0..1271ac63 100644 --- a/MP.Prog/Pages/Setup.razor +++ b/MP.Prog/Pages/Setup.razor @@ -11,6 +11,6 @@

Setup

- +
\ No newline at end of file diff --git a/MP.Prog/Pages/_Host.cshtml b/MP.Prog/Pages/_Host.cshtml index 461883e7..8f20e6cb 100644 --- a/MP.Prog/Pages/_Host.cshtml +++ b/MP.Prog/Pages/_Host.cshtml @@ -16,11 +16,10 @@ MP.Prog - - - + + @@ -37,8 +36,6 @@ - - diff --git a/MP.Prog/Resources/ChangeLog.html b/MP.Prog/Resources/ChangeLog.html index 5883b33b..01be5e3f 100644 --- a/MP.Prog/Resources/ChangeLog.html +++ b/MP.Prog/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

Versione: 6.16.2409.0409

+

Versione: 6.16.2410.2109


Note di rilascio: