feat(ui): subscribe to WorkerLog SignalR event
This commit is contained in:
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.SignalR.Client;
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public record ActiveTask(string Slot, string TaskId, DateTime StartedAt);
|
||||
public sealed record WorkerLogEntry(string Message, WorkerLogLevel Level, DateTime TimestampUtc);
|
||||
|
||||
sealed class IndefiniteRetryPolicy : IRetryPolicy
|
||||
{
|
||||
@@ -46,6 +47,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
||||
public event Action<string>? WorktreeUpdatedEvent;
|
||||
public event Action<string>? RunNowRequestedEvent;
|
||||
public event Action<string>? ListUpdatedEvent;
|
||||
public event Action<WorkerLogEntry>? WorkerLogReceivedEvent;
|
||||
|
||||
public WorkerClient(string signalRUrl)
|
||||
{
|
||||
@@ -116,6 +118,11 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => ListUpdatedEvent?.Invoke(listId));
|
||||
});
|
||||
|
||||
_hub.On<string, WorkerLogLevel, DateTime>("WorkerLog", (message, level, timestampUtc) =>
|
||||
{
|
||||
WorkerLogReceivedEvent?.Invoke(new WorkerLogEntry(message, level, timestampUtc));
|
||||
});
|
||||
}
|
||||
|
||||
public Task StartAsync()
|
||||
|
||||
Reference in New Issue
Block a user