MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / SetApp

Method SetApp

internal/ui/components/storage_browser.go:69–123  ·  view source on GitHub ↗
(app *App)

Source from the content-addressed store, hash-verified

67}
68
69func (sb *StorageBrowser) SetApp(app *App) {
70 sb.app = app
71
72 treeNav := createNavigationInputCapture(app, nil, sb.contentTable)
73 var pendingG bool
74 sb.tree.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
75 if handleVimTopBottomRune(event, &pendingG, func() {
76 sb.jumpTreeTop()
77 }, func() {
78 sb.jumpTreeBottom()
79 }) {
80 return nil
81 }
82
83 return treeNav(event)
84 })
85
86 detailsNav := createNavigationInputCapture(app, sb.tree, sb.contentTable)
87 pendingG = false
88 sb.details.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
89 if sb.handlePaneCycleKey(event, sb.contentTable, sb.contentTable) {
90 return nil
91 }
92 if handleVimTopBottomRune(event, &pendingG, func() {
93 jumpTableTop(sb.details)
94 }, func() {
95 jumpTableBottom(sb.details)
96 }) {
97 return nil
98 }
99 return detailsNav(event)
100 })
101
102 contentNav := createNavigationInputCapture(app, sb.tree, nil)
103 pendingG = false
104 sb.contentTable.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
105 if sb.handlePaneCycleKey(event, sb.details, sb.details) {
106 return nil
107 }
108 if sb.handleContentFilterKey(event) {
109 return nil
110 }
111 if handleVimTopBottomRune(event, &pendingG, func() {
112 jumpTableTop(sb.contentTable)
113 }, func() {
114 jumpTableBottom(sb.contentTable)
115 }) {
116 return nil
117 }
118 return contentNav(event)
119 })
120 sb.contentTable.SetSelectionChangedFunc(func(row, column int) {
121 sb.handleContentSelection(row)
122 })
123}
124
125func (sb *StorageBrowser) SetNodes(nodes []*api.Node) {
126 sb.nodes = cloneAndSortStorageNodes(nodes)

Callers

nothing calls this directly

Calls 9

jumpTreeTopMethod · 0.95
jumpTreeBottomMethod · 0.95
handlePaneCycleKeyMethod · 0.95
handleVimTopBottomRuneFunction · 0.85
jumpTableTopFunction · 0.85
jumpTableBottomFunction · 0.85

Tested by

no test coverage detected