diff --git a/base/cli/system.go b/base/cli/system.go index 704f134a..583f8a30 100644 --- a/base/cli/system.go +++ b/base/cli/system.go @@ -56,7 +56,7 @@ func init() { SYSTEM: {Name: "system", Help: "系统命令", Value: kit.Data()}, }, Commands: map[string]*ice.Command{ - SYSTEM: {Name: "system cmd arg", Help: "系统命令", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) { + SYSTEM: {Name: "system cmd 执行:button 清空:button", Help: "系统命令", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) { cmd := exec.Command(arg[0], arg[1:]...) // 运行目录 diff --git a/base/ctx/cmd.go b/base/ctx/cmd.go index e3de18fb..d533c38b 100644 --- a/base/ctx/cmd.go +++ b/base/ctx/cmd.go @@ -83,7 +83,7 @@ func _command_make(m *ice.Message, cmd *ice.Command) { } } if len(cmd.List) == 0 { - cmd.List = append(cmd.List, kit.List(kit.MDB_INPUT, "text", "name", "name")...) + cmd.List = append(cmd.List, kit.List(kit.MDB_INPUT, "text", "name", "path")...) } if !button { cmd.List = append(cmd.List, kit.List(kit.MDB_INPUT, "button", "name", "查看")...) diff --git a/core/chat/action.go b/core/chat/action.go index dfc19df0..7a71f011 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -175,6 +175,14 @@ func init() { ORDER: {Name: "order cmd...", Help: "定制", Hand: func(m *ice.Message, arg ...string) { _action_order_list(m, m.Option(ice.MSG_RIVER), m.Option(ice.MSG_STORM), arg...) }}, + + "command": {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) { + if len(arg) == 1 { + m.Cmdy(ctx.COMMAND, arg[0]) + return + } + m.Cmdy(arg[0], arg[1:]) + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if len(arg) == 0 { // 命令列表 diff --git a/core/code/go.go b/core/code/go.go index 307f2193..a68e38e1 100644 --- a/core/code/go.go +++ b/core/code/go.go @@ -24,6 +24,9 @@ func _go_find(m *ice.Message, key string) { } } func _go_tags(m *ice.Message, key string) { + ls := strings.Split(key, ".") + key = ls[len(ls)-1] + if _, e := os.Stat(path.Join(m.Option("_path"), ".tags")); e != nil { m.Cmd(cli.SYSTEM, "gotags", "-R", "-f", ".tags", "./") } diff --git a/core/code/inner.go b/core/code/inner.go index 91f1b3e1..7b482588 100644 --- a/core/code/inner.go +++ b/core/code/inner.go @@ -52,7 +52,7 @@ func _inner_list(m *ice.Message, ext, file, dir string, arg ...string) { func init() { Index.Merge(&ice.Context{ Commands: map[string]*ice.Command{ - INNER: {Name: "inner path=usr/demo file=hi.sh line=1 查看:button=auto", Help: "编辑器", Meta: kit.Dict( + INNER: {Name: "inner path=usr/demo file=hi.sh line=1 auto", Help: "编辑器", Meta: kit.Dict( "display", "/plugin/local/code/inner.js", "style", "editor", ), Action: map[string]*ice.Action{ web.UPLOAD: {Name: "upload path name", Help: "上传", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/mall/mall.go b/core/mall/mall.go index c6461abb..a2dca916 100644 --- a/core/mall/mall.go +++ b/core/mall/mall.go @@ -248,7 +248,7 @@ var Index = &ice.Context{Name: "mall", Help: "贸易中心", }}, ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(ASSET) }}, - ASSET: {Name: "asset account=auto id=auto auto 支出:button 转账:button 收入:button 导出:button 导入:button", Help: "资产", Meta: kit.Dict( + ASSET: {Name: "asset account=auto id=auto auto 支出:button 转账:button 收入:button", Help: "资产", Meta: kit.Dict( "支出", _input_spend, "转账", _input_trans, "收入", _input_bonus, ), Action: map[string]*ice.Action{ "spend": {Name: "insert [key value]...", Help: "支出", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/team/team.go b/core/team/team.go index 3c7e31f1..600880d5 100644 --- a/core/team/team.go +++ b/core/team/team.go @@ -200,16 +200,26 @@ func _task_action(m *ice.Message, status interface{}, action ...string) string { } return strings.Join(action, "") } -func _task_input(m *ice.Message, key, value string) { - switch key { +func _task_input(m *ice.Message, field, value string) { + switch field { case "zone": m.Richs(TASK, kit.Keys(kit.MDB_HASH, m.Optionv(ice.MSG_DOMAIN)), kit.MDB_FOREACH, func(key string, val map[string]interface{}) { m.Push("zone", kit.Value(val, "meta.zone")) m.Push("count", kit.Select("0", kit.Format(kit.Value(val, "meta.count")))) }) m.Sort("count", "int_r") - case "name": - case "text": + case "name", "text": + list := map[string]int{} + m.Richs(TASK, kit.Keys(kit.MDB_HASH, m.Optionv(ice.MSG_DOMAIN)), kit.MDB_FOREACH, func(key string, val map[string]interface{}) { + m.Grows(TASK, kit.Keys(kit.MDB_HASH, m.Optionv(ice.MSG_DOMAIN), kit.MDB_HASH, key), "", "", func(index int, value map[string]interface{}) { + list[kit.Format(value[field])]++ + }) + }) + for k, i := range list { + m.Push("key", k) + m.Push("count", i) + } + m.Sort("count", "int_r") } } func _task_scope(m *ice.Message, arg ...string) (time.Time, time.Time) { @@ -298,7 +308,7 @@ var Index = &ice.Context{Name: "team", Help: "团队中心", }}, ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(TASK) }}, - TASK: {Name: "task zone=auto id=auto auto 添加:button 导出:button 导入:button", Help: "任务", Meta: kit.Dict( + TASK: {Name: "task zone=auto id=auto auto 添加:button", Help: "任务", Meta: kit.Dict( "添加", _task_inputs, ), Action: map[string]*ice.Action{ mdb.INSERT: {Name: "insert [key value]...", Help: "添加", Hand: func(m *ice.Message, arg ...string) { @@ -350,7 +360,7 @@ var Index = &ice.Context{Name: "team", Help: "团队中心", } }}, PLAN: {Name: "plan scale:select=day|week|month|year|long begin_time=@date auto 添加:button", Help: "计划", Meta: kit.Dict( - mdb.INSERT, _task_inputs, + "添加", _task_inputs, "display", "/plugin/local/team/plan.js", "detail", []string{StatusPrepare, StatusProcess, StatusCancel, StatusFinish}, ), Action: map[string]*ice.Action{ mdb.INSERT: {Name: "insert [key value]...", Help: "添加", Hand: func(m *ice.Message, arg ...string) { diff --git a/misc/lark/lark.shy b/misc/lark/lark.shy index 5dbbf2f4..7c6d2acf 100644 --- a/misc/lark/lark.shy +++ b/misc/lark/lark.shy @@ -1,5 +1,4 @@ title "飞书机器人" - refer "官网" ` 官网 https://www.feishu.cn/ 应用管理 https://open.feishu.cn/app @@ -7,6 +6,7 @@ refer "官网" ` 文档 https://open.feishu.cn/document/uQjL04CN/ucDOz4yN4MjL3gzM 源码 https://github.com/shylinux/icebergs/blob/master/misc/lark/lark.go ` +image qrcode `https://www.feishu.cn/` chapter "应用" field "ship" web.chat.lark.ship @@ -16,5 +16,4 @@ chapter "项目" section "icebergs" field "icebergs_统计" web.code.git.trend args `[ icebergs ]` action `{ height 200 speed 20 }` field "icebergs_源码" web.code.inner args `[ usr/icebergs misc/lark/lark.go 74 ]` -field "icebergs_项目" web.code.git.spide args `[ icebergs ]` diff --git a/misc/mp/mp.shy b/misc/mp/mp.shy index b4959b2d..6c4c9d05 100644 --- a/misc/mp/mp.shy +++ b/misc/mp/mp.shy @@ -5,12 +5,14 @@ refer "" ` 文档 https://developers.weixin.qq.com/miniprogram/dev/api/ 源码 https://github.com/shylinux/icebergs/blob/master/misc/mp/mp.go ` +image qrcode `https://weixin.qq.com` chapter "应用" +field "asset" web.mall.asset args `[ ]` +field "task" web.team.task args `[ ]` chapter "项目" section "icebergs" field "icebergs_统计" web.code.git.trend args `[ icebergs ]` action `{ height 200 speed 20 }` field "icebergs_源码" web.code.inner args `[ usr/icebergs misc/mp/mp.go 1 ]` -field "icebergs_项目" web.code.git.spide args `[ icebergs ]` diff --git a/misc/wx/wx.shy b/misc/wx/wx.shy index b7adb63f..1a988ff9 100644 --- a/misc/wx/wx.shy +++ b/misc/wx/wx.shy @@ -1,5 +1,4 @@ title "微信公众号" - refer "" ` 官网 https://weixin.qq.com/ 后台 https://mp.weixin.qq.com/ @@ -8,16 +7,13 @@ refer "" ` ` image qrcode `https://weixin.qq.com` - chapter "应用" -field "plan" web.team.plan args `[ ]` -field "task" web.team.task args `[ ]` +field "runtime" cli.runtime field "asset" web.mall.asset args `[ ]` - +field "task" web.team.task args `[ ]` chapter "项目" section "icebergs" -field "icebergs_统计" web.code.git.trend args `[ icebergs ]` action `{ height 200 speed 20 }` -field "icebergs_源码" web.code.inner args `[ usr/icebergs misc/wx/wx.go 1 ]` -field "icebergs_项目" web.code.git.spide args `[ icebergs ]` +field "icebergs 统计" web.code.git.trend args `[ icebergs ]` action `{ height 200 speed 20 }` +field "icebergs 源码" web.code.inner args `[ usr/icebergs misc/wx/wx.go 1 ]`