diff --git a/core/chat/action.go b/core/chat/action.go index 7a71f011..6e8889ce 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -130,6 +130,7 @@ func _action_show(m *ice.Message, river, storm, index string, arg ...string) { } else { return } + if len(cmds) == 0 { if p := m.Option(POD); p != "" { m.Option(POD, "") diff --git a/misc/es/es.go b/misc/es/es.go index 164cb10a..918a8069 100644 --- a/misc/es/es.go +++ b/misc/es/es.go @@ -5,6 +5,7 @@ import ( "github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/tcp" + "github.com/shylinux/icebergs/base/web" "github.com/shylinux/icebergs/core/code" kit "github.com/shylinux/toolkits" @@ -66,7 +67,12 @@ var Index = &ice.Context{Name: ES, Help: "搜索", } }}, - "command": {Name: "command 执行:button method:select=GET|PUT|POST|DELETE cmd data:textarea", Help: "命令", Action: map[string]*ice.Action{}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + "command": {Name: "command 执行:button method:select=GET|PUT|POST|DELETE cmd=/ data:textarea", Help: "命令", Action: map[string]*ice.Action{}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if pod := m.Option("_pod"); pod != "" { + m.Option("_pod", "") + m.Cmdy(web.SPACE, pod, "web.code.es.command", arg) + return + } m.Option("header", "Content-Type", "application/json") m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx("web.spide", "dev", "raw", arg[0], "http://localhost:9200/"+arg[1], "data", arg[2])))) }}, diff --git a/misc/es/es.shy b/misc/es/es.shy index ced20aac..806a43ed 100644 --- a/misc/es/es.shy +++ b/misc/es/es.shy @@ -26,9 +26,10 @@ spark shell ` $ curl http://localhost:9200 ` -field command web.code.es.command option `{ pod centos.remote }` +field command web.code.es.command option `{ _pod centos.remote }` +field es web.code.es.es +return field document web.code.es.document -field es web.code.es.es field install web.code.install