Files
archie/internal/app/archieui/logs.go
T
sam 0f75475b91 feat(ui): schedules table, runs page and Schedule trigger
Schedules list as a table with enable, run now, edit, duplicate, delete and
view runs; built-ins only enable, retime and run. The runs page links each
run's tasks through its capture's dispatches. The Start node gains a Schedule
trigger that picks or creates a schedule and binds the schedule source to the
workflow. Times show in a per-browser display zone set under Appearance; the
cron time zone and run retention are edited on the Schedules page.
2026-10-26 00:57:52 +11:00

36 lines
1.4 KiB
Go

package archieui
import (
"context"
"github.com/samcharles93/archie-core/internal/domain/presence"
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/messagingrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/staterpc"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/webui"
)
// The State Store client serves the dashboard's schedules (wireOrgSurface).
var _ webui.ScheduleStore = (*staterpc.Client)(nil)
func wireServiceLogs(opts Options, srv *webui.Server, tasks *staterpc.Client, chat *gatewayrpc.Client, feed *logging.Feed) (func(), error) {
srv.LogFeed = feed
srv.LogSources = map[string]webui.LogSource{
presence.UI: func(_ context.Context, q logging.Query) (logging.Result, error) { return feed.Read(q) },
presence.StateStore: tasks.RecentLogs,
presence.Gateway: func(ctx context.Context, q logging.Query) (logging.Result, error) {
return chat.RecentLogs(ctx, presence.Gateway, q)
},
presence.Daemon: func(ctx context.Context, q logging.Query) (logging.Result, error) {
return chat.RecentLogs(ctx, presence.Daemon, q)
},
}
messaging, closeMessaging, dialErr := messagingrpc.Dial(opts.Messaging.Target, opts.identity)
if dialErr != nil {
return nil, dialErr
}
srv.LogSources[presence.Messaging] = messaging.RecentLogs
return closeMessaging, nil
}