dashboards

package
v0.0.0-...-1ccb659 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DashboardConfigSUI = []container.Option{
		container.Border(linestyle.Light),
		container.BorderColor(cell.ColorGreen),
		container.FocusedColor(cell.ColorGreen),
		container.AlignHorizontal(align.HorizontalCenter),
		container.AlignVertical(align.VerticalMiddle),
		container.BorderTitle(dashboardName),
		container.Focused(),
	}

	Rows = []grid.Element{
		0: NewRowPct(12,
			Columns[CellNameNodeStatus],
			Columns[CellNameNetworkStatus],
			Columns[CellNameCurrentEpoch],
			Columns[CellNameEpochEnd],
			Columns[CellNameConnectedPeers],
			Columns[CellNameVersion],
			Columns[CellNameCommit],
		),
		1: NewRowPct(12,
			Columns[CellNameUptime],
			Columns[CellNameTotalTransactions],
			Columns[CellNameLatestCheckpoint],
			Columns[CellNameHighestCheckpoint],
		),
		2: NewRowPct(12,
			Columns[CellNameBytesSent],
			Columns[CellNameBytesReceived],
			Columns[CellNameTransactionsPerSecond],
			Columns[CellNameCheckpointsPerSecond],
			Columns[CellNameDatabaseSize],
		),
		3: NewRowPct(50,
			NewColumnPct(40,
				NewRowPct(50,
					Columns[CellNameEpochProgress],
					Columns[CellNameDiskUsage],
				),
				NewRowPct(50,
					Columns[CellNameCpuUsage],
					Columns[CellNameMemoryUsage],
				),
			),
			NewColumnPct(60,
				NewRowPct(15,
					Columns[CellNameTXSyncProgress],
					Columns[CellNameCheckSyncProgress],
				),
				NewRowPct(20, Columns[CellNameTPSTracker]),
				NewRowPct(20, Columns[CellNameCPSTracker]),
				NewRowPct(45, Columns[CellNameNodeLogs]),
			),
		),
	}

	Columns = []grid.Element{
		CellNameNodeStatus:            NewColumnPct(5, Cells[CellNameNodeStatus].GetGridWidget()),
		CellNameNetworkStatus:         NewColumnPct(5, Cells[CellNameNetworkStatus].GetGridWidget()),
		CellNameTransactionsPerSecond: NewColumnPct(16, Cells[CellNameTransactionsPerSecond].GetGridWidget()),
		CellNameCheckpointsPerSecond:  NewColumnPct(15, Cells[CellNameCheckpointsPerSecond].GetGridWidget()),
		CellNameTotalTransactions:     NewColumnPct(28, Cells[CellNameTotalTransactions].GetGridWidget()),
		CellNameLatestCheckpoint:      NewColumnPct(28, Cells[CellNameLatestCheckpoint].GetGridWidget()),
		CellNameHighestCheckpoint:     NewColumnPct(28, Cells[CellNameHighestCheckpoint].GetGridWidget()),
		CellNameConnectedPeers:        NewColumnPct(10, Cells[CellNameConnectedPeers].GetGridWidget()),
		CellNameTXSyncProgress:        NewColumnPct(50, Cells[CellNameTXSyncProgress].GetGridWidget()),
		CellNameCheckSyncProgress:     NewColumnPct(50, Cells[CellNameCheckSyncProgress].GetGridWidget()),
		CellNameUptime:                NewColumnPct(16, Cells[CellNameUptime].GetGridWidget()),
		CellNameVersion:               NewColumnPct(21, Cells[CellNameVersion].GetGridWidget()),
		CellNameCommit:                NewColumnPct(10, Cells[CellNameCommit].GetGridWidget()),
		CellNameCurrentEpoch:          NewColumnPct(10, Cells[CellNameCurrentEpoch].GetGridWidget()),
		CellNameEpochProgress:         NewColumnPct(50, Cells[CellNameEpochProgress].GetGridWidget()),
		CellNameEpochEnd:              NewColumnPct(20, Cells[CellNameEpochEnd].GetGridWidget()),
		CellNameDiskUsage:             NewColumnPct(50, Cells[CellNameDiskUsage].GetGridWidget()),
		CellNameDatabaseSize:          NewColumnPct(20, Cells[CellNameDatabaseSize].GetGridWidget()),
		CellNameBytesSent:             NewColumnPct(20, Cells[CellNameBytesSent].GetGridWidget()),
		CellNameBytesReceived:         NewColumnPct(20, Cells[CellNameBytesReceived].GetGridWidget()),
		CellNameMemoryUsage:           NewColumnPct(50, Cells[CellNameMemoryUsage].GetGridWidget()),
		CellNameCpuUsage:              NewColumnPct(50, Cells[CellNameCpuUsage].GetGridWidget()),
		CellNameNodeLogs:              NewColumnPct(50, Cells[CellNameNodeLogs].GetGridWidget()),
		CellNameButtonQuit:            NewColumnPct(25, Cells[CellNameButtonQuit].GetGridWidget()),
		CellNameTPSTracker:            NewColumnPct(99, Cells[CellNameTPSTracker].GetGridWidget()),
		CellNameCPSTracker:            NewColumnPct(99, Cells[CellNameCPSTracker].GetGridWidget()),
	}

	Cells = []*Cell{
		CellNameNodeStatus:            NewCell(CellNameNodeStatus),
		CellNameNetworkStatus:         NewCell(CellNameNetworkStatus),
		CellNameTransactionsPerSecond: NewCell(CellNameTransactionsPerSecond),
		CellNameCheckpointsPerSecond:  NewCell(CellNameCheckpointsPerSecond),
		CellNameTotalTransactions:     NewCell(CellNameTotalTransactions),
		CellNameLatestCheckpoint:      NewCell(CellNameLatestCheckpoint),
		CellNameHighestCheckpoint:     NewCell(CellNameHighestCheckpoint),
		CellNameConnectedPeers:        NewCell(CellNameConnectedPeers),
		CellNameTXSyncProgress:        NewCell(CellNameTXSyncProgress),
		CellNameCheckSyncProgress:     NewCell(CellNameCheckSyncProgress),
		CellNameUptime:                NewCell(CellNameUptime),
		CellNameVersion:               NewCell(CellNameVersion),
		CellNameCommit:                NewCell(CellNameCommit),
		CellNameCurrentEpoch:          NewCell(CellNameCurrentEpoch),
		CellNameEpochProgress:         NewCell(CellNameEpochProgress),
		CellNameEpochEnd:              NewCell(CellNameEpochEnd),
		CellNameDiskUsage:             NewCell(CellNameDiskUsage),
		CellNameDatabaseSize:          NewCell(CellNameDatabaseSize),
		CellNameBytesSent:             NewCell(CellNameBytesSent),
		CellNameBytesReceived:         NewCell(CellNameBytesReceived),
		CellNameMemoryUsage:           NewCell(CellNameMemoryUsage),
		CellNameCpuUsage:              NewCell(CellNameCpuUsage),
		CellNameNodeLogs:              NewCell(CellNameNodeLogs),
		CellNameButtonQuit:            NewCell(CellNameButtonQuit),
		CellNameTPSTracker:            NewCell(CellNameTPSTracker),
		CellNameCPSTracker:            NewCell(CellNameCPSTracker),
	}
)

Functions

func CellNameStrings

func CellNameStrings() []string

CellNameStrings returns a slice of all String values of the enum

func DashboardLoadingBlinkValue

func DashboardLoadingBlinkValue() string

func NewColumn

func NewColumn(width int, elements ...grid.Element) grid.Element

func NewColumnPct

func NewColumnPct(width int, elements ...grid.Element) grid.Element

func NewRowPct

func NewRowPct(height int, elements ...grid.Element) grid.Element

Types

type Cell

type Cell struct {
	Name    CellName
	Widget  widgetapi.Widget
	Options []container.Option
}

func NewCell

func NewCell(name CellName) *Cell

func (*Cell) GetGridWidget

func (c *Cell) GetGridWidget() grid.Element

func (*Cell) Write

func (c *Cell) Write(value any, options any)

type CellName

type CellName int
const (
	CellNameNodeStatus CellName = iota
	CellNameNetworkStatus
	CellNameTransactionsPerSecond
	CellNameCheckpointsPerSecond
	CellNameTotalTransactions
	CellNameLatestCheckpoint
	CellNameHighestCheckpoint
	CellNameConnectedPeers
	CellNameTXSyncProgress
	CellNameCheckSyncProgress
	CellNameUptime
	CellNameVersion
	CellNameCommit
	CellNameCurrentEpoch
	CellNameEpochProgress
	CellNameEpochEnd
	CellNameDiskUsage
	CellNameDatabaseSize
	CellNameBytesSent
	CellNameBytesReceived
	CellNameMemoryUsage
	CellNameCpuUsage
	CellNameNodeLogs
	CellNameButtonQuit
	CellNameTPSTracker
	CellNameCPSTracker
)

func CellNameString

func CellNameString(s string) (CellName, error)

CellNameString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CellNameValues

func CellNameValues() []CellName

CellNameValues returns all values of the enum

func (CellName) CellNameString

func (i CellName) CellNameString() string

func (CellName) IsACellName

func (i CellName) IsACellName() bool

IsACellName returns "true" if the value is listed in the enum definition. "false" otherwise

func (CellName) MarshalJSON

func (i CellName) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for CellName

func (CellName) String

func (i CellName) String() string

func (*CellName) UnmarshalJSON

func (i *CellName) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CellName

type Column

type Column struct {
	Width    int
	Elements []Element
}

type DonutWriteInput

type DonutWriteInput struct {
	Label      string
	Percentage int
	Color      cell.Color
}

func NewDonutInput

func NewDonutInput(label string, pct int) DonutWriteInput

type Element

type Element interface {
	// contains filtered or unexported methods
}

type Row

type Row struct {
	Height   int
	Elements []Element
}

Jump to

Keyboard shortcuts

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