ui

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BadgeOK      = model.BadgeOK
	BadgeWarn    = model.BadgeWarn
	BadgeError   = model.BadgeError
	BadgePending = model.BadgePending
	BadgeUnknown = model.BadgeUnknown
)

Variables

This section is empty.

Functions

func AssetVersion

func AssetVersion() string

AssetVersion returns a short content hash of all embedded assets, used as a cache-busting query string. The result is memoized.

func JoinPath

func JoinPath(basePath, sub string) string

JoinPath joins the UI base path with a sub-path (which must start with "/"), avoiding a duplicate leading slash that would produce a protocol-relative URL.

func StaticHandler

func StaticHandler(prefix string) http.Handler

StaticHandler serves the embedded assets under the given prefix with a long cache lifetime (assets are content-versioned via AssetVersion()).

Types

type BadgeState

type BadgeState = model.BadgeState

BadgeState is the visual state of a status badge.

type CachedDataSource

type CachedDataSource struct {
	Reader client.Reader
}

CachedDataSource reads from a controller-runtime cached client.Reader.

func (*CachedDataSource) GetCluster

func (d *CachedDataSource) GetCluster(ctx context.Context, namespace, name string) (*ClusterDetail, error)

GetCluster returns the detail view for one cluster plus its related satellites.

func (*CachedDataSource) ListClusters

func (d *CachedDataSource) ListClusters(ctx context.Context) ([]ClusterSummary, error)

ListClusters returns every TemporalCluster sorted by namespace then name.

type ClusterDetail

type ClusterDetail = model.ClusterDetail

ClusterDetail is the full per-cluster view.

type ClusterSummary

type ClusterSummary = model.ClusterSummary

ClusterSummary is one row/card on the overview.

func SummaryFromCluster

func SummaryFromCluster(c *temporalv1alpha1.TemporalCluster) ClusterSummary

SummaryFromCluster maps a TemporalCluster to its overview view-model.

type ConditionRow

type ConditionRow = model.ConditionRow

ConditionRow is one status condition.

type DataSource

type DataSource interface {
	ListClusters(ctx context.Context) ([]ClusterSummary, error)
	GetCluster(ctx context.Context, namespace, name string) (*ClusterDetail, error)
}

DataSource provides view-models to the handlers. It is the seam that lets a future SSE/watch-push implementation replace cache polling.

type EndpointsInfo

type EndpointsInfo = model.EndpointsInfo

EndpointsInfo holds resolved endpoints.

type Identity

type Identity struct {
	User          string
	Email         string
	Groups        []string
	Authenticated bool
}

Identity is the request's authenticated user, derived from forward-auth headers.

type Options

type Options struct {
	// BindAddress is the listen address; empty disables the UI.
	BindAddress string
	// RefreshInterval is the htmx poll interval surfaced to templates.
	RefreshInterval time.Duration
	// BasePath is the URL prefix the UI is served under (no trailing slash).
	BasePath string
	// RequireAuth makes the server return 401 when no trusted user header is present.
	RequireAuth bool
	// UserHeader, GroupsHeader and EmailHeader are the trusted forward-auth headers.
	UserHeader   string
	GroupsHeader string
	EmailHeader  string
}

Options configures the UI server.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the UI options used when the UI is enabled.

Note: BindAddress here (":8082") is the suggested address once the UI is turned on; it is NOT the runtime default. The CLI flag --ui-bind-address defaults to empty (disabled), and Normalize never fills BindAddress from these defaults, so an empty BindAddress keeps the UI off.

func (Options) Enabled

func (o Options) Enabled() bool

Enabled reports whether the UI should run.

func (Options) IdentityFrom

func (o Options) IdentityFrom(r *http.Request) Identity

IdentityFrom extracts the Identity from the configured trusted headers.

func (Options) Normalize

func (o Options) Normalize() Options

Normalize fills blank fields with defaults and tidies the base path.

type PersistenceInfo

type PersistenceInfo = model.PersistenceInfo

PersistenceInfo summarizes datastore state.

type RelatedResource

type RelatedResource = model.RelatedResource

RelatedResource is a satellite CRD tied to a cluster.

type Server

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

Server serves the operator UI. It implements manager.Runnable and manager.LeaderElectionRunnable (so it runs on every replica).

func NewServer

func NewServer(opts Options, data DataSource, log logr.Logger) *Server

NewServer builds a UI server.

func (*Server) Handler

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

Handler builds the UI's HTTP handler (router + middleware).

func (*Server) NeedLeaderElection

func (s *Server) NeedLeaderElection() bool

NeedLeaderElection returns false so the UI runs regardless of leadership.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start runs the HTTP server until ctx is cancelled (manager.Runnable).

type ServiceRow

type ServiceRow = model.ServiceRow

ServiceRow reports readiness of one Temporal service.

type UpgradeInfo

type UpgradeInfo = model.UpgradeInfo

UpgradeInfo describes an in-flight upgrade.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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