mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt chat
This commit is contained in:
parent
be96492c62
commit
0b863d1eeb
@ -10,13 +10,6 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
DOMAIN = "domain"
|
|
||||||
PUBLIC = "public"
|
|
||||||
PROTECTED = "protected"
|
|
||||||
PRIVATE = "private"
|
|
||||||
)
|
|
||||||
|
|
||||||
func _action_domain(m *ice.Message, cmd string, arg ...string) (domain string) {
|
func _action_domain(m *ice.Message, cmd string, arg ...string) (domain string) {
|
||||||
m.Option(ice.MSG_LOCAL, "")
|
m.Option(ice.MSG_LOCAL, "")
|
||||||
m.Option(ice.MSG_DOMAIN, "")
|
m.Option(ice.MSG_DOMAIN, "")
|
||||||
@ -94,6 +87,14 @@ func _action_upload(m *ice.Message, arg ...string) {
|
|||||||
m.Option(ice.MSG_UPLOAD, msg.Append(kit.MDB_HASH), msg.Append(kit.MDB_NAME))
|
m.Option(ice.MSG_UPLOAD, msg.Append(kit.MDB_HASH), msg.Append(kit.MDB_NAME))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
DOMAIN = "domain"
|
||||||
|
PUBLIC = "public"
|
||||||
|
PROTECTED = "protected"
|
||||||
|
PRIVATE = "private"
|
||||||
|
)
|
||||||
|
|
||||||
|
const P_ACTION = "/action"
|
||||||
const ACTION = "action"
|
const ACTION = "action"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -102,7 +103,7 @@ func init() {
|
|||||||
ACTION: {Name: ACTION, Help: "应用", Value: kit.Data(DOMAIN, kit.Dict())},
|
ACTION: {Name: ACTION, Help: "应用", Value: kit.Data(DOMAIN, kit.Dict())},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
"/action": {Name: "/action river storm action arg...", Help: "工作台", Action: map[string]*ice.Action{
|
P_ACTION: {Name: "/action river storm action arg...", Help: "工作台", Action: map[string]*ice.Action{
|
||||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||||
for _, k := range arg {
|
for _, k := range arg {
|
||||||
m.Cmdy(ctx.COMMAND, k)
|
m.Cmdy(ctx.COMMAND, k)
|
||||||
@ -112,10 +113,9 @@ func init() {
|
|||||||
if arg[0] == "_share" {
|
if arg[0] == "_share" {
|
||||||
switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append(kit.MDB_TYPE) {
|
switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append(kit.MDB_TYPE) {
|
||||||
case STORM:
|
case STORM:
|
||||||
m.Debug(msg.Format(kit.MDB_META))
|
m.Option(kit.MDB_TITLE, msg.Append(kit.MDB_NAME))
|
||||||
arg[0] = msg.Append(RIVER)
|
arg[0] = msg.Append(RIVER)
|
||||||
arg[1] = msg.Append(STORM)
|
arg[1] = msg.Append(STORM)
|
||||||
m.Option(kit.MDB_TITLE, msg.Append(kit.MDB_NAME))
|
|
||||||
default:
|
default:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -130,11 +130,11 @@ func init() {
|
|||||||
|
|
||||||
m.Option(ice.MSG_RIVER, arg[0])
|
m.Option(ice.MSG_RIVER, arg[0])
|
||||||
m.Option(ice.MSG_STORM, arg[1])
|
m.Option(ice.MSG_STORM, arg[1])
|
||||||
|
|
||||||
if len(arg) == 2 {
|
if len(arg) == 2 {
|
||||||
_action_list(m, arg[0], arg[1])
|
_action_list(m, arg[0], arg[1])
|
||||||
return //命令列表
|
return //命令列表
|
||||||
}
|
}
|
||||||
|
|
||||||
_action_show(m, arg[0], arg[1], arg[2], arg[3:]...)
|
_action_show(m, arg[0], arg[1], arg[2], arg[3:]...)
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
|
@ -8,17 +8,18 @@ import (
|
|||||||
const (
|
const (
|
||||||
LEGAL = "legal"
|
LEGAL = "legal"
|
||||||
)
|
)
|
||||||
|
const P_FOOTER = "/footer"
|
||||||
const FOOTER = "footer"
|
const FOOTER = "footer"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{
|
Index.Merge(&ice.Context{
|
||||||
Configs: map[string]*ice.Config{
|
Configs: map[string]*ice.Config{
|
||||||
FOOTER: {Name: "footer", Help: "状态栏", Value: kit.Dict(
|
FOOTER: {Name: FOOTER, Help: "状态栏", Value: kit.Dict(
|
||||||
LEGAL, []interface{}{`<a href="mailto:shylinuxc@gmail.com">shylinuxc@gmail.com</a>`},
|
LEGAL, []interface{}{`<a href="mailto:shylinuxc@gmail.com">shylinuxc@gmail.com</a>`},
|
||||||
)},
|
)},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
"/footer": {Name: "/footer", Help: "状态栏", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
P_FOOTER: {Name: "/footer", Help: "状态栏", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
kit.Fetch(m.Confv(FOOTER, LEGAL), func(index int, value string) { m.Echo(value) })
|
kit.Fetch(m.Confv(FOOTER, LEGAL), func(index int, value string) { m.Echo(value) })
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
|
@ -16,6 +16,7 @@ const (
|
|||||||
|
|
||||||
BACKGROUND = "background"
|
BACKGROUND = "background"
|
||||||
)
|
)
|
||||||
|
const P_HEADER = "/header"
|
||||||
const HEADER = "header"
|
const HEADER = "header"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -24,7 +25,7 @@ func init() {
|
|||||||
HEADER: {Name: HEADER, Help: "标题栏", Value: kit.Dict(TITLE, "github.com/shylinux/contexts")},
|
HEADER: {Name: HEADER, Help: "标题栏", Value: kit.Dict(TITLE, "github.com/shylinux/contexts")},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
"/header": {Name: "/header", Help: "标题栏", Action: map[string]*ice.Action{
|
P_HEADER: {Name: "/header", Help: "标题栏", Action: map[string]*ice.Action{
|
||||||
LOGIN: {Name: "login", Help: "用户登录", Hand: func(m *ice.Message, arg ...string) {
|
LOGIN: {Name: "login", Help: "用户登录", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if aaa.UserLogin(m, arg[0], arg[1]) {
|
if aaa.UserLogin(m, arg[0], arg[1]) {
|
||||||
m.Option(ice.MSG_SESSID, aaa.SessCreate(m, m.Option(ice.MSG_USERNAME), m.Option(ice.MSG_USERROLE)))
|
m.Option(ice.MSG_SESSID, aaa.SessCreate(m, m.Option(ice.MSG_USERNAME), m.Option(ice.MSG_USERROLE)))
|
||||||
|
@ -27,6 +27,9 @@ func init() {
|
|||||||
m.PushSearch(kit.SSH_CMD, P_SEARCH, value)
|
m.PushSearch(kit.SSH_CMD, P_SEARCH, value)
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
|
mdb.RENDER: {Name: "render", Help: "渲染", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(m.Space(m.Option(POD)), mdb.RENDER, arg[1:])
|
||||||
|
}},
|
||||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == "run" {
|
if len(arg) > 0 && arg[0] == "run" {
|
||||||
m.Cmdy(arg[1:])
|
m.Cmdy(arg[1:])
|
||||||
@ -34,14 +37,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
m.Cmdy(ctx.COMMAND, arg)
|
m.Cmdy(ctx.COMMAND, arg)
|
||||||
}},
|
}},
|
||||||
mdb.RENDER: {Name: "render", Help: "渲染", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(m.Space(m.Option(POD)), mdb.RENDER, arg[1:])
|
|
||||||
}},
|
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if kit.Contains(arg[1], ";") {
|
if kit.Contains(arg[1], ";") {
|
||||||
arg = kit.Split(arg[1], ";", ";", ";")
|
arg = kit.Split(arg[1], ";", ";", ";")
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Cmdy(m.Space(m.Option(POD)), mdb.SEARCH, arg); arg[1] == "" {
|
if m.Cmdy(m.Space(m.Option(POD)), mdb.SEARCH, arg); arg[1] == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title "微信公众号"
|
title "微信公众号"
|
||||||
refer "" `
|
refer `
|
||||||
官网 https://weixin.qq.com/
|
官网 https://weixin.qq.com/
|
||||||
后台 https://mp.weixin.qq.com/
|
后台 https://mp.weixin.qq.com/
|
||||||
文档 https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html
|
文档 https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html
|
||||||
@ -9,10 +9,10 @@ image qrcode `https://weixin.qq.com`
|
|||||||
spark
|
spark
|
||||||
|
|
||||||
chapter "应用"
|
chapter "应用"
|
||||||
field location web.chat.location
|
|
||||||
field paste web.chat.paste
|
|
||||||
field scan web.chat.scan
|
field scan web.chat.scan
|
||||||
field feel web.chat.feel
|
field paste web.chat.paste
|
||||||
|
field files web.chat.files
|
||||||
|
field location web.chat.location
|
||||||
|
|
||||||
chapter "权限"
|
chapter "权限"
|
||||||
field access web.chat.wx.access
|
field access web.chat.wx.access
|
||||||
|
Loading…
x
Reference in New Issue
Block a user