diff --git a/base/web/dream.go b/base/web/dream.go index 2a5f7dbe..64c7a57c 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -104,7 +104,7 @@ func _dream_list_more(m *ice.Message, simple bool) *ice.Message { defer m.PushButton(strings.Join(msg.Appendv(ctx.ACTION), "")) } case aaa.LOGIN: - value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP]) + value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP], kit.Format(PublicIP(m, value[aaa.IP]))) defer m.PushButton(GRANT) default: return diff --git a/base/web/render.go b/base/web/render.go index d3dae22c..b7156711 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -150,7 +150,7 @@ func RenderMain(m *ice.Message) *ice.Message { } m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m)) m.OptionDefault(mdb.ICONS, strings.Split(m.Resource(ice.Info.NodeIcon), "?")[0]+m.Option(nfs.VERSION)) - m.OptionDefault(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD))) + m.OptionDefault(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD), ice.Info.Titles)) return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m)) } func RenderCmds(m *ice.Message, cmds ...ice.Any) { diff --git a/base/web/spide.go b/base/web/spide.go index 8880c32b..a2a96df4 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -469,7 +469,9 @@ func PublicIP(m *ice.Message, arg ...string) ice.Any { if len(arg) == 0 { return SpideGet(m, "http://ip-api.com/json") } - return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location")) + return mdb.Cache(m, "web.spide.location."+arg[0], func() ice.Any { + return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location")) + }) } func SpideGet(m *ice.Message, arg ...ice.Any) ice.Any { return kit.UnMarshal(m.Cmdx(http.MethodGet, arg)) diff --git a/core/chat/chat.go b/core/chat/chat.go index 173394f3..ea8b7b2e 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -14,8 +14,8 @@ func init() { web.Index.Register(Index, &web.Frame{}, HEADER, FOOTER, IFRAME, FAVOR, - MESSAGE, TUTOR, - FLOWS, + TUTOR, FLOWS, + MESSAGE, ) } diff --git a/core/chat/grant.go b/core/chat/grant.go index 7f586f6a..a7cee945 100644 --- a/core/chat/grant.go +++ b/core/chat/grant.go @@ -65,6 +65,7 @@ func init() { m.Option(aaa.IP, msg.Append(aaa.IP)) m.Option(ice.MSG_USERUA, msg.Append(aaa.UA)) m.Options(web.ParseUA(m)) + m.Options("location", web.PublicIP(m, m.Option(aaa.IP))) if m.EchoInfoButton(nfs.Template(m, "auth.html"), aaa.CONFIRM); m.IsWeixinUA() { m.OptionFields(mdb.DETAIL) m.Push(web.SPACE, arg[0]) diff --git a/core/chat/header.go b/core/chat/header.go index 3f43b299..bed14919 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -146,6 +146,8 @@ func init() { m.Option(ice.MSG_NODETYPE, ice.Info.NodeType) kit.If(m.Option(ice.MSG_USERPOD), func(p string) { m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE)) + }, func() { + m.Option("titles", ice.Info.Title()) }) m.Option("favicon", m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), web.SPACE, ice.INFO).Append(mdb.ICONS)) m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid( diff --git a/core/team/corporation.go b/core/team/corporation.go new file mode 100644 index 00000000..417401d4 --- /dev/null +++ b/core/team/corporation.go @@ -0,0 +1,20 @@ +package team + +import ( + ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/mdb" + "shylinux.com/x/icebergs/base/web" +) + +func init() { + const corporation = "corporation" + Index.MergeCommands(ice.Commands{ + corporation: {Name: "corporation username auto", Help: "企业法人", Actions: ice.MergeActions(ice.Actions{}, mdb.ExportHashAction( + mdb.SHORT, "username", mdb.FIELD, "time,username,mobile,idnumber,usci,email,portal", + )), Hand: func(m *ice.Message, arg ...string) { + mdb.HashSelect(m, arg...) + web.PushPodCmd(m, "", arg...) + m.Action(mdb.CREATE) + }}, + }) +} diff --git a/info.go b/info.go index a3d7d5d6..daebfec8 100644 --- a/info.go +++ b/info.go @@ -44,10 +44,11 @@ func (s MakeInfo) Versions() string { } } func (s info) Title() string { - p := path.Base(kit.Select(s.Pathname, s.Make.Remote)) + p := path.Base(kit.Select(s.Pathname, s.Make.Remote, s.Titles)) if strings.HasPrefix(p, "20") { p = kit.Join(strings.Split(p, "-")[1:], "-") } + return p return kit.Capital(p) } @@ -67,6 +68,7 @@ type info struct { Pwd string Lang string + Titles string System string Domain string CtxRoot string