39 lines
No EOL
1.6 KiB
HTML
39 lines
No EOL
1.6 KiB
HTML
{{ $config := ((.Context).Value "adapter").GetConfig }}
|
|
{{ $csrfToken := (.Context).Value "csrfToken" }}
|
|
|
|
{{ template "header" . }}
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
<form class="configurator" method="POST" action="/config-set">
|
|
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
|
|
{{ range $opt, $val := $config }}
|
|
{{ if eq ($opt).Type "bool" }}
|
|
<input type="hidden" name="{{($opt).Name}}:{{($opt).Type}}" value="0"/>
|
|
<label> {{($opt).Name}} <input type="checkbox" name="{{($opt).Name}}:{{($opt).Type}}" {{ if ne $val "0" }}checked{{end}} value="1"/></label><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ range $opt, $val := $config }}
|
|
{{ if eq ($opt).Type "int" }}
|
|
<label>{{($opt).Name}} <input type="number" step="1" name="{{($opt).Name}}:{{($opt).Type}}" value="{{$val}}"/></label><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ range $opt, $val := $config }}
|
|
{{ if eq ($opt).Type "float" }}
|
|
<label>{{($opt).Name}} <input type="number" step="0.00000001" name="{{($opt).Name}}:{{($opt).Type}}" value="{{$val}}"/></label><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ range $opt, $val := $config }}
|
|
{{ if eq ($opt).Type "string" }}
|
|
<label>{{($opt).Name}} <input type="text" name="{{($opt).Name}}:{{($opt).Type}}" value="{{$val}}"/></label><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ range $opt, $val := $config }}
|
|
{{ if eq ($opt).Type "multilinestring" }}
|
|
<label>{{($opt).Name}} <textarea name="{{($opt).Name}}:{{($opt).Type}}">{{$val}}</textarea></label><br/>
|
|
{{ end }}
|
|
{{ end }}
|
|
<input type="submit" value="Save"/>
|
|
</form>
|
|
|
|
{{ template "footer" . }} |