forked from x/icebergs
add some
This commit is contained in:
parent
72bbad483a
commit
a12978d028
@ -225,7 +225,10 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
tcp.HOST: {Help: "公网", Hand: func(m *ice.Message, arg ...string) { m.Echo(kit.Formats(PublicIP(m))) }},
|
tcp.HOST: {Help: "公网", Hand: func(m *ice.Message, arg ...string) { m.Echo(kit.Formats(PublicIP(m))) }},
|
||||||
cli.SYSTEM: {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }},
|
cli.SYSTEM: {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }},
|
||||||
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) { _serve_start(m) }},
|
cli.START: {Name: "start dev proto host port=9020 nodename username usernick", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmd(nfs.SAVE, "etc/local.sh", m.Spawn(ice.Maps{"pwd": kit.Path(""), "user": kit.UserName(), "args": kit.JoinCmds(arg...)}).Template("local.sh")+lex.NL)
|
||||||
|
_serve_start(m)
|
||||||
|
}},
|
||||||
SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
|
SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SPIDE, mdb.CREATE, ice.OPS, kit.Format("http://localhost:%s", m.Option(tcp.PORT)), nfs.REPOS, nfs.USR_ICONS_CONTEXTS)
|
m.Cmd(SPIDE, mdb.CREATE, ice.OPS, kit.Format("http://localhost:%s", m.Option(tcp.PORT)), nfs.REPOS, nfs.USR_ICONS_CONTEXTS)
|
||||||
Count(m, m.ActionKey(), m.Option(tcp.PORT))
|
Count(m, m.ActionKey(), m.Option(tcp.PORT))
|
||||||
|
@ -359,7 +359,10 @@ func init() {
|
|||||||
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
||||||
}},
|
}},
|
||||||
}, DevTokenAction(CLIENT_NAME, CLIENT_URL), mdb.HashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token")), Hand: func(m *ice.Message, arg ...string) {
|
}, DevTokenAction(CLIENT_NAME, CLIENT_URL),
|
||||||
|
mdb.HashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token"),
|
||||||
|
mdb.ImportantHashAction(),
|
||||||
|
), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
||||||
list := m.CmdMap(SPACE, mdb.NAME)
|
list := m.CmdMap(SPACE, mdb.NAME)
|
||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})
|
||||||
|
@ -68,6 +68,14 @@ func init() {
|
|||||||
m.Cmdy(mdb.MODIFY, RIVER, _storm_key(m), mdb.LIST, m.OptionSimple(mdb.ID), arg)
|
m.Cmdy(mdb.MODIFY, RIVER, _storm_key(m), mdb.LIST, m.OptionSimple(mdb.ID), arg)
|
||||||
}},
|
}},
|
||||||
web.SHARE: {Hand: func(m *ice.Message, arg ...string) { _action_share(m, arg...) }},
|
web.SHARE: {Hand: func(m *ice.Message, arg ...string) { _action_share(m, arg...) }},
|
||||||
|
ctx.COMMAND: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if msg := m.Cmd(REWRITE, kit.Hashs(kit.Fields(m.Option(ice.POD), arg[0]))); msg.Length() > 0 {
|
||||||
|
kit.If(msg.Append("to_space"), func(p string) { m.Option(ice.POD, p) })
|
||||||
|
kit.If(msg.Append("to_index"), func(p string) { arg[0] = p })
|
||||||
|
defer m.Push(web.SPACE, m.Option(ice.POD))
|
||||||
|
}
|
||||||
|
ctx.Command(m, arg...)
|
||||||
|
}},
|
||||||
}, web.ApiAction(""), aaa.WhiteAction("", web.SHARE)), Hand: func(m *ice.Message, arg ...string) {
|
}, web.ApiAction(""), aaa.WhiteAction("", web.SHARE)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.WarnNotLogin(m.Option(ice.MSG_USERNAME) == "", arg) {
|
if m.WarnNotLogin(m.Option(ice.MSG_USERNAME) == "", arg) {
|
||||||
return
|
return
|
||||||
|
14
core/chat/rewrite.go
Normal file
14
core/chat/rewrite.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package chat
|
||||||
|
|
||||||
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
)
|
||||||
|
|
||||||
|
const REWRITE = "rewrite"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Index.MergeCommands(ice.Commands{
|
||||||
|
REWRITE: {Actions: ice.MergeActions(ice.Actions{}, mdb.HashAction(mdb.SHORT, "space,index", mdb.FIELD, "time,hash,space,index,to_space,to_index"))},
|
||||||
|
})
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user