From 248258d71d85b641678594502a3b966b623c34eb Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 11 Feb 2024 22:56:07 +0800 Subject: [PATCH] add some --- base/aaa/user.go | 5 +++-- base/web/serve.go | 4 +++- base/web/space.go | 2 +- core/chat/footer.go | 2 +- core/wiki/portal.css | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/base/aaa/user.go b/base/aaa/user.go index 70632118..19be5864 100644 --- a/base/aaa/user.go +++ b/base/aaa/user.go @@ -51,7 +51,7 @@ func init() { m.Push(arg[0], m.Option(ice.MSG_USERNAME)) } }}, - mdb.CREATE: {Name: "create usernick username* userrole=void,tech userzone", Hand: func(m *ice.Message, arg ...string) { + mdb.CREATE: {Name: "create usernick username* userrole=void,tech userzone language", Hand: func(m *ice.Message, arg ...string) { _user_create(m, m.Option(USERNAME), m.OptionSimple(USERNICK, USERROLE, USERZONE, LANGUAGE, EMAIL, BACKGROUND, AVATAR)...) }}, }, mdb.ImportantHashAction(mdb.SHORT, USERNAME, mdb.FIELD, "time,usernick,username,userrole,userzone,language"))}, @@ -83,13 +83,14 @@ func UserZone(m *ice.Message, username ice.Any) (zone string) { return UserInfo(m, username, USERZONE, ice.MSG_USERZONE) } func UserRoot(m *ice.Message, arg ...string) *ice.Message { + language := kit.Select("", arg, 4) userzone := kit.Select("", arg, 3) userrole := kit.Select(ROOT, arg, 2) username := kit.Select(ice.Info.Username, arg, 1) usernick := kit.Select(UserNick(m, username), arg, 0) if len(arg) > 0 { ice.Info.Username = username - m.Cmd(USER, mdb.CREATE, usernick, username, userrole, userzone) + m.Cmd(USER, mdb.CREATE, usernick, username, userrole, userzone, language) } return SessAuth(m, kit.Dict(USERNICK, usernick, USERNAME, username, USERROLE, userrole)) } diff --git a/base/web/serve.go b/base/web/serve.go index ffc9dfba..180881ae 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -25,7 +25,9 @@ import ( func _serve_address(m *ice.Message) string { return HostPort(m, tcp.LOCALHOST, m.Option(tcp.PORT)) } func _serve_start(m *ice.Message) { - kit.If(m.Option(aaa.USERNAME), func() { aaa.UserRoot(m, m.Option(aaa.USERNICK), m.Option(aaa.USERNAME)) }) + kit.If(m.Option(aaa.USERNAME), func() { + aaa.UserRoot(m, m.Option(aaa.USERNICK), m.Option(aaa.USERNAME), "", ice.DEV, m.Option(aaa.LANGUAGE)) + }) kit.If(m.Option(tcp.PORT) == tcp.RANDOM, func() { m.Option(tcp.PORT, m.Cmdx(tcp.PORT, aaa.RIGHT)) }) cli.NodeInfo(m, kit.Select(kit.Split(ice.Info.Hostname, nfs.PT)[0], m.Option(tcp.NODENAME)), SERVER) m.Go(func() { diff --git a/base/web/space.go b/base/web/space.go index 5024cc1b..6ce03c93 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -323,7 +323,7 @@ func init() { } m.PushButton(kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN), mdb.REMOVE) }) - m.Sort("", kit.Simple(WEIXIN, PORTAL, WORKER, SERVER, MASTER)) + m.Sort("", kit.Simple(aaa.LOGIN, WEIXIN, PORTAL, WORKER, SERVER, MASTER)) } else { _space_send(m, arg[0], kit.Simple(kit.Split(arg[1]), arg[2:])...) } diff --git a/core/chat/footer.go b/core/chat/footer.go index ab045859..5b89f061 100644 --- a/core/chat/footer.go +++ b/core/chat/footer.go @@ -28,7 +28,7 @@ func init() { }}, nfs.SOURCE: {Hand: func(m *ice.Message, arg ...string) { _footer_plugin(m, web.CODE_VIMER, func() []string { - return nfs.SplitPath(m, ctx.GetCmdFile(m, arg[0])) + return nfs.SplitPath(m, kit.Split(ctx.GetCmdFile(m, arg[0]), "?")[0]) }, arg...) }}, nfs.SCRIPT: {Hand: func(m *ice.Message, arg ...string) { diff --git a/core/wiki/portal.css b/core/wiki/portal.css index b19707e0..d2b5e458 100644 --- a/core/wiki/portal.css +++ b/core/wiki/portal.css @@ -7,6 +7,7 @@ fieldset.web.wiki.portal>div.output { padding:0; } fieldset.web.wiki.portal>div.output>div.header { background-color:rgb(22 31 49); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); } fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { display:flex; justify-content:center; } fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { text-align:center; padding:var(--legend-padding); height:var(--portal-header-height); } +fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { display:flex; align-items:center; } fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:first-child { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); } body.mobile fieldset.web.wiki.portal.cmd>div.output>div.header div.story[data-name=navmenu] div.item { line-height:calc(var(--portal-header-height) - 2 * var(--legend-padding)); } fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--output-bg-color); } @@ -43,8 +44,8 @@ body.cmd.web.wiki.portal { background-color:rgb(22 31 49); } fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; text-align:center; } body.dark fieldset.web.wiki.portal>div.output>div.layout { background-color:var(--plugin-bg-color); --code-bg-color:var(--output-bg-color); } -body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--plugin-bg-color); } body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item:hover { background-color:var(--plugin-bg-color); } +body.dark fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.select { background-color:var(--plugin-bg-color); } body.white fieldset.web.wiki.portal>div.output>div.header { color:silver; } body.light fieldset.web.wiki.portal>div.output>div.header { color:white; } body.light fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { --hover-fg-color:black; }