forked from x/icebergs
54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
package chat
|
|
|
|
import (
|
|
ice "github.com/shylinux/icebergs"
|
|
"github.com/shylinux/icebergs/base/web"
|
|
kit "github.com/shylinux/toolkits"
|
|
)
|
|
|
|
const CHAT = "chat"
|
|
|
|
var Index = &ice.Context{Name: CHAT, Help: "聊天中心",
|
|
Commands: map[string]*ice.Command{
|
|
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
|
m.Load()
|
|
m.Conf(RIVER, "meta.template", kit.Dict(
|
|
"base", kit.Dict(
|
|
"info", []interface{}{
|
|
"web.chat.info",
|
|
"web.chat.auth",
|
|
"web.chat.user",
|
|
"web.chat.tool",
|
|
"web.chat.node",
|
|
},
|
|
"scan", []interface{}{
|
|
"web.chat.scan",
|
|
"web.chat.paste",
|
|
"web.chat.location",
|
|
},
|
|
"miss", []interface{}{
|
|
"web.team.task",
|
|
"web.team.plan",
|
|
"web.wiki.word",
|
|
},
|
|
"wiki", []interface{}{
|
|
"web.wiki.draw",
|
|
"web.wiki.data",
|
|
"web.wiki.feel",
|
|
"web.wiki.word",
|
|
},
|
|
),
|
|
))
|
|
m.Watch(web.SPACE_START, m.Prefix(NODE))
|
|
m.Watch(web.SPACE_CLOSE, m.Prefix(NODE))
|
|
}},
|
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
web.Index.Register(Index, &web.Frame{},
|
|
HEADER, RIVER, STORM, ACTION, FOOTER,
|
|
)
|
|
}
|