diff --git a/MP.Land/Components/ArchiveStatus.razor b/MP.Land/Components/ArchiveStatus.razor deleted file mode 100644 index 2a8f5230..00000000 --- a/MP.Land/Components/ArchiveStatus.razor +++ /dev/null @@ -1,99 +0,0 @@ -
-
- -
-
- @if (showProgress) - { -
-
-
- } -
-
- @if (ListRecords == null) - { -
-
- @if (showProgress) - { -
-
- @if (setupMessages.Count > 0) - { -
    - @foreach (var item in setupMessages) - { -
  • @item
  • - } -
- } -
-
- } -
-
- -
-
- } - else if (totalCount == 0) - { -
Nessun record trovato
- } - else - { - - - - - - - - - - - - - - - @foreach (var record in ListRecords) - { - - - - - - - - - - } - -
MacchinaPathTagsSenza TagModificatiTot File
- @if (!string.IsNullOrEmpty(record.BasePath)) - { - - } - - @record.Nome - -
@record.BasePath
-
- @record.TotalTags - - @record.NoTags - - @record.NumChanged - - - @record.TotFile - -
- } -
-
\ No newline at end of file diff --git a/MP.Land/Components/ArchiveStatus.razor.cs b/MP.Land/Components/ArchiveStatus.razor.cs deleted file mode 100644 index c3df7a6e..00000000 --- a/MP.Land/Components/ArchiveStatus.razor.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Microsoft.AspNetCore.Components; -using MP.FileData.DTO; -using MP.Land.Data; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MP.Land.Components -{ - public partial class ArchiveStatus - { - #region Private Fields - - private List ListRecords; - - private int numChecks = 0; - - private int totalCount = 0; - - #endregion Private Fields - - #region Private Properties - - private List setupMessages { get; set; } = new List(); - - #endregion Private Properties - - #region Protected Properties - - [Inject] - protected FileArchDataService DataService { get; set; } - - protected int percLoading { get; set; } = 0; - protected bool showProgress { get; set; } = false; - - #endregion Protected Properties - - #region Private Methods - - private async Task verificaSingola(string idxMacchina, int numDays, int numMacchine) - { - // recupero elenco macchine - percLoading += 100 / numMacchine; - numChecks = await DataService.updateMachineArchive(idxMacchina, numDays, true, false); - await Task.Delay(1); - setupMessages.Add($"{idxMacchina}: {numChecks} files"); - StateHasChanged(); - await Task.Delay(1); - } - - private async Task verificaTutte(int numDays) - { - // recupero elenco macchine - var listaMacchine = await DataService.MacchineGetAll(); - int numMacchine = listaMacchine.Count(); - foreach (var item in listaMacchine.Where(x => !string.IsNullOrEmpty(x.BasePath)).ToList()) - { - await verificaSingola(item.IdxMacchina, numDays, numMacchine); - } - } - - #endregion Private Methods - - #region Protected Methods - - protected async Task ArchiveCheck(int maxHour) - { - showProgress = true; - percLoading = 0; - await verificaTutte(maxHour); - - setupMessages.Add($"Effettuata verifica e rilettura di {numChecks} files!"); - await ReloadData(); - } - - protected async Task ArchiveSingleCheck(string idxMacchina, int maxHour) - { - showProgress = true; - percLoading = 0; - await verificaSingola(idxMacchina, maxHour, 2); - - setupMessages.Add($"Effettuata verifica e rilettura di {numChecks} files!"); - await ReloadData(); - } - - protected async Task ClearMessage() - { - await Task.Delay(10); - setupMessages = new List(); - } - - protected async Task ForceCheck(int maxHour) - { - setupMessages.Add("Inizio Analisi Archivio..."); - ListRecords = null; - await Task.Delay(1); - await ArchiveCheck(maxHour); - await ClearMessage(); - await ReloadData(); - } - - protected async Task ForceCheckMacchina(string idxMacchina) - { - setupMessages.Add("Inizio Analisi Archivio..."); - ListRecords = null; - await Task.Delay(1); - await ArchiveSingleCheck(idxMacchina, 0); - await ClearMessage(); - await ReloadData(); - } - - protected override async Task OnInitializedAsync() - { - ListRecords = null; - await ReloadData(); - } - - protected async Task ReloadData() - { - await Task.Delay(1); - numChecks = 0; - ListRecords = await DataService.GetArchiveStatus(); - totalCount = ListRecords.Count; - await Task.Delay(1); - setupMessages = new List(); - showProgress = false; - percLoading = 0; - } - - #endregion Protected Methods - } -} \ No newline at end of file diff --git a/MP.Land/Components/CodArtSelector.razor b/MP.Land/Components/CodArtSelector.razor deleted file mode 100644 index f76926fc..00000000 --- a/MP.Land/Components/CodArtSelector.razor +++ /dev/null @@ -1,110 +0,0 @@ -@using MP.FileData.DatabaseModels -@using MP.Prog.Data - -@inject FileArchDataService DataService -@inject MessageService AppMService - -@if (ArtList == null) -{ - -} -else -{ -
-
- - - -
- - -
- -
-
-} - -@code { - - [Parameter] - public EventCallback searchUpdated { get; set; } - [Parameter] - public string SelCodArt - { - get - { - string answ = ""; - if (AppMService.File_Filter != null) - { - answ = AppMService.File_Filter.CodArticolo; - } - return answ; - } - set - { - if (!AppMService.File_Filter.CodArticolo.Equals(value)) - { - AppMService.File_Filter.CodArticolo = value; - } - reportChange(); - } - } - - private void reportChange() - { - searchUpdated.InvokeAsync(SelCodArt); - } - - protected string _SearchArt; - protected string defCodArt = ""; - protected List ArtList; - - protected string SearchArt - { - get - { - return _SearchArt; - } - set - { - _SearchArt = value; - // se son > 3 char... debounce... - if (string.IsNullOrEmpty(value)) - { - _SearchArt = defCodArt; - } - if (value.Length >= defCodArt.Length) - { - var pUpd = Task.Run(async () => - { - ArtList = await DataService.ArticoliGetFilt(SearchArt); - }); - pUpd.Wait(); - } - } - } - protected override async Task OnInitializedAsync() - { - await ReloadAllData(); - _SearchArt = defCodArt; - } - - protected async Task ReloadAllData() - { - SelCodArt = defCodArt; - ArtList = await DataService.ArticoliGetFilt(SearchArt); - } - - protected void ResetSearchArt() - { - SearchArt = defCodArt; - } -} \ No newline at end of file diff --git a/MP.Land/Components/FileEditor.razor b/MP.Land/Components/FileEditor.razor deleted file mode 100644 index 6da44a7b..00000000 --- a/MP.Land/Components/FileEditor.razor +++ /dev/null @@ -1,31 +0,0 @@ -
-
-
-
-
Dettaglio modifiche
-
-
- @if (_currItem.DiskStatus != FileData.FileState.Ok) - { -
-
- -
-
- -
-
- } -
-
- @numDiff -
-
- -
-
-
-
- -
-
\ No newline at end of file diff --git a/MP.Land/Components/FileEditor.razor.cs b/MP.Land/Components/FileEditor.razor.cs deleted file mode 100644 index d403ee1a..00000000 --- a/MP.Land/Components/FileEditor.razor.cs +++ /dev/null @@ -1,161 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using MP.FileData.DatabaseModels; -using MP.Land.Data; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; - -namespace MP.Land.Components -{ - public partial class FileEditor : ComponentBase - { - #region Protected Fields - - protected int numDiff = 0; - - #endregion Protected Fields - - #region Public Fields - - public FileModel _currItem = new FileModel(); - - #endregion Public Fields - - #region Protected Properties - - [Inject] - protected FileArchDataService DataService { get; set; } - - [Inject] - protected IJSRuntime JSRuntime { get; set; } - - #endregion Protected Properties - - #region Public Properties - - [Parameter] - public FileModel currItem - { - get - { - return _currItem = null; - } - set - { - _currItem = value; - } - } - - [Parameter] - public EventCallback DataReset { get; set; } - - [Parameter] - public EventCallback DataUpdated { get; set; } - - [Parameter] - public List MacList { get; set; } - - [Parameter] - public List TagList { get; set; } - - #endregion Public Properties - - #region Private Methods - - private async Task ApproveChange() - { - if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler asccettare la modifica del file selezionato generando una nuova revisione?")) - return; - - if (_currItem != null) - { - await DataService.FileApprove(_currItem); - await DataUpdated.InvokeAsync(1); - } - else - { - Console.WriteLine("File null!"); - } - } - - private async Task cancelUpdate() - { - await DataReset.InvokeAsync(0); - } - - private async Task deleteRecord() - { - if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler eliminare il file selezionato??")) - return; - - if (_currItem != null) - { - await DataService.FileDelete(_currItem); - await DataUpdated.InvokeAsync(1); - } - else - { - Console.WriteLine("File null!"); - } - } - - private async Task RejectChange() - { - if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler eliminare la modifica del file selezionato e sovrascrivere la versione in rete?")) - return; - - if (_currItem != null) - { - await DataService.FileReject(_currItem); - await DataUpdated.InvokeAsync(1); - } - else - { - Console.WriteLine("File null!"); - } - } - - private async Task saveUpdate() - { - if (_currItem != null) - { - await DataService.FileUpdate(_currItem); - await DataUpdated.InvokeAsync(1); - } - else - { - Console.WriteLine("File null!"); - } - } - - #endregion Private Methods - - #region Protected Methods - - protected void diffDoneHandler(int numChanges) - { -#if false - numDiff = numChanges; -#endif - } - - #endregion Protected Methods - - #region Public Methods - - public string CurrFileContent(string fullPath) - { - string answ = ""; - if (File.Exists(fullPath)) - { - answ = File.ReadAllText(fullPath); - } - return answ; - } - - #endregion Public Methods - } -} \ No newline at end of file diff --git a/MP.Land/Components/TagSearch.razor b/MP.Land/Components/TagSearch.razor deleted file mode 100644 index d1bf7e85..00000000 --- a/MP.Land/Components/TagSearch.razor +++ /dev/null @@ -1,36 +0,0 @@ - \ No newline at end of file diff --git a/MP.Land/Components/TagSearch.razor.cs b/MP.Land/Components/TagSearch.razor.cs deleted file mode 100644 index 25ba642a..00000000 --- a/MP.Land/Components/TagSearch.razor.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; -using MP.FileData.DatabaseModels; -using MP.Land; -using MP.Land.Data; - -namespace MP.Land.Components -{ - public partial class TagSearch - { - #region Protected Fields - - protected string _SearchTag; - protected string defTag = "###"; - - protected string LastSelTag = ""; - - #endregion Protected Fields - - #region Protected Properties - - [Inject] - protected MessageService AppMService { get; set; } - - [Inject] - protected FileArchDataService DataService { get; set; } - - protected string SearchTag - { - get - { - return _SearchTag; - } - set - { - _SearchTag = value; - // se son > 3 char... debounce... - if (string.IsNullOrEmpty(value)) - { - _SearchTag = defTag; - } - if (value.Length >= defTag.Length) - { - var pUpd = Task.Run(async () => - { - TagList = await DataService.TagGetSearch(_SearchTag, 50); - }); - pUpd.Wait(); - } - } - } - - protected List TagList { get; set; } = new List(); - - #endregion Protected Properties - - #region Public Properties - - [Parameter] - public EventCallback OnClose { get; set; } - - [Parameter] - public EventCallback searchUpdated { get; set; } - - [Parameter] - public string SelTag - { - get - { - string answ = ""; - if (AppMService.File_Filter != null) - { - answ = AppMService.File_Filter.Tag; - } - return answ; - } - set - { - if (!AppMService.File_Filter.Tag.Equals(value)) - { - AppMService.File_Filter.Tag = value; - } - reportChange(); - } - } - - [Parameter] - public string Text { get; set; } - - [Parameter] - public string Title { get; set; } - - #endregion Public Properties - - #region Private Methods - - private Task ModalCancel() - { - // resetto ricerca - SelTag = LastSelTag; - return OnClose.InvokeAsync(false); - } - - private Task ModalOk() - { - return OnClose.InvokeAsync(true); - } - - private void reportChange() - { - searchUpdated.InvokeAsync(SelTag); - } - - #endregion Private Methods - - #region Protected Methods - - protected override async Task OnInitializedAsync() - { - LastSelTag = SelTag; - await ReloadAllData(); - _SearchTag = defTag; - } - - protected async Task ReloadAllData() - { - SelTag = defTag; - TagList = await DataService.TagGetSearch(SearchTag, 20); - } - - protected async Task ResetSearchTag() - { - SearchTag = defTag; - await Task.Delay(1); - } - - #endregion Protected Methods - } -} \ No newline at end of file