feat: add Gateway page and Runs page with real-time updates

- Implemented a new Gateway page that provides a uniform ingress for deployed agents.
- Created a Runs page that lists recent pipeline executions with auto-refresh and error handling.
- Added a RunsListener component to handle real-time notifications for new runs via SSE.
- Updated the AppSidebar to include links to the new Gateway and Runs pages.
- Enhanced FlowNode component to improve status display and styling.
- Introduced EmptySection component for consistent empty state presentation.
- Updated API utility to include a new endpoint for the runs stream.
This commit is contained in:
patel-lyzr
2026-05-13 22:15:08 +05:30
parent 0284ff768a
commit b6647a537d
25 changed files with 1764 additions and 509 deletions
+29
View File
@@ -17,6 +17,7 @@ import (
"github.com/lyzrai/flow/pkg/engine"
"github.com/lyzrai/flow/pkg/execevents"
"github.com/lyzrai/flow/pkg/executors"
"github.com/lyzrai/flow/pkg/logstore"
"github.com/lyzrai/flow/pkg/orchestrator"
"github.com/lyzrai/flow/pkg/storage"
)
@@ -132,6 +133,33 @@ func serve() int {
}()
slog.Info("mongo connected", slog.String("db", mongoDB))
// MinIO is optional — when MINIO_ENDPOINT is unset we skip log
// archiving. Live SSE log streaming still works regardless.
var logs logstore.Store
if endpoint := envOr("MINIO_ENDPOINT", ""); endpoint != "" {
minioCtx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
m, err := logstore.NewMinio(minioCtx, logstore.Config{
Endpoint: endpoint,
AccessKey: envOr("MINIO_ACCESS_KEY", "minio"),
SecretKey: envOr("MINIO_SECRET_KEY", "minio12345"),
Bucket: envOr("MINIO_BUCKET", "flow-logs"),
UseSSL: envOr("MINIO_USE_SSL", "false") == "true",
})
cancel()
if err != nil {
slog.Warn("minio init failed, log archive disabled",
slog.String("endpoint", endpoint),
slog.Any("error", err),
)
} else {
logs = m
slog.Info("minio connected",
slog.String("endpoint", endpoint),
slog.String("bucket", envOr("MINIO_BUCKET", "flow-logs")),
)
}
}
// Register executors now that storage is ready; the Build executor
// reads from AgentStore.
executors.RegisterAll(executors.RegistryDeps{
@@ -189,6 +217,7 @@ func serve() int {
Runs: mongo.Runs(),
Agents: mongo.Agents(),
Events: eventBus,
Logs: logs,
}),
ReadHeaderTimeout: 10 * time.Second,
}