add client to containermap, add views package, help view

This commit is contained in:
Bradley Cicenas
2017-01-01 22:42:13 +00:00
parent adaa07fd4d
commit 6e87539b9d
7 changed files with 103 additions and 43 deletions

26
views/help.go Normal file
View File

@@ -0,0 +1,26 @@
package views
import (
"strings"
ui "github.com/gizak/termui"
)
var helpDialog = []string{
"[h] - open this help dialog",
"[q] - exit ctop",
}
func Help() {
p := ui.NewPar(strings.Join(helpDialog, "\n"))
p.Height = 10
p.Width = 50
p.TextFgColor = ui.ColorWhite
p.BorderLabel = "Help"
p.BorderFg = ui.ColorCyan
ui.Render(p)
ui.Handle("/sys/kbd/q", func(ui.Event) {
ui.StopLoop()
})
ui.Loop()
}