make some config options hidden
This commit is contained in:
parent
716fa54d56
commit
30c3a2c4b4
3 changed files with 20 additions and 8 deletions
|
@ -22,6 +22,7 @@ type Page struct {
|
|||
type ConfigOption struct {
|
||||
Name string
|
||||
Type string
|
||||
Hidden bool
|
||||
}
|
||||
|
||||
type BuildOption ConfigOption
|
||||
|
|
|
@ -379,6 +379,7 @@ func (self *EurekaAdapter) readCfg() error {
|
|||
self.Config[ConfigOption{
|
||||
Name: k,
|
||||
Type: "string",
|
||||
Hidden: strings.HasPrefix(k, "DEPLOY") || k == "SITEROOT",
|
||||
}] = cleanedString
|
||||
}
|
||||
} else if strings.Contains(v, ".") {
|
||||
|
|
|
@ -36,31 +36,41 @@
|
|||
<form class="configurator" method="POST" action="/config-set">
|
||||
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ if ne ($opt).Hidden true }}
|
||||
{{ 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 }}
|
||||
{{ end }}
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ if ne ($opt).Hidden true }}
|
||||
{{ if eq ($opt).Type "int" }}
|
||||
<label>{{($opt).Name}} <input type="number" step="1" name="{{($opt).Name}}:{{($opt).Type}}" value="{{$val}}"/></label><br/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ if ne ($opt).Hidden true }}
|
||||
{{ 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 }}
|
||||
{{ end }}
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ if ne ($opt).Hidden true }}
|
||||
{{ if eq ($opt).Type "string" }}
|
||||
<label>{{($opt).Name}} <input type="text" name="{{($opt).Name}}:{{($opt).Type}}" value="{{$val}}"/></label><br/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ if ne ($opt).Hidden true }}
|
||||
{{ if eq ($opt).Type "multilinestring" }}
|
||||
<label>{{($opt).Name}} <textarea name="{{($opt).Name}}:{{($opt).Type}}">{{$val}}</textarea></label><br/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<input type="submit" value="Save"/>
|
||||
</form>
|
||||
|
||||
|
|
Loading…
Reference in a new issue