Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package views
import (
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
type CommandListView struct {
rootNode *tview.TreeNode
commandsTree *tview.TreeView
}
func NewCommandListView(rootTitle string) *CommandListView {
v := &CommandListView{}
v.rootNode = tview.NewTreeNode(rootTitle)
v.commandsTree = tview.NewTreeView()
v.commandsTree.
SetRoot(v.rootNode).
SetTitle("Commands").
SetBorder(true).
SetBorderColor(tcell.ColorSteelBlue)
return v
}
func (c *CommandListView) GetContent() tview.Primitive {
return c.commandsTree
}
func (v *CommandListView) GetCommands(path string) {
//TODO: change to use commandlist
}
func (v *CommandListView) SelectedFunc() {
//TODO: call GRPC calls for the selected item
}