You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ feat: enhance profile application and VNC connection handling
- Added legacy compatibility comment for profile settings application in Config.
- Introduced DefaultProfile assignment to ensure getters resolve to the current profile.
- Improved VNC connection handling by centralizing UI feedback for connection outcomes.
- Added success dialog for VNC connections with URL information for better user guidance.
- Enhanced logging for profile switching and VNC connection processes to aid in debugging.
ifstrings.Contains(err.Error(), "xdg-open not found") {
54
+
message:=fmt.Sprintf("Cannot open browser automatically on this system.\n\nxdg-open is not installed or not available.\n\nThe VNC server is still running and ready for connection.\n\nTo connect:\n1. Copy the shortened URL below\n2. Paste it into your browser\n3. It will automatically redirect to the full VNC session\n4. Connect quickly before the session expires\n\nShortened URL:\n%s", vncURL)
55
+
56
+
modal:=CreateErrorDialogWithScrollableText("Browser Not Available", message, func() {
// Success path: show fallback URL and header success
84
+
vartitle, startedHeader, headerMsgstring
85
+
ifkind=="node" {
86
+
title="VNC Shell Started"
87
+
startedHeader=fmt.Sprintf("VNC shell started successfully for %s!", name)
88
+
headerMsg=fmt.Sprintf("Embedded VNC shell started for %s", name)
89
+
} else {
90
+
title="VNC Console Started"
91
+
startedHeader=fmt.Sprintf("VNC console started successfully for %s!", name)
92
+
headerMsg=fmt.Sprintf("Embedded VNC console started for %s", name)
93
+
}
94
+
95
+
message:=fmt.Sprintf("%s\n\nOpening in your default browser...\n\nIf the browser doesn't open automatically, you can use this URL as a fallback:\n\n%s", startedHeader, vncURL)
a.updateHeaderWithActiveProfile() // Restore header with active profile
63
-
64
-
// Check if this is an xdg-open not found error
65
-
ifstrings.Contains(err.Error(), "xdg-open not found") {
66
-
// Show helpful dialog with shortened VNC URL
67
-
message:=fmt.Sprintf("Cannot open browser automatically on this system.\n\nxdg-open is not installed or not available.\n\nThe VNC server is still running and ready for connection.\n\nTo connect to the VNC shell:\n1. Copy the shortened URL below\n2. Paste it into your browser\n3. It will automatically redirect to the full VNC session\n4. Connect quickly before the session expires\n\nShortened URL:\n%s", vncURL)
68
-
69
-
// Create a custom dialog with scrollable text area for long URLs
70
-
modal:=CreateErrorDialogWithScrollableText("Browser Not Available", message, func() {
// Open embedded VNC connection in a goroutine to avoid blocking UI
97
133
gofunc() {
134
+
uiLogger:=models.GetUILogger()
135
+
uiLogger.Debug("Starting VNC connection for VM %s with client addr: %s", vm.Name, a.config.GetAddr())
136
+
98
137
vncURL, err:=vncService.ConnectToVMEmbedded(vm)
99
138
100
139
a.QueueUpdateDraw(func() {
101
-
iferr!=nil {
102
-
// Clear the loading message from header
103
-
a.header.StopLoading()
104
-
a.updateHeaderWithActiveProfile() // Restore header with active profile
105
-
106
-
// Check if this is an xdg-open not found error
107
-
ifstrings.Contains(err.Error(), "xdg-open not found") {
108
-
// Show helpful dialog with shortened VNC URL
109
-
message:=fmt.Sprintf("Cannot open browser automatically on this system.\n\nxdg-open is not installed or not available.\n\nThe VNC server is still running and ready for connection.\n\nTo connect to the VNC console:\n1. Copy the shortened URL below\n2. Paste it into your browser\n3. It will automatically redirect to the full VNC session\n4. Connect quickly before the session expires\n\nShortened URL:\n%s", vncURL)
110
-
111
-
// Create a custom dialog with scrollable text area for long URLs
112
-
modal:=CreateErrorDialogWithScrollableText("Browser Not Available", message, func() {
0 commit comments