1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-02 17:26:08 +08:00
parent 72bbad483a
commit a12978d028
4 changed files with 30 additions and 2 deletions

View File

@ -225,7 +225,10 @@ func init() {
}},
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.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) {
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))

View File

@ -359,7 +359,10 @@ func init() {
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()
}},
}, 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] == "") {
list := m.CmdMap(SPACE, mdb.NAME)
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})

View File

@ -68,6 +68,14 @@ func init() {
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...) }},
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) {
if m.WarnNotLogin(m.Option(ice.MSG_USERNAME) == "", arg) {
return

14
core/chat/rewrite.go Normal file
View 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"))},
})
}