Fix port mapping when multiple protocols are enabled

This commit is contained in:
cuigh 2018-11-06 15:56:22 +08:00
parent ce196dd274
commit e9d1ad449c
5 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,7 @@
FROM golang:alpine AS build FROM golang:alpine AS build
WORKDIR /go/src/github.com/cuigh/swirl/ WORKDIR /go/src/github.com/cuigh/swirl/
ADD . . ADD . .
ENV GO111MODULE on
RUN CGO_ENABLED=0 go build -ldflags "-s -w" RUN CGO_ENABLED=0 go build -ldflags "-s -w"
FROM alpine:3.8 FROM alpine:3.8

View File

@ -2446,8 +2446,9 @@ var Swirl;
<td> <td>
<div class="select is-small"> <div class="select is-small">
<select name="endpoint.ports[${this.index}].protocol"> <select name="endpoint.ports[${this.index}].protocol">
<option value="false">TCP</option> <option value="tcp">TCP</option>
<option value="true">UDP</option> <option value="udp">UDP</option>
<option value="sctp">SCTP</option>
</select> </select>
</div> </div>
</td> </td>

File diff suppressed because one or more lines are too long

View File

@ -81,8 +81,9 @@ namespace Swirl.Service {
<td> <td>
<div class="select is-small"> <div class="select is-small">
<select name="endpoint.ports[${this.index}].protocol"> <select name="endpoint.ports[${this.index}].protocol">
<option value="false">TCP</option> <option value="tcp">TCP</option>
<option value="true">UDP</option> <option value="udp">UDP</option>
<option value="sctp">SCTP</option>
</select> </select>
</div> </div>
</td> </td>

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"github.com/pkg/errors"
"net/http" "net/http"
"path/filepath" "path/filepath"
"runtime" "runtime"
@ -11,6 +10,7 @@ import (
_ "github.com/cuigh/auxo/cache/memory" _ "github.com/cuigh/auxo/cache/memory"
"github.com/cuigh/auxo/config" "github.com/cuigh/auxo/config"
"github.com/cuigh/auxo/data/valid" "github.com/cuigh/auxo/data/valid"
"github.com/cuigh/auxo/errors"
"github.com/cuigh/auxo/net/web" "github.com/cuigh/auxo/net/web"
"github.com/cuigh/auxo/net/web/filter" "github.com/cuigh/auxo/net/web/filter"
"github.com/cuigh/auxo/net/web/filter/auth" "github.com/cuigh/auxo/net/web/filter/auth"
@ -27,7 +27,7 @@ func main() {
misc.BindOptions() misc.BindOptions()
app.Name = "Swirl" app.Name = "Swirl"
app.Version = "0.8.3" app.Version = "0.8.4"
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) error { app.Action = func(ctx *app.Context) error {
err := config.UnmarshalOption("swirl", &misc.Options) err := config.UnmarshalOption("swirl", &misc.Options)