This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-02-16 12:09:58 +08:00
parent 74adc00902
commit 96178dfff5
2 changed files with 35 additions and 0 deletions

View File

@ -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()) }

34
src/travel/travel.go Normal file
View File

@ -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{}) }