@TimeZoneInfo.ConvertTime(serviceEvent.DateUtc, _timeZone)
@serviceEvent.Severity [@serviceEvent.Source]
diff --git a/Manager.App/Components/Application/System/EventConsole.razor.cs b/Manager.App/Components/Application/System/EventConsole.razor.cs
index ca4787c..dfd01d8 100644
--- a/Manager.App/Components/Application/System/EventConsole.razor.cs
+++ b/Manager.App/Components/Application/System/EventConsole.razor.cs
@@ -9,7 +9,7 @@ namespace Manager.App.Components.Application.System;
public partial class EventConsole : ComponentBase
{
- private const int BatchDelayMs = 1000;
+ private const int BatchDelayMs = 2000;
private List _serviceEvents = [];
private readonly List _batchBuffer = [];
private readonly SemaphoreSlim _batchLock = new(1, 1);
@@ -17,6 +17,7 @@ public partial class EventConsole : ComponentBase
private bool _autoScroll = true;
private CancellationTokenSource _cts = new();
private TimeZoneInfo _timeZone = TimeZoneInfo.Local;
+ private Virtualize? _virtualize;
[Parameter]
public List InitialEvents { get; set; } = [];
@@ -109,12 +110,17 @@ public partial class EventConsole : ComponentBase
_serviceEvents.AddRange(batch);
_lastBatchUpdate = DateTime.UtcNow;
- await InvokeAsync(StateHasChanged);
+ if (_virtualize != null)
+ {
+ await _virtualize.RefreshDataAsync();
+ }
if (_autoScroll)
{
await JsRuntime.InvokeVoidAsync("scrollToBottom", _consoleContainer);
}
+
+ await InvokeAsync(StateHasChanged);
_updateScheduled = false;
break;
diff --git a/Manager.App/Services/System/TestService.cs b/Manager.App/Services/System/TestService.cs
deleted file mode 100644
index 504a8e9..0000000
--- a/Manager.App/Services/System/TestService.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using DotBased.Logging;
-
-namespace Manager.App.Services.System;
-
-public class TestService(ILogger logger) : ExtendedBackgroundService("TestService", "Development service", logger, TimeSpan.FromMilliseconds(100))
-{
- protected override Task InitializeAsync(CancellationToken stoppingToken)
- {
- return Task.CompletedTask;
- }
-
- protected override Task ExecuteServiceAsync(CancellationToken stoppingToken)
- {
- LogEvent("TestService");
- LogEvent($"Error {Guid.NewGuid()}", LogSeverity.Error);
- LogEvent("Something went wrong!", LogSeverity.Warning);
- LogEvent("Tracing.", LogSeverity.Trace);
- LogEvent("Fatal error!", LogSeverity.Fatal);
- return Task.CompletedTask;
- }
-}
\ No newline at end of file
diff --git a/Manager.App/wwwroot/js/eventConsole.js b/Manager.App/wwwroot/js/eventConsole.js
index 4ad94b6..e43391a 100644
--- a/Manager.App/wwwroot/js/eventConsole.js
+++ b/Manager.App/wwwroot/js/eventConsole.js
@@ -1,6 +1,8 @@
window.scrollToBottom = (element) => {
if (element) {
- element.scroll({ top: element.scrollHeight, behavior: 'smooth' });
+ requestAnimationFrame(function () {
+ element.scroll({ top: element.scrollHeight, behavior: 'smooth' });
+ })
}
};