Added more unit options to create form

This commit is contained in:
Christian Muehlhaeuser 2018-03-13 03:03:12 +01:00
parent c5be883f56
commit 162b76826f
No known key found for this signature in database
GPG Key ID: BA4CF857DD4117E9
1 changed files with 14 additions and 8 deletions

View File

@ -79,22 +79,28 @@ var (
}
app := tview.NewApplication()
form := tview.NewForm().
AddInputField("Exec", createOpts.Exec, 40, nil, func(s string) {
createOpts.Exec = s
}).
AddInputField("Description", createOpts.Description, 40, nil, func(s string) {
AddInputField("Description:", createOpts.Description, 40, nil, func(s string) {
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
}).
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
}).
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
}).
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
})