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 ¶
type FilterState uint
const ( Unfiltered FilterState = iota Filtering FilterApplied )
type ItemStyle ¶
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 ¶
func DefaultItemStyle() (s ItemStyle)
type JobDelegate ¶
type JobDelegate struct { list.DefaultDelegate Style ItemStyle // contains filtered or unexported fields }
func NewJobDelegate ¶
func NewJobDelegate() *JobDelegate
type JobKeys ¶
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 ¶
func DefaultJobKeys() JobKeys
func (*JobKeys) SetEnabled ¶
type JobRender ¶
type JobRender struct { Styles RenderStyles // contains filtered or unexported fields }
func NewJobRender ¶
func NewJobRender() *JobRender
func (*JobRender) JobTimeLine ¶
func (*JobRender) ResetFilter ¶
func (self *JobRender) ResetFilter()
type JobStatus ¶
type JobStatus struct { Styles JobStyles Keys JobKeys Help help.Model FilterInput textinput.Model StatusMessageLifetime time.Duration // contains filtered or unexported fields }
func NewJobStatus ¶
func (*JobStatus) WithBackTo ¶
type JobStyles ¶
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 ¶
func DefaultJobStyles() (s JobStyles)
type JobsList ¶
type JobsList struct { Choose key.Binding Style lipgloss.Style // contains filtered or unexported fields }
func NewJobsList ¶
func NewJobsList() *JobsList
func (*JobsList) RefreshTitle ¶
func (*JobsList) WithSelected ¶
type ListItem ¶
type ListItem struct { Caption string Desc string Func func() tea.Cmd ItemFunc func(item *ListItem) tea.Cmd }
func (*ListItem) Description ¶
func (*ListItem) FilterValue ¶
type ListModel ¶
type ListModel struct { Choose key.Binding Style lipgloss.Style // contains filtered or unexported fields }
func (*ListModel) InitDelegate ¶
func (self *ListModel) InitDelegate(d *list.DefaultDelegate)
func (*ListModel) WithBackTo ¶
type RenderStyles ¶
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 ¶
func DefaultRenderStyles() (s RenderStyles)
func (*RenderStyles) Filesystem ¶
type StatusTUI ¶
type StatusTUI struct {
// contains filtered or unexported fields
}
func NewStatusTUI ¶
func (*StatusTUI) WithInitialJob ¶
Click to show internal directories.
Click to hide internal directories.