mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 10:12:02 +08:00
add some
This commit is contained in:
parent
e6e89563ef
commit
8fb70fa41d
@ -32,6 +32,10 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func AdminCmd(m *ice.Message, cmd string) string {
|
func AdminCmd(m *ice.Message, cmd string, arg ...string) string {
|
||||||
return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, C(cmd))
|
if ice.Info.NodeType == WORKER {
|
||||||
|
return m.Cmdx(SPIDE, ice.OPS, SPIDE_RAW, http.MethodGet, path.Join(C(cmd), path.Join(arg...)))
|
||||||
|
} else {
|
||||||
|
return m.Cmdx(cmd, arg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
args = _space_agent(m, args...)
|
args = _space_agent(m, args...)
|
||||||
if c, e := websocket.Upgrade(m.W, m.R); !m.Warn(e) {
|
if c, e := websocket.Upgrade(m.W, m.R); !m.Warn(e) {
|
||||||
gdb.Go(m, func() {
|
gdb.Go(m, func() {
|
||||||
|
safe := false
|
||||||
defer mdb.HashCreateDeferRemove(m, args, kit.Dict(mdb.TARGET, c))()
|
defer mdb.HashCreateDeferRemove(m, args, kit.Dict(mdb.TARGET, c))()
|
||||||
switch m.Option(mdb.TYPE) {
|
switch m.Option(mdb.TYPE) {
|
||||||
case LOGIN:
|
case LOGIN:
|
||||||
@ -109,6 +110,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
m.Go(func() { m.Cmd(SPACE, name, cli.PWD, name) })
|
m.Go(func() { m.Cmd(SPACE, name, cli.PWD, name) })
|
||||||
case WORKER:
|
case WORKER:
|
||||||
defer gdb.EventDeferEvent(m, DREAM_OPEN, args)(DREAM_CLOSE, args)
|
defer gdb.EventDeferEvent(m, DREAM_OPEN, args)(DREAM_CLOSE, args)
|
||||||
|
safe = true
|
||||||
case SERVER:
|
case SERVER:
|
||||||
defer gdb.EventDeferEvent(m, SPACE_OPEN, args)(SPACE_CLOSE, args)
|
defer gdb.EventDeferEvent(m, SPACE_OPEN, args)(SPACE_CLOSE, args)
|
||||||
m.Go(func() {
|
m.Go(func() {
|
||||||
@ -121,7 +123,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
m.Cmd(gdb.EVENT, gdb.HAPPEN, gdb.EVENT, OPS_SERVER_OPEN, args, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
m.Cmd(gdb.EVENT, gdb.HAPPEN, gdb.EVENT, OPS_SERVER_OPEN, args, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
_space_handle(m, false, name, c)
|
_space_handle(m, safe, name, c)
|
||||||
}, kit.Join(kit.Simple(SPACE, name), lex.SP))
|
}, kit.Join(kit.Simple(SPACE, name), lex.SP))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,7 +219,10 @@ func _space_send(m *ice.Message, name string, arg ...string) (h string) {
|
|||||||
}
|
}
|
||||||
if target := kit.Split(name, nfs.PT, nfs.PT); !mdb.HashSelectDetail(m, target[0], func(value ice.Map) {
|
if target := kit.Split(name, nfs.PT, nfs.PT); !mdb.HashSelectDetail(m, target[0], func(value ice.Map) {
|
||||||
if c, ok := value[mdb.TARGET].(*websocket.Conn); !m.Warn(!ok, ice.ErrNotValid, mdb.TARGET) {
|
if c, ok := value[mdb.TARGET].(*websocket.Conn); !m.Warn(!ok, ice.ErrNotValid, mdb.TARGET) {
|
||||||
kit.For([]string{ice.MSG_USERROLE}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
kit.For([]string{
|
||||||
|
ice.LOG_TRACEID,
|
||||||
|
ice.MSG_USERROLE,
|
||||||
|
}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) { m.Optionv(k, m.Optionv(k)) })
|
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
if withecho {
|
if withecho {
|
||||||
_space_echo(m.Set(ice.MSG_DETAIL, arg...), []string{h}, target, c)
|
_space_echo(m.Set(ice.MSG_DETAIL, arg...), []string{h}, target, c)
|
||||||
|
@ -25,7 +25,7 @@ func init() {
|
|||||||
LOCAL = "http://localhost:9020"
|
LOCAL = "http://localhost:9020"
|
||||||
)
|
)
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
TOKEN: {Help: "令牌", Actions: ice.MergeActions(ice.Actions{
|
TOKEN: {Help: "令牌桶", Actions: ice.MergeActions(ice.Actions{
|
||||||
GEN: {Hand: func(m *ice.Message, arg ...string) {
|
GEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.EchoInfoButton(kit.Format("请授权 %s\n访问 %s\n", m.Option(tcp.HOST), m.Option(mdb.TYPE)), CONFIRM)
|
m.EchoInfoButton(kit.Format("请授权 %s\n访问 %s\n", m.Option(tcp.HOST), m.Option(mdb.TYPE)), CONFIRM)
|
||||||
}},
|
}},
|
||||||
|
@ -29,7 +29,7 @@ func init() {
|
|||||||
)
|
)
|
||||||
const SEARCH = "search"
|
const SEARCH = "search"
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
SEARCH: {Name: "search keyword auto", Help: "代码源", Actions: ice.MergeActions(ice.Actions{
|
SEARCH: {Name: "search keyword auto", Help: "源码库", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
macos.AppInstall(m, "App Store.png", m.PrefixKey())
|
macos.AppInstall(m, "App Store.png", m.PrefixKey())
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user