MCPcopy Create free account
hub / github.com/Xpl0itU/passiveMachine / ConfigureForm

Method ConfigureForm

mystnode.go:21–45  ·  view source on GitHub ↗
(form *tview.Form, frame *tview.Frame, app *tview.Application)

Source from the content-addressed store, hash-verified

19}
20
21func (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
47func (i *MystConfig) ConfigureDocker(kind DockerConfigKind, form *tview.Form) (string, error) {
48 switch kind {

Callers

nothing calls this directly

Calls 1

returnToMenuFunction · 0.85

Tested by

no test coverage detected