1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| {% import ( "strings"
"{{{ .Package }}}/app" "{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/app/lib/exec" "{{{ .Package }}}/views/components" "{{{ .Package }}}/views/layout" ) %}
{% code type Form struct { layout.Basic Exec *exec.Exec } %}
{% func (p *Form) Body(as *app.State, ps *cutil.PageState) %} {%- code x := p.Exec -%} <form action="" method="post" class="mt expanded"> <div class="card"> <h3>{%= components.SVGRefIcon("terminal", ps) %}New Process</h3> <div class="overflow full-width"> <table class="mt min-200 expanded"> <tbody> {%= components.TableInput("key", "", "Key", x.Key, 5, "optional, defaults to command") %} {%= components.TableInput("cmd", "", "Command", x.Cmd, 5, "command to execute, with arguments") %} {%= components.TableInput("path", "", "Path", x.Path, 5) %} {%= components.TableTextarea("env", "", "Env Vars", len(x.Env), strings.Join(x.Env, "\n"), 5) %} <tr> <td colspan="2"><button class="mt" type="submit">Create</button></td> </tr> </tbody> </table> </div> </div> </form> {% endfunc %}
|