tui

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProbeStatusLabel

func ProbeStatusLabel(kind string) string

func RenderDashboard

func RenderDashboard(w io.Writer, d Dashboard) error

func RenderDashboardWidth

func RenderDashboardWidth(w io.Writer, d Dashboard, width int) error

func SnapshotAgeLabel

func SnapshotAgeLabel(t time.Time) string

Types

type ActionKind

type ActionKind string
const (
	ActionKindInit   ActionKind = "init"
	ActionKindBackup ActionKind = "backup"
	ActionKindCheck  ActionKind = "check"
)

type ActivityPanel

type ActivityPanel struct {
	Status     ActivityStatus
	ActionKind ActionKind
	Action     string
	Target     string
	Phase      string
	Current    int64
	Total      int64
	IsBytes    bool
	Summary    string
	UpdatedAt  string
	Lines      []string
}

type ActivityStatus

type ActivityStatus string
const (
	ActivityStatusIdle    ActivityStatus = ""
	ActivityStatusRunning ActivityStatus = "running"
	ActivityStatusSuccess ActivityStatus = "success"
	ActivityStatusError   ActivityStatus = "error"
)

type BackupFreshness

type BackupFreshness string
const (
	BackupFreshnessUnknown BackupFreshness = ""
	BackupFreshnessNever   BackupFreshness = "never"
	BackupFreshnessRecent  BackupFreshness = "recent"
	BackupFreshnessStale   BackupFreshness = "stale"
)

type Dashboard

type Dashboard struct {
	ProfileCount    int
	StoreCount      int
	AuthCount       int
	SelectedProfile string
	SelectedView    ProfileView
	Activity        ActivityPanel
	Modal           *Modal
	Profiles        []ProfileCard
}

func BuildDashboard

func BuildDashboard(cfg *engine.ProfilesConfig, probes map[string]StoreProbe) Dashboard

func BuildDashboardFromConfig

func BuildDashboardFromConfig(ctx context.Context, cfg *engine.ProfilesConfig, load SnapshotLoader) Dashboard

type DashboardLayout

type DashboardLayout struct {
	ProfileRows map[int]string
	ProfileRect Rect
	ActionRows  map[int]string
	ActionRect  Rect
}

func LayoutDashboardWidth

func LayoutDashboardWidth(d Dashboard, width int) DashboardLayout
type Modal struct {
	Kind        ModalKind
	Title       string
	Subtitle    string
	Error       string
	ErrorField  string
	Hint        string
	Message     []string
	Fields      []ModalField
	Selected    int
	SubmitLabel string
	CancelLabel string
}

type ModalField

type ModalField struct {
	Key      string
	Label    string
	Kind     ModalFieldKind
	Value    string
	Options  []string
	Required bool
	Disabled bool
}

type ModalFieldKind

type ModalFieldKind string
const (
	ModalFieldText   ModalFieldKind = "text"
	ModalFieldSelect ModalFieldKind = "select"
)

type ModalKind

type ModalKind string
const (
	ModalKindProfileForm ModalKind = "profile_form"
	ModalKindConfirm     ModalKind = "confirm"
)

type ProfileAction

type ProfileAction struct {
	Kind    ActionKind
	Key     string
	Label   string
	Enabled bool
	Reason  string
}

type ProfileCard

type ProfileCard struct {
	Name         string
	Source       string
	StoreRef     string
	AuthRef      string
	Enabled      bool
	Status       ProfileStatus
	StatusNote   string
	StoreHealth  StoreHealth
	Reachability StoreReachability
	Repository   RepositoryState
	BackupState  BackupFreshness
	LastBackup   string
	LastRef      string
	History      []ProfileSnapshot
	Actions      []ProfileAction
}

type ProfileSnapshot

type ProfileSnapshot struct {
	Created string
	Ref     string
}

type ProfileStatus

type ProfileStatus string
const (
	ProfileStatusReady    ProfileStatus = "ready"
	ProfileStatusDisabled ProfileStatus = "disabled"
	ProfileStatusWarning  ProfileStatus = "warning"
	ProfileStatusError    ProfileStatus = "error"
)

type ProfileView

type ProfileView string
const (
	ProfileViewSummary ProfileView = "summary"
	ProfileViewHistory ProfileView = "history"
)

type Rect

type Rect struct {
	X int
	Y int
	W int
	H int
}

type RepositoryState

type RepositoryState string
const (
	RepositoryStateUnknown        RepositoryState = "unknown"
	RepositoryStateInitialized    RepositoryState = "initialized"
	RepositoryStateNotInitialized RepositoryState = "not_initialized"
)

type StoreHealth

type StoreHealth string
const (
	StoreHealthReady            StoreHealth = "ready"
	StoreHealthPending          StoreHealth = "pending"
	StoreHealthDisabled         StoreHealth = "disabled"
	StoreHealthMissingStore     StoreHealth = "missing_store"
	StoreHealthMissingAuth      StoreHealth = "missing_auth"
	StoreHealthProviderMismatch StoreHealth = "provider_mismatch"
	StoreHealthUnavailable      StoreHealth = "unavailable"
	StoreHealthNotInitialized   StoreHealth = "not_initialized"
	StoreHealthUnknown          StoreHealth = "unknown"
)

type StoreProbe

type StoreProbe struct {
	Status    string
	Error     string
	Snapshots []engine.SnapshotEntry
}

type StoreReachability

type StoreReachability string
const (
	StoreReachabilityUnknown     StoreReachability = "unknown"
	StoreReachabilityPending     StoreReachability = "pending"
	StoreReachabilityReachable   StoreReachability = "reachable"
	StoreReachabilityUnavailable StoreReachability = "unavailable"
)

Jump to

Keyboard shortcuts

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