This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-02-16 17:16:52 +08:00
parent 4f972c0473
commit 8419bfdd9c

View File

@ -5,30 +5,31 @@ import (
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
) )
type travel struct { type travel struct {
ice.Hash list string `name:"list list" help:"遍历"`
list string `name:"list hash auto" help:"travel"`
} }
func (s travel) MachineMonitor(m *ice.Message, arg ...string) { func (s travel) List(m *ice.Message, arg ...string) {
m.Cmd("").Table(func(value ice.Maps) { m.Cmd(web.SPACE, ice.OPS, web.DREAM, web.SERVER).Table(func(value ice.Maps) {
switch value[nfs.MODULE] { if len(arg) == 0 {
case "2025-dev.shylinux.com/x/20250215-cluster": m.PushRecord(value, "time,name,module,version")
m.Cmdy(web.SPACE, value[mdb.NAME], m.PrefixKey(), m.ActionKey()) } else {
case "2025-dev.shylinux.com/x/20250213-machine": switch value[nfs.MODULE] {
m.Cmdy(web.SPACE, value[mdb.NAME], "web.chat.dev.machine.monitor") 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{}) } func init() { ice.Cmd("web.chat.dev.cluster.travel", travel{}) }