consoleui

package
v0.1.0-rc.77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package consoleui serves w17ctl's local web app — a human-facing view and controller over the dev-machine-local project registry (devconfig), each project's lock, and the local Docker daemon. It is the GUI counterpart to the `w17ctl project` / `stack` CLI: the CLI is the surface coding agents drive, this is the surface a human clicks.

It introduces no new source of truth — it reads ~/.w17/config.yaml, w17/lock.yaml, and `docker compose ps` / `docker stats`, and drives the same compose lifecycle the CLI drives. Bind to 127.0.0.1 only: the local Docker socket is root-equivalent on the host.

Index

Constants

View Source
const HealthApp = "w17ctl-ui"

HealthApp is the marker an `/api/healthz` response carries so the `w17ctl ui start` launcher can tell OUR server apart from some other process that happens to hold the port.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Service string `json:"service"`
	Image   string `json:"image"`
	State   string `json:"state"`  // running / exited / …
	Status  string `json:"status"` // "Up 3 minutes", "Exited (0) …"
	Ports   string `json:"ports"`

	// Live resource use, filled from `docker stats` (empty when the
	// container is not running or stats are unavailable).
	CPUPerc  string  `json:"cpuPerc,omitempty"`
	MemUsage *string `json:"memUsage,omitempty"`
	MemPerc  string  `json:"memPerc,omitempty"`
}

Container is one row of `docker compose ps` / `docker stats`, flattened to the fields the UI shows. Names mirror docker's JSON keys so the frontend can rely on them.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the local UI HTTP server.

func New

func New(addr string) *Server

New builds a Server bound to addr (expected to be a loopback address).

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the address the server is configured to listen on.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, ready func(addr string)) error

Serve listens and serves until ctx is cancelled, then shuts down gracefully. Returns the bound address via the optional ready callback (so callers can print the real port when addr used :0).

type ServiceLink struct {
	Label   string `json:"label"`
	URL     string `json:"url"`
	Kind    string `json:"kind"` // gateway | mcp | admin | trace | db | bus | other
	Service string `json:"service"`
	Web     bool   `json:"web"` // browser-navigable (http) vs raw TCP (db/bus)
}

ServiceLink is a friendly, typed link to a running service derived from a host-port slot — the "jump to the admin / gateway / Jaeger" affordance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL