Documentation
¶
Overview ¶
Package ui implements the bubbletea TUI application, views, and modal dialogs.
Index ¶
- func NewEditorCmd(tmpPath string) *editorCmd
- func NewExecWrap(pluginPath string, args []string) *execWrapCmd
- func ParseScaleInput(value string) (int, error)
- func RenderHelp(lines []struct{ ... }, width int) string
- type App
- type ConfirmAction
- type ConfirmModel
- type ConfirmResultMsg
- type HelpModel
- type InputAction
- type InputModel
- type InputResultMsg
- type KeyBindings
- type ModeSaveDefaultMsg
- type ModeSwitchSelectedMsg
- type ModeSwitcherModel
- type ModeTab
- type PathInput
- type PathInputCancelMsg
- type PathInputResultMsg
- type PickerAction
- type PickerDeleteMsg
- type PickerModel
- type PickerResultMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEditorCmd ¶
func NewEditorCmd(tmpPath string) *editorCmd
NewEditorCmd creates a command that opens the given temp file in $EDITOR.
func NewExecWrap ¶
func ParseScaleInput ¶
func RenderHelp ¶
RenderHelp renders a context-sensitive help overlay from the provided keybinding lines.
Types ¶
type ConfirmAction ¶
type ConfirmAction int
const ( ConfirmNone ConfirmAction = iota ConfirmForceDeploy ConfirmStopTask ConfirmScaleInToggle ConfirmSSMUpdate ConfirmSMUpdate ConfirmDynamoFieldEdit ConfirmDynamoClone ConfirmSMClone ConfirmSQSDelete ConfirmSQSSend ConfirmCBStartBuild ConfirmCBStopBuild ConfirmEC2Start ConfirmEC2Stop ConfirmEC2Reboot ConfirmEC2Terminate ConfirmLambdaCodeUpdate ConfirmR53Create ConfirmR53Update ConfirmR53Delete ConfirmECRDelete )
type ConfirmModel ¶
type ConfirmModel struct {
Active bool
Action ConfirmAction
Message string
}
func NewConfirm ¶
func NewConfirm(action ConfirmAction, message string) ConfirmModel
func (ConfirmModel) Update ¶
func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)
func (ConfirmModel) View ¶
func (m ConfirmModel) View() string
type ConfirmResultMsg ¶
type ConfirmResultMsg struct {
Action ConfirmAction
Confirmed bool
}
type InputAction ¶
type InputAction int
const ( InputNone InputAction = iota InputScale InputSSMPath InputSSMSaveName InputExecCommand InputLogGroupPrefix InputLogSearchPattern InputLogSaveName InputSSMEditValue InputLogSaveFile InputSMFilter InputSMSaveName InputSMEditValue InputS3Search InputS3SaveName InputS3Download InputLambdaSearch InputLambdaSaveName InputDynamoSearch InputDynamoSaveName InputDynamoFilterAttr InputDynamoFilterValue InputDynamoPartiQL InputDynamoQuerySaveName InputS3KeySearch InputSMCloneName InputSQSSearch InputSQSSaveName InputLogSearchFrom InputLogSearchTo InputLogSearchGroupsSave InputTofuDir InputTofuSaveName )
type InputModel ¶
type InputModel struct {
Active bool
Action InputAction
Label string
// contains filtered or unexported fields
}
func NewInput ¶
func NewInput(action InputAction, label, defaultValue string) InputModel
func (InputModel) Update ¶
func (m InputModel) Update(msg tea.Msg) (InputModel, tea.Cmd)
func (InputModel) View ¶
func (m InputModel) View() string
type InputResultMsg ¶
type InputResultMsg struct {
Action InputAction
Value string
Canceled bool
}
type KeyBindings ¶ added in v0.6.0
type KeyBindings struct {
// Global
SwitchMode string
ReopenPicker string
PauseResume string
EditConfig string
SwitchRegion string
// ECS
ForceRedeploy string
Scale string
ServiceDetail string
ServiceLogs string
Metrics string
StandaloneTasks string
TaskLogs string
StopTask string
ECSExec string
EnvVars string
ToggleScaleIn string
// Log viewer
LogFollow string
LogTimestamp string
LogOlder string
LogNewer string
LogCopy string
LogOpenEditor string
LogSave string
// CloudWatch Logs
TailStream string
TailGroup string
BrowseStreams string
SavePath string
// CloudWatch Alarms
ToggleActions string
SetAlarmState string
// SSM / SM
EditValue string
CloneSecret string
CopyARN string
// S3
Download string
// Lambda
EditCode string
// DynamoDB
FilterScan string
PartiQL string
NextPage string
EditField string
CloneItem string
// SQS
Messages string
PollMessages string
SendMessage string
CloneSend string
DeleteMsg string
// CodeBuild
StartBuild string
StopBuild string
ViewLogs string
// EC2
SSMSession string
ConsoleOutput string
StartInstance string
StopInstance string
RebootInstance string
TermInstance string
// Route53
TestDNS string
EditRecord string
DeleteRecord string
NewRecord string
// ECR
StartScan string
CopyURI string
DeleteImage string
// OpenTofu
RunPlan string
RunApply string
RunInit string
// Shared
Save string // W — save/bookmark
Search string // s — general search/find
Timestamp string // t — toggle timestamps
}
KeyBindings holds all configurable key bindings. Each field is the key string that msg.String() returns (e.g. "ctrl+s", "e", "`", "W"). Defaults are set in NewKeyBindings, then overridden from config.
func NewKeyBindings ¶ added in v0.6.0
func NewKeyBindings() KeyBindings
NewKeyBindings returns KeyBindings with all defaults.
func (*KeyBindings) ApplyOverrides ¶ added in v0.6.0
func (kb *KeyBindings) ApplyOverrides(overrides map[string]string)
ApplyOverrides applies user-configured key overrides from the config map.
type ModeSaveDefaultMsg ¶
type ModeSaveDefaultMsg struct {
Mode topMode
}
ModeSaveDefaultMsg is sent when the user wants to save the current mode as default.
type ModeSwitchSelectedMsg ¶
type ModeSwitchSelectedMsg struct {
Mode topMode
}
ModeSwitchSelectedMsg is sent when the user picks a mode.
type ModeSwitcherModel ¶
type ModeSwitcherModel struct {
Active bool
// contains filtered or unexported fields
}
func NewModeSwitcher ¶
func NewModeSwitcher(tabs []ModeTab, current topMode) ModeSwitcherModel
func (ModeSwitcherModel) Update ¶
func (m ModeSwitcherModel) Update(msg tea.Msg) (ModeSwitcherModel, tea.Cmd)
func (ModeSwitcherModel) View ¶
func (m ModeSwitcherModel) View() string
type PathInput ¶ added in v0.5.0
type PathInput struct {
Action InputAction
Prompt string
// contains filtered or unexported fields
}
PathInput provides a directory path input with filesystem completion. Type to filter, Tab/Down/Up to navigate suggestions, Enter to select.
func NewPathInput ¶ added in v0.5.0
func NewPathInput(action InputAction, prompt, defaultVal string) PathInput
type PathInputCancelMsg ¶ added in v0.5.0
type PathInputCancelMsg struct{}
PathInputCancelMsg is returned when the user cancels.
type PathInputResultMsg ¶ added in v0.5.0
type PathInputResultMsg struct {
Action InputAction
Value string
}
PathInputResultMsg is returned when the user submits a path.
type PickerAction ¶
type PickerAction int
const ( PickerNone PickerAction = iota PickerExecContainer PickerLogContainer PickerEnvContainer PickerSSMPrefix PickerLogPath PickerLogSearchTimeRange PickerSMFilter PickerS3Search PickerLambdaSearch PickerDynamoTable PickerDynamoQuery PickerDynamoFilterOp PickerSQSQueue PickerCWAlarmState PickerSetAlarmState PickerTofuDir )
type PickerDeleteMsg ¶
type PickerDeleteMsg struct {
Action PickerAction
Index int
}
type PickerModel ¶
type PickerModel struct {
Active bool
Action PickerAction
Title string
Items []string
Deletable int // number of items from the start that are deletable (saved entries)
// contains filtered or unexported fields
}
func NewPicker ¶
func NewPicker(action PickerAction, title string, items []string) PickerModel
func NewPickerWithDelete ¶
func NewPickerWithDelete(action PickerAction, title string, items []string, deletableCount int) PickerModel
func (PickerModel) Update ¶
func (m PickerModel) Update(msg tea.Msg) (PickerModel, tea.Cmd)
func (PickerModel) View ¶
func (m PickerModel) View() string
type PickerResultMsg ¶
type PickerResultMsg struct {
Action PickerAction
Index int
Value string
Canceled bool
}
Source Files
¶
- app.go
- app_cloudwatch.go
- app_codebuild.go
- app_cw_alarms.go
- app_dynamodb.go
- app_ec2.go
- app_ecr.go
- app_ecs.go
- app_lambda.go
- app_messages.go
- app_route53.go
- app_s3.go
- app_shared.go
- app_sm.go
- app_sqs.go
- app_ssm.go
- app_tofu.go
- confirm.go
- editwrap.go
- execwrap.go
- frame.go
- help.go
- input.go
- keybinds.go
- modeswitcher.go
- overlay.go
- pathinput.go
- picker.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package components provides reusable UI components like the auto-sizing grid table.
|
Package components provides reusable UI components like the auto-sizing grid table. |
|
Package theme defines ANSI-adaptive colors and lipgloss styles for the TUI.
|
Package theme defines ANSI-adaptive colors and lipgloss styles for the TUI. |
|
Package views implements the individual bubbletea view models for each screen.
|
Package views implements the individual bubbletea view models for each screen. |