tui

package
v0.9.5-dev.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: GPL-3.0 Imports: 36 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DeleteSubscription      = ui.ActionDeleteSubscription
	CloseAllConnections     = ui.ActionCloseAllConnections
	UpdateAllProviders      = ui.ActionUpdateAllProviders
	RollbackPanel           = ui.ActionRollbackPanel
	RestartCore             = ui.ActionRestartCore
	UpdateCore              = ui.ActionUpdateCore
	SwitchCoreChannel       = ui.ActionSwitchCoreChannel
	SwitchMihariChannel     = ui.ActionSwitchMihariChannel
	UpdateMihari            = ui.ActionUpdateMihari
	ApplyEndpointChange     = ui.ActionApplyEndpointChange
	SelectProxy             = ui.ActionSelectProxy
	SetRouting              = ui.ActionSetRouting
	CloseConnection         = ui.ActionCloseConnection
	RefreshSubscription     = ui.ActionRefreshSubscription
	RefreshAllSubscriptions = ui.ActionRefreshAllSubscriptions
	UpdateProvider          = ui.ActionUpdateProvider
	InstallPanel            = ui.ActionInstallPanel
	UpdatePanel             = ui.ActionUpdatePanel
	ActivatePanel           = ui.ActionActivatePanel
	OpenWebGUI              = ui.ActionOpenWebGUI
	UninstallPanel          = ui.ActionUninstallPanel
	ReinstallPanel          = ui.ActionReinstallPanel
	ServiceInstall          = ui.ActionServiceInstall
	ServiceUninstall        = ui.ActionServiceUninstall
	ServiceReinstall        = ui.ActionServiceReinstall
	ServiceStart            = ui.ActionServiceStart
	ServiceStop             = ui.ActionServiceStop
	ServiceRestart          = ui.ActionServiceRestart
	CompleteUninstall       = ui.ActionCompleteUninstall
	EnableSystemProxy       = ui.ActionEnableSystemProxy
	ForceSystemProxy        = ui.ActionForceSystemProxy
	DisableSystemProxy      = ui.ActionDisableSystemProxy
	EnableTun               = ui.ActionEnableTun
	DisableTun              = ui.ActionDisableTun
	ForceTun                = ui.ActionForceTun
)

Variables

This section is empty.

Functions

func Classify

func Classify(width, height int) ui.SizeClass

func RequiresConfirmation

func RequiresConfirmation(action Action) bool

func RequiresDaemon

func RequiresDaemon(action Action) bool

RequiresDaemon reports whether the action needs a live daemon control session. OS service control talks to the local service manager and works while disconnected.

func Run

func Run(ctx context.Context, options Options) (resultErr error)

Run starts the full-screen Mihari terminal interface and blocks until it exits.

Types

type Action

type Action = ui.Action

type InstallationActions added in v0.9.3

type InstallationActions struct {
	// Diagnostics borrows local task metadata and reporting from Run.
	Diagnostics ui.LocalTaskDiagnostics
	Inspect     func(context.Context) (protocol.InstallationStatus, error)
	Plan        func(context.Context, app.InstallationPlanRequest) (app.InstallationPlan, error)
	Execute     func(context.Context, app.InstallationExecuteRequest) (app.InstallationOutcome, error)
	Elevated    func() bool
	Binary      string
}

InstallationActions connects the TUI to the read-only inspector and explicit application installation manager. Execute runs only after TUI cleanup.

type Layout

type Layout struct {
	Class         ui.SizeClass
	Width         int
	Height        int
	RailWidth     int
	ContentWidth  int
	ContentHeight int
	StatusHeight  int
	FooterHeight  int
	RailNavHeight int
	MonitorHeight int
}

type LocalLoggingHealth added in v0.9.2

type LocalLoggingHealth interface {
	Available() bool
}

LocalLoggingHealth reports whether the local TUI file logger is available.

type LoggingFactory added in v0.9.2

type LoggingFactory func(context.Context) (LoggingResources, error)

LoggingFactory opens TUI-local file logging using the Run context.

type LoggingResources added in v0.9.2

type LoggingResources struct {
	Runtime   *logging.Runtime
	Redactor  *logging.Redactor
	PrivateFS *platform.PrivateFS
	Health    LocalLoggingHealth
	// contains filtered or unexported fields
}

LoggingResources owns the TUI file logging runtime and the shared local data-root capability.

func NewLoggingResources added in v0.9.2

func NewLoggingResources(runtime *logging.Runtime, redactor *logging.Redactor, privateFS *platform.PrivateFS) LoggingResources

NewLoggingResources creates TUI logging resources whose close state and health remain shared when the value is copied by a LoggingFactory caller.

func (*LoggingResources) Available added in v0.9.2

func (r *LoggingResources) Available() bool

Available reports whether the TUI file logging runtime opened successfully.

func (*LoggingResources) Close added in v0.9.2

func (r *LoggingResources) Close() error

Close releases the runtime before the shared data-root capability. It is safe to call repeatedly.

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

func NewConfirmation

func NewConfirmation(title, object, impact, rollback string) *Modal

func NewDetail

func NewDetail(title, body string) *Modal

func NewErrorDetail added in v0.9.4

func NewErrorDetail(title, body string) *Modal

NewErrorDetail creates a scrollable, copyable diagnostic dialog.

func NewHelp added in v0.9.1

func NewHelp(title, body string) *Modal

func (*Modal) Update

func (m *Modal) Update(message tea.Msg) ModalAction

Update handles modal navigation and reports explicit close, confirm or copy actions.

func (*Modal) View

func (m *Modal) View(width, height int) string

View renders the selected dialog kind using the shared TUI theme.

type ModalAction

type ModalAction uint8
const (
	ModalNone ModalAction = iota
	ModalClose
	ModalConfirm
	// ModalCopy requests copying the current modal's text.
	ModalCopy
)

type ModalConfirmedMsg

type ModalConfirmedMsg struct {
	Title  string
	Object string
}

type Model

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

func NewModel

func NewModel() Model

func NewModelWithEvents

func NewModelWithEvents(events <-chan session.Event) Model

func (Model) Init

func (model Model) Init() tea.Cmd

func (Model) RelaunchRequested added in v0.4.0

func (model Model) RelaunchRequested() bool

RelaunchRequested reports whether the updated binary should enter the TUI.

func (Model) RelaunchWarning added in v0.4.0

func (model Model) RelaunchWarning() string

RelaunchWarning returns a partial-success summary for the restored terminal.

func (Model) Route

func (model Model) Route() ui.PageID

Route reports the root-level route currently presented to the user.

func (*Model) SetLocalLoggingHealth added in v0.9.2

func (model *Model) SetLocalLoggingHealth(health LocalLoggingHealth)

SetLocalLoggingHealth injects local TUI writer availability observed during bootstrap.

func (*Model) SetLoggingApplier added in v0.9.2

func (model *Model) SetLoggingApplier(applier loggingApplier)

SetLoggingApplier injects the Run-owned local writer applier.

func (*Model) SetLoggingHealth added in v0.9.2

func (model *Model) SetLoggingHealth(health LocalLoggingHealth)

SetLoggingHealth is retained for callers built against the PR 1 bootstrap API.

func (*Model) SetSelfUpdateChannel added in v0.9.3

func (model *Model) SetSelfUpdateChannel(read func(context.Context) (string, error))

SetSelfUpdateChannel supplies the selected platform's read-only discovery.

func (*Model) SetSelfUpdater added in v0.4.0

func (model *Model) SetSelfUpdater(updater systempage.SelfUpdater, currentVersion, binaryPath string, elevated func() bool)

SetSelfUpdater configures the System page's local Mihari lifecycle action.

func (*Model) SetServiceController

func (model *Model) SetServiceController(ctrl systempage.ServiceController)

SetServiceController injects the OS service controller used for the top-right badge and the System page. Safe to call before Run.

func (Model) SetupComplete

func (model Model) SetupComplete() bool

SetupComplete reports an authoritative completed onboarding state.

func (Model) Update

func (model Model) Update(message tea.Msg) (tea.Model, tea.Cmd)

Update routes shell, modal and page events while retaining ownership of asynchronous results.

func (Model) View

func (model Model) View() tea.View

View renders the active shell or setup layout and overlays the current modal.

type MonitorModel

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

func NewMonitor

func NewMonitor() MonitorModel

func (*MonitorModel) Observe

func (m *MonitorModel) Observe(event session.Event)

func (*MonitorModel) ObserveConnections

func (m *MonitorModel) ObserveConnections(connections protocol.ConnectionList)

func (*MonitorModel) ObserveMemory

func (m *MonitorModel) ObserveMemory(inUse int64)

func (*MonitorModel) ObserveTraffic

func (m *MonitorModel) ObserveTraffic(up, down int64)

func (*MonitorModel) SetStale

func (m *MonitorModel) SetStale(stale bool)

func (MonitorModel) Snapshot

func (m MonitorModel) Snapshot() ui.MonitorSnapshot

func (MonitorModel) Traffic

func (m MonitorModel) Traffic() []ui.TrafficPoint

func (MonitorModel) ViewFull

func (m MonitorModel) ViewFull(width, height int) string

func (MonitorModel) ViewNumbers

func (m MonitorModel) ViewNumbers(width int) string

func (MonitorModel) ViewSummary

func (m MonitorModel) ViewSummary(_ int) string

type OperationRecordMsg

type OperationRecordMsg struct{ Record ui.OperationRecord }

type Options

type Options struct {
	Installation              InstallationActions
	SplitLogging              bool
	UserLogDir, UserExportDir string
	Client                    *controlclient.Client
	Service                   systempage.ServiceController
	Uninstaller               Uninstaller
	SelfUpdater               systempage.SelfUpdater
	SelfUpdateChannel         func(context.Context) (string, error)
	CurrentVersion            string
	BinaryPath                string
	Elevated                  func() bool
	Relaunch                  func() error
	Input                     io.Reader
	Output                    io.Writer
	OpenLogging               LoggingFactory
	BuildExportLogs           func(LoggingResources) ui.ExportLogsOptions
	ErrorOutput               io.Writer
}

Options contains the control client and terminal streams used by the TUI.

type Uninstaller added in v0.9.3

type Uninstaller interface {
	Preview(context.Context) ([]app.UninstallTarget, error)
	Run(context.Context, func(string)) error
	RunForce(context.Context, func(string)) error
}

Uninstaller is the local complete-uninstall use case owned by app assembly.

Directories

Path Synopsis
pages

Jump to

Keyboard shortcuts

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