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

Method SelectNode

internal/ui/components/storage_browser.go:184–200  ·  view source on GitHub ↗
(node *api.Node)

Source from the content-addressed store, hash-verified

182}
183
184func (sb *StorageBrowser) SelectNode(node *api.Node) {
185 if node == nil || sb.tree.GetRoot() == nil {
186 return
187 }
188
189 target := sb.findNode(sb.tree.GetRoot(), selectionKey(node, nil))
190 if target == nil {
191 return
192 }
193
194 sb.tree.SetCurrentNode(target)
195 sb.handleTreeSelection(target)
196 if sb.app != nil {
197 sb.app.pages.SwitchToPage(api.PageStorage)
198 sb.app.SetFocus(sb.tree)
199 }
200}
201
202func (sb *StorageBrowser) handleTreeSelection(node *tview.TreeNode) {
203 ref, _ := node.GetReference().(*storageSelection)

Callers

nothing calls this directly

Calls 4

findNodeMethod · 0.95
handleTreeSelectionMethod · 0.95
selectionKeyFunction · 0.85
SetFocusMethod · 0.65

Tested by

no test coverage detected