1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 09:34:05 +08:00
This commit is contained in:
harveyshao 2022-11-12 22:14:56 +08:00
parent 20b60b11bf
commit 398be22600
6 changed files with 13 additions and 29 deletions

View File

@ -54,12 +54,10 @@ func _action_share(m *ice.Message, arg ...string) {
break
}
_action_exec(m, msg.Append(web.RIVER), msg.Append(web.STORM), arg[1], arg[2:]...)
case web.FIELD:
if len(arg) == 1 {
m.Push(TITLE, msg.Append(TITLE))
m.Push(TOPIC, msg.Append(TOPIC))
m.Push(ctx.INDEX, msg.Append(mdb.NAME))
m.Push(ctx.ARGS, msg.Append(mdb.TEXT))
m.Cmdy(ctx.COMMAND, msg.Append(mdb.NAME))
break
@ -80,15 +78,11 @@ const ACTION = "action"
func init() {
Index.MergeCommands(ice.Commands{
web.P(ACTION): {Name: "/action river storm action arg...", Help: "工作台", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
m.Cmd(aaa.ROLE, aaa.BLACK, aaa.VOID, m.CommandKey(), ctx.ACTION)
}},
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { m.Cmd(aaa.ROLE, aaa.BLACK, aaa.VOID, m.CommandKey(), ctx.ACTION) }},
mdb.MODIFY: {Hand: func(m *ice.Message, arg ...string) {
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.CmdAction(nfs.PATH, ice.USR_LOCAL_RIVER), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) {
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin, arg) {
return
@ -99,9 +93,9 @@ func init() {
if len(arg) == 2 {
m.OptionFromConfig(MENUS)
_action_list(m, arg[0], arg[1])
return
} else {
_action_exec(m, arg[0], arg[1], arg[2], arg[3:]...)
}
_action_exec(m, arg[0], arg[1], arg[2], arg[3:]...)
}},
})
}

View File

@ -11,7 +11,6 @@ import (
const FOOTER = "footer"
func init() {
const EMAIL = "email"
Index.MergeCommands(ice.Commands{
web.P(FOOTER): {Name: "/footer", Help: "状态栏", Actions: ice.MergeActions(ice.Actions{
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
@ -21,8 +20,8 @@ func init() {
}
}
}},
}, ctx.CmdAction(EMAIL, `shylinuxc@gmail.com`), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) {
m.Result(m.Configv(EMAIL))
}, ctx.CmdAction(TITLE, `<a href="mailto:shylinuxc@gmail.com">shylinuxc@gmail.com</a>`), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) {
m.Result(m.Configv(TITLE))
}},
})
}

View File

@ -30,7 +30,7 @@ func _header_share(m *ice.Message, arg ...string) {
func _header_check(m *ice.Message, arg ...string) bool {
if m.Option(web.SHARE) != "" {
m.Cmd(web.SHARE, m.Option(web.SHARE), ice.OptionFields(""), func(value ice.Maps) {
if m.Warn(value[mdb.TIME] < m.Time(), ice.ErrNotValid, m.Option(web.SHARE)) {
if m.Warn(value[mdb.TIME] < m.Time(), ice.ErrNotValid, m.Option(web.SHARE), value[mdb.TIME], m.Time()) {
return
}
switch value[mdb.TYPE] {

View File

@ -40,9 +40,7 @@ const RIVER = "river"
func init() {
Index.MergeCommands(ice.Commands{
web.P(RIVER): {Name: "/river hash auto create", Help: "群组", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
m.Cmd(aaa.ROLE, aaa.BLACK, aaa.VOID, m.CommandKey(), ctx.ACTION)
}},
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { m.Cmd(aaa.ROLE, aaa.BLACK, aaa.VOID, m.CommandKey(), ctx.ACTION) }},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
switch arg[0] {
case nfs.TEMPLATE:

View File

@ -35,15 +35,11 @@ func init() {
}
}},
}, Hand: func(m *ice.Message, arg ...string) {
if m.Option(ice.MSG_STORM) == "" { // 应用列表
m.OptionFields("time,hash,name,text,count")
m.Cmdy(mdb.SELECT, RIVER, _river_key(m), mdb.HASH)
} else if len(arg) == 0 || kit.Int(arg[0]) > 0 { // 工具列表
m.OptionFields("time,id,space,index,args,style,display")
m.Cmdy(mdb.SELECT, RIVER, _storm_key(m), mdb.LIST, mdb.ID, arg)
} else if aaa.Right(m, arg[0]) { // 静态群组
if m.Option(ice.MSG_STORM) == "" {
m.Cmdy(mdb.SELECT, RIVER, _river_key(m), mdb.HASH, ice.OptionFields("time,hash,name,text,count"))
} else if len(arg) == 0 || kit.Int(arg[0]) > 0 {
m.Cmdy(mdb.SELECT, RIVER, _storm_key(m), mdb.LIST, mdb.ID, arg, ice.OptionFields("time,id,space,index,args,style,display"))
} else if aaa.Right(m, arg[0]) {
m.Push(ctx.INDEX, arg[0])
}
}},

View File

@ -29,7 +29,6 @@ func Render(m *Message, cmd string, args ...Any) string {
return strings.Join(list, "")
case RENDER_IMAGES: // src [height]
m.Debug("what %v", m.Option(MSG_USERUA))
if strings.Contains(m.Option(MSG_USERUA), "Mobile") {
return kit.Format(`<img src="%s" width=%d>`, arg[0], kit.Int(kit.Select(kit.Select("120", m.Option("width")), arg, 1))-24)
}
@ -84,8 +83,6 @@ func (m *Message) RenderRedirect(args ...Any) *Message {
return m.Render(RENDER_REDIRECT, args...)
}
func (m *Message) RenderDownload(args ...Any) *Message {
m.Debug("what %v", kit.Format(args))
return m.Render(RENDER_DOWNLOAD, args...)
}
func (m *Message) RenderResult(args ...Any) *Message { // [fmt arg...]