diff --git a/core/chat/div.go b/core/chat/div.go index 84569b38..e239c128 100644 --- a/core/chat/div.go +++ b/core/chat/div.go @@ -30,8 +30,8 @@ func _div_parse(m *ice.Message, root map[string]interface{}, list []string) int } ls := kit.Split(list[i]) - if ls[0] == "_left" { - ls = append([]string{"", "", "style", "left"}, ls[1:]...) + if ls[0] == "_span" { + ls = append([]string{"", "", "style", "span"}, ls[1:]...) } meta := kit.Dict( "index", kit.Select("", ls, 0), diff --git a/core/chat/river.go b/core/chat/river.go index 72840ed0..8ff3a478 100644 --- a/core/chat/river.go +++ b/core/chat/river.go @@ -64,7 +64,6 @@ func init() { kit.MDB_PATH, ice.USR_LOCAL_RIVER, MENUS, `["river", ["添加", "创建群组", "添加应用", "添加工具", "添加用户", "添加设备", "创建空间"], - ["访问", "内部系统", "访问应用", "访问工具", "访问用户", "访问设备", "工作任务"], ["共享", "共享群组", "共享应用", "共享工具", "共享主机"] ]`, )}, diff --git a/core/code/vimer.go b/core/code/vimer.go index 55866c79..88e1894d 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -32,7 +32,7 @@ func init() { nfs.SAVE: {Name: "save type file path", Help: "保存", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(nfs.SAVE, path.Join(m.Option(kit.MDB_PATH), m.Option(kit.MDB_FILE))) }}, - AUTOGEN: {Name: "create main=src/main.go@key name=hi@key from=usr/icebergs/misc/bash/bash.go@key", Help: "模块", Hand: func(m *ice.Message, arg ...string) { + AUTOGEN: {Name: "create main=src/main.go@key key= zone= type=Zone,Hash,List,Data name=hi list= help=", Help: "模块", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(AUTOGEN, mdb.CREATE, arg) }}, mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/wiki/poems.go b/core/wiki/poems.go new file mode 100644 index 00000000..5a7bd6b4 --- /dev/null +++ b/core/wiki/poems.go @@ -0,0 +1,35 @@ +package wiki + +import ( + ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/mdb" + kit "shylinux.com/x/toolkits" +) + +const ( + AUTHOR = "author" + // TITLE = "title" +) +const poems = "poems" + +func init() { + Index.Merge(&ice.Context{Configs: map[string]*ice.Config{ + poems: {Name: "poems", Help: "诗词", Value: kit.Data( + kit.MDB_SHORT, AUTHOR, + )}, + }, Commands: map[string]*ice.Command{ + poems: {Name: "poems author title auto insert", Help: "诗词", Action: map[string]*ice.Action{ + mdb.INSERT: {Name: "insert author title content:textarea", Help: "添加", Hand: func(m *ice.Message, arg ...string) { + m.Cmd(mdb.INSERT, m.PrefixKey(), "", mdb.HASH, m.OptionSimple(AUTHOR)) + m.Conf(poems, kit.KeyHash(m.Option(AUTHOR), kit.MDB_META, kit.MDB_SHORT), TITLE) + m.Cmd(mdb.INSERT, m.PrefixKey(), kit.KeyHash(m.Option(AUTHOR)), mdb.HASH, arg[2:]) + }}, + }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if m.Fields(len(arg), "time,author", "time,title,content"); len(arg) == 0 { + m.Cmdy(mdb.SELECT, m.PrefixKey(), "", mdb.HASH) + return + } + m.Cmdy(mdb.SELECT, m.PrefixKey(), kit.KeyHash(arg[0]), mdb.HASH, AUTHOR, arg[1:]) + }}, + }}) +}