1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

add es.command

This commit is contained in:
shylinux 2020-08-14 00:44:06 +08:00
parent ce43453626
commit c72b3d2c28
3 changed files with 11 additions and 3 deletions

View File

@ -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, "")

View File

@ -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]))))
}},

View File

@ -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