This commit is contained in:
cuigh 2018-04-17 11:20:51 +08:00
parent aa9481ac7a
commit 1b014b17f7
3 changed files with 6 additions and 6 deletions

2
Gopkg.lock generated
View File

@ -59,7 +59,7 @@
"util/lazy", "util/lazy",
"util/run" "util/run"
] ]
revision = "92f7532da4ac19d55266a770847167bb9fb5130f" revision = "9855e0c983b3355b993c7b8af526a30594eccfe8"
[[projects]] [[projects]]
branch = "master" branch = "master"

View File

@ -28,7 +28,7 @@ func main() {
misc.BindOptions() misc.BindOptions()
app.Name = "Swirl" app.Name = "Swirl"
app.Version = "0.7.5" app.Version = "0.7.6"
app.Desc = "A web management UI for Docker, focused on swarm cluster" app.Desc = "A web management UI for Docker, focused on swarm cluster"
app.Action = func(ctx *app.Context) { app.Action = func(ctx *app.Context) {
err := config.UnmarshalOption("swirl", &misc.Options) err := config.UnmarshalOption("swirl", &misc.Options)

View File

@ -13,16 +13,16 @@
<label for="{{id ? id : (name + "-" + value)}}">{{label}}</label> <label for="{{id ? id : (name + "-" + value)}}">{{label}}</label>
{{ end }} {{ end }}
{{ block radios(name, values, labels="", checked) }} {{ block radios(name, values, labels, checked) }}
{{ labels = eq(labels, "") ? values : labels }} {{ labels = choose(labels, values) }}
{{ range i, v := values }} {{ range i, v := values }}
<input id="{{ name + "-" + v }}" name="{{name}}" value="{{v}}" type="radio" class="is-checkradio"{{ if eq(checked, v) }} checked{{end}}> <input id="{{ name + "-" + v }}" name="{{name}}" value="{{v}}" type="radio" class="is-checkradio"{{ if eq(checked, v) }} checked{{end}}>
<label for="{{ name + "-" + v }}">{{ labels[i] }}</label> <label for="{{ name + "-" + v }}">{{ labels[i] }}</label>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ block select(name, values, labels="", selected, dt) }} {{ block select(name, values, labels, selected, dt) }}
{{ labels = eq(labels, "") ? values : labels }} {{ labels = choose(labels, values) }}
<select name="{{name}}"{{if dt}} data-type="{{dt}}"{{end}}> <select name="{{name}}"{{if dt}} data-type="{{dt}}"{{end}}>
{{ range i, v := values }} {{ range i, v := values }}
<option value="{{ v }}"{{ if eq(selected, v) }} selected{{ end }}>{{ labels[i] }}</option> <option value="{{ v }}"{{ if eq(selected, v) }} selected{{ end }}>{{ labels[i] }}</option>