forked from x/icebergs
opt some
This commit is contained in:
parent
a92d298f12
commit
f25f7037cb
@ -141,7 +141,11 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
|
||||
}
|
||||
m.Push("uptime", kit.Split(m.Cmdx(SYSTEM, "uptime"), ",")[0])
|
||||
case "diskinfo":
|
||||
m.Split(m.Cmdx(SYSTEM, "df", "-h"), "", " ", "\n")
|
||||
m.Spawn().Split(m.Cmdx(SYSTEM, "df", "-h"), "", " ", "\n").Table(func(index int, value map[string]string, head []string) {
|
||||
if strings.HasPrefix(value["Filesystem"], "/dev") {
|
||||
m.Push("", value, head)
|
||||
}
|
||||
})
|
||||
case "ifconfig":
|
||||
m.Cmdy("tcp.ip")
|
||||
case "userinfo":
|
||||
|
@ -330,16 +330,16 @@ var Index = &ice.Context{Name: "nfs", Help: "存储模块",
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
}},
|
||||
DIR: {Name: "dir path=auto field... 查看:button=auto 返回 上传", Help: "目录", Action: map[string]*ice.Action{
|
||||
"upload": {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
|
||||
DIR: {Name: "dir path=auto field... auto 上传", Help: "目录", Action: map[string]*ice.Action{
|
||||
"upload": {Name: "upload [name path dev]", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) > 0 {
|
||||
m.Cmdy("spide", "dev", "cache", "GET", kit.MergeURL(arg[2], "path", arg[1], "name", arg[0]))
|
||||
m.Option("name", arg[0])
|
||||
m.Cmdy("spide", "dev", "cache", "GET", kit.MergeURL(arg[2], "path", arg[1], "name", m.Option("name", arg[0])))
|
||||
} else {
|
||||
m.Cmdy("cache", "upload")
|
||||
}
|
||||
m.Cmdy("cache", "watch", m.Option("data"), path.Join(m.Option("path"), m.Option("name")))
|
||||
}},
|
||||
|
||||
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
|
||||
_file_search(m, arg[0], arg[1], arg[2], arg[3:]...)
|
||||
}},
|
||||
@ -351,7 +351,7 @@ var Index = &ice.Context{Name: "nfs", Help: "存储模块",
|
||||
rg, _ := regexp.Compile(m.Option(DIR_REG))
|
||||
_file_list(m, kit.Select("./", m.Option(DIR_ROOT)), kit.Select("", arg, 0),
|
||||
0, m.Options(DIR_DEEP), kit.Select("both", m.Option(DIR_TYPE)), rg,
|
||||
strings.Split(kit.Select("time size line path", strings.Join(arg[1:], " ")), " "))
|
||||
strings.Split(kit.Select("time size path", strings.Join(arg[1:], " ")), " "))
|
||||
}},
|
||||
CAT: {Name: "cat file", Help: "查看", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
_file_show(m, arg[0])
|
||||
|
11
meta.go
11
meta.go
@ -53,8 +53,15 @@ func (m *Message) Set(key string, arg ...string) *Message {
|
||||
func (m *Message) Push(key string, value interface{}, arg ...interface{}) *Message {
|
||||
switch value := value.(type) {
|
||||
case map[string]string:
|
||||
for k, v := range value {
|
||||
m.Push(k, v)
|
||||
head := kit.Simple(arg)
|
||||
if len(head) == 0 {
|
||||
for k := range value {
|
||||
head = append(head, k)
|
||||
}
|
||||
}
|
||||
|
||||
for _, k := range head {
|
||||
m.Push(k, value[k])
|
||||
}
|
||||
return m
|
||||
case map[string]interface{}:
|
||||
|
@ -25,6 +25,9 @@ section 体验
|
||||
spark shell `
|
||||
curl http://localhost:9200
|
||||
`
|
||||
field "进程管理" cli.daemon
|
||||
field "下载管理" web.code.install
|
||||
field "编辑器" web.code.vimer args `[ src/ main.go ]`
|
||||
|
||||
# field command web.code.es.command option `{ _pod centos.remote }`
|
||||
field "查询数据" web.code.es.GET args `[ /index_test/test_type/1 ]` style command option `{ _pod centos.remote }`
|
||||
@ -35,6 +38,5 @@ field "提交数据" web.code.es.CMD args `[ POST /index_test/test_type/1 ] ` co
|
||||
}` style command option `{ _pod centos.remote }`
|
||||
|
||||
section 管理
|
||||
field "文件夹" nfs.dir args `[ "'usr/publish/'" "'time size path link'" ]`
|
||||
field "服务管理" web.code.es.es
|
||||
field "进程管理" cli.daemon
|
||||
field "下载管理" web.code.install
|
||||
|
Loading…
x
Reference in New Issue
Block a user