diff --git a/src/main.go b/src/main.go index 5addb64..5188854 100644 --- a/src/main.go +++ b/src/main.go @@ -1,5 +1,6 @@ package main import "shylinux.com/x/ice" +import _ "2025-dev.shylinux.com/x/20250215-cluster/src/travel" func main() { print(ice.Run()) } \ No newline at end of file diff --git a/src/travel/travel.go b/src/travel/travel.go new file mode 100644 index 0000000..0e8f446 --- /dev/null +++ b/src/travel/travel.go @@ -0,0 +1,34 @@ +package travel + +import ( + "shylinux.com/x/ice" + "shylinux.com/x/icebergs/base/mdb" + "shylinux.com/x/icebergs/base/nfs" + "shylinux.com/x/icebergs/base/web" +) + +type travel struct { + ice.Hash + list string `name:"list hash auto" help:"travel"` +} + +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) 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{}) }