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

Function CreateAboutDialog

internal/ui/components/dialogs_creators.go:212–264  ·  view source on GitHub ↗

CreateAboutDialog creates an about dialog with version information and links.

(versionInfo *version.BuildInfo, onClose func())

Source from the content-addressed store, hash-verified

210
211// CreateAboutDialog creates an about dialog with version information and links.
212func CreateAboutDialog(versionInfo *version.BuildInfo, onClose func()) tview.Primitive {
213 // Format build date for display
214 buildDateDisplay := versionInfo.BuildDate
215 if buildDateDisplay != "unknown" {
216 if parsed, err := time.Parse(time.RFC3339, buildDateDisplay); err == nil {
217 buildDateDisplay = parsed.Format("2006-01-02 15:04:05 UTC")
218 }
219 }
220
221 // Create about text with dynamic information
222 aboutText := fmt.Sprintf(`pvetui
223
224A terminal user interface for Proxmox VE
225
226Version: %s
227Build Date: %s
228Commit: %s
229Go Version: %s
230OS/Arch: %s/%s
231
232Copyright © %s %s
233Licensed under the %s
234
235GitHub: %s
236Releases: %s`,
237 versionInfo.Version,
238 buildDateDisplay,
239 versionInfo.Commit,
240 versionInfo.GoVersion,
241 versionInfo.OS,
242 versionInfo.Arch,
243 version.GetCopyrightYearRange(),
244 version.Author,
245 version.License,
246 version.GetGitHubURL(),
247 version.GetGitHubReleaseURL())
248
249 // Use a wider modal to avoid wrapping long URLs; enforce a generous minimum width.
250 modal := NewWideModal(0.55, 70)
251 modal.SetText(aboutText)
252 modal.SetTextColor(theme.Colors.Primary)
253 modal.SetBorderColor(theme.Colors.Border)
254 modal.SetTitle("About")
255 modal.SetTitleColor(theme.Colors.Title)
256 modal.AddButtons([]string{"OK"})
257 modal.SetDoneFunc(func(buttonIndex int, buttonLabel string) {
258 if onClose != nil {
259 onClose()
260 }
261 })
262
263 return modal
264}

Callers 1

showAboutDialogMethod · 0.85

Calls 9

SetTextMethod · 0.95
SetTextColorMethod · 0.95
AddButtonsMethod · 0.95
SetDoneFuncMethod · 0.95
GetCopyrightYearRangeFunction · 0.92
GetGitHubURLFunction · 0.92
GetGitHubReleaseURLFunction · 0.92
NewWideModalFunction · 0.85
SetTitleMethod · 0.65

Tested by

no test coverage detected