1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-01-06 21:38:46 +08:00
parent 61b81cf089
commit be8c60d97c
5 changed files with 22 additions and 5 deletions

View File

@ -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...)) m.Option(ice.MSG_DISPLAY, kit.MergeURL(kit.Select(kit.ExtChange(file, nfs.JS), file, strings.Contains(file, mdb.QS)), arg...))
return Toolkit(m, "") 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 { func Toolkit(m *ice.Message, arg ...string) *ice.Message {
m.OptionDefault(ice.MSG_ONLINE, mdb.Config(m, "online")) 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))) return m.Options(ice.MSG_TOOLKIT, kit.Select(mdb.Config(m, mdb.TOOLS), kit.Fields(arg)))

View File

@ -2,6 +2,7 @@ package code
import ( import (
"bytes" "bytes"
"os"
"path" "path"
"strings" "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)) _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) { 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 ( const (
USR_RELEASE_CONF_GO = "usr/release/conf.go" USR_RELEASE_CONF_GO = "usr/release/conf.go"
USR_RELEASE_BINPACK_GO = "usr/release/binpack.go" USR_RELEASE_BINPACK_GO = "usr/release/binpack.go"

View File

@ -22,6 +22,11 @@ func _css_show(m *ice.Message, arg ...string) {
m.EchoIFrame(m.MergePodCmd("", web.ADMIN)) m.EchoIFrame(m.MergePodCmd("", web.ADMIN))
return 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{} zone, stats_key, stats_value := "", map[string]int{}, map[string]int{}
m.Cmd(nfs.CAT, path.Join(arg[2], arg[1]), func(line string) { 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, "/*") { if line = strings.TrimSpace(line); line == "" || strings.HasPrefix(line, "//") || strings.HasPrefix(line, "/*") {

View File

@ -127,7 +127,7 @@ func init() {
nfs.SCRIPT: {Name: "script file*", Help: "脚本", Hand: func(m *ice.Message, arg ...string) { 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)) 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)) 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) { mdb.RENAME: {Name: "rename to*", Hand: func(m *ice.Message, arg ...string) {

View File

@ -510,13 +510,15 @@ func init() {
switch mdb.HashInputs(m, arg); m.Option(ctx.ACTION) { switch mdb.HashInputs(m, arg); m.Option(ctx.ACTION) {
case INIT: case INIT:
m.Push(arg[0], ice.Info.Make.Remote) 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.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: 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.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: default:
switch arg[0] { switch arg[0] {
case MESSAGE: case MESSAGE: