From a8bfff72ce2f42f59fca22be90b8655f3e7d6162 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sun, 9 Jan 2022 17:50:52 +0800 Subject: [PATCH] opt chat --- core/chat/chat.shy | 24 ++++++++++++++---------- core/chat/files.go | 2 +- core/chat/header.go | 5 +++-- core/chat/sso.go | 3 ++- core/chat/trans.go | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/core/chat/chat.shy b/core/chat/chat.shy index 759003b8..61c34881 100644 --- a/core/chat/chat.shy +++ b/core/chat/chat.shy @@ -1,27 +1,31 @@ chapter "组织" - -chat.go -chat.shy - + header.go -search.go +footer.go river.go storm.go ocean.go action.go -footer.go +search.go + +info.go +node.go +chat.go +chat.shy pod.go cmd.go div.go +sso.go +grant.go +website.go +room.go +meet.go scan.go scan.js paste.go files.go +trans.go location.go -info.go -node.go -room.go -meet.go diff --git a/core/chat/files.go b/core/chat/files.go index 2d5f7a20..08af52b2 100644 --- a/core/chat/files.go +++ b/core/chat/files.go @@ -28,7 +28,7 @@ func init() { }, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { mdb.HashSelect(m, arg...) m.Table(func(index int, value map[string]string, head []string) { - link := "/share/cache/" + value[mdb.DATA] + link := web.SHARE_CACHE + value[mdb.DATA] if m.PushDownload(mdb.LINK, value[mdb.NAME], link); len(arg) > 0 && kit.ExtIsImage(value[mdb.NAME]) { m.PushImages("image", link) } diff --git a/core/chat/header.go b/core/chat/header.go index 1f80b94a..f4509a98 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -80,8 +80,9 @@ const HEADER = "header" func init() { Index.Merge(&ice.Context{Configs: map[string]*ice.Config{ HEADER: {Name: HEADER, Help: "标题栏", Value: kit.Data( - TITLE, "shylinux.com/x/contexts", MENUS, kit.List("header", kit.List("setting", "black", "white", "print", "webpack", "devpack")), - aaa.LOGIN, kit.List("登录", "扫码", "授权"), + TITLE, "shylinux.com/x/contexts", MENUS, kit.List( + "header", kit.List("setting", "black", "white", "print", "webpack", "devpack"), + ), aaa.LOGIN, kit.List("登录", "扫码", "授权"), )}, }, Commands: map[string]*ice.Command{ web.WEB_LOGIN: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { diff --git a/core/chat/sso.go b/core/chat/sso.go index 2b0da4c8..167c3906 100644 --- a/core/chat/sso.go +++ b/core/chat/sso.go @@ -3,6 +3,7 @@ package chat import ( ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/aaa" + "shylinux.com/x/icebergs/base/cli" "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" @@ -25,7 +26,7 @@ func init() { ) m.Cmdy(GRANT, mdb.INSERT, web.SPACE, m.Option(web.SPACE), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK)) - m.RenderRedirect(kit.MergeURL(m.Option("back"), ice.MSG_SESSID, sessid)) + m.RenderRedirect(kit.MergeURL(m.Option(cli.BACK), ice.MSG_SESSID, sessid)) // web.RenderCookie(m, sessid, web.CookieName(m.Option("back"))) // m.RenderRedirect(kit.MergeURL(m.Option("back"))) }}, diff --git a/core/chat/trans.go b/core/chat/trans.go index 964ac69a..3a21add4 100644 --- a/core/chat/trans.go +++ b/core/chat/trans.go @@ -22,7 +22,7 @@ func init() { TRANS: {Name: "trans from to auto", Help: "传输", Action: ice.MergeAction(map[string]*ice.Action{ SEND: {Name: "send", Help: "发送", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(web.SPACE, m.Option(TO), web.SPIDE, ice.DEV, web.SPIDE_SAVE, kit.Select(ice.PWD, m.Option("to_path")), - m.MergeURL2(path.Join("/share/local/", m.Option("from_path")), ice.POD, m.Option(FROM), + m.MergeURL2(path.Join(web.SHARE_LOCAL, m.Option("from_path")), ice.POD, m.Option(FROM), web.SHARE, m.Cmdx(web.SHARE, mdb.CREATE, mdb.TYPE, web.LOGIN), ), )