Documentation ¶
Index ¶
- Variables
- type Client
- type FilterState
- type ItemStyle
- type JobDelegate
- type JobKeys
- type JobRender
- type JobStatus
- func (self *JobStatus) FullHelp() [][]key.Binding
- func (self *JobStatus) NewStatusMessage(s string) tea.Cmd
- func (self *JobStatus) Reset()
- func (self *JobStatus) SetJob(name string, job *job.Status)
- func (self *JobStatus) ShortHelp() []key.Binding
- func (self *JobStatus) Update(msg tea.Msg) tea.Cmd
- func (self *JobStatus) View() string
- func (self *JobStatus) WithBackTo(fn func()) *JobStatus
- type JobStyles
- type JobsList
- func (self *JobsList) List() *list.Model
- func (self *JobsList) Loading() tea.Cmd
- func (self *JobsList) RefreshTitle() tea.Cmd
- func (self *JobsList) Select(name string)
- func (self *JobsList) SetItems(status *daemon.Status) tea.Cmd
- func (self *JobsList) Update(msg tea.Msg) tea.Cmd
- func (self *JobsList) View() string
- func (self *JobsList) WithSelected(fn func(name string)) *JobsList
- type ListItem
- type ListModel
- func (self *ListModel) InitDelegate(d *list.DefaultDelegate)
- func (self *ListModel) List() *list.Model
- func (self *ListModel) SetItems(items []ListItem)
- func (self *ListModel) Update(msg tea.Msg) tea.Cmd
- func (self *ListModel) View() string
- func (self *ListModel) WithBackTo(fn func()) *ListModel
- func (self *ListModel) WithItemFunc(fn func(item *ListItem) tea.Cmd) *ListModel
- type RenderStyles
- type StatusTUI
- func (self *StatusTUI) Err() error
- func (self *StatusTUI) Init() tea.Cmd
- func (self *StatusTUI) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (self *StatusTUI) View() string
- func (self *StatusTUI) WithInitialJob(name string) *StatusTUI
- func (self *StatusTUI) WithUpdateEvery(d time.Duration) *StatusTUI
Constants ¶
This section is empty.
Variables ¶
View Source
var Subcommand = &cli.Subcommand{ Use: "status", Short: "display daemon status information", SetupCobra: func(cmd *cobra.Command) { cmd.Args = cobra.ExactArgs(0) addSelectedJob(cmd) cmd.Flags().DurationVarP(&refreshInterval, "delay", "d", 1*time.Second, "refresh interval") }, SetupSubcommands: func() []*cli.Subcommand { return []*cli.Subcommand{dumpCmd, rawCmd} }, Run: func(ctx context.Context, cmd *cli.Subcommand, args []string) error { return withStatusClient(cmd, func(c *Client) error { model := NewStatusTUI(c).WithInitialJob(selectedJob). WithUpdateEvery(refreshInterval) p := tea.NewProgram(model, tea.WithAltScreen()) if _, err := p.Run(); err != nil { return fmt.Errorf("running program: %w", err) } return model.Err() }) }, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SignalReset ¶
func (*Client) SignalWakeup ¶
type FilterState ¶ added in v0.8.0
type FilterState uint
const ( Unfiltered FilterState = iota Filtering FilterApplied )
type ItemStyle ¶ added in v0.8.0
type ItemStyle struct { Time lipgloss.Style Running lipgloss.Style Sleeping lipgloss.Style WithError lipgloss.Style Steps lipgloss.Style ActiveStepDot lipgloss.Style InactiveStepDot lipgloss.Style Bar lipgloss.Style }
func DefaultItemStyle ¶ added in v0.8.0
func DefaultItemStyle() (s ItemStyle)
type JobDelegate ¶ added in v0.8.0
type JobDelegate struct { list.DefaultDelegate Style ItemStyle // contains filtered or unexported fields }
func NewJobDelegate ¶ added in v0.8.0
func NewJobDelegate() *JobDelegate
type JobKeys ¶ added in v0.8.0
type JobKeys struct { GoToStart key.Binding GoToEnd key.Binding Filter key.Binding ClearFilter key.Binding CancelWhileFiltering key.Binding AcceptWhileFiltering key.Binding Jump key.Binding Back key.Binding Signal key.Binding ShowFullHelp key.Binding CloseFullHelp key.Binding Quit key.Binding ForceQuit key.Binding }
func DefaultJobKeys ¶ added in v0.8.0
func DefaultJobKeys() JobKeys
func (*JobKeys) SetEnabled ¶ added in v0.8.0
type JobRender ¶ added in v0.8.0
type JobRender struct { Styles RenderStyles // contains filtered or unexported fields }
func NewJobRender ¶ added in v0.8.0
func NewJobRender() *JobRender
func (*JobRender) JobTimeLine ¶ added in v0.8.1
func (*JobRender) ResetFilter ¶ added in v0.8.0
func (self *JobRender) ResetFilter()
type JobStatus ¶ added in v0.8.0
type JobStatus struct { Styles JobStyles Keys JobKeys Help help.Model FilterInput textinput.Model StatusMessageLifetime time.Duration // contains filtered or unexported fields }
func NewJobStatus ¶ added in v0.8.0
func (*JobStatus) NewStatusMessage ¶ added in v0.8.0
func (*JobStatus) WithBackTo ¶ added in v0.8.0
type JobStyles ¶ added in v0.8.0
type JobStyles struct { TitleBar lipgloss.Style Title lipgloss.Style FilterPrompt lipgloss.Style FilterCursor lipgloss.Style StatusBar lipgloss.Style View lipgloss.Style Pagination lipgloss.Style Help lipgloss.Style ActivePaginationDot lipgloss.Style InactivePaginationDot lipgloss.Style ArabicPagination lipgloss.Style DividerDot lipgloss.Style }
func DefaultJobStyles ¶ added in v0.8.0
func DefaultJobStyles() (s JobStyles)
type JobsList ¶ added in v0.8.0
type JobsList struct { Choose key.Binding Style lipgloss.Style // contains filtered or unexported fields }
func NewJobsList ¶ added in v0.8.0
func NewJobsList() *JobsList
func (*JobsList) RefreshTitle ¶ added in v0.8.1
func (*JobsList) WithSelected ¶ added in v0.8.0
type ListItem ¶ added in v0.8.0
type ListItem struct { Caption string Desc string Func func() tea.Cmd ItemFunc func(item *ListItem) tea.Cmd }
func (*ListItem) Description ¶ added in v0.8.0
func (*ListItem) FilterValue ¶ added in v0.8.0
type ListModel ¶ added in v0.8.0
type ListModel struct { Choose key.Binding Style lipgloss.Style // contains filtered or unexported fields }
func NewList ¶ added in v0.8.0
func NewList(items []ListItem, d list.ItemDelegate, w, h int) *ListModel
func NewSimpleList ¶ added in v0.8.0
func (*ListModel) InitDelegate ¶ added in v0.8.0
func (self *ListModel) InitDelegate(d *list.DefaultDelegate)
func (*ListModel) WithBackTo ¶ added in v0.8.0
type RenderStyles ¶ added in v0.8.0
type RenderStyles struct { Title lipgloss.Style Content lipgloss.Style Indent lipgloss.Style NotYet lipgloss.Style InactiveFsIcon lipgloss.Style RunningFsIcon lipgloss.Style InactiveFs lipgloss.Style RunningFs lipgloss.Style FsNext lipgloss.Style FilterMatch lipgloss.Style StatusBar lipgloss.Style StatusEmpty lipgloss.Style StatusBarFilterCount lipgloss.Style DividerDot lipgloss.Style SnapState lipgloss.Style SnapTime lipgloss.Style }
func DefaultRenderStyles ¶ added in v0.8.0
func DefaultRenderStyles() (s RenderStyles)
func (*RenderStyles) Filesystem ¶ added in v0.8.0
type StatusTUI ¶ added in v0.8.0
type StatusTUI struct {
// contains filtered or unexported fields
}
func NewStatusTUI ¶ added in v0.8.0
func (*StatusTUI) WithInitialJob ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.