diff --git a/controller/config.go b/controller/config.go index e9c3772..c43ef33 100644 --- a/controller/config.go +++ b/controller/config.go @@ -34,7 +34,7 @@ func Config() (c *ConfigController) { func configList(ctx web.Context) error { name := ctx.Q("name") - page := cast.ToIntD(ctx.Q("page"), 1) + page := cast.ToInt(ctx.Q("page"), 1) configs, totalCount, err := docker.ConfigList(name, page, model.PageSize) if err != nil { return err diff --git a/controller/container.go b/controller/container.go index 3bf9e52..c035f9f 100644 --- a/controller/container.go +++ b/controller/container.go @@ -87,8 +87,8 @@ func containerLogs(ctx web.Context) error { return err } - line := cast.ToIntD(ctx.Q("line"), 500) - timestamps := cast.ToBoolD(ctx.Q("timestamps"), false) + line := cast.ToInt(ctx.Q("line"), 500) + timestamps := cast.ToBool(ctx.Q("timestamps"), false) stdout, stderr, err := docker.ContainerLogs(id, line, timestamps) if err != nil { return err diff --git a/controller/image.go b/controller/image.go index f808d2a..5a71db5 100644 --- a/controller/image.go +++ b/controller/image.go @@ -30,7 +30,7 @@ func Image() (c *ImageController) { func imageList(ctx web.Context) error { name := ctx.Q("name") - page := cast.ToIntD(ctx.Q("page"), 1) + page := cast.ToInt(ctx.Q("page"), 1) images, totalCount, err := docker.ImageList(name, page, model.PageSize) if err != nil { return err diff --git a/controller/secret.go b/controller/secret.go index 19c7d19..2a73090 100644 --- a/controller/secret.go +++ b/controller/secret.go @@ -33,7 +33,7 @@ func Secret() (c *SecretController) { } func secretList(ctx web.Context) error { name := ctx.Q("name") - page := cast.ToIntD(ctx.Q("page"), 1) + page := cast.ToInt(ctx.Q("page"), 1) secrets, totalCount, err := docker.SecretList(name, page, model.PageSize) if err != nil { return err diff --git a/controller/service.go b/controller/service.go index 2ad0329..86eae15 100644 --- a/controller/service.go +++ b/controller/service.go @@ -47,7 +47,7 @@ func Service() (c *ServiceController) { func serviceList(ctx web.Context) error { name := ctx.Q("name") - page := cast.ToIntD(ctx.Q("page"), 1) + page := cast.ToInt(ctx.Q("page"), 1) services, totalCount, err := docker.ServiceList(name, page, model.PageSize) if err != nil { return err @@ -102,8 +102,8 @@ func serviceRaw(ctx web.Context) error { func serviceLogs(ctx web.Context) error { name := ctx.P("name") - line := cast.ToIntD(ctx.Q("line"), 500) - timestamps := cast.ToBoolD(ctx.Q("timestamps"), false) + line := cast.ToInt(ctx.Q("line"), 500) + timestamps := cast.ToBool(ctx.Q("timestamps"), false) stdout, stderr, err := docker.ServiceLogs(name, line, timestamps) if err != nil { return err diff --git a/controller/volume.go b/controller/volume.go index fb3c9a0..1dc5152 100644 --- a/controller/volume.go +++ b/controller/volume.go @@ -37,7 +37,7 @@ func Volume() (c *VolumeController) { func volumeList(ctx web.Context) error { //name := ctx.Q("name") - page := cast.ToIntD(ctx.Q("page"), 1) + page := cast.ToInt(ctx.Q("page"), 1) volumes, totalCount, err := docker.VolumeList(page, model.PageSize) if err != nil { return err diff --git a/main.go b/main.go index 9b2a056..d5f5e6a 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,6 @@ import ( "github.com/cuigh/auxo/net/web/auth" "github.com/cuigh/auxo/net/web/middleware" "github.com/cuigh/auxo/net/web/renderer/jet" - valid "github.com/cuigh/auxo/net/web/validator" "github.com/cuigh/swirl/biz" "github.com/cuigh/swirl/controller" "github.com/cuigh/swirl/misc" @@ -43,7 +42,7 @@ func main() { AddVariable("language", setting.Language). AddVariable("version", misc.Version). AddVariable("go_version", runtime.Version()) - ws.Validator = valid.New() + //ws.Validator = valid.New() // register global filters ws.Filter(middleware.Recover()) diff --git a/misc/perm.go b/misc/perm.go index 687c312..ca27404 100644 --- a/misc/perm.go +++ b/misc/perm.go @@ -61,12 +61,12 @@ var Perms = []PermGroup{ { Name: "Template", Perms: []Perm{ - {Key: "service.list", Text: "View list"}, - {Key: "service.new", Text: "View new"}, - {Key: "service.edit", Text: "View edit"}, - {Key: "service.create", Text: "Create"}, - {Key: "service.delete", Text: "Delete"}, - {Key: "service.update", Text: "Update"}, + {Key: "template.list", Text: "View list"}, + {Key: "template.new", Text: "View new"}, + {Key: "template.edit", Text: "View edit"}, + {Key: "template.create", Text: "Create"}, + {Key: "template.delete", Text: "Delete"}, + {Key: "template.update", Text: "Update"}, }, }, {