automc: operator UI on AUTOMC_UI_BINDING
Adds a separate HTTP server (not the upstream API on :25590) for the operator dashboard. Single-page UI with two panes: * routes table — current pg-synced mappings, polled every 2s * logs — SSE stream backed by a logrus hook + 500-entry ring buffer Opt-in via AUTOMC_UI_BINDING (e.g. ":8082"); unset = no-op, behaves exactly like upstream. Designed to live behind server-manager's /infra/mc-router/* reverse-proxy. Patch is internal/automc-only, same fork philosophy as the rest — upstream files stay verbatim. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -20,5 +20,14 @@ func Wire(ctx context.Context) error {
|
||||
s := newSyncer(dsn, waker)
|
||||
go s.run(ctx)
|
||||
logrus.Info("automc: pg route sync started")
|
||||
|
||||
// Operator UI on a separate port — upstream's API_BINDING stays
|
||||
// JSON-only and untouched. Enable by setting AUTOMC_UI_BINDING (e.g.
|
||||
// ":8082"); leave unset to skip and behave exactly like upstream.
|
||||
if uiBinding := os.Getenv("AUTOMC_UI_BINDING"); uiBinding != "" {
|
||||
bus := NewLogBus(500)
|
||||
logrus.AddHook(&logrusBusHook{bus: bus})
|
||||
startUI(ctx, uiBinding, bus)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user