forked from x/icebergs
add es.command
This commit is contained in:
parent
ce43453626
commit
c72b3d2c28
@ -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, "")
|
||||
|
@ -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]))))
|
||||
}},
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user