From be8c60d97caf7ae5e2e68f166769d64823f8afa7 Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 6 Jan 2025 21:38:46 +0800 Subject: [PATCH] add some --- base/ctx/display.go | 4 ++++ core/code/autogen.go | 6 ++++++ core/code/css.go | 5 +++++ core/code/vimer.go | 2 +- misc/git/repos.go | 10 ++++++---- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/base/ctx/display.go b/base/ctx/display.go index dcc4a69c..8a46ce06 100644 --- a/base/ctx/display.go +++ b/base/ctx/display.go @@ -81,6 +81,10 @@ func DisplayBase(m *ice.Message, file string, arg ...ice.Any) *ice.Message { m.Option(ice.MSG_DISPLAY, kit.MergeURL(kit.Select(kit.ExtChange(file, nfs.JS), file, strings.Contains(file, mdb.QS)), arg...)) return Toolkit(m, "") } +func DisplayBaseCSS(m *ice.Message, file string, arg ...ice.Any) *ice.Message { + m.Option(ice.MSG_DISPLAY_CSS, kit.MergeURL(kit.Select(kit.ExtChange(file, nfs.CSS), file, strings.Contains(file, mdb.QS)), arg...)) + return m +} func Toolkit(m *ice.Message, arg ...string) *ice.Message { m.OptionDefault(ice.MSG_ONLINE, mdb.Config(m, "online")) return m.Options(ice.MSG_TOOLKIT, kit.Select(mdb.Config(m, mdb.TOOLS), kit.Fields(arg))) diff --git a/core/code/autogen.go b/core/code/autogen.go index a24daee6..e0401f62 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -2,6 +2,7 @@ package code import ( "bytes" + "os" "path" "strings" @@ -201,6 +202,11 @@ func init() { _autogen_import(m, ice.SRC_MAIN_GO, arg[0], kit.Select(_autogen_mod(m, ice.GO_MOD), arg, 1)) }}, BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { + kit.For([]string{"intshell", "volcanos", "node_modules", "learning", "icons"}, func(p string) { + if _, e := os.Stat("usr/" + p); os.IsNotExist(e) { + m.Cmd("web.code.git.repos", "clone", "https://shylinux.com/x/"+p, p, "usr/"+p+"/") + } + }) const ( USR_RELEASE_CONF_GO = "usr/release/conf.go" USR_RELEASE_BINPACK_GO = "usr/release/binpack.go" diff --git a/core/code/css.go b/core/code/css.go index 7ca8992f..b3d66d0e 100644 --- a/core/code/css.go +++ b/core/code/css.go @@ -22,6 +22,11 @@ func _css_show(m *ice.Message, arg ...string) { m.EchoIFrame(m.MergePodCmd("", web.ADMIN)) return } + cmd := kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(kit.ExtChange(path.Join(arg[2], arg[1]), GO))) + ctx.DisplayBaseCSS(m, require(arg[2], arg[1]), "render", "replace", ctx.INDEX, cmd, ice.POD, m.Option(ice.MSG_USERPOD)) + ctx.DisplayBase(m, require(arg[2], arg[1])) + ctx.ProcessField(m, cmd, kit.Simple()) + return zone, stats_key, stats_value := "", map[string]int{}, map[string]int{} m.Cmd(nfs.CAT, path.Join(arg[2], arg[1]), func(line string) { if line = strings.TrimSpace(line); line == "" || strings.HasPrefix(line, "//") || strings.HasPrefix(line, "/*") { diff --git a/core/code/vimer.go b/core/code/vimer.go index 4e62e4a5..d688f33a 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -127,7 +127,7 @@ func init() { nfs.SCRIPT: {Name: "script file*", Help: "脚本", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(nfs.DEFS, path.Join(m.Option(nfs.PATH), m.Option(nfs.FILE)), m.Cmdx("", TEMPLATE)) }}, - mdb.CREATE: {Name: "create file*", Help: "文件", Icon: "bi bi-file-earmark-text", Hand: func(m *ice.Message, arg ...string) { + mdb.CREATE: {Name: "create file*", Help: "添加文件", Icon: "bi bi-file-earmark-text", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(nfs.DEFS, path.Join(m.Option(nfs.PATH), m.Option(nfs.FILE)), m.Cmdx("", TEMPLATE)) }}, mdb.RENAME: {Name: "rename to*", Hand: func(m *ice.Message, arg ...string) { diff --git a/misc/git/repos.go b/misc/git/repos.go index 8def6508..2360903c 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -510,13 +510,15 @@ func init() { switch mdb.HashInputs(m, arg); m.Option(ctx.ACTION) { case INIT: m.Push(arg[0], ice.Info.Make.Remote) - m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_ORIGIN), func(value ice.Maps) { m.Push(arg[0], value[web.CLIENT_ORIGIN]+web.X(path.Base(kit.Path("")))) }) m.Push(arg[0], kit.MergeURL2(web.UserHost(m), web.X(path.Base(kit.Path(""))))) - m.Sort(arg[0]) + m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_ORIGIN)).Sort(web.CLIENT_ORIGIN).Table(func(value ice.Maps) { + m.Push(arg[0], value[web.CLIENT_ORIGIN]+web.X(path.Base(kit.Path("")))) + }) case INSTEADOF: - m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_ORIGIN), func(value ice.Maps) { m.Push(arg[0], value[web.CLIENT_ORIGIN]+web.X()) }) m.Push(arg[0], kit.MergeURL2(web.UserHost(m), web.X())) - m.Sort(arg[0]) + m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_ORIGIN)).Sort(web.CLIENT_ORIGIN).Table(func(value ice.Maps) { + m.Push(arg[0], value[web.CLIENT_ORIGIN]+web.X()) + }) default: switch arg[0] { case MESSAGE: