From e67d59d3101dff5ecd6ee9f54a69dc9644144a68 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 13 Jan 2024 22:39:30 +0800 Subject: [PATCH] opt island --- base/web/spide.go | 2 ++ core/chat/action.go | 2 +- core/code/publish.go | 1 + misc.go | 1 + misc/git/repos.go | 8 +++++--- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/base/web/spide.go b/base/web/spide.go index 3183881c..cf4a4696 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -8,6 +8,7 @@ import ( "mime/multipart" "net/http" "net/url" + "os" "path" "strings" "time" @@ -295,6 +296,7 @@ func init() { conf := mdb.Confm(m, cli.RUNTIME, cli.CONF) m.Cmd("", mdb.CREATE, ice.SHY, kit.Select("https://shylinux.com", conf[cli.CTX_SHY])) m.Cmd("", mdb.CREATE, ice.DEV, kit.Select("https://2021.shylinux.com", ice.Info.Make.Domain, conf[cli.CTX_DEV])) + m.Cmd("", mdb.CREATE, "dev_ip", kit.Select("https://2021.shylinux.com", os.Getenv("ctx_dev_ip"))) m.Cmd("", mdb.CREATE, ice.OPS, kit.Select("http://localhost:9020", conf[cli.CTX_OPS])) m.Cmd("", mdb.CREATE, ice.DEMO, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO])) m.Cmd("", mdb.CREATE, ice.MAIL, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL])) diff --git a/core/chat/action.go b/core/chat/action.go index bb5b4c20..a601b635 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -21,7 +21,7 @@ func _action_exec(m *ice.Message, river, storm, index string, arg ...string) { }).Length() == 0, ice.ErrNotRight, index, arg) { return } - kit.If(index == "web.chat.island.portal", func() { m.Option(ice.MSG_USERROLE, aaa.VOID) }) + // kit.If(index == "web.chat.island.portal", func() { m.Option(ice.MSG_USERROLE, aaa.VOID) }) kit.If(!ctx.PodCmd(m, index, arg), func() { m.Cmdy(index, arg) }) } func _action_auth(m *ice.Message, share string) *ice.Message { diff --git a/core/code/publish.go b/core/code/publish.go index 8f91584b..f5a6dc1b 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -48,6 +48,7 @@ func _publish_contexts(m *ice.Message, arg ...string) { for _, k := range kit.Default(arg, ice.MISC) { m.OptionDefault(web.DOMAIN, web.UserHost(m)) m.Options(cli.CTX_ENV, kit.Select("", lex.SP+kit.JoinKV(mdb.EQ, lex.SP, cli.CTX_POD, m.Option(ice.MSG_USERPOD)), m.Option(ice.MSG_USERPOD) != "")) + kit.If(m.Option("ctx_dev_ip"), func(p string) { m.Option(cli.CTX_ENV, m.Option(cli.CTX_DEV)+" "+"ctx_dev_ip="+p) }) m.Option(ice.TCP_DOMAIN, kit.ParseURL(web.UserHost(m)).Hostname()) switch k { case INSTALL: diff --git a/misc.go b/misc.go index bab28d6f..60fddaf5 100644 --- a/misc.go +++ b/misc.go @@ -80,6 +80,7 @@ func (m *Message) PushDetail(value Any, arg ...string) *Message { case string: value = kit.UnMarshal(v) } + m.Option(MSG_FIELDS, FIELDS_DETAIL) return m.Push(FIELDS_DETAIL, value, kit.Split(kit.Join(arg))) } func (m *Message) RenameOption(from, to string) *Message { diff --git a/misc/git/repos.go b/misc/git/repos.go index 34afc08d..b5352de7 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -521,7 +521,7 @@ func init() { return } defer web.ToastProcess(m)() - for _, dev := range []string{ice.DEV, ice.SHY} { + for _, dev := range []string{"dev_ip", ice.DEV, ice.SHY} { p := m.Option(ORIGIN) kit.If(!kit.HasPrefix(p, nfs.PS, web.HTTP), func() { p = m.Cmdv(web.SPIDE, dev, web.CLIENT_ORIGIN) + web.X(p) }) m.Info("clone %s", p) @@ -641,8 +641,10 @@ func init() { } }}, web.SERVE_START: {Hand: func(m *ice.Message, arg ...string) { - m.Cmd("", CLONE, ORIGIN, "node_modules", mdb.NAME, "", nfs.PATH, "") - m.Cmd("", CLONE, ORIGIN, "icons", mdb.NAME, "", nfs.PATH, "") + m.Go(func() { + m.Cmd("", CLONE, ORIGIN, "node_modules", mdb.NAME, "", nfs.PATH, "") + m.Cmd("", CLONE, ORIGIN, "icons", mdb.NAME, "", nfs.PATH, "") + }) }}, web.STATS_TABLES: {Hand: func(m *ice.Message, _ ...string) { if ice.Info.NodeType == web.SERVER {