tui

package
v0.9.0-dev.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: GPL-3.0 Imports: 26 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
	UpdateMihari            = ui.ActionUpdateMihari
	ApplyEndpointChange     = ui.ActionApplyEndpointChange
	SelectProxy             = ui.ActionSelectProxy
	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
	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) error

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

Types

type Action

type Action = ui.Action

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 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 (*Modal) Update

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

func (*Modal) View

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

type ModalAction

type ModalAction uint8
const (
	ModalNone ModalAction = iota
	ModalClose
	ModalConfirm
)

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 sanitized partial-success detail 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) 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)

func (Model) View

func (model Model) View() tea.View

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 {
	Client         *controlclient.Client
	Service        systempage.ServiceController
	SelfUpdater    systempage.SelfUpdater
	CurrentVersion string
	BinaryPath     string
	Elevated       func() bool
	Relaunch       func() error
	Input          io.Reader
	Output         io.Writer
}

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

Directories

Path Synopsis
pages

Jump to

Keyboard shortcuts

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