ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName              = "lazyssh"
	RepoURL              = "github.com/adembc/lazyssh"
	SplashScreenDuration = 1 * time.Second

)

Variables

This section is empty.

Functions

func BuildSSHCommand

func BuildSSHCommand(s domain.Server) string

BuildSSHCommand constructs a ready-to-run ssh command for the given server. Format: ssh [user@]host [-p PORT if not 22] [-i KEY if provided]

func DefaultStatusText

func DefaultStatusText() string

func NewHintBar

func NewHintBar() *tview.TextView

func NewStatusBar

func NewStatusBar() *tview.TextView

func NewTUI

func NewTUI(logger *zap.SugaredLogger, ss ports.ServerService, version, commit, buildDate string) *tui

Types

type AppHeader

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

func NewAppHeader

func NewAppHeader(version, gitCommit, buildTime, repoURL string) *AppHeader
type SearchBar struct {
	*tview.InputField
	// contains filtered or unexported fields
}

func NewSearchBar

func NewSearchBar() *SearchBar

func (*SearchBar) OnEscape

func (s *SearchBar) OnEscape(fn func()) *SearchBar

func (*SearchBar) OnSearch

func (s *SearchBar) OnSearch(fn func(string)) *SearchBar

type ServerDetails

type ServerDetails struct {
	*tview.TextView
}

func NewServerDetails

func NewServerDetails() *ServerDetails

func (*ServerDetails) ShowEmpty

func (sd *ServerDetails) ShowEmpty()

func (*ServerDetails) UpdateServer

func (sd *ServerDetails) UpdateServer(server domain.Server)

type ServerForm

type ServerForm struct {
	*tview.Form
	// contains filtered or unexported fields
}

func NewServerForm

func NewServerForm(mode ServerFormMode, original *domain.Server) *ServerForm

func (*ServerForm) OnCancel

func (sf *ServerForm) OnCancel(fn func()) *ServerForm

func (*ServerForm) OnSave

func (sf *ServerForm) OnSave(fn func(domain.Server, *domain.Server)) *ServerForm

type ServerFormData

type ServerFormData struct {
	Alias string
	Host  string
	User  string
	Port  string
	Key   string
	Tags  string
}

type ServerFormMode

type ServerFormMode int
const (
	ServerFormAdd ServerFormMode = iota
	ServerFormEdit
)

type ServerList

type ServerList struct {
	*tview.List
	// contains filtered or unexported fields
}

func NewServerList

func NewServerList() *ServerList

func (*ServerList) GetSelectedServer

func (sl *ServerList) GetSelectedServer() (domain.Server, bool)

func (*ServerList) OnSelection

func (sl *ServerList) OnSelection(fn func(server domain.Server)) *ServerList

func (*ServerList) OnSelectionChange

func (sl *ServerList) OnSelectionChange(fn func(server domain.Server)) *ServerList

func (*ServerList) UpdateServers

func (sl *ServerList) UpdateServers(servers []domain.Server)

type SortMode

type SortMode int

SortMode controls how unpinned servers are ordered in the UI.

const (
	SortByAliasAsc SortMode = iota
	SortByAliasDesc
	SortByLastSeenDesc
	SortByLastSeenAsc
)

func (SortMode) Reverse

func (m SortMode) Reverse() SortMode

Reverse flips the direction within the current field.

func (SortMode) String

func (m SortMode) String() string

func (SortMode) ToggleField

func (m SortMode) ToggleField() SortMode

ToggleField switches between Alias and LastSeen while preserving direction.

Jump to

Keyboard shortcuts

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