widgets

package
v0.0.0-...-0d6890e Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorGreen1     ui.Color = 46
	ColorGreen2     ui.Color = 42
	ColorGreen3     ui.Color = 34
	DarkRed         ui.Color = 52
	ColorRed1       ui.Color = 195
	ColorRed3       ui.Color = 99
	RoyalBlue1      ui.Color = 63
	NavyBlue        ui.Color = 17
	MediumPurple3   ui.Color = 141
	DeepPink4       ui.Color = 125
	LightSteelBlue  ui.Color = 147
	Gold3           ui.Color = 178
	Aquamarine3     ui.Color = 79
	Orange4         ui.Color = 94
	LightGreen      ui.Color = 119
	SteelBlue1      ui.Color = 81
	CornflowerBlue  ui.Color = 69
	LightGoldenrod3 ui.Color = 179
	IndianRed       ui.Color = 173
)

对termui颜色的额外补充

Variables

View Source
var CpuBorderStyle = ui.NewStyle(ui.ColorCyan)

CPU

View Source
var CpuTextStyle = ui.NewStyle(Gold3)
View Source
var DiskBorderStyle = ui.NewStyle(ui.ColorCyan)

Disk

View Source
var DiskTextStyle = ui.NewStyle(Aquamarine3)
View Source
var MemBorderStyle = ui.NewStyle(ui.ColorCyan)

Mem

View Source
var MemLabelStyles = MemStrStyles
View Source
var MemTextStyle = ui.NewStyle(MediumPurple3)
View Source
var MyBorderStyle = ui.NewStyle(ui.ColorCyan)
View Source
var NetBorderStyle = ui.NewStyle(ui.ColorCyan)

Net

View Source
var NetTextStyle = ui.NewStyle(IndianRed)
View Source
var ProcessBorderStyle = ui.NewStyle(SteelBlue1)

Process

View Source
var ProcessCMDTextStyle = ui.NewStyle(LightGreen)
View Source
var ProcessTextStyle = ui.NewStyle(LightGreen)
View Source
var ProcessesBorderStyle = ui.NewStyle(ui.ColorCyan)

Processes

View Source
var ProcessesTextStyle = ui.NewStyle(ui.ColorGreen)
View Source
var TextStyle = ui.NewStyle(ui.ColorYellow)
View Source
var TitleStyle = ui.Theme.Block.Title

Functions

This section is empty.

Types

type BarChart

type BarChart struct {
	BarColors     []Color
	Data          []float64
	Str           []string
	StrStyles     []Style
	StrMinWidth   int
	Labels        []string
	LabelStyles   []Style
	LabelMinWidth int
	BarMinWidth   int // 7
	MaxVal        float64
}

type CMD

type CMD struct {
	CMDText      string
	CMDTextStyle Style
	CMDStyle     Style
	RowY         int
}

type ExtraBlock

type ExtraBlock struct {
	Block

	RightTitle      string
	RightTitleStyle Style

	BottomTitle      string
	BottomTitleStyle Style

	BottomRightTitle      string
	BottomRightTitleStyle Style
}

func NewExtraBlock

func NewExtraBlock() *ExtraBlock

func (*ExtraBlock) Draw

func (self *ExtraBlock) Draw(buf *Buffer)

type FormattedText

type FormattedText struct {
	Str      []string
	StrStyle []Style
	RowY     []int
	Align    []string
	Widths   []int
}

type Graph

type Graph struct {
	Text      []string
	TextStyle Style
	MinWidth  int
}

type Line

type Line struct {
	Data   [][]float64
	MaxVal float64

	LineColors []Color
}

type Table

type Table struct {
	Rows                     [][]string
	TitleStyle               Style
	ColumnsImportance        []string
	ColumnsMinWidth          []int
	IncreaseWidthColumnIndex int
	TextStyle                Style
	ColumnsStyles            map[int]Style
	FillRow                  bool

	ActiveRowIndex int
	ActiveRowStyle Style
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) GetRow

func (self *Table) GetRow() []string

func (*Table) Render

func (self *Table) Render(buf *Buffer, block *ExtraBlock)

func (*Table) ScrolDown

func (self *Table) ScrolDown()

func (*Table) ScrolUp

func (self *Table) ScrolUp()

func (*Table) ScrollBottom

func (self *Table) ScrollBottom()

func (*Table) ScrollTop

func (self *Table) ScrollTop()

type WCpu

type WCpu struct {
	ExtraBlock
	Graph
	Line
}

func NewWCpu

func NewWCpu() *WCpu

func (*WCpu) Draw

func (self *WCpu) Draw(buf *Buffer)

type WDisk

type WDisk struct {
	ExtraBlock
	Table
}

func NewWDisk

func NewWDisk() *WDisk

func (*WDisk) Draw

func (self *WDisk) Draw(buf *Buffer)

type WMem

type WMem struct {
	ExtraBlock
	Graph
	BarChart
}

func NewWMem

func NewWMem() *WMem

func (*WMem) Draw

func (self *WMem) Draw(buf *Buffer)

type WNet

type WNet struct {
	ExtraBlock
	Table
}

func NewWNet

func NewWNet() *WNet

func (*WNet) Draw

func (self *WNet) Draw(buf *Buffer)

type WProcess

type WProcess struct {
	ExtraBlock
	Table
	FormattedText
	CMD
}

func NewWProcess

func NewWProcess() *WProcess

func (*WProcess) Draw

func (self *WProcess) Draw(buf *Buffer)

type WProcesses

type WProcesses struct {
	ExtraBlock
	Table
}

func NewWProcesses

func NewWProcesses() *WProcesses

func (*WProcesses) Draw

func (self *WProcesses) Draw(buf *Buffer)

Jump to

Keyboard shortcuts

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