Fix gestione allegati e creato metodo di esportazione log

This commit is contained in:
2026-03-04 11:51:42 +01:00
parent 3760e38c8d
commit 2d938fb210
26 changed files with 986 additions and 384 deletions

View File

@@ -1,4 +1,5 @@
@page "/ispezione"
@using Microsoft.Extensions.Logging
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.Layout.Overlay
@using SteUp.Shared.Components.SingleElements.Card
@@ -15,7 +16,8 @@
@inject IIspezioniService IspezioniService
@inject IDialogService Dialog
@inject IIntegrySteupService IntegrySteupService
@inject IAttachedService AttachedService
@inject IFileManager FileManager
@inject ILogger<IspezionePage> Logger
@implements IDisposable
<HeaderLayout Title="Ispezione" BackTo="Indietro" Back="true"/>
@@ -150,7 +152,7 @@
if (scheda.ImageNames == null) continue;
var fileList = (await AttachedService.GetInspectionFiles(ispezione, scheda.ImageNames))?
var fileList = (await FileManager.GetInspectionFiles(ispezione, scheda.ImageNames))?
.Where(x => x.ToUpload).ToList();
if (fileList == null) continue;
@@ -187,7 +189,7 @@
StateHasChanged();
});
OnError(e.Message);
OnError(e, e.Message);
}
}
@@ -286,8 +288,9 @@
StateHasChanged();
}
private void OnError(string? errorMessage)
private void OnError(Exception? e, string? errorMessage)
{
if (e != null) Logger.LogError(e, errorMessage);
if (errorMessage == null) return;
_ = Dialog.ShowError(errorMessage);