Example #1
0
func uiDetail(detail *termui.List) *termui.Grid {
	body := termui.NewGrid()
	help := termui.NewPar("s:summary(main view) q:quit h:help")
	help.Height = 3
	help.Border.Label = "Keyboard shortcuts"
	detail.Height = 15
	body.AddRows(
		termui.NewRow(termui.NewCol(12, 0, help)),
		termui.NewRow(termui.NewCol(12, 0, detail)))
	return body
}
Example #2
0
func uiHelp() *termui.Grid {
	body := termui.NewGrid()
	kbHelp := termui.NewList()
	kbHelp.Items = []string{
		"h: Help",
		"s: Summary view",
		"c: processes by cpu usage",
		"C: cgroups for cpu subsystem",
		"m: processes by memory usage",
		"M: cgroups for memory subsystem",
		"i: processes by io",
		"d: disk io statistics",
		"f: filesystem statistics",
		"n: network interface statistics",
		"p: problems found",
		"q: Quit",
	}
	kbHelp.Border.Label = "Keyboard shortcuts"
	kbHelp.Height = 20
	body.AddRows(termui.NewRow(termui.NewCol(12, 0, kbHelp)))
	return body
}
Example #3
0
func uiSummary(widgets *osmain.DisplayWidgets) *termui.Grid {
	body := termui.NewGrid()
	help := termui.NewPar("q:quit h:help c:cpu etc")
	help.Height = 3
	body.AddRows(
		termui.NewRow(
			termui.NewCol(8, 0, widgets.Summary),
			termui.NewCol(4, 0, help)),
		termui.NewRow(
			termui.NewCol(6, 0, widgets.ProcessesByCPU),
			termui.NewCol(6, 0, widgets.ProcessesByMemory)),
		termui.NewRow(
			termui.NewCol(8, 0, widgets.ProcessesByIO),
			termui.NewCol(4, 0, widgets.DiskIOUsage)),
		termui.NewRow(
			termui.NewCol(6, 0, widgets.FileSystemUsage),
			termui.NewCol(6, 0, widgets.InterfaceUsage)),
		termui.NewRow(
			termui.NewCol(6, 0, widgets.CgroupsCPU),
			termui.NewCol(6, 0, widgets.CgroupsMem)),
		termui.NewRow(termui.NewCol(12, 0, widgets.Problems)))
	return body
}