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

Method NodeActionsForNode

internal/ui/components/plugins.go:125–141  ·  view source on GitHub ↗

NodeActionsForNode filters registered actions by availability for the provided node.

(node *api.Node)

Source from the content-addressed store, hash-verified

123// NodeActionsForNode filters registered actions by availability for the
124// provided node.
125func (r *pluginRegistry) NodeActionsForNode(node *api.Node) []NodeAction {
126 r.mu.RLock()
127 defer r.mu.RUnlock()
128
129 if len(r.nodeActions) == 0 {
130 return nil
131 }
132
133 var filtered []NodeAction
134 for _, action := range r.nodeActions {
135 if action.IsAvailable == nil || action.IsAvailable(node) {
136 filtered = append(filtered, action)
137 }
138 }
139
140 return filtered
141}
142
143// GuestActions returns a snapshot of all registered guest actions.
144func (r *pluginRegistry) GuestActions() []GuestAction {

Callers 2

ShowNodeContextMenuMethod · 0.80

Calls

no outgoing calls

Tested by 1