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

Function CreateSuccessDialogWithURL

internal/ui/components/dialogs_creators.go:139–168  ·  view source on GitHub ↗

CreateSuccessDialogWithURL creates a success dialog with URL information for VNC connections.

(title, message string, onClose func())

Source from the content-addressed store, hash-verified

137
138// CreateSuccessDialogWithURL creates a success dialog with URL information for VNC connections.
139func CreateSuccessDialogWithURL(title, message string, onClose func()) *tview.Modal {
140 // Create a modal with the message
141 modal := tview.NewModal()
142 modal.SetText(message)
143 modal.SetTextColor(theme.Colors.Success)
144 modal.SetBorderColor(theme.Colors.Border)
145 modal.SetTitle(title)
146 modal.SetTitleColor(theme.Colors.Title)
147
148 // Add close button
149 modal.AddButtons([]string{"OK"})
150 modal.SetDoneFunc(func(buttonIndex int, buttonLabel string) {
151 if onClose != nil {
152 onClose()
153 }
154 })
155
156 // Add keyboard shortcuts for dismissal
157 modal.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
158 if event.Key() == tcell.KeyEscape {
159 if onClose != nil {
160 onClose()
161 }
162 return nil
163 }
164 return event
165 })
166
167 return modal
168}
169
170// CreateFormDialog creates a form dialog with custom fields.
171func CreateFormDialog(title string, fields []FormField, onSubmit, onCancel func(map[string]string)) *tview.Form {

Callers 1

handleVNCOutcomeMethod · 0.85

Calls 5

SetTextColorMethod · 0.80
AddButtonsMethod · 0.80
SetDoneFuncMethod · 0.80
SetTitleMethod · 0.65
SetTextMethod · 0.45

Tested by

no test coverage detected