Documentation
¶
Overview ¶
Package views provides view models for the Lux TUI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainStatus ¶
type ChainStatus struct {
ChainID string
Name string
Type string
Height uint64
Status string
Validators int
TPS float64
}
ChainStatus represents a chain's status
type ChainsModel ¶
type ChainsModel struct {
// contains filtered or unexported fields
}
ChainsModel represents the chains view
func (*ChainsModel) SetSize ¶
func (m *ChainsModel) SetSize(width, height int)
SetSize sets the view dimensions
func (ChainsModel) Update ¶
func (m ChainsModel) Update(msg tea.Msg) (ChainsModel, tea.Cmd)
Update handles messages
func (*ChainsModel) UpdateData ¶
func (m *ChainsModel) UpdateData(chains []ChainStatus)
UpdateData updates the chains data
type DashboardModel ¶
type DashboardModel struct {
// contains filtered or unexported fields
}
DashboardModel represents the dashboard view
func NewDashboardModel ¶
func NewDashboardModel() DashboardModel
NewDashboardModel creates a new dashboard model
func (*DashboardModel) SetSize ¶
func (m *DashboardModel) SetSize(width, height int)
SetSize sets the view dimensions
func (DashboardModel) Update ¶
func (m DashboardModel) Update(msg tea.Msg) (DashboardModel, tea.Cmd)
Update handles messages
func (*DashboardModel) UpdateData ¶
func (m *DashboardModel) UpdateData(nodes []NodeStatus, chains []ChainStatus, validators []ValidatorStatus)
UpdateData updates the dashboard with new data
type LogsModel ¶
type LogsModel struct {
// contains filtered or unexported fields
}
LogsModel represents the logs view
type NodeStatus ¶
type NodeStatus struct {
Name string
NodeID string
Status string
Version string
Uptime string
Connected int
Staking bool
}
NodeStatus represents a node's status
type NodesModel ¶
type NodesModel struct {
// contains filtered or unexported fields
}
NodesModel represents the nodes view
func (*NodesModel) SetSize ¶
func (m *NodesModel) SetSize(width, height int)
SetSize sets the view dimensions
func (NodesModel) Update ¶
func (m NodesModel) Update(msg tea.Msg) (NodesModel, tea.Cmd)
Update handles messages
func (*NodesModel) UpdateData ¶
func (m *NodesModel) UpdateData(nodes []NodeStatus)
UpdateData updates the nodes data
type ValidatorStatus ¶
type ValidatorStatus struct {
NodeID string
Stake string
StartTime time.Time
EndTime time.Time
Uptime string
Connected bool
}
ValidatorStatus represents a validator's status
type ValidatorsModel ¶
type ValidatorsModel struct {
// contains filtered or unexported fields
}
ValidatorsModel represents the validators view
func NewValidatorsModel ¶
func NewValidatorsModel() ValidatorsModel
NewValidatorsModel creates a new validators model
func (*ValidatorsModel) SetSize ¶
func (m *ValidatorsModel) SetSize(width, height int)
SetSize sets the view dimensions
func (ValidatorsModel) Update ¶
func (m ValidatorsModel) Update(msg tea.Msg) (ValidatorsModel, tea.Cmd)
Update handles messages
func (*ValidatorsModel) UpdateData ¶
func (m *ValidatorsModel) UpdateData(validators []ValidatorStatus)
UpdateData updates the validators data
func (ValidatorsModel) View ¶
func (m ValidatorsModel) View() string
View renders the validators view