Documentation ¶
Index ¶
- Constants
- func Decolorise(str string) string
- func RenderCell(cluster entity.Cluster, col int) *tview.TableCell
- func ToTitle(str string) string
- func TrimCell(tv *SelectTable, row, col int) string
- func WithPadding(str string, padding int) string
- type ClusterTableContent
- func (tc *ClusterTableContent) Clear()
- func (tc *ClusterTableContent) GetCell(row, column int) *tview.TableCell
- func (tc *ClusterTableContent) GetColumnCount() int
- func (tc *ClusterTableContent) GetRowCount() int
- func (tc *ClusterTableContent) InsertColumn(column int)
- func (tc *ClusterTableContent) InsertRow(row int)
- func (tc *ClusterTableContent) RemoveColumn(column int)
- func (tc *ClusterTableContent) RemoveRow(row int)
- func (tc *ClusterTableContent) SetCell(row, column int, cell *tview.TableCell)
- func (tc *ClusterTableContent) SetFilter(filter func(entity.Cluster) bool)
- type ClusterView
- type NavBar
- type SelectTable
- func (s *SelectTable) ClearMarks()
- func (s *SelectTable) ClearSelection()
- func (s *SelectTable) DeleteMark(k string)
- func (s *SelectTable) GetModel() TableModel
- func (s *SelectTable) GetRowID(index int) (string, bool)
- func (s *SelectTable) GetSelectedCell(col int) string
- func (s *SelectTable) GetSelectedItem() string
- func (s *SelectTable) GetSelectedItems() []string
- func (s *SelectTable) GetSelectedRowIndex() int
- func (s *SelectTable) SelectFirstRow()
- func (s *SelectTable) SelectRow(r int, broadcast bool)
- func (s *SelectTable) SetModel(m TableModel)
- func (s *SelectTable) SetSelectedFn(f func(string) string)
- func (s *SelectTable) SpanMark()
- func (s *SelectTable) ToggleMark()
- type TableModel
- type Tui
- type ViewState
Constants ¶
const ( LoadingState state = iota ReadyState ErrorState )
const (
COUNT_COL = 4
)
Variables ¶
This section is empty.
Functions ¶
func Decolorise ¶
func TrimCell ¶
func TrimCell(tv *SelectTable, row, col int) string
func WithPadding ¶
Types ¶
type ClusterTableContent ¶
type ClusterTableContent struct {
// contains filtered or unexported fields
}
func NewTableContent ¶
func NewTableContent(clusters []entity.Cluster) *ClusterTableContent
func (*ClusterTableContent) Clear ¶
func (tc *ClusterTableContent) Clear()
Clear does not do anything.
func (*ClusterTableContent) GetCell ¶
func (tc *ClusterTableContent) GetCell(row, column int) *tview.TableCell
func (*ClusterTableContent) GetColumnCount ¶
func (tc *ClusterTableContent) GetColumnCount() int
func (*ClusterTableContent) GetRowCount ¶
func (tc *ClusterTableContent) GetRowCount() int
func (*ClusterTableContent) InsertColumn ¶
func (tc *ClusterTableContent) InsertColumn(column int)
InsertColumn does not do anything.
func (*ClusterTableContent) InsertRow ¶
func (tc *ClusterTableContent) InsertRow(row int)
InsertRow does not do anything.
func (*ClusterTableContent) RemoveColumn ¶
func (tc *ClusterTableContent) RemoveColumn(column int)
RemoveColumn does not do anything.
func (*ClusterTableContent) RemoveRow ¶
func (tc *ClusterTableContent) RemoveRow(row int)
RemoveRow does not do anything.
type ClusterView ¶
func NewClusterView ¶
func NewClusterView(name string) *ClusterView
func (*ClusterView) Draw ¶
func (v *ClusterView) Draw(screen tcell.Screen)
func (*ClusterView) Focus ¶
func (v *ClusterView) Focus(delegate func(p tview.Primitive))
Focus set the focus either on the menu is showMenu is true or on the textView.
func (*ClusterView) HandleEventKey ¶
func (v *ClusterView) HandleEventKey(key *tcell.EventKey)
func (*ClusterView) Model ¶
func (v *ClusterView) Model(model any)
func (*ClusterView) SetFocus ¶
func (v *ClusterView) SetFocus()
type NavBar ¶
type NavBar struct {
}NavBar displays the navigation bar at the bottom of the screen.
func (*NavBar) SelectPage ¶
SelectPage highlight the page.
type SelectTable ¶
SelectTable represents a table with selections.
func (*SelectTable) ClearMarks ¶
func (s *SelectTable) ClearMarks()
ClearMarks delete all marked items.
func (*SelectTable) ClearSelection ¶
func (s *SelectTable) ClearSelection()
ClearSelection reset selected row.
func (*SelectTable) DeleteMark ¶
func (s *SelectTable) DeleteMark(k string)
DeleteMark delete a marked item.
func (*SelectTable) GetModel ¶
func (s *SelectTable) GetModel() TableModel
GetModel returns the current model.
func (*SelectTable) GetRowID ¶
func (s *SelectTable) GetRowID(index int) (string, bool)
GetRowID returns the row id at at given location.
func (*SelectTable) GetSelectedCell ¶
func (s *SelectTable) GetSelectedCell(col int) string
GetSelectedCell returns the content of a cell for the currently selected row.
func (*SelectTable) GetSelectedItem ¶
func (s *SelectTable) GetSelectedItem() string
GetSelectedItem returns the currently selected item name.
func (*SelectTable) GetSelectedItems ¶
func (s *SelectTable) GetSelectedItems() []string
GetSelectedItems return currently marked or selected items names.
func (*SelectTable) GetSelectedRowIndex ¶
func (s *SelectTable) GetSelectedRowIndex() int
GetSelectedRowIndex fetch the currently selected row index.
func (*SelectTable) SelectFirstRow ¶
func (s *SelectTable) SelectFirstRow()
SelectFirstRow select first data row if any.
func (*SelectTable) SelectRow ¶
func (s *SelectTable) SelectRow(r int, broadcast bool)
SelectRow select a given row by index.
func (*SelectTable) SetModel ¶
func (s *SelectTable) SetModel(m TableModel)
SetModel sets the table model.
func (*SelectTable) SetSelectedFn ¶
func (s *SelectTable) SetSelectedFn(f func(string) string)
SetSelectedFn defines a function that cleanse the current selection.
type TableModel ¶
type Tui ¶
type Tui struct {
// contains filtered or unexported fields
}
func New ¶
func New(app *tview.Application, fmReader service.FleetManagerReader) *Tui
func (*Tui) HandleEventKey ¶
func (t *Tui) HandleEventKey(key *tcell.EventKey)