diff --git a/base/ctx/command.go b/base/ctx/command.go index 82c1f79d..7ec6ad8b 100644 --- a/base/ctx/command.go +++ b/base/ctx/command.go @@ -112,7 +112,8 @@ func CmdInputs(m *ice.Message, arg ...string) { } func PodCmd(m *ice.Message, arg ...ice.Any) bool { Upload(m) - for _, key := range []string{ice.SPACE, ice.POD} { + // for _, key := range []string{ice.SPACE, ice.POD} { + for _, key := range []string{ice.POD} { if pod := m.Option(key); pod != "" { m.Options(key, []string{}, ice.MSG_USERPOD, pod).Cmdy(append(kit.List(ice.SPACE, pod), arg...)...) return true diff --git a/base/web/space.go b/base/web/space.go index 9d2ff31f..0b7c9a1f 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -54,6 +54,7 @@ func _space_fork(m *ice.Message) { m.Option(TOKEN) != "" && m.Cmdv(TOKEN, m.Option(TOKEN), mdb.TIME) > m.Time()) || mdb.HashSelect(m.Spawn(), name).Length() > 0 { name, text = kit.Hashs(name), kit.Select(addr, m.Option(mdb.NAME), m.Option(mdb.TEXT)) } + args := kit.Simple(mdb.TYPE, kit.Select(WORKER, m.Option(mdb.TYPE)), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(cli.DAEMON, ice.MSG_USERUA), m.OptionSimple(nfs.MODULE, nfs.VERSION)) if c, e := websocket.Upgrade(m.W, m.R); !m.Warn(e) { gdb.Go(m, func() { @@ -65,8 +66,13 @@ func _space_fork(m *ice.Message) { case CHROME: m.Go(func() { m.Cmd(SPACE, name, cli.PWD, name) }) case LOGIN: + m.Debug("what %v", m.Option(ice.MSG_USERNAME)) + if m.Option(ice.MSG_SESSID) != "" && m.Option(ice.MSG_USERNAME) != "" { + m.Cmd(SPACE, name, ice.MSG_SESSID, m.Option(ice.MSG_SESSID)) + } gdb.Event(m, SPACE_LOGIN, args) } + m.Debug("what %v", m.Option(ice.MSG_USERNAME)) _space_handle(m, false, name, c) }, kit.Join(kit.Simple(SPACE, name), lex.SP)) } diff --git a/core/chat/oauth/client.go b/core/chat/oauth/client.go index cba40029..044b7486 100644 --- a/core/chat/oauth/client.go +++ b/core/chat/oauth/client.go @@ -79,10 +79,14 @@ func (s Client) User(m *ice.Message, arg ...string) { m.OptionSimple(aaa.EMAIL, aaa.LANGUAGE, aaa.AVATAR_URL)) } } +func (s Client) Sso(m *ice.Message, arg ...string) { + mdb.Conf(m, "web.chat.header", kit.Keym("sso.gitea.url"), kit.MergeURL2(m.Option(web.DOMAIN), m.Option(OAUTH_URL), m.OptionSimple(CLIENT_ID), REDIRECT_URI, s.RedirectURI(m), RESPONSE_TYPE, CODE, STATE, m.Option(mdb.HASH))) + mdb.Conf(m, "web.chat.header", kit.Keym("sso.gitea.icon"), "usr/icons/gitea.png") +} func (s Client) Orgs(m *ice.Message, arg ...string) {} func (s Client) Repo(m *ice.Message, arg ...string) {} func (s Client) List(m *ice.Message, arg ...string) { - if s.Hash.List(m, arg...).PushAction(s.User, s.Auth, s.Remove); len(arg) == 0 { + if s.Hash.List(m, arg...).PushAction(s.Sso, s.User, s.Auth, s.Remove); len(arg) == 0 { m.EchoScript(s.RedirectURI(m)) } else { m.EchoScript("config header sso " + kit.MergeURL2(m.Append(web.DOMAIN), m.Append(OAUTH_URL), m.AppendSimple(CLIENT_ID), REDIRECT_URI, s.RedirectURI(m), RESPONSE_TYPE, CODE, STATE, arg[0])) diff --git a/misc/git/search.js b/misc/git/search.js index d2ce3ffc..317abcd8 100644 --- a/misc/git/search.js +++ b/misc/git/search.js @@ -18,6 +18,7 @@ Volcanos(chat.ONIMPORT, { {view: html.ACTION, inner: value.action, _init: function(target) { can.onappend.mores(can, target, value, 5) }}, ]} })), can.onappend.board(can, msg), can.onimport.layout(can) + can.onappend.scroll(can, can._output) }, layout: function(can) { can.onlayout.expand(can, can._output, 380) }, -}, [""]) \ No newline at end of file +}, [""])