Added more unit options to create form

This commit is contained in:
Christian Muehlhaeuser 2018-03-13 03:03:12 +01:00
parent ebbbe314e4
commit e1d5cc843f
1 changed files with 14 additions and 8 deletions

View File

@ -79,22 +79,28 @@ var (
} }
app := tview.NewApplication() app := tview.NewApplication()
form := tview.NewForm(). form := tview.NewForm().
AddInputField("Exec", createOpts.Exec, 40, nil, func(s string) { AddInputField("Description:", createOpts.Description, 40, nil, func(s string) {
createOpts.Exec = s
}).
AddInputField("Description", createOpts.Description, 40, nil, func(s string) {
createOpts.Description = s createOpts.Description = s
}). }).
AddDropDown("Type", types, types.IndexOf(createOpts.Type), func(s string, i int) { AddDropDown("Type:", types, types.IndexOf(createOpts.Type), func(s string, i int) {
createOpts.Type = s createOpts.Type = s
}). }).
AddDropDown("Restarts", restarts, restarts.IndexOf(createOpts.Restart), func(s string, i int) { AddInputField("Exec on start:", createOpts.Exec, 40, nil, func(s string) {
createOpts.Exec = s
}).
AddInputField("Exec on stop:", createOpts.ExecStop, 40, nil, func(s string) {
createOpts.ExecStop = s
}).
AddInputField("Exec on reload:", createOpts.ExecReload, 40, nil, func(s string) {
createOpts.ExecReload = s
}).
AddDropDown("Restarts on:", restarts, restarts.IndexOf(createOpts.Restart), func(s string, i int) {
createOpts.Restart = s createOpts.Restart = s
}). }).
AddDropDown("Start After", ts.Strings(), Strings(ts.Strings()).IndexOf(createOpts.After), func(s string, i int) { AddDropDown("Start after target:", ts.Strings(), Strings(ts.Strings()).IndexOf(createOpts.After), func(s string, i int) {
createOpts.After = s createOpts.After = s
}). }).
AddDropDown("Wanted By", ts.Strings(), Strings(ts.Strings()).IndexOf(createOpts.WantedBy), func(s string, i int) { AddDropDown("Wanted by target:", ts.Strings(), Strings(ts.Strings()).IndexOf(createOpts.WantedBy), func(s string, i int) {
createOpts.WantedBy = s createOpts.WantedBy = s
}) })