mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 14:51:57 +00:00
Fix permission key of service template
This commit is contained in:
parent
ec76dbc318
commit
e862737699
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
3
main.go
3
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())
|
||||
|
12
misc/perm.go
12
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"},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user