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

Method showEditProfileDialog

internal/ui/components/connection_profiles.go:771–857  ·  view source on GitHub ↗

showEditProfileDialog displays a dialog for editing an existing connection profile.

(profileName string)

Source from the content-addressed store, hash-verified

769// showEditProfileDialog displays a dialog for editing an existing connection profile.
770
771func (a *App) showEditProfileDialog(profileName string) {
772
773 // Store last focused primitive
774
775 a.lastFocus = a.GetFocus()
776
777 // Get the existing profile
778
779 profiles := a.config.Profiles
780
781 if profiles == nil {
782
783 profiles = make(map[string]config.ProfileConfig)
784
785 }
786
787 profile, exists := profiles[profileName]
788
789 if !exists {
790
791 a.showMessageSafe("Profile '" + profileName + "' not found!")
792
793 return
794
795 }
796
797 // Create a temporary config for the wizard with proper profile structure
798
799 tempConfig := &config.Config{
800
801 Profiles: make(map[string]config.ProfileConfig),
802
803 DefaultProfile: profileName,
804
805 Debug: a.config.Debug,
806
807 CacheDir: a.config.CacheDir,
808
809 Theme: a.config.Theme,
810 }
811
812 // Copy the profile data into the temporary config's profiles map
813
814 tempConfig.Profiles[profileName] = profile
815
816 // Create a channel for the wizard result
817
818 resultChan := make(chan WizardResult, 1)
819
820 // Create the wizard page using our embedded version
821
822 wizardPage := a.createEmbeddedConfigWizard(tempConfig, resultChan)
823
824 // Add the wizard page
825
826 a.pages.AddPage("profileWizard", wizardPage, true, true)
827
828 a.SetFocus(wizardPage)

Callers 1

Calls 7

showMessageSafeMethod · 0.95
QueueUpdateDrawMethod · 0.80
SetFocusMethod · 0.65
ShowActiveProfileMethod · 0.65
ShowSuccessMethod · 0.65

Tested by

no test coverage detected