diff --git a/base/web/web.go b/base/web/web.go index 75d061e3..0430950d 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -303,7 +303,9 @@ func (web *Frame) HandleCmd(m *ice.Message, key string, cmd *ice.Command) { // 请求命令 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")) @@ -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, "button", "value", "查看", "action", "auto", 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( - "remote", "pod", "exports", []string{"you", "name"}, + "exports", []string{"you", "name"}, "detail", []interface{}{"启动", "停止"}, ), List: kit.List( 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( - "remote", "pod", "exports", []string{"hot", "favor"}, + "exports", []string{"hot", "favor"}, "detail", []string{"编辑", "收藏", "收录", "导出", "删除"}, ), List: kit.List( kit.MDB_INPUT, "text", "name", "favor", "action", "auto", @@ -1263,7 +1265,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", 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( kit.MDB_INPUT, "text", "name", "story", "action", "auto", kit.MDB_INPUT, "text", "name", "list", "action", "auto", diff --git a/core/chat/chat.go b/core/chat/chat.go index 649d01e7..272c4db4 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -511,11 +511,10 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", // 代理命令 proxy := []string{} - m.Search(cmds[0], func(p *ice.Context, c *ice.Context, key string, cmd *ice.Command) { - if remote := kit.Format(kit.Value(cmd.Meta, "remote")); m.Option(remote) != "" { - proxy = append(proxy, ice.WEB_PROXY, m.Option(remote)) - } - }) + if m.Option("pod") != "" { + proxy = append(proxy, ice.WEB_PROXY, m.Option("pod")) + m.Option("pod", "") + } // 执行命令 m.Cmdy(proxy, cmds).Option("cmds", cmds) diff --git a/core/code/code.go b/core/code/code.go index 2cdb1715..af58a44d 100644 --- a/core/code/code.go +++ b/core/code/code.go @@ -32,9 +32,14 @@ var Index = &ice.Context{Name: "code", Help: "编程中心", 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" { switch arg[1] { + case "prune", "清理": + m.Cmdy("login", "prune") + case "modify", "编辑": 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]) diff --git a/core/wiki/wiki.go b/core/wiki/wiki.go index c2a92c39..08b7bb89 100644 --- a/core/wiki/wiki.go +++ b/core/wiki/wiki.go @@ -87,7 +87,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", 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, "button", "name", "执行", "action", "auto", 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")) }}, - "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, "button", "name", "查看", "action", "auto", kit.MDB_INPUT, "button", "name", "返回", "cb", "Last", @@ -387,7 +387,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", 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, "button", "name", "执行", "action", "auto", kit.MDB_INPUT, "button", "name", "返回", "cb", "Last", @@ -407,7 +407,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", // 解析数据 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, "button", "name", "执行", "action", "auto", 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.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, "button", "name", "执行", 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])) }}, - "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, "button", "name", "执行", kit.MDB_INPUT, "button", "name", "返回", "cb", "Last", @@ -560,7 +560,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", 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", "type", "figure", "key", kit.MDB_INPUT, "text", "name", "name", "figure", "key", diff --git a/misc/tmux/tmux.go b/misc/tmux/tmux.go index 3bdab045..ef4ceba6 100644 --- a/misc/tmux/tmux.go +++ b/misc/tmux/tmux.go @@ -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, "button", "value", "保存", 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) }}, - "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", "value", kit.MDB_INPUT, "button", "value", "查看", "action", "auto",