diff --git a/base/web/story.go b/base/web/story.go index 83e2f635..ba9bb5e2 100644 --- a/base/web/story.go +++ b/base/web/story.go @@ -250,7 +250,8 @@ func _story_add(m *ice.Message, arg ...string) { "scene", arg[1], "story", arg[2], "count", count+1, "data", arg[3], "prev", prev, )) m.Log_CREATE("story", list, "type", arg[1], "name", arg[2]) - m.Push("list", list) + m.Push("count", count+1) + m.Push("key", list) if head == "" { // 添加索引 @@ -375,11 +376,13 @@ func _story_history(m *ice.Message, name string) { func StoryHistory(m *ice.Message, name string) *ice.Message { _story_history(m, name); return m } func StoryIndex(m *ice.Message, name string) *ice.Message { _story_index(m, name, true); return m } func StoryWatch(m *ice.Message, index string, file string) { _story_watch(m, index, file) } -func StoryCatch(m *ice.Message, mime string, file string) { +func StoryCatch(m *ice.Message, mime string, file string) *ice.Message { _story_catch(m, "catch", kit.Select(mime, strings.TrimPrefix(path.Ext(file), ".")), file, "") + return m } -func StoryAdd(m *ice.Message, mime string, name string, text string, arg ...string) { +func StoryAdd(m *ice.Message, mime string, name string, text string, arg ...string) *ice.Message { _story_add(m, kit.Simple("add", mime, name, text, arg)...) + return m } func init() { diff --git a/core/wiki/inner.go b/core/wiki/inner.go index 17a3e04b..d7023113 100644 --- a/core/wiki/inner.go +++ b/core/wiki/inner.go @@ -129,7 +129,7 @@ func init() { )}, }, Commands: map[string]*ice.Command{ - INNER: {Name: "inner path=auto name=auto auto", Help: "编辑器", Meta: map[string]interface{}{ + INNER: {Name: "inner path=tmp name=hi.qrc key auto", Help: "编辑器", Meta: map[string]interface{}{ "display": "/plugin/inner.js", "style": "editor", }, Action: map[string]*ice.Action{ "cmd": {Name: "cmd arg", Help: "命令", Hand: func(m *ice.Message, arg ...string) { @@ -164,7 +164,8 @@ func init() { } }}, "commit": {Name: "commit path name", Help: "提交", Hand: func(m *ice.Message, arg ...string) { - web.StoryCatch(m, "", path.Join("./", arg[0], arg[1])) + msg := web.StoryCatch(m.Spawn(), "", path.Join("./", arg[0], arg[1])) + m.Copy(msg, ice.MSG_APPEND, "time", "count", "key") }}, "recover": {Name: "recover", Help: "复盘", Hand: func(m *ice.Message, arg ...string) { msg := web.StoryHistory(m.Spawn(), path.Join("./", arg[0], arg[1])+".display") @@ -175,7 +176,8 @@ func init() { } }}, "record": {Name: "record", Help: "记录", Hand: func(m *ice.Message, arg ...string) { - web.StoryAdd(m, "display", path.Join("./", m.Option("path"), m.Option("name"))+".display", m.Option("display")) + msg := web.StoryAdd(m.Spawn(), "display", path.Join("./", m.Option("path"), m.Option("name"))+".display", m.Option("display")) + m.Copy(msg, ice.MSG_APPEND, "time", "count", "key") }}, "log": {Name: "log path name", Help: "日志", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/wiki/wiki.go b/core/wiki/wiki.go index 90648124..96e97028 100644 --- a/core/wiki/wiki.go +++ b/core/wiki/wiki.go @@ -359,7 +359,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", // 解析数据 m.CSV(m.Result()) }}, - "word": {Name: "word path=auto auto", Help: "语言文字", Meta: kit.Dict("display", "local/wiki/word"), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + "word": {Name: "word path=自然/编程/hi.shy auto", Help: "语言文字", Meta: kit.Dict("display", "local/wiki/word"), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if len(arg) > 0 && arg[0] == "action" { switch arg[1] { case "story":