webui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package webui serves the citadel-logs dashboard at localhost:5500.

The HTML page is server-rendered once; htmx polls a fragment endpoint every 5 seconds to refresh the error list for the selected service. There is no JavaScript build step — all assets are embedded into the binary via embed.FS so the Docker image stays a single static binary plus distroless.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeployServer

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

DeployServer serves the local deployment-history dashboard. It reuses the embedded htmx/static assets but is backed by deploydb instead of logsdb.

func NewDeployServer

func NewDeployServer(db *deploydb.DB) (*DeployServer, error)

NewDeployServer parses the deployments template and returns a server.

func (*DeployServer) Handler

func (s *DeployServer) Handler() http.Handler

Handler wires the routes:

GET /                  -> redirect to /deployments
GET /static/...        -> embedded assets
GET /healthz           -> "ok"
GET /deployments       -> full page
GET /deployments/rows  -> htmx tbody fragment (filterable)

type Server

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

Server is the HTTP entrypoint for the dashboard.

func New

func New(db *logsdb.DB, factory ingest.LogsClientFactory) (*Server, error)

New constructs a Server. Templates are parsed once at startup; the embedded FS is read-only so there's no hot-reload concern.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the wired http.Handler. Routes:

GET /                          — redirect to /logs
GET /logs                      — main dashboard
GET /logs/services             — htmx fragment for the rail
GET /logs/stream               — SSE live logs tail
GET /logs/errors               — htmx fragment for selected service
GET /logs/error/{id}           — htmx fragment for one error's detail
GET /api/services              — JSON
GET /healthz                   — liveness
GET /static/*                  — embedded css/js

Jump to

Keyboard shortcuts

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