forked from x/icebergs
add some
This commit is contained in:
parent
8a1c4ab943
commit
cd84800ac9
@ -58,6 +58,7 @@ func _runtime_init(m *ice.Message) {
|
||||
}
|
||||
func _runtime_hostinfo(m *ice.Message) {
|
||||
m.Push("nCPU", runtime.NumCPU())
|
||||
if runtime.GOOS == LINUX {
|
||||
for i, ls := range strings.Split(m.Cmdx(nfs.CAT, "/proc/meminfo"), lex.NL) {
|
||||
if vs := kit.Split(ls, ": "); len(vs) > 1 {
|
||||
if m.Push(strings.TrimSpace(vs[0]), kit.FmtSize(kit.Int64(strings.TrimSpace(vs[1]))*1024)); i > 1 {
|
||||
@ -65,6 +66,7 @@ func _runtime_hostinfo(m *ice.Message) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.Push("uptime", kit.Split(m.Cmdx(SYSTEM, "uptime"), mdb.FS)[0])
|
||||
m.Push("GOMAXPROCS", runtime.GOMAXPROCS(0))
|
||||
m.Push("NumGoroutine", runtime.NumGoroutine())
|
||||
|
@ -9,10 +9,7 @@ const SESSION = "session"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
SESSION: {Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { mdb.HashImport(m) }},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { mdb.HashExport(m) }},
|
||||
}, CmdHashAction(mdb.NAME), mdb.ImportantHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||
SESSION: {Actions: ice.MergeActions(CmdHashAction(mdb.NAME), mdb.ImportantHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||
if mdb.HashSelect(m, arg...); len(arg) > 0 {
|
||||
m.EchoIFrame(m.MergePodCmd("", DESKTOP, SESSION, arg[0]))
|
||||
}
|
||||
|
@ -17,8 +17,6 @@ type field struct {
|
||||
list string `name:"list domain id auto insert" help:"插件"`
|
||||
}
|
||||
|
||||
func (s field) Init(m *ice.Message, arg ...string) { s.Zone.Imports(m) }
|
||||
func (s field) Exit(m *ice.Message, arg ...string) { s.Zone.Exports(m) }
|
||||
func (s field) Inputs(m *ice.Message, arg ...string) { s.daemon.Inputs(m, arg...) }
|
||||
func (s field) Command(m *ice.Message, arg ...string) {
|
||||
s.Zone.List(m.Spawn(), kit.Simple(m.Option(web.DOMAIN), arg)...).Table(func(index int, value ice.Maps, head []string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user