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

Method connectToNodeVNC

internal/ui/components/shell.go:113–141  ·  view source on GitHub ↗

connectToNodeVNC performs the actual node VNC connection using embedded noVNC client.

(node *api.Node, vncService *vnc.Service)

Source from the content-addressed store, hash-verified

111
112// connectToNodeVNC performs the actual node VNC connection using embedded noVNC client.
113func (a *App) connectToNodeVNC(node *api.Node, vncService *vnc.Service) {
114 // Show loading message
115 a.header.ShowLoading(fmt.Sprintf("Starting embedded VNC shell for %s...", node.Name))
116
117 // Open embedded VNC connection in a goroutine to avoid blocking UI
118 go func() {
119 uiLogger := models.GetUILogger()
120 uiLogger.Debug("Starting VNC connection for node %s with client addr: %s", node.Name, a.config.GetAddr())
121
122 var vncURL string
123 var err error
124
125 client, clientErr := a.getClientForNode(node)
126 if clientErr != nil {
127 err = clientErr
128 } else {
129 vncURL, err = vncService.ConnectToNodeEmbeddedWithClient(client, node.Name)
130 }
131
132 a.QueueUpdateDraw(func() {
133 // Clear the loading message from header
134 a.header.StopLoading()
135 a.updateHeaderWithActiveProfile() // Restore header with active profile
136
137 // Unified outcome handling
138 a.handleVNCOutcome("node", node.Name, vncURL, err)
139 })
140 }()
141}
142
143// connectToVMVNC performs the actual VM VNC connection using embedded noVNC client.
144func (a *App) connectToVMVNC(vm *api.VM, vncService *vnc.Service) {

Callers 1

openNodeVNCMethod · 0.95

Calls 10

getClientForNodeMethod · 0.95
handleVNCOutcomeMethod · 0.95
GetUILoggerFunction · 0.92
QueueUpdateDrawMethod · 0.80
ShowLoadingMethod · 0.65
DebugMethod · 0.65
GetAddrMethod · 0.65
StopLoadingMethod · 0.65

Tested by

no test coverage detected