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"
|
||||
)
|
||||
|
||||
const (
|
||||
DOMAIN = "domain"
|
||||
PUBLIC = "public"
|
||||
PROTECTED = "protected"
|
||||
PRIVATE = "private"
|
||||
)
|
||||
|
||||
func _action_domain(m *ice.Message, cmd string, arg ...string) (domain string) {
|
||||
m.Option(ice.MSG_LOCAL, "")
|
||||
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))
|
||||
}
|
||||
|
||||
const (
|
||||
DOMAIN = "domain"
|
||||
PUBLIC = "public"
|
||||
PROTECTED = "protected"
|
||||
PRIVATE = "private"
|
||||
)
|
||||
|
||||
const P_ACTION = "/action"
|
||||
const ACTION = "action"
|
||||
|
||||
func init() {
|
||||
@ -102,7 +103,7 @@ func init() {
|
||||
ACTION: {Name: ACTION, Help: "应用", Value: kit.Data(DOMAIN, kit.Dict())},
|
||||
},
|
||||
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) {
|
||||
for _, k := range arg {
|
||||
m.Cmdy(ctx.COMMAND, k)
|
||||
@ -112,10 +113,9 @@ func init() {
|
||||
if arg[0] == "_share" {
|
||||
switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append(kit.MDB_TYPE) {
|
||||
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[1] = msg.Append(STORM)
|
||||
m.Option(kit.MDB_TITLE, msg.Append(kit.MDB_NAME))
|
||||
default:
|
||||
return
|
||||
}
|
||||
@ -130,11 +130,11 @@ func init() {
|
||||
|
||||
m.Option(ice.MSG_RIVER, arg[0])
|
||||
m.Option(ice.MSG_STORM, arg[1])
|
||||
|
||||
if len(arg) == 2 {
|
||||
_action_list(m, arg[0], arg[1])
|
||||
return //命令列表
|
||||
}
|
||||
|
||||
_action_show(m, arg[0], arg[1], arg[2], arg[3:]...)
|
||||
}},
|
||||
}})
|
||||
|
@ -8,17 +8,18 @@ import (
|
||||
const (
|
||||
LEGAL = "legal"
|
||||
)
|
||||
const P_FOOTER = "/footer"
|
||||
const FOOTER = "footer"
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{
|
||||
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>`},
|
||||
)},
|
||||
},
|
||||
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) })
|
||||
}},
|
||||
},
|
||||
|
@ -16,6 +16,7 @@ const (
|
||||
|
||||
BACKGROUND = "background"
|
||||
)
|
||||
const P_HEADER = "/header"
|
||||
const HEADER = "header"
|
||||
|
||||
func init() {
|
||||
@ -24,7 +25,7 @@ func init() {
|
||||
HEADER: {Name: HEADER, Help: "标题栏", Value: kit.Dict(TITLE, "github.com/shylinux/contexts")},
|
||||
},
|
||||
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) {
|
||||
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)))
|
||||
|
@ -27,6 +27,9 @@ func init() {
|
||||
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) {
|
||||
if len(arg) > 0 && arg[0] == "run" {
|
||||
m.Cmdy(arg[1:])
|
||||
@ -34,14 +37,10 @@ func init() {
|
||||
}
|
||||
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) {
|
||||
if kit.Contains(arg[1], ";") {
|
||||
arg = kit.Split(arg[1], ";", ";", ";")
|
||||
}
|
||||
|
||||
if m.Cmdy(m.Space(m.Option(POD)), mdb.SEARCH, arg); arg[1] == "" {
|
||||
return
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
title "微信公众号"
|
||||
refer "" `
|
||||
refer `
|
||||
官网 https://weixin.qq.com/
|
||||
后台 https://mp.weixin.qq.com/
|
||||
文档 https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html
|
||||
@ -9,10 +9,10 @@ image qrcode `https://weixin.qq.com`
|
||||
spark
|
||||
|
||||
chapter "应用"
|
||||
field location web.chat.location
|
||||
field paste web.chat.paste
|
||||
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 "权限"
|
||||
field access web.chat.wx.access
|
||||
|
Loading…
x
Reference in New Issue
Block a user