From 56b87e9e786b18033fc2ef871c854640cc42d62f Mon Sep 17 00:00:00 2001 From: shy Date: Fri, 20 Sep 2024 20:53:41 +0800 Subject: [PATCH] add some --- base/ctx/command.go | 1 + base/web/render.go | 3 +++ conf.go | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base/ctx/command.go b/base/ctx/command.go index 41f86b18..847b5d36 100644 --- a/base/ctx/command.go +++ b/base/ctx/command.go @@ -18,6 +18,7 @@ func _command_list(m *ice.Message, name string) *ice.Message { return m.Push(mdb.INDEX, name).Push(mdb.NAME, name).Push(mdb.HELP, "").Push(mdb.META, "").Push(mdb.LIST, "") } m.Option(ice.MSG_NODENAME, ice.Info.Titles) + m.Option(ice.MSG_NODEICON, m.Resource(ice.Info.NodeIcon)) m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) { icon := kit.Format(kit.Value(cmd.Meta, kit.Keys(ice.CTX_ICONS, key))) m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key)) diff --git a/base/web/render.go b/base/web/render.go index 9e683c24..6f78e796 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -163,6 +163,9 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) { if msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.ShortKey(), cmd)); msg.Length() == 0 { RenderResult(m, kit.Format("not found command %s", cmd)) } else { + if msg.Append(ctx.INDEX) == "web.code.vimer" { + m.Option(mdb.ICONS, msg.Option(ice.MSG_NODEICON)) + } m.OptionDefault(mdb.ICONS, m.Resource(kit.Select(ice.Info.NodeIcon, msg.Append(mdb.ICONS)))) if !kit.IsIn(cmd, PORTAL, DESKTOP, ADMIN) { pod = kit.Select(pod, msg.Option(ice.MSG_NODENAME)) diff --git a/conf.go b/conf.go index 2c30ebf6..055d11d8 100644 --- a/conf.go +++ b/conf.go @@ -256,8 +256,9 @@ const ( // MSG LOG_DISABLE = "log.disable" LOG_TRACEID = "log.id" - MSG_NODETYPE = "node.type" + MSG_NODEICON = "node.icon" MSG_NODENAME = "node.name" + MSG_NODETYPE = "node.type" MSG_FILES = "file.system" FROM_SPACE = "from.space" FROM_DAEMON = "from.daemon"