From d4c73ce195aee11eea77393830d6c123ebdfd5b8 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 5 Jan 2025 12:01:27 +0800 Subject: [PATCH] add some --- base/aaa/role.go | 1 + base/web/serve.go | 1 + base/web/space.go | 4 ++++ base/web/spide.go | 6 +++--- core/code/autogen.go | 7 ++++++- core/wiki/image.go | 8 +++++++- core/wiki/portal.css | 4 +++- misc/git/repos.go | 2 ++ 8 files changed, 27 insertions(+), 6 deletions(-) diff --git a/base/aaa/role.go b/base/aaa/role.go index 5fca83b4..3731919e 100644 --- a/base/aaa/role.go +++ b/base/aaa/role.go @@ -87,6 +87,7 @@ func init() { roleHandle(m, role, list...) }) }) + m.Cmd(ROLE, WHITE, VOID, ROLE, "action", RIGHT) }}, mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { if arg[0] == mdb.KEY { diff --git a/base/web/serve.go b/base/web/serve.go index 9d63f961..0fc13d2b 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -309,6 +309,7 @@ func init() { for _, p := range []string{"server.conf", "location.conf", "upstream.conf"} { m.Cmd(nfs.SAVE, kit.Format("%s/conf/portal/%s/%s", dir, m.Option(mdb.NAME), p), m.Template(p)+lex.NL) } + m.Cmd(cli.SYSTEM, "sudo", kit.Path("usr/local/daemon/10000/sbin/nginx"), "-p", kit.Path("usr/local/daemon/10000/"), "-s", "reload") } }}, }, gdb.EventsAction(SERVE_START), mdb.HashAction( diff --git a/base/web/space.go b/base/web/space.go index be7a549e..7a3d7f29 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -458,6 +458,10 @@ func init() { }) m.Sort("", kit.Simple(aaa.LOGIN, WEIXIN, PORTAL, WORKER, SERVER, ORIGIN)) } else { + if ice.Info.NodeType != WORKER && arg[0] == ice.OPS { + m.Cmdy(arg[1:]) + return + } if kit.IsIn(arg[0], "", ice.CONTEXTS, ice.Info.NodeName) { m.Cmdy(arg[1:]) return diff --git a/base/web/spide.go b/base/web/spide.go index 84c36085..3e25dc74 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -299,9 +299,9 @@ func init() { m.Cmd("", mdb.CREATE, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), ice.SHY, ice.SRC_MAIN_ICO, nfs.REPOS) m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png", "mail") m.Cmd("", mdb.CREATE, kit.Select("https://demo.shylinux.com", conf[cli.CTX_DEMO]), ice.DEMO, ice.SRC_MAIN_ICO, "demo") - m.Cmd("", mdb.CREATE, "https://2023-ContextOS.shylinux.com", "2023-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) - m.Cmd("", mdb.CREATE, "https://2024-ContextOS.shylinux.com", "2024-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) - m.Cmd("", mdb.CREATE, "https://2025-ContextOS.shylinux.com", "2025-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) + m.Cmd("", mdb.CREATE, "https://2023.shylinux.com", "2023-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) + m.Cmd("", mdb.CREATE, "https://2024.shylinux.com", "2024-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) + m.Cmd("", mdb.CREATE, "https://2025.shylinux.com", "2025-ContextOS", ice.SRC_MAIN_ICO, nfs.REPOS) }}, mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { if mdb.IsSearchPreview(m, arg) { diff --git a/core/code/autogen.go b/core/code/autogen.go index 0e5f616b..a24daee6 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -44,7 +44,7 @@ func _autogen_defs(m *ice.Message, arg ...string) { } func _autogen_import(m *ice.Message, main string, ctx string, mod string) string { m.Cmd(nfs.DEFS, ice.ETC_MISS_SH, m.Template("miss.sh")) - _autogen_defs(m, ice.README_MD, ice.MAKEFILE, ice.LICENSE) + // _autogen_defs(m, ice.README_MD, ice.MAKEFILE, ice.LICENSE) _autogen_defs(m, ice.SRC_MAIN_GO, ice.ETC_MISS_SH, ice.README_MD, ice.MAKEFILE, ice.LICENSE) begin, done, list := false, false, []string{} imports := kit.Format(`_ "%s/src/%s"`, mod, ctx) @@ -159,6 +159,11 @@ func init() { m.Cmd(nfs.DEFS, ice.ETC_MISS_SH, m.Cmdx(nfs.CAT, ice.ETC_MISS_SH)) m.Cmdy(nfs.DIR, ice.ETC_MISS_SH).Cmdy(nfs.CAT, ice.ETC_MISS_SH) }}, + nfs.REPOS: {Help: "仓库", Hand: func(m *ice.Message, arg ...string) { + _autogen_defs(m, ice.SRC_MAIN_GO, ice.SRC_MAIN_SHY, ice.ETC_MISS_SH, ice.README_MD, ice.MAKEFILE, ice.LICENSE) + _autogen_mod(m, ice.GO_MOD) + ReposAddFile(m, "", ice.GO_MOD) + }}, nfs.MODULE: {Name: "module name*=hi help type*=Hash,Zone,Data,Lang,Code main*=main.go@key zone top", Help: "模块", Hand: func(m *ice.Message, arg ...string) { if m.WarnNotFound(!nfs.Exists(m, kit.Path(".git")), "未初始化代码库") { return diff --git a/core/wiki/image.go b/core/wiki/image.go index 2e14dc7a..7b663fe6 100644 --- a/core/wiki/image.go +++ b/core/wiki/image.go @@ -2,6 +2,7 @@ package wiki import ( "path" + "strings" ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/nfs" @@ -19,7 +20,12 @@ const IMAGE = "image" func init() { Index.MergeCommands(ice.Commands{ - IMAGE: {Name: "image path", Help: "图片", Hand: func(m *ice.Message, arg ...string) { + IMAGE: {Name: "image path", Help: "图片", Actions: ice.Actions{ + "material": {Hand: func(m *ice.Message, arg ...string) { + m.Info("what %v", m.FormatChain()) + m.Cmdy("", path.Join("usr/material", strings.TrimPrefix(path.Dir(m.Option("_script")), "usr/"), arg[0])) + }}, + }, Hand: func(m *ice.Message, arg ...string) { arg = _name(m, arg) _image_show(m, arg[0], arg[1], arg[2:]...) }}, diff --git a/core/wiki/portal.css b/core/wiki/portal.css index 15d45e0e..97faf7d2 100644 --- a/core/wiki/portal.css +++ b/core/wiki/portal.css @@ -2,7 +2,9 @@ fieldset.web.wiki.portal { --portal-max-width:1200px; --portal-header-height:64p fieldset.web.wiki.portal.home { --portal-max-width:1500px; } fieldset.web.wiki.portal>div.header { display:none; } fieldset.web.wiki.portal>div.output { padding:0; } -fieldset.web.wiki.portal>div.output>div.header { background-color:var(--panel-bg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); } +fieldset.web.wiki.portal>div.output>div.header { + border-bottom:var(--box-border); +background-color:var(--panel-bg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); } fieldset.web.wiki.portal>div.output>div.header div.list { display:flex; } fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { --hover-fg-color:white; } fieldset.web.wiki.portal>div.output>div.header div.story div.item span { white-space:pre; overflow:hidden; } diff --git a/misc/git/repos.go b/misc/git/repos.go index 4abd9263..8def6508 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -448,6 +448,8 @@ func init() { m.Cmd(nfs.DEFS, path.Join(m.Option(nfs.PATH), _GITIGNORE), nfs.Template(m, IGNORE)) git.PlainInit(m.Option(nfs.PATH), false) _repos_insert(m, m.Option(nfs.PATH)) + m.Cmd(code.AUTOGEN, nfs.REPOS) + m.Cmd(STATUS, web.DEV_CREATE_TOKEN, kit.Dict(web.ORIGIN, web.UserHost(m), web.TOKEN, m.Cmdx(web.SPACE, ice.OPS, web.TOKEN, mdb.CREATE, mdb.TYPE, STATUS, mdb.NAME, m.Option(ice.MSG_USERNAME), mdb.TEXT, web.UserHost(m)))) m.ProcessRefresh() }}, INSTEADOF: {Name: "insteadof remote", Help: "代理", Icon: "bi bi-clouds", Hand: func(m *ice.Message, arg ...string) {