Documentation
¶
Overview ¶
Package ui serves a live browser view of an apply run: the plan's step graph drawn as cards that change color as steps start, finish, or fail. The server binds an ephemeral loopback port, serves one embedded page under a random token path so other local users cannot guess the URL, and streams step state changes over server-sent events. It is an observer only: it consumes the same ApplyEvent values the terminal renderer does and never blocks the scheduler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenBrowser ¶
OpenBrowser tries to open url in the operator's browser and reports whether a command appeared to succeed. $BROWSER wins, then the platform opener, then a short list of common browsers.
Types ¶
type Config ¶
type Config struct {
Factory string
Stack string
Graph []runtime.StepNode
// contains filtered or unexported fields
}
Config names the run a Server displays.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the live run view: an HTTP server plus the step state table it streams from. Create one with Start, feed it with Observe, end the stream with Complete, and shut it down with Close.
func (*Server) Close ¶
func (s *Server) Close()
Close shuts the server down, closing any open event streams.
func (*Server) Complete ¶
Complete ends the stream: it computes the run totals from the observed events and broadcasts the run-complete frame. message explains a failure that has no failed step, such as an interrupt; it is ignored when ok is true.
func (*Server) Observe ¶
func (s *Server) Observe(ev runtime.ApplyEvent)
Observe records one apply event and forwards it to every connected client. It never blocks on a slow client.