mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
9d246c8014
commit
16098569b9
@ -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),
|
||||
|
@ -64,7 +64,6 @@ func init() {
|
||||
kit.MDB_PATH, ice.USR_LOCAL_RIVER,
|
||||
MENUS, `["river",
|
||||
["添加", "创建群组", "添加应用", "添加工具", "添加用户", "添加设备", "创建空间"],
|
||||
["访问", "内部系统", "访问应用", "访问工具", "访问用户", "访问设备", "工作任务"],
|
||||
["共享", "共享群组", "共享应用", "共享工具", "共享主机"]
|
||||
]`,
|
||||
)},
|
||||
|
@ -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) {
|
||||
|
35
core/wiki/poems.go
Normal file
35
core/wiki/poems.go
Normal file
@ -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:])
|
||||
}},
|
||||
}})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user