mirror of
https://2025-dev.shylinux.com/x/20250215-cluster
synced 2025-04-25 13:18:05 +08:00
add some
This commit is contained in:
parent
4f972c0473
commit
8419bfdd9c
@ -5,30 +5,31 @@ import (
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type travel struct {
|
||||
ice.Hash
|
||||
list string `name:"list hash auto" help:"travel"`
|
||||
list string `name:"list list" help:"遍历"`
|
||||
}
|
||||
|
||||
func (s travel) MachineMonitor(m *ice.Message, arg ...string) {
|
||||
m.Cmd("").Table(func(value ice.Maps) {
|
||||
switch value[nfs.MODULE] {
|
||||
case "2025-dev.shylinux.com/x/20250215-cluster":
|
||||
m.Cmdy(web.SPACE, value[mdb.NAME], m.PrefixKey(), m.ActionKey())
|
||||
case "2025-dev.shylinux.com/x/20250213-machine":
|
||||
m.Cmdy(web.SPACE, value[mdb.NAME], "web.chat.dev.machine.monitor")
|
||||
func (s travel) List(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPACE, ice.OPS, web.DREAM, web.SERVER).Table(func(value ice.Maps) {
|
||||
if len(arg) == 0 {
|
||||
m.PushRecord(value, "time,name,module,version")
|
||||
} else {
|
||||
switch value[nfs.MODULE] {
|
||||
case "2025-dev.shylinux.com/x/20250215-cluster":
|
||||
m.Cmdy(web.SPACE, value[mdb.NAME], m.PrefixKey(), arg).RewriteAppend(func(val, key string, index int) string {
|
||||
kit.If(key == web.SPACE, func() { val = kit.Keys(value[mdb.NAME], val) })
|
||||
return val
|
||||
})
|
||||
case arg[0]:
|
||||
m.Cmd(web.SPACE, value[mdb.NAME], arg[1:]).Table(func(val ice.Maps, index int, head []string) {
|
||||
m.Push(web.SPACE, value[mdb.NAME]).PushRecord(val, head...)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
func (s travel) ServiceMonitor(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s travel) List(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPACE, ice.OPS, web.DREAM, web.SERVER).Table(func(value ice.Maps) {
|
||||
m.PushRecord(value, "time,name,module,version")
|
||||
})
|
||||
m.Action(s.MachineMonitor, s.ServiceMonitor)
|
||||
}
|
||||
|
||||
func init() { ice.Cmd("web.chat.dev.cluster.travel", travel{}) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user