MCPcopy
hub / github.com/basecamp/once / NewInstallImageForm

Function NewInstallImageForm

internal/ui/install_image_form.go:14–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12}
13
14func NewInstallImageForm() InstallImageForm {
15 m := InstallImageForm{
16 form: NewForm("Next", FormItem{
17 Label: "Image",
18 Field: NewTextField("user/repo:tag"),
19 Required: true,
20 }),
21 }
22
23 m.form.OnSubmit(func(f *Form) tea.Cmd {
24 ref := f.TextField(0).Value()
25 if expanded, ok := expandAlias(ref); ok {
26 ref = expanded
27 }
28 return func() tea.Msg { return InstallImageSubmitMsg{ImageRef: ref} }
29 })
30 m.form.OnCancel(func(f *Form) tea.Cmd {
31 return func() tea.Msg { return InstallImageBackMsg{} }
32 })
33
34 return m
35}
36
37func (m InstallImageForm) Init() tea.Cmd {
38 return m.form.Init()

Calls 7

NewFormFunction · 0.85
NewTextFieldFunction · 0.85
expandAliasFunction · 0.85
OnSubmitMethod · 0.80
TextFieldMethod · 0.80
OnCancelMethod · 0.80
ValueMethod · 0.65

Used in the wild real call sites across dependent graphs

searching dependent graphs…