(form *tview.Form, frame *tview.Frame, app *tview.Application)
| 19 | } |
| 20 | |
| 21 | func (i *MystConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app *tview.Application) { |
| 22 | enabled := i.Configured |
| 23 | form.AddCheckbox("Enable Myst", i.Configured, func(checked bool) { |
| 24 | enabled = checked |
| 25 | }) |
| 26 | form.AddButton("Save", func() { |
| 27 | i.Configured = enabled |
| 28 | returnToMenu(frame, app) |
| 29 | }) |
| 30 | form.AddButton("Cancel", func() { |
| 31 | returnToMenu(frame, app) |
| 32 | }) |
| 33 | form.AddButton("Register", func() { |
| 34 | modal := tview.NewModal(). |
| 35 | SetText("Register on Mysterium Nodes\n" + MYST_REFERRAL_LINK). |
| 36 | AddButtons([]string{"Open", "Cancel"}). |
| 37 | SetDoneFunc(func(buttonIndex int, buttonLabel string) { |
| 38 | if buttonLabel == "Open" { |
| 39 | webbrowser.Open(MYST_REFERRAL_LINK) |
| 40 | } |
| 41 | app.SetRoot(form, true) |
| 42 | }) |
| 43 | app.SetRoot(modal, true) |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | func (i *MystConfig) ConfigureDocker(kind DockerConfigKind, form *tview.Form) (string, error) { |
| 48 | switch kind { |
nothing calls this directly
no test coverage detected