From c022852de3c9a978fd456f4ef3f2bb51dc34251c Mon Sep 17 00:00:00 2001 From: shy Date: Thu, 23 Jan 2025 21:36:46 +0800 Subject: [PATCH] add some --- core/chat/center/center.go | 18 +++++++++--------- core/wiki/portal.go | 2 ++ core/wiki/portal.js | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/chat/center/center.go b/core/chat/center/center.go index 6d9d7858..68c769c6 100644 --- a/core/chat/center/center.go +++ b/core/chat/center/center.go @@ -10,25 +10,25 @@ import ( ) type center struct { - list string `name:"list name auto" help:"云游"` + list string `name:"list list" help:"云游"` } func (s center) List(m *ice.Message, arg ...string) { - if len(arg) > 1 { + if len(arg) == 0 { + m.Cmd(web.SPACE).Table(func(value ice.Maps) { + if value[mdb.TYPE] == web.SERVER { + m.PushRecord(value, mdb.NAME, mdb.ICONS, nfs.MODULE, nfs.VERSION) + } + }) + m.Display("/plugin/story/spides.js?split=.").Option(nfs.DIR_ROOT, ice.Info.NodeName) + } else { m.Cmdy(web.SPACE, arg[0], m.PrefixKey()).Table(func(value ice.Maps) { m.Push(nfs.FILE, kit.Keys(arg[0], value[mdb.NAME])) }) if m.Length() == 0 { m.Push(web.SPACE, arg[0]).Push(ctx.INDEX, web.DESKTOP) } - return } - m.Cmd(web.SPACE).Table(func(value ice.Maps) { - if value[mdb.TYPE] == web.SERVER { - m.PushRecord(value, mdb.NAME, mdb.ICONS, nfs.MODULE, nfs.VERSION) - } - }) - m.Display("/plugin/story/spides.js?split=.").Option(nfs.DIR_ROOT, ice.Info.NodeName) } func init() { ice.Cmd("web.chat.center.center", center{}) } diff --git a/core/wiki/portal.go b/core/wiki/portal.go index e63243c5..b6b3eafc 100644 --- a/core/wiki/portal.go +++ b/core/wiki/portal.go @@ -6,6 +6,7 @@ import ( ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/ctx" + "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/web" ) @@ -33,6 +34,7 @@ func init() { }}, web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcessIframe(m, arg...) }}, }, web.ServeCmdAction(), web.DreamTablesAction()), Hand: func(m *ice.Message, arg ...string) { + m.Option(mdb.ICONS, ice.Info.NodeIcon) if m.Push(HEADER, m.Cmdx(WORD, _portal_path(m, INDEX_SHY))); len(arg) > 0 { m.Push(NAV, m.Cmdx(WORD, _portal_path(m, path.Join(arg...), INDEX_SHY))) } diff --git a/core/wiki/portal.js b/core/wiki/portal.js index f253c795..5c34294f 100644 --- a/core/wiki/portal.js +++ b/core/wiki/portal.js @@ -23,7 +23,7 @@ Volcanos(chat.ONIMPORT, { meta.style && can.page.style(can, target, can.base.Obj(meta.style)) }); var nav = can.db.nav[file]; nav? nav.click(): can.onimport.content(can, "content.shy") can.page.Select(can, can.ui.header, "div.item:first-child>span", function(target, index) { - can.page.insertBefore(can, [{img: can.misc.ResourceFavicon(can, can.user.info.favicon), style: {height: 42}}], target) + can.page.insertBefore(can, [{img: msg.Option(mdb.ICONS)||can.misc.ResourceFavicon(can, can.user.info.favicon), style: {height: 42}}], target) }) }, 300) },