105 lines
3.8 KiB
Plaintext
105 lines
3.8 KiB
Plaintext
@using TIAM.Entities.Products
|
|
@using TIAM.Entities.Transfers
|
|
@using TIAM.Entities.Drivers
|
|
@using TIAM.Entities.Users
|
|
@using TIAM.Models.Dtos.Users
|
|
@using TIAM.Services
|
|
@using TIAMSharedUI.Shared.Components.Grids
|
|
@using TIAMWebApp.Shared.Application.Interfaces
|
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
|
@using TIAMWebApp.Shared.Application.Services
|
|
@using TIAMWebApp.Shared.Application.Utility
|
|
@using TIAM.Core.Loggers
|
|
@using AyCode.Core.Loggers
|
|
@using AyCode.Services.Loggers
|
|
@using AyCode.Core
|
|
@using AyCode.Core.Extensions
|
|
@inject IServiceProviderDataService ServiceProviderDataService
|
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
|
@inject AdminSignalRClient AdminSignalRClient
|
|
@inject IWizardProcessor WizardProcessor
|
|
@inject IUserDataService UserDataService
|
|
|
|
|
|
@* VirtualScrollingEnabled="true" *@
|
|
<LogViewerGrid Logger="_logger"
|
|
@ref="_logViewerGrid"
|
|
SignalRClient="AdminSignalRClient"
|
|
ShowGroupPanel="true"
|
|
PageSize="25"
|
|
PageSizeSelectorVisible="true"
|
|
PageSizeSelectorItems="@(new int[] { 25, 50, 100, 200, 300, 400, 500 })"
|
|
PageSizeSelectorAllRowsItemVisible="true"
|
|
ValidationEnabled="false"
|
|
CustomizeElement="Grid_CustomizeElement"
|
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
|
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto"
|
|
ShowFilterRow="true">
|
|
<Columns>
|
|
<DxGridDataColumn FieldName="TimeStampUtc" Caption="TimeStampUtc" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" DisplayFormat="g" Width="130" />
|
|
<DxGridDataColumn FieldName="AppType" Caption="AppType" Width="80px" />
|
|
<DxGridDataColumn FieldName="LogLevel" Caption="LogLevel" Width="80px" />
|
|
<DxGridDataColumn FieldName="ThreadId" Caption="ThId" Width="55px" />
|
|
<DxGridDataColumn FieldName="CategoryName" Width="170" />
|
|
<DxGridDataColumn FieldName="CallerName" Width="200" />
|
|
<DxGridDataColumn FieldName="Text" />
|
|
<DxGridDataColumn FieldName="Exception" Width="200" />
|
|
<DxGridDataColumn FieldName="ErrorType" Visible="false" />
|
|
</Columns>
|
|
<DetailRowTemplate>
|
|
@{
|
|
var a = ((LogItemViewerModel)context.DataItem);
|
|
}
|
|
<div>@($"{a.CategoryName}->{a.CallerName}")</div>
|
|
<div>@($"{a.Text}")</div><br/>
|
|
<div style="font-weight: bold;">Exception:</div>
|
|
<div style="word-wrap: break-word;">@a.Exception</div>
|
|
</DetailRowTemplate>
|
|
</LogViewerGrid>
|
|
|
|
@code {
|
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
|
|
|
private LoggerClient<LogViewerGridComponent> _logger;
|
|
|
|
private LogViewerGrid _logViewerGrid;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_logger = new LoggerClient<LogViewerGridComponent>(LogWriters.ToArray());
|
|
|
|
base.OnInitialized();
|
|
}
|
|
|
|
void Grid_CustomizeElement(GridCustomizeElementEventArgs e)
|
|
{
|
|
if (e.ElementType != GridElementType.DataRow) return;
|
|
|
|
var logLevelObject = e.Grid?.GetRowValue(e.VisibleIndex, "LogLevel");
|
|
if (logLevelObject == null) return;
|
|
|
|
var levelObject = (LogLevel)logLevelObject;
|
|
|
|
switch (levelObject)
|
|
{
|
|
case LogLevel.Detail:
|
|
break;
|
|
case LogLevel.Trace:
|
|
break;
|
|
case LogLevel.Debug:
|
|
break;
|
|
case LogLevel.Info:
|
|
break;
|
|
case LogLevel.Suggest:
|
|
break;
|
|
case LogLevel.Warning:
|
|
e.CssClass = "bg-attention";
|
|
break;
|
|
case LogLevel.Error:
|
|
e.CssClass = "bg-important";
|
|
break;
|
|
case LogLevel.Disabled:
|
|
break;
|
|
}
|
|
}
|
|
} |