diff --git a/base/web/web.go b/base/web/web.go index a7a8f71b..07bd4697 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -1589,29 +1589,29 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", if last := m.Richs(ice.WEB_STORY, nil, prev, nil); prev != "" && last != nil && last["data"] == arg[3] { // 重复提交 m.Echo(prev) - break - } - - // 添加节点 - list := m.Rich(ice.WEB_STORY, nil, kit.Dict( - "scene", arg[1], "story", arg[2], "count", count+1, "data", arg[3], "prev", prev, - )) - m.Log(ice.LOG_CREATE, "story: %s %s: %s", list, arg[1], arg[2]) - m.Push("list", list) - - if head == "" { - // 添加索引 - m.Rich(ice.WEB_STORY, "head", kit.Dict("scene", arg[1], "story", arg[2], "count", count+1, "list", list)) } else { - // 更新索引 - value["count"] = count + 1 - value["time"] = m.Time() - value["list"] = list + // 添加节点 + list := m.Rich(ice.WEB_STORY, nil, kit.Dict( + "scene", arg[1], "story", arg[2], "count", count+1, "data", arg[3], "prev", prev, + )) + m.Log(ice.LOG_CREATE, "story: %s %s: %s", list, arg[1], arg[2]) + m.Push("list", list) + + if head == "" { + // 添加索引 + m.Rich(ice.WEB_STORY, "head", kit.Dict("scene", arg[1], "story", arg[2], "count", count+1, "list", list)) + } else { + // 更新索引 + value["count"] = count + 1 + value["time"] = m.Time() + value["list"] = list + } + m.Echo(list) } - m.Echo(list) // 分发数据 if p := kit.Select(m.Conf(ice.WEB_FAVOR, "meta.proxy"), m.Option("you")); p != "" { + m.Info("what %v", p) m.Option("you", "") m.Cmd(ice.WEB_PROXY, p, ice.WEB_STORY, ice.STORY_PULL, arg[2], "dev", arg[2]) } diff --git a/conf.go b/conf.go index 32ea2fec..01d7dcb5 100644 --- a/conf.go +++ b/conf.go @@ -162,8 +162,10 @@ const ( // MDB ) const ( // APP - APP_MIND = "mind" - APP_MISS = "miss" + APP_MIND = "mind" + APP_MISS = "miss" + APP_SEARCH = "search" + APP_COMMEND = "commend" ) const ( // ROLE ROLE_ROOT = "root" @@ -273,8 +275,10 @@ var Alias = map[string]string{ CHAT_RIVER: "web.chat.river", - APP_MISS: "web.team.miss", - APP_MIND: "web.wiki.mind", + APP_MISS: "web.team.miss", + APP_MIND: "web.wiki.mind", + APP_SEARCH: "web.chat.search", + APP_COMMEND: "web.chat.commend", "compile": "web.code.compile", "publish": "web.code.publish", diff --git a/core/chat/chat.go b/core/chat/chat.go index 03c88752..4f0fba52 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -13,26 +13,6 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", "template", kit.Dict("root", []interface{}{ []interface{}{"river", `{{.Option "user.nick"|Format}}@{{.Conf "runtime" "node.name"|Format}}`, "mall"}, - []interface{}{"storm", "mall", "mall"}, - []interface{}{"field", "asset", "web.mall"}, - []interface{}{"field", "spend", "web.mall"}, - []interface{}{"field", "trans", "web.mall"}, - []interface{}{"field", "bonus", "web.mall"}, - []interface{}{"field", "month", "web.mall"}, - - []interface{}{"storm", "team", "team"}, - []interface{}{"field", "plan", "web.team"}, - []interface{}{"field", "miss", "web.team"}, - []interface{}{"field", "stat", "web.team"}, - []interface{}{"field", "task", "web.team"}, - - []interface{}{"storm", "wiki", "wiki"}, - []interface{}{"field", "draw", "web.wiki"}, - []interface{}{"field", "data", "web.wiki"}, - []interface{}{"field", "word", "web.wiki"}, - []interface{}{"field", "walk", "web.wiki"}, - []interface{}{"field", "feel", "web.wiki"}, - []interface{}{"storm", "code", "code"}, []interface{}{"field", "login", "web.code"}, []interface{}{"field", "buffer", "web.code.tmux"}, @@ -44,6 +24,13 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", []interface{}{"field", "total", "web.code.git"}, []interface{}{"field", "status", "web.code.git"}, + []interface{}{"storm", "wiki", "wiki"}, + []interface{}{"field", "draw", "web.wiki"}, + []interface{}{"field", "data", "web.wiki"}, + []interface{}{"field", "word", "web.wiki"}, + []interface{}{"field", "walk", "web.wiki"}, + []interface{}{"field", "feel", "web.wiki"}, + []interface{}{"storm", "root"}, []interface{}{"field", "spide"}, []interface{}{"field", "space"}, @@ -51,6 +38,26 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", []interface{}{"field", "favor"}, []interface{}{"field", "story"}, []interface{}{"field", "share"}, + + []interface{}{"storm", "miss"}, + []interface{}{"field", "route"}, + []interface{}{"field", "group"}, + []interface{}{"field", "label"}, + []interface{}{"field", "search"}, + []interface{}{"field", "commend"}, + + []interface{}{"storm", "team", "team"}, + []interface{}{"field", "plan", "web.team"}, + []interface{}{"field", "miss", "web.team"}, + []interface{}{"field", "stat", "web.team"}, + []interface{}{"field", "task", "web.team"}, + + []interface{}{"storm", "mall", "mall"}, + []interface{}{"field", "asset", "web.mall"}, + []interface{}{"field", "spend", "web.mall"}, + []interface{}{"field", "trans", "web.mall"}, + []interface{}{"field", "bonus", "web.mall"}, + []interface{}{"field", "month", "web.mall"}, }, "void", []interface{}{ []interface{}{"storm", "wiki", "wiki"}, []interface{}{"field", "note", "web.wiki"}, @@ -152,7 +159,7 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", case "login": // 密码登录 if len(arg) > 2 { - m.Render("cookie", m.Option(ice.MSG_SESSID, m.Cmdx(ice.AAA_USER, "login", m.Option(ice.MSG_USERNAME, arg[1]), arg[2]))) + web.Render(m, "cookie", m.Option(ice.MSG_SESSID, m.Cmdx(ice.AAA_USER, "login", m.Option(ice.MSG_USERNAME, arg[1]), arg[2]))) } default: @@ -215,14 +222,10 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", m.Richs(ice.AAA_USER, nil, m.Option(ice.MSG_USERNAME), func(key string, value map[string]interface{}) { m.Push("nickname", value["nickname"]) }) - m.Echo(m.Option(ice.MSG_USERNAME)) + m.Render(m.Option(ice.MSG_USERNAME)) case "login": - if len(arg) > 1 { - m.Cmdy(ice.AAA_USER, "login", arg[1:]) - break - } - m.Echo(m.Option(ice.MSG_SESSID)) + m.Render(m.Option(ice.MSG_SESSID)) case "share": switch arg[1] { diff --git a/core/wiki/wiki.go b/core/wiki/wiki.go index d165dc99..972d578a 100644 --- a/core/wiki/wiki.go +++ b/core/wiki/wiki.go @@ -212,10 +212,15 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", data := kit.Dict() cmds := kit.Split(arg[1]) m.Search(cmds[0], func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) { + ls := strings.Split(cmds[0], ".") + m.Cmd(ice.CTX_COMMAND, strings.Join(ls[:len(ls)-1], "."), key) if data["feature"], data["inputs"] = cmd.Meta, cmd.List; len(cmd.List) == 0 { data["inputs"] = m.Confv("field", "meta.some.simple.inputs") } }) + if len(data) == 0 { + m.Echo("not found", arg[1]) + } for i := 2; i < len(arg)-1; i += 2 { if data := m.Confv("field", kit.Keys("meta.some", arg[i+1], arg[i])); data != nil { diff --git a/misc/tmux/tmux.go b/misc/tmux/tmux.go index 80dc7e57..3372d177 100644 --- a/misc/tmux/tmux.go +++ b/misc/tmux/tmux.go @@ -84,14 +84,11 @@ var Index = &ice.Context{Name: "tmux", Help: "工作台", m.Option("cmd_env", "TMUX", "", "ctx_dev", dev, "ctx_share", share) m.Option("cmd_dir", path.Join(m.Conf(ice.WEB_DREAM, "meta.path"), arg[0])) - if arg[0] != "" && m.Cmd(prefix, "has-session", "-t", arg[0]).Append("code") == "0" { - // 复用会话 - return + if arg[0] != "" && m.Cmd(prefix, "has-session", "-t", arg[0]).Append("code") != "0" { + // 创建会话 + m.Cmd(prefix, "new-session", "-ds", arg[0]) } - // 创建会话 - m.Cmd(prefix, "new-session", "-ds", arg[0]) - if m.Option("local") != "" { // 创建容器 m.Cmd("local", m.Option("local"), arg[0])