views

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

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 NewChainsModel

func NewChainsModel() ChainsModel

NewChainsModel creates a new chains model

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

func (ChainsModel) View

func (m ChainsModel) View() string

View renders the chains view

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

func (DashboardModel) View

func (m DashboardModel) View() string

View renders the dashboard

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Level     string
	Source    string
	Message   string
}

LogEntry represents a log entry

type LogsModel

type LogsModel struct {
	// contains filtered or unexported fields
}

LogsModel represents the logs view

func NewLogsModel

func NewLogsModel() LogsModel

NewLogsModel creates a new logs model

func (*LogsModel) AddLog

func (m *LogsModel) AddLog(entry LogEntry)

AddLog adds a log entry

func (*LogsModel) AddMockLogs

func (m *LogsModel) AddMockLogs()

Mock some logs for demonstration

func (*LogsModel) SetSize

func (m *LogsModel) SetSize(width, height int)

SetSize sets the view dimensions

func (LogsModel) Update

func (m LogsModel) Update(msg tea.Msg) (LogsModel, tea.Cmd)

Update handles messages

func (LogsModel) View

func (m LogsModel) View() string

View renders 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 NewNodesModel

func NewNodesModel() NodesModel

NewNodesModel creates a new nodes model

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

func (NodesModel) View

func (m NodesModel) View() string

View renders the nodes view

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

Jump to

Keyboard shortcuts

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