Documentation
¶
Index ¶
- Constants
- func Classify(width, height int) ui.SizeClass
- func RequiresConfirmation(action Action) bool
- func RequiresDaemon(action Action) bool
- func Run(ctx context.Context, options Options) error
- type Action
- type Layout
- type LocalLoggingHealth
- type LoggingFactory
- type LoggingResources
- type Modal
- type ModalAction
- type ModalConfirmedMsg
- type Model
- func (model Model) Init() tea.Cmd
- func (model Model) RelaunchRequested() bool
- func (model Model) RelaunchWarning() string
- func (model Model) Route() ui.PageID
- func (model *Model) SetLoggingHealth(health LocalLoggingHealth)
- func (model *Model) SetSelfUpdater(updater systempage.SelfUpdater, currentVersion, binaryPath string, ...)
- func (model *Model) SetServiceController(ctrl systempage.ServiceController)
- func (model Model) SetupComplete() bool
- func (model Model) Update(message tea.Msg) (tea.Model, tea.Cmd)
- func (model Model) View() tea.View
- type MonitorModel
- func (m *MonitorModel) Observe(event session.Event)
- func (m *MonitorModel) ObserveConnections(connections protocol.ConnectionList)
- func (m *MonitorModel) ObserveMemory(inUse int64)
- func (m *MonitorModel) ObserveTraffic(up, down int64)
- func (m *MonitorModel) SetStale(stale bool)
- func (m MonitorModel) Snapshot() ui.MonitorSnapshot
- func (m MonitorModel) Traffic() []ui.TrafficPoint
- func (m MonitorModel) ViewFull(width, height int) string
- func (m MonitorModel) ViewNumbers(width int) string
- func (m MonitorModel) ViewSummary(_ int) string
- type OperationRecordMsg
- type Options
Constants ¶
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 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 RequiresConfirmation ¶
func RequiresDaemon ¶
RequiresDaemon reports whether the action needs a live daemon control session. OS service control talks to the local service manager and works while disconnected.
Types ¶
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 ModalAction ¶
type ModalAction uint8
const ( ModalNone ModalAction = iota ModalClose ModalConfirm )
type ModalConfirmedMsg ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModelWithEvents ¶
func (Model) RelaunchRequested ¶ added in v0.4.0
RelaunchRequested reports whether the updated binary should enter the TUI.
func (Model) RelaunchWarning ¶ added in v0.4.0
RelaunchWarning returns sanitized partial-success detail for the restored terminal.
func (*Model) SetLoggingHealth ¶ added in v0.9.2
func (model *Model) SetLoggingHealth(health LocalLoggingHealth)
SetLoggingHealth injects the local TUI logging availability observed during bootstrap.
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 ¶
SetupComplete reports an authoritative completed onboarding state.
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
OpenLogging LoggingFactory
ErrorOutput io.Writer
}
Options contains the control client and terminal streams used by the TUI.