forked from x/icebergs
opt pod proxy
This commit is contained in:
parent
4b1cbf9e90
commit
2fd224205f
@ -303,7 +303,9 @@ func (web *Frame) HandleCmd(m *ice.Message, key string, cmd *ice.Command) {
|
|||||||
|
|
||||||
// 请求命令
|
// 请求命令
|
||||||
if msg.Optionv("cmds") == nil {
|
if msg.Optionv("cmds") == nil {
|
||||||
msg.Optionv("cmds", strings.Split(strings.TrimPrefix(msg.Option(ice.MSG_USERURL), key), "/"))
|
if p := strings.TrimPrefix(msg.Option(ice.MSG_USERURL), key); p != "" {
|
||||||
|
msg.Optionv("cmds", strings.Split(p, "/"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmds := kit.Simple(msg.Optionv("cmds"))
|
cmds := kit.Simple(msg.Optionv("cmds"))
|
||||||
|
|
||||||
@ -519,7 +521,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
|
|
||||||
ice.WEB_SPIDE: {Name: "spide name [msg|raw|cache] POST|GET url [json|form|part|file|data] arg...", Help: "蜘蛛侠", Meta: kit.Dict("remote", "pod"), List: kit.List(
|
ice.WEB_SPIDE: {Name: "spide name [msg|raw|cache] POST|GET url [json|form|part|file|data] arg...", Help: "蜘蛛侠", List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "name",
|
kit.MDB_INPUT, "text", "name", "name",
|
||||||
kit.MDB_INPUT, "button", "value", "查看", "action", "auto",
|
kit.MDB_INPUT, "button", "value", "查看", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "value", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "value", "返回", "cb", "Last",
|
||||||
@ -884,7 +886,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
ice.WEB_DREAM: {Name: "dream", Help: "梦想家", Meta: kit.Dict(
|
ice.WEB_DREAM: {Name: "dream", Help: "梦想家", Meta: kit.Dict(
|
||||||
"remote", "pod", "exports", []string{"you", "name"},
|
"exports", []string{"you", "name"},
|
||||||
"detail", []interface{}{"启动", "停止"},
|
"detail", []interface{}{"启动", "停止"},
|
||||||
), List: kit.List(
|
), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "value", "", "name", "name",
|
kit.MDB_INPUT, "text", "value", "", "name", "name",
|
||||||
@ -944,7 +946,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
ice.WEB_FAVOR: {Name: "favor [path [type name [text [key value]....]]", Help: "收藏夹", Meta: kit.Dict(
|
ice.WEB_FAVOR: {Name: "favor [path [type name [text [key value]....]]", Help: "收藏夹", Meta: kit.Dict(
|
||||||
"remote", "pod", "exports", []string{"hot", "favor"},
|
"exports", []string{"hot", "favor"},
|
||||||
"detail", []string{"编辑", "收藏", "收录", "导出", "删除"},
|
"detail", []string{"编辑", "收藏", "收录", "导出", "删除"},
|
||||||
), List: kit.List(
|
), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "favor", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "favor", "action", "auto",
|
||||||
@ -1263,7 +1265,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
m.Push("data", h)
|
m.Push("data", h)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
ice.WEB_STORY: {Name: "story", Help: "故事会", Meta: kit.Dict("remote", "pod", "exports", []string{"top", "story"},
|
ice.WEB_STORY: {Name: "story", Help: "故事会", Meta: kit.Dict("exports", []string{"top", "story"},
|
||||||
"detail", []string{"共享", "更新", "推送"}), List: kit.List(
|
"detail", []string{"共享", "更新", "推送"}), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "story", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "story", "action", "auto",
|
||||||
kit.MDB_INPUT, "text", "name", "list", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "list", "action", "auto",
|
||||||
|
@ -511,11 +511,10 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心",
|
|||||||
|
|
||||||
// 代理命令
|
// 代理命令
|
||||||
proxy := []string{}
|
proxy := []string{}
|
||||||
m.Search(cmds[0], func(p *ice.Context, c *ice.Context, key string, cmd *ice.Command) {
|
if m.Option("pod") != "" {
|
||||||
if remote := kit.Format(kit.Value(cmd.Meta, "remote")); m.Option(remote) != "" {
|
proxy = append(proxy, ice.WEB_PROXY, m.Option("pod"))
|
||||||
proxy = append(proxy, ice.WEB_PROXY, m.Option(remote))
|
m.Option("pod", "")
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
// 执行命令
|
// 执行命令
|
||||||
m.Cmdy(proxy, cmds).Option("cmds", cmds)
|
m.Cmdy(proxy, cmds).Option("cmds", cmds)
|
||||||
|
@ -32,9 +32,14 @@ var Index = &ice.Context{Name: "code", Help: "编程中心",
|
|||||||
m.Save("login")
|
m.Save("login")
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"login": {Name: "login", Help: "登录", List: ice.ListLook("key"), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
"login": {Name: "login", Help: "登录", Meta: kit.Dict(
|
||||||
|
"detail", []string{"编辑", "清理", "清空", "删除"},
|
||||||
|
), List: ice.ListLook("key"), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == "action" {
|
if len(arg) > 0 && arg[0] == "action" {
|
||||||
switch arg[1] {
|
switch arg[1] {
|
||||||
|
case "prune", "清理":
|
||||||
|
m.Cmdy("login", "prune")
|
||||||
|
|
||||||
case "modify", "编辑":
|
case "modify", "编辑":
|
||||||
m.Richs("login", nil, m.Option("key"), func(key string, value map[string]interface{}) {
|
m.Richs("login", nil, m.Option("key"), func(key string, value map[string]interface{}) {
|
||||||
m.Log(ice.LOG_MODIFY, "%s %s %v->%s", key, arg[2], value[arg[2]], arg[3])
|
m.Log(ice.LOG_MODIFY, "%s %s %v->%s", key, arg[2], value[arg[2]], arg[3])
|
||||||
|
@ -87,7 +87,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
m.Save("feel")
|
m.Save("feel")
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"note": {Name: "note file", Help: "文档", Meta: kit.Dict("remote", "you", "display", "inner"), List: kit.List(
|
"note": {Name: "note file", Help: "文档", Meta: kit.Dict("display", "inner"), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "path", "value", "README.md", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "path", "value", "README.md", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -361,7 +361,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
m.Render(ice.RENDER_TEMPLATE, m.Conf("chart", "meta.suffix"))
|
m.Render(ice.RENDER_TEMPLATE, m.Conf("chart", "meta.suffix"))
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"draw": {Name: "draw", Help: "思维导图", Meta: kit.Dict("remote", "pod", "display", "wiki/draw"), List: kit.List(
|
"draw": {Name: "draw", Help: "思维导图", Meta: kit.Dict("display", "wiki/draw"), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "path", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "path", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "查看", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "查看", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -387,7 +387,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
|
|
||||||
reply(m, cmd, arg...)
|
reply(m, cmd, arg...)
|
||||||
}},
|
}},
|
||||||
"data": {Name: "data", Help: "数据表格", Meta: kit.Dict("remote", "pod", "display", "wiki/data"), List: kit.List(
|
"data": {Name: "data", Help: "数据表格", Meta: kit.Dict("display", "wiki/data"), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "path", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "path", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -407,7 +407,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
// 解析数据
|
// 解析数据
|
||||||
m.CSV(m.Result())
|
m.CSV(m.Result())
|
||||||
}},
|
}},
|
||||||
"word": {Name: "word", Help: "语言文字", Meta: kit.Dict("remote", "pod", "display", "wiki/word"), List: kit.List(
|
"word": {Name: "word", Help: "语言文字", Meta: kit.Dict("display", "wiki/word"), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "path", "value", "自然/编程/hi.shy",
|
kit.MDB_INPUT, "text", "name", "path", "value", "自然/编程/hi.shy",
|
||||||
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -474,7 +474,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
m.Optionv(ice.MSG_ALIAS, m.Confv("word", "meta.alias"))
|
m.Optionv(ice.MSG_ALIAS, m.Confv("word", "meta.alias"))
|
||||||
m.Set("result").Cmdy(ice.SSH_SOURCE, path.Join(m.Conf(cmd, "meta.path"), arg[0]))
|
m.Set("result").Cmdy(ice.SSH_SOURCE, path.Join(m.Conf(cmd, "meta.path"), arg[0]))
|
||||||
}},
|
}},
|
||||||
"feel": {Name: "feel", Help: "影音媒体", Meta: kit.Dict("remote", "pod", "display", "wiki/feel", "detail", []string{"标签", "删除"}), List: kit.List(
|
"feel": {Name: "feel", Help: "影音媒体", Meta: kit.Dict("display", "wiki/feel", "detail", []string{"标签", "删除"}), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "name",
|
kit.MDB_INPUT, "text", "name", "name",
|
||||||
kit.MDB_INPUT, "button", "name", "执行",
|
kit.MDB_INPUT, "button", "name", "执行",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -531,7 +531,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
// 下载文件
|
// 下载文件
|
||||||
m.Echo(path.Join(m.Conf(cmd, "meta.path"), arg[0]))
|
m.Echo(path.Join(m.Conf(cmd, "meta.path"), arg[0]))
|
||||||
}},
|
}},
|
||||||
"walk": {Name: "walk", Help: "走遍世界", Meta: kit.Dict("remote", "pod", "display", "wiki/walk"), List: kit.List(
|
"walk": {Name: "walk", Help: "走遍世界", Meta: kit.Dict("display", "wiki/walk"), List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "file", "figure", "province",
|
kit.MDB_INPUT, "text", "name", "file", "figure", "province",
|
||||||
kit.MDB_INPUT, "button", "name", "执行",
|
kit.MDB_INPUT, "button", "name", "执行",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
@ -560,7 +560,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
m.CSV(m.Result())
|
m.CSV(m.Result())
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"mind": {Name: "mind zone type name text", Help: "思考", Meta: kit.Dict("remote", "pod"), List: kit.List(
|
"mind": {Name: "mind zone type name text", Help: "思考", List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "path", "action", "auto", "figure", "key",
|
kit.MDB_INPUT, "text", "name", "path", "action", "auto", "figure", "key",
|
||||||
kit.MDB_INPUT, "text", "name", "type", "figure", "key",
|
kit.MDB_INPUT, "text", "name", "type", "figure", "key",
|
||||||
kit.MDB_INPUT, "text", "name", "name", "figure", "key",
|
kit.MDB_INPUT, "text", "name", "name", "figure", "key",
|
||||||
|
@ -112,7 +112,7 @@ var Index = &ice.Context{Name: "tmux", Help: "工作台",
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"text": {Name: "text", Help: "文本", Meta: kit.Dict("remote", "pod"), List: kit.List(
|
"text": {Name: "text", Help: "文本", List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "name",
|
kit.MDB_INPUT, "text", "name", "name",
|
||||||
kit.MDB_INPUT, "button", "value", "保存",
|
kit.MDB_INPUT, "button", "value", "保存",
|
||||||
kit.MDB_INPUT, "textarea", "name", "text",
|
kit.MDB_INPUT, "textarea", "name", "text",
|
||||||
@ -123,7 +123,7 @@ var Index = &ice.Context{Name: "tmux", Help: "工作台",
|
|||||||
}
|
}
|
||||||
m.Cmdy(prefix, "show-buffer").Set(ice.MSG_APPEND)
|
m.Cmdy(prefix, "show-buffer").Set(ice.MSG_APPEND)
|
||||||
}},
|
}},
|
||||||
"buffer": {Name: "buffer", Help: "缓存", Meta: kit.Dict("remote", "pod"), List: kit.List(
|
"buffer": {Name: "buffer", Help: "缓存", List: kit.List(
|
||||||
kit.MDB_INPUT, "text", "name", "buffer", "action", "auto",
|
kit.MDB_INPUT, "text", "name", "buffer", "action", "auto",
|
||||||
kit.MDB_INPUT, "text", "name", "value",
|
kit.MDB_INPUT, "text", "name", "value",
|
||||||
kit.MDB_INPUT, "button", "value", "查看", "action", "auto",
|
kit.MDB_INPUT, "button", "value", "查看", "action", "auto",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user