Skip to content

Commit

Permalink
refactor: Simplify setupModal function and handle nil cfg.OutputServer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Dec 16, 2024
1 parent 9f795ab commit 739a252
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cmd/cli/commands/install/wizard/step_output_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ func (s *OutputCredentialsStep) Previous() (display.WizardStep, error) {

func (s *OutputCredentialsStep) setupModal() {
var (
cfg = s.Wizard.GetConfig()
pandaOutputServer = strings.Contains(cfg.OutputServer.Address, "platform.ethpandaops.io")
helpText = "Please enter your custom output server address below, with credentials if they are required."
labels = []string{"Server Address", "Username", "Password"}
maxLengths = []int{256, 256, 256}
isPassword = []bool{false, false, true}
cfg = s.Wizard.GetConfig()
helpText = "Please enter your custom output server address below, with credentials if they are required."
labels = []string{"Server Address", "Username", "Password"}
maxLengths = []int{256, 256, 256}
isPassword = []bool{false, false, true}
)

if cfg.OutputServer == nil {
cfg.OutputServer = &service.OutputServerConfig{}
}

pandaOutputServer := strings.Contains(cfg.OutputServer.Address, "platform.ethpandaops.io")
if pandaOutputServer {
helpText = "The ethPandaOps team will have provided you with a username and password. Please enter them below."
labels = []string{"Username", "Password"}
Expand Down

0 comments on commit 739a252

Please sign in to comment.