showAddProfileDialog displays a dialog for adding a new connection profile.
()
| 656 | // showAddProfileDialog displays a dialog for adding a new connection profile. |
| 657 | |
| 658 | func (a *App) showAddProfileDialog() { |
| 659 | |
| 660 | // Store last focused primitive |
| 661 | |
| 662 | a.lastFocus = a.GetFocus() |
| 663 | |
| 664 | // Create a new profile config |
| 665 | |
| 666 | newProfile := config.ProfileConfig{ |
| 667 | |
| 668 | Addr: "", |
| 669 | |
| 670 | User: "", |
| 671 | |
| 672 | Password: "", |
| 673 | |
| 674 | TokenID: "", |
| 675 | |
| 676 | TokenSecret: "", |
| 677 | |
| 678 | Realm: "pam", |
| 679 | |
| 680 | ApiPath: "/api2/json", |
| 681 | |
| 682 | Insecure: false, |
| 683 | |
| 684 | SSHUser: "", |
| 685 | |
| 686 | VMSSHUser: "", |
| 687 | } |
| 688 | |
| 689 | // Create a temporary config for the wizard |
| 690 | |
| 691 | tempConfig := &config.Config{ |
| 692 | |
| 693 | Profiles: make(map[string]config.ProfileConfig), |
| 694 | |
| 695 | DefaultProfile: "new_profile", // This will be replaced with the actual name |
| 696 | |
| 697 | // Use the legacy fields for the wizard |
| 698 | |
| 699 | Addr: newProfile.Addr, |
| 700 | |
| 701 | User: newProfile.User, |
| 702 | |
| 703 | Password: newProfile.Password, |
| 704 | |
| 705 | TokenID: newProfile.TokenID, |
| 706 | |
| 707 | TokenSecret: newProfile.TokenSecret, |
| 708 | |
| 709 | Realm: newProfile.Realm, |
| 710 | |
| 711 | ApiPath: newProfile.ApiPath, |
| 712 | |
| 713 | Insecure: newProfile.Insecure, |
| 714 | |
| 715 | SSHUser: newProfile.SSHUser, |
no test coverage detected