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) (resultErr error)
- type Action
- type InstallationActions
- 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) SetLocalLoggingHealth(health LocalLoggingHealth)
- func (model *Model) SetLoggingApplier(applier loggingApplier)
- func (model *Model) SetLoggingHealth(health LocalLoggingHealth)
- func (model *Model) SetSelfUpdateChannel(read func(context.Context) (string, error))
- 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
- type Uninstaller
Constants ¶
const ( DeleteSubscription = ui.ActionDeleteSubscription CloseAllConnections = ui.ActionCloseAllConnections UpdateAllProviders = ui.ActionUpdateAllProviders RollbackPanel = ui.ActionRollbackPanel RestartCore = ui.ActionRestartCore UpdateCore = ui.ActionUpdateCore ReinstallCore = ui.ActionReinstallCore 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 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 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 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 ¶
type Modal struct {
// contains filtered or unexported fields
}
func NewConfirmation ¶
func NewErrorDetail ¶ added in v0.9.4
NewErrorDetail creates a scrollable, copyable diagnostic dialog.
type ModalAction ¶
type ModalAction uint8
const ( ModalNone ModalAction = iota ModalClose ModalConfirm // ModalCopy requests copying the current modal's text. ModalCopy )
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 a partial-success summary for the restored terminal.
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
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 ¶
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 {
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.