R
Roberto Azevedo

Log File Results Frontend

MudBlazor Log Monitor provides a log parsing and inspection UI with MudDataGrid results and MudDatePicker/MudSelect filters. Supports paste or .txt file input and shows summary counts.

LIVE DEMO
Generated using Instruct UI - An AI for Blazor UI Generation
## What's implemented - File input and multi-line paste area for ingesting log text. - Client-side parsing of common timestamp/level formats into a LogEntryModel list. - Filtering: level (MudSelect), free-text search (MudTextField), start/end date (MudDatePicker). - Results displayed in a MudDataGrid with sorting and row styling; summary counters for totals, errors, warns, resolved. - Buttons for Parse, Clear, Apply/Reset filters. ## Key components - MudContainer, MudPaper, MudText, MudButton - MudDataGrid<T> (PropertyColumn entries) - MudSelect (level filter), MudTextField (search), MudDatePicker (start/end) - Standard file input element and a textarea bound with @bind - LogEntryModel (data model) ## How it works - Raw input is read from a textarea or (placeholder) file input handler, then ParseLogs splits lines and calls ParseLine for each line. - ParseLine uses Regex patterns to extract timestamp, level and message; falls back to keyword detection (error/warn). - AllEntries holds parsed items; FilteredEntries is a LINQ query (ApplyFilterQuery) that applies selectedLevel, searchText, startDate/endDate and orders by Timestamp desc. - UI state updates via @bind for inputs and explicit StateHasChanged calls when filters apply. - Row styling uses GetRowClass to add MudBlazor theme classes (mud-theme-error, mud-text-disabled). Row click toggle is noted but not implemented in code (RowClick guidance required for version-specific APIs). ## Styling - Uses MudBlazor components and classes for layout and theming (MudContainer, MudPaper, mud-typography classes). - Layout relies on flex utility classes (d-flex, flex-column, flex-md-row, gap-*) present in the markup for responsive behavior. - Grid/table appearance and hover/dense behavior come from MudDataGrid props; error highlighting uses MudBlazor theme class names. ## Reuse steps 1. Add MudBlazor NuGet and register services (builder.Services.AddMudServices()) and add MudBlazor CSS in index.html/_Host. 2. Import MudBlazor namespace in _Imports.razor (using MudBlazor) and reference the component (.razor and model). 3. Copy LogEntryModel and the ParseLine/ApplyFilterQuery logic; adapt Regex patterns to target logs. 4. Implement file reading in OnInputFileChange using IBrowserFile.OpenReadStream and StreamReader for large files. 5. Optionally implement MudDataGrid RowClick or selection to toggle Resolved and persist state to a service. ## Limitations & next steps - File upload handler is a placeholder; large file streaming, progress and size limits need implementation. - Row click toggling is not wired; MudDataGrid RowClick/SelectedItem handler must be added per MudBlazor version to toggle Resolved. - No server-side paging or persistence; add API endpoints or SignalR for production scale and remote logs. - Consider debouncing search, adding server-side filtering, and parsing performance improvements for high-volume logs.