connectToNodeVNC performs the actual node VNC connection using embedded noVNC client.
(node *api.Node, vncService *vnc.Service)
| 111 | |
| 112 | // connectToNodeVNC performs the actual node VNC connection using embedded noVNC client. |
| 113 | func (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. |
| 144 | func (a *App) connectToVMVNC(vm *api.VM, vncService *vnc.Service) { |
no test coverage detected