list

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectHosts added in v0.8.0

func SelectHosts(prompt string, names []string, data conf.Config, multi bool) (selected []string, ok bool, err error)

SelectHosts displays the selector UI and returns selected hosts. ok is false when the selector was canceled.

Types

type ListArrayInfo

type ListArrayInfo struct {
	Name    string
	Connect string
	Note    string
}

type ListInfo

type ListInfo struct {
	// Incremental search line prompt string
	Prompt string

	NameList   []string
	SelectName []string
	DataList   conf.Config // original config data(struct)
	DataText   []string    // all data text list
	ViewText   []string    // filtered text list
	MultiFlag  bool        // multi select flag
	Keyword    string      // input keyword
	CursorLine int         // cursor line
	Term       TermInfo
}

ListInfo is Struct at view list.

func (*ListInfo) View

func (l *ListInfo) View()

View is display the list in TUI

type TermInfo

type TermInfo struct {
	Headline        int
	LeftMargin      int
	Color           int
	BackgroundColor int
}

type TviewSelector added in v0.8.0

type TviewSelector struct {
	*tview.Flex
	// contains filtered or unexported fields
}

TviewSelector is a tview-based selector that mirrors the classic list UI.

func NewTviewSelector added in v0.8.0

func NewTviewSelector(app *tview.Application, prompt string, data conf.Config, names []string, multi bool) *TviewSelector

NewTviewSelector creates a host selector widget.

func (*TviewSelector) FocusTarget added in v0.8.0

func (s *TviewSelector) FocusTarget() tview.Primitive

FocusTarget returns the primitive that should receive keyboard input.

func (*TviewSelector) ListInfo added in v0.8.0

func (s *TviewSelector) ListInfo() *ListInfo

func (*TviewSelector) Refresh added in v0.8.0

func (s *TviewSelector) Refresh()

func (*TviewSelector) SetCancelFunc added in v0.8.0

func (s *TviewSelector) SetCancelFunc(fn func())

func (*TviewSelector) SetDoneFunc added in v0.8.0

func (s *TviewSelector) SetDoneFunc(fn func([]string))

Jump to

Keyboard shortcuts

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