76 lines
2.7 KiB
Plaintext
76 lines
2.7 KiB
Plaintext
@using RobotNet.VDA5050.State
|
|
@using RobotNet.VDA5050.Type
|
|
|
|
<MudPaper Class="pa-4" Elevation="2">
|
|
<MudText Typo="Typo.h6" Class="mb-3">Errors</MudText>
|
|
@if (Errors != null && Errors.Length > 0)
|
|
{
|
|
<MudTable Items="@Errors" T="Error" Hover="true" Dense="true" Height="400px" FixedHeader="true" Elevation="0">
|
|
<HeaderContent>
|
|
<MudTh>Error Type</MudTh>
|
|
<MudTh>Level</MudTh>
|
|
<MudTh>Description</MudTh>
|
|
<MudTh>Hint</MudTh>
|
|
<MudTh>References</MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd DataLabel="Error Type">@context.ErrorType</MudTd>
|
|
<MudTd DataLabel="Level">
|
|
<MudChip T="string"
|
|
Size="Size.Small"
|
|
Color="@GetErrorLevelColor(context.ErrorLevel)">
|
|
@context.ErrorLevel
|
|
</MudChip>
|
|
</MudTd>
|
|
<MudTd DataLabel="Description">
|
|
<MudText Typo="Typo.body2" Style="max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
@(context.ErrorDescription ?? "N/A")
|
|
</MudText>
|
|
</MudTd>
|
|
<MudTd DataLabel="Hint">
|
|
<MudText Typo="Typo.body2" Style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
@(context.ErrorHint ?? "N/A")
|
|
</MudText>
|
|
</MudTd>
|
|
<MudTd DataLabel="References">
|
|
@if (context.ErrorReferences != null && context.ErrorReferences.Length > 0)
|
|
{
|
|
<MudChip T="string" Size="Size.Small" Color="Color.Info">
|
|
@context.ErrorReferences.Length reference(s)
|
|
</MudChip>
|
|
}
|
|
else
|
|
{
|
|
<MudText Typo="Typo.body2">N/A</MudText>
|
|
}
|
|
</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
}
|
|
else
|
|
{
|
|
<MudText Typo="Typo.body2" Align="Align.Center">No errors</MudText>
|
|
}
|
|
</MudPaper>
|
|
|
|
@code {
|
|
private Error[]? Errors { get; set; }
|
|
|
|
private Color GetErrorLevelColor(ErrorLevel level)
|
|
{
|
|
return level switch
|
|
{
|
|
ErrorLevel.NONE => Color.Success,
|
|
ErrorLevel.WARNING => Color.Warning,
|
|
ErrorLevel.FATAL => Color.Error,
|
|
_ => Color.Default
|
|
};
|
|
}
|
|
|
|
public void Update(Error[]? errors)
|
|
{
|
|
Errors = errors;
|
|
StateHasChanged();
|
|
}
|
|
}
|