forked from x/icebergs
add some
This commit is contained in:
parent
e02517a57e
commit
dc242dfa54
@ -62,7 +62,7 @@ func init() {
|
|||||||
m.Option(ice.TABLE_CHECKBOX, ice.TRUE)
|
m.Option(ice.TABLE_CHECKBOX, ice.TRUE)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
mdb.CREATE: {Name: "create userrole=void,tech username* usernick language userzone email", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create userrole=void,tech username* usernick language userzone email avatar", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_user_create(m, m.Option(USERNAME), m.OptionSimple(USERROLE, USERNICK, LANGUAGE, AVATAR, BACKGROUND, USERZONE, EMAIL)...)
|
_user_create(m, m.Option(USERNAME), m.OptionSimple(USERROLE, USERNICK, LANGUAGE, AVATAR, BACKGROUND, USERZONE, EMAIL)...)
|
||||||
}},
|
}},
|
||||||
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) { _user_remove(m, m.Option(USERNAME)) }},
|
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) { _user_remove(m, m.Option(USERNAME)) }},
|
||||||
|
@ -293,8 +293,13 @@ func init() {
|
|||||||
case tcp.NODENAME:
|
case tcp.NODENAME:
|
||||||
m.Cmdy(SPACE, m.Option(mdb.NAME), SPACE, ice.INFO).CutTo(mdb.NAME, tcp.NODENAME)
|
m.Cmdy(SPACE, m.Option(mdb.NAME), SPACE, ice.INFO).CutTo(mdb.NAME, tcp.NODENAME)
|
||||||
case aaa.USERNAME:
|
case aaa.USERNAME:
|
||||||
m.Push(arg[0], m.Option(tcp.NODENAME))
|
if aaa.IsTechOrRoot(m) && m.Option(ctx.ACTION) == GRANT {
|
||||||
m.Push(arg[0], m.Option(ice.MSG_USERNAME))
|
m.Cmdy(aaa.USER).Cut(aaa.USERNAME, aaa.USERNICK)
|
||||||
|
m.Option(ice.TABLE_CHECKBOX, ice.FALSE)
|
||||||
|
} else {
|
||||||
|
m.Push(arg[0], m.Option(ice.MSG_USERNAME))
|
||||||
|
m.Push(arg[0], m.Option(tcp.NODENAME))
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
gdb.Event(m, DREAM_INPUTS, arg)
|
gdb.Event(m, DREAM_INPUTS, arg)
|
||||||
}
|
}
|
||||||
@ -429,7 +434,10 @@ func init() {
|
|||||||
"gettoken": {Help: "令牌", Style: "danger", Hand: func(m *ice.Message, arg ...string) {
|
"gettoken": {Help: "令牌", Style: "danger", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST)
|
||||||
}},
|
}},
|
||||||
GRANT: {Hand: func(m *ice.Message, arg ...string) {
|
GRANT: {Name: "grant username", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if aaa.IsTechOrRoot(m) && m.Option(aaa.USERNAME) != "" {
|
||||||
|
m.Option(ice.MSG_USERNAME, m.Option(aaa.USERNAME))
|
||||||
|
}
|
||||||
m.Cmd(CHAT_GRANT, aaa.CONFIRM, kit.Dict(SPACE, m.Option(mdb.NAME)))
|
m.Cmd(CHAT_GRANT, aaa.CONFIRM, kit.Dict(SPACE, m.Option(mdb.NAME)))
|
||||||
}},
|
}},
|
||||||
OPEN: {Style: "notice", Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
OPEN: {Style: "notice", Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||||
@ -450,7 +458,6 @@ func init() {
|
|||||||
m.ProcessOpen(S(m.Option(mdb.NAME)))
|
m.ProcessOpen(S(m.Option(mdb.NAME)))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
DREAM_OPEN: {Hand: func(m *ice.Message, arg ...string) {}},
|
|
||||||
DREAM_CLOSE: {Hand: func(m *ice.Message, arg ...string) {
|
DREAM_CLOSE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.For(arg, func(k, v string) {
|
kit.For(arg, func(k, v string) {
|
||||||
if k == cli.DAEMON && v == ice.OPS && m.Cmdv(SPACE, m.Option(mdb.NAME), mdb.STATUS) != cli.STOP {
|
if k == cli.DAEMON && v == ice.OPS && m.Cmdv(SPACE, m.Option(mdb.NAME), mdb.STATUS) != cli.STOP {
|
||||||
|
@ -106,7 +106,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
safe = true
|
safe = true
|
||||||
m.Go(func() {
|
m.Go(func() {
|
||||||
SpacePwd(m, name, kit.Path(""))
|
SpacePwd(m, name, kit.Path(""))
|
||||||
SpaceEvent(m, OPS_SERVER_OPEN, name, args...)
|
// SpaceEvent(m, OPS_DREAM_OPEN, name, args...)
|
||||||
})
|
})
|
||||||
case SERVER:
|
case SERVER:
|
||||||
defer gdb.EventDeferEvent(m, SPACE_OPEN, args)(SPACE_CLOSE, args)
|
defer gdb.EventDeferEvent(m, SPACE_OPEN, args)(SPACE_CLOSE, args)
|
||||||
@ -203,7 +203,7 @@ func _space_exec(m *ice.Message, name string, source, target []string, c *websoc
|
|||||||
args := m.OptionSimple(mdb.ICONS, mdb.TIME, nfs.MODULE, nfs.VERSION, AGENT, cli.SYSTEM)
|
args := m.OptionSimple(mdb.ICONS, mdb.TIME, nfs.MODULE, nfs.VERSION, AGENT, cli.SYSTEM)
|
||||||
kit.If(name == ice.OPS, func() { args = append(args, m.OptionSimple(mdb.TEXT)...) })
|
kit.If(name == ice.OPS, func() { args = append(args, m.OptionSimple(mdb.TEXT)...) })
|
||||||
mdb.HashModify(m, mdb.HASH, name, ParseUA(m), args)
|
mdb.HashModify(m, mdb.HASH, name, ParseUA(m), args)
|
||||||
SpaceEvent(m, OPS_ORIGIN_OPEN, name, kit.Simple(mdb.NAME, name, args)...)
|
// SpaceEvent(m, OPS_ORIGIN_OPEN, name, kit.Simple(mdb.NAME, name, args)...)
|
||||||
default:
|
default:
|
||||||
if m.IsErr() {
|
if m.IsErr() {
|
||||||
return
|
return
|
||||||
@ -290,6 +290,7 @@ const (
|
|||||||
OPS_ORIGIN_OPEN = "ops.origin.open"
|
OPS_ORIGIN_OPEN = "ops.origin.open"
|
||||||
OPS_SERVER_OPEN = "ops.server.open"
|
OPS_SERVER_OPEN = "ops.server.open"
|
||||||
OPS_DREAM_SPAWN = "ops.dream.spawn"
|
OPS_DREAM_SPAWN = "ops.dream.spawn"
|
||||||
|
OPS_DREAM_OPEN = "ops.dream.open"
|
||||||
|
|
||||||
SPACE_LOGIN = "space.login"
|
SPACE_LOGIN = "space.login"
|
||||||
SPACE_LOGIN_CLOSE = "space.login.close"
|
SPACE_LOGIN_CLOSE = "space.login.close"
|
||||||
@ -496,9 +497,11 @@ func init() {
|
|||||||
m.SetAppend().Push(arg[0], SpideOrigin(m, ice.DEV))
|
m.SetAppend().Push(arg[0], SpideOrigin(m, ice.DEV))
|
||||||
m.Copy(m.Cmd(SPIDE, kit.Dict(ice.MSG_FIELDS, CLIENT_ORIGIN)).CutTo(CLIENT_ORIGIN, arg[0]).Sort(arg[0]))
|
m.Copy(m.Cmd(SPIDE, kit.Dict(ice.MSG_FIELDS, CLIENT_ORIGIN)).CutTo(CLIENT_ORIGIN, arg[0]).Sort(arg[0]))
|
||||||
case mdb.ICONS:
|
case mdb.ICONS:
|
||||||
m.Options(nfs.DIR_REG, kit.ExtReg(nfs.PNG, nfs.JPG, nfs.JPEG), nfs.DIR_DEEP, ice.TRUE)
|
m.Options(nfs.DIR_DEEP, ice.TRUE, nfs.DIR_REG, kit.ExtReg(nfs.PNG, nfs.JPG, nfs.JPEG))
|
||||||
m.Cmdy(nfs.DIR, nfs.SRC, nfs.PATH)
|
m.Cmdy(nfs.DIR, nfs.SRC, nfs.PATH)
|
||||||
m.Cmdy(nfs.DIR, ice.USR_LOCAL_IMAGE, nfs.PATH)
|
if aaa.IsTechOrRoot(m) {
|
||||||
|
m.Cmdy(nfs.DIR, ice.USR_LOCAL_IMAGE, nfs.PATH)
|
||||||
|
}
|
||||||
m.Cmdy(nfs.DIR, ice.USR_ICONS, nfs.PATH)
|
m.Cmdy(nfs.DIR, ice.USR_ICONS, nfs.PATH)
|
||||||
m.CutTo(nfs.PATH, arg[0])
|
m.CutTo(nfs.PATH, arg[0])
|
||||||
case ctx.INDEX, ice.CMD:
|
case ctx.INDEX, ice.CMD:
|
||||||
|
@ -74,7 +74,8 @@ func _go_show(m *ice.Message, arg ...string) {
|
|||||||
// ctx.ProcessField(m, "web.code.xterm", kit.Simple())
|
// ctx.ProcessField(m, "web.code.xterm", kit.Simple())
|
||||||
ctx.ProcessField(m, "log.debug", kit.Simple("bench"))
|
ctx.ProcessField(m, "log.debug", kit.Simple("bench"))
|
||||||
} else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
|
} else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" {
|
||||||
if p := path.Join(path.Dir(path.Join(arg[2], arg[1])), "portal.go"); path.Base(arg[1]) != "portal.go" && nfs.Exists(m, p) && arg[1] != "gonganxitong/user.go" {
|
if p := path.Join(path.Dir(path.Join(arg[2], arg[1])), "portal.go"); path.Base(arg[1]) != "portal.go" && nfs.Exists(m, p) &&
|
||||||
|
!kit.IsIn(arg[1], "gonganxitong/user.go", "gonganxitong/domain.go") {
|
||||||
if cmd := ctx.GetFileCmd(p); cmd != "" {
|
if cmd := ctx.GetFileCmd(p); cmd != "" {
|
||||||
ctx.ProcessField(m, cmd, kit.Simple())
|
ctx.ProcessField(m, cmd, kit.Simple())
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user