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

Method GetSelectedNode

internal/ui/components/node_list.go:122–129  ·  view source on GitHub ↗

GetSelectedNode returns the currently selected node.

()

Source from the content-addressed store, hash-verified

120
121// GetSelectedNode returns the currently selected node.
122func (nl *NodeList) GetSelectedNode() *api.Node {
123 idx := nl.GetCurrentItem()
124 if idx >= 0 && idx < len(nl.nodes) {
125 return nl.nodes[idx]
126 }
127
128 return nil
129}
130
131// GetNodes returns the current nodes slice.
132func (nl *NodeList) GetNodes() []*api.Node {

Callers

nothing calls this directly

Calls 1

GetCurrentItemMethod · 0.65

Tested by

no test coverage detected