1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-05 19:13:49 +08:00
parent 39518a878c
commit 01f5f90c2a
4 changed files with 16 additions and 6 deletions

View File

@ -67,7 +67,7 @@ func DisplayLocalInner(m *ice.Message, arg ...ice.Any) *ice.Message {
return DisplayLocal(m, "code/inner", arg...) return DisplayLocal(m, "code/inner", arg...)
} }
func DisplayBase(m *ice.Message, file string, arg ...ice.Any) *ice.Message { func DisplayBase(m *ice.Message, file string, arg ...ice.Any) *ice.Message {
m.Option(ice.MSG_DISPLAY, m.MergeLink(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 Toolkit(m *ice.Message, arg ...string) *ice.Message { func Toolkit(m *ice.Message, arg ...string) *ice.Message {

View File

@ -5,6 +5,7 @@ import (
"net/url" "net/url"
"path" "path"
"regexp" "regexp"
"runtime"
"strings" "strings"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
@ -228,7 +229,9 @@ func init() {
tcp.HOST: {Help: "公网", Hand: func(m *ice.Message, arg ...string) { m.Echo(kit.Formats(PublicIP(m))) }}, tcp.HOST: {Help: "公网", Hand: func(m *ice.Message, arg ...string) { m.Echo(kit.Formats(PublicIP(m))) }},
cli.SYSTEM: {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }}, cli.SYSTEM: {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }},
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) { cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) {
if runtime.GOOS == cli.LINUX {
m.Cmd(nfs.SAVE, "etc/local.sh", m.Spawn(ice.Maps{"pwd": kit.Path(""), "user": kit.UserName(), "args": kit.JoinCmds(arg...)}).Template("local.sh")+lex.NL) m.Cmd(nfs.SAVE, "etc/local.sh", m.Spawn(ice.Maps{"pwd": kit.Path(""), "user": kit.UserName(), "args": kit.JoinCmds(arg...)}).Template("local.sh")+lex.NL)
}
_serve_start(m) _serve_start(m)
}}, }},
SERVE_START: {Hand: func(m *ice.Message, arg ...string) { SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
@ -243,7 +246,9 @@ func init() {
ssh.PrintQRCode(m, tcp.PublishLocalhost(m, _serve_address(m))) ssh.PrintQRCode(m, tcp.PublishLocalhost(m, _serve_address(m)))
cli.Opens(m, mdb.Config(m, cli.OPEN)) cli.Opens(m, mdb.Config(m, cli.OPEN))
}) })
if runtime.GOOS == cli.LINUX {
m.Cmd("", PROXY_CONF, ice.Info.NodeName) m.Cmd("", PROXY_CONF, ice.Info.NodeName)
}
}}, }},
PROXY_CONF: {Name: "proxyConf name* port path", Hand: func(m *ice.Message, arg ...string) { PROXY_CONF: {Name: "proxyConf name* port path", Hand: func(m *ice.Message, arg ...string) {
if dir := m.OptionDefault(nfs.PATH, PROXY_PATH); nfs.Exists(m, dir) { if dir := m.OptionDefault(nfs.PATH, PROXY_PATH); nfs.Exists(m, dir) {

View File

@ -25,7 +25,6 @@ func init() {
DeskAppend(m, "Photos.png", web.WIKI_FEEL, ctx.ARGS, nfs.USR_LOCAL_IMAGE) DeskAppend(m, "Photos.png", web.WIKI_FEEL, ctx.ARGS, nfs.USR_LOCAL_IMAGE)
} else { } else {
DeskAppend(m, "Photos.png", web.WIKI_FEEL, ctx.ARGS, nfs.USR_ICONS) DeskAppend(m, "Photos.png", web.WIKI_FEEL, ctx.ARGS, nfs.USR_ICONS)
} }
DeskAppend(m, "Grapher.png", web.WIKI_DRAW) DeskAppend(m, "Grapher.png", web.WIKI_DRAW)
DeskAppend(m, "Calendar.png", web.TEAM_PLAN) DeskAppend(m, "Calendar.png", web.TEAM_PLAN)

View File

@ -82,10 +82,16 @@ func _webpack_cache(m *ice.Message, dir string, write bool) {
}) })
mdb.HashSelects(m).Sort(nfs.PATH).Table(func(value ice.Maps) { mdb.HashSelects(m).Sort(nfs.PATH).Table(func(value ice.Maps) {
defer fmt.Fprintln(js, "") defer fmt.Fprintln(js, "")
if p := value[nfs.PATH]; kit.Ext(p) == nfs.CSS { if p := value[nfs.PATH]; kit.HasPrefix(p, nfs.SRC, nfs.USR) {
if kit.Ext(p) == nfs.CSS {
_webpack_css(m, css, js, p)
} else {
_webpack_js(m, js, p)
}
} else if kit.Ext(p) == nfs.CSS {
_webpack_css(m, css, js, path.Join(nfs.USR_MODULES, p)) _webpack_css(m, css, js, path.Join(nfs.USR_MODULES, p))
} else { } else {
p = kit.Select(path.Join(p, LIB, kit.Keys(p, JS)), p, kit.Ext(p) == nfs.JS) // p = kit.Select(path.Join(p, LIB, kit.Keys(p, JS)), p, kit.Ext(p) == nfs.JS)
_webpack_node(m, js, path.Join(nfs.USR_MODULES, p)) _webpack_node(m, js, path.Join(nfs.USR_MODULES, p))
} }
}) })