Fix permission key of service template

This commit is contained in:
cuigh 2017-10-19 14:24:38 +08:00
parent ec76dbc318
commit e862737699
8 changed files with 16 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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())

View File

@ -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"},
},
},
{