forked from x/icebergs
opt inner
This commit is contained in:
parent
fbed37c343
commit
515ec07559
@ -17,7 +17,7 @@ func init() {
|
|||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Load() }},
|
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Load() }},
|
||||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(PASTE) }},
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(PASTE) }},
|
||||||
|
|
||||||
PASTE: {Name: "paste text auto 添加:button", Help: "粘贴板", Meta: kit.Dict(
|
PASTE: {Name: "paste text auto 粘贴:button", Help: "粘贴板", Meta: kit.Dict(
|
||||||
"display", "/plugin/story/paste.js",
|
"display", "/plugin/story/paste.js",
|
||||||
), Action: map[string]*ice.Action{
|
), Action: map[string]*ice.Action{
|
||||||
mdb.INSERT: {Name: "insert [key value]...", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
mdb.INSERT: {Name: "insert [key value]...", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -19,13 +19,15 @@ func _inner_list(m *ice.Message, ext, file, dir string, arg ...string) {
|
|||||||
if !m.Right(strings.Split(dir, "/"), file) {
|
if !m.Right(strings.Split(dir, "/"), file) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if m.Cmdy(mdb.RENDER, ext, file, dir, arg); m.Result() == "" {
|
if m.Cmdy(mdb.RENDER, ext, file, dir, arg); m.Result() != "" {
|
||||||
if m.Conf(INNER, kit.Keys("meta.source", ext)) == "true" {
|
return
|
||||||
if m.Cmdy(mdb.RENDER, nfs.FILE, file, dir, arg); m.Result() == "" {
|
}
|
||||||
m.Echo(path.Join(dir, file))
|
if m.Conf(INNER, kit.Keys("meta.source", ext)) == "true" {
|
||||||
}
|
if m.Cmdy(mdb.RENDER, nfs.FILE, file, dir, arg); m.Result() != "" {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m.Echo(path.Join(dir, file))
|
||||||
}
|
}
|
||||||
func _inner_show(m *ice.Message, ext, file, dir string, arg ...string) {
|
func _inner_show(m *ice.Message, ext, file, dir string, arg ...string) {
|
||||||
if m.Cmdy(mdb.ENGINE, ext, file, dir, arg); m.Result() == "" {
|
if m.Cmdy(mdb.ENGINE, ext, file, dir, arg); m.Result() == "" {
|
||||||
@ -105,6 +107,7 @@ func init() {
|
|||||||
"csv", "true", "json", "true",
|
"csv", "true", "json", "true",
|
||||||
"css", "true", "html", "true",
|
"css", "true", "html", "true",
|
||||||
"txt", "true", "url", "true",
|
"txt", "true", "url", "true",
|
||||||
|
"log", "true", "err", "true",
|
||||||
|
|
||||||
"md", "true", "conf", "true",
|
"md", "true", "conf", "true",
|
||||||
"ts", "true", "tsx", "true", "vue", "true", "sass", "true",
|
"ts", "true", "tsx", "true", "vue", "true", "sass", "true",
|
||||||
|
@ -39,7 +39,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(cli.CMD_DIR, arg[2])
|
m.Option(cli.CMD_DIR, arg[2])
|
||||||
m.Cmdy(cli.SYSTEM, arg[1])
|
m.Cmdy(cli.SYSTEM, "sh", arg[1])
|
||||||
m.Set(ice.MSG_APPEND)
|
m.Set(ice.MSG_APPEND)
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package wiki
|
package wiki
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/shylinux/icebergs"
|
"path"
|
||||||
|
|
||||||
|
ice "github.com/shylinux/icebergs"
|
||||||
"github.com/shylinux/icebergs/base/mdb"
|
"github.com/shylinux/icebergs/base/mdb"
|
||||||
"github.com/shylinux/icebergs/base/nfs"
|
"github.com/shylinux/icebergs/base/nfs"
|
||||||
"github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func _data_show(m *ice.Message, name string, arg ...string) {
|
func _data_show(m *ice.Message, name string, arg ...string) {
|
||||||
@ -21,7 +23,7 @@ func init() {
|
|||||||
Index.Merge(&ice.Context{Name: "data", Help: "数据表格",
|
Index.Merge(&ice.Context{Name: "data", Help: "数据表格",
|
||||||
Configs: map[string]*ice.Config{
|
Configs: map[string]*ice.Config{
|
||||||
DATA: {Name: "data", Help: "数据表格", Value: kit.Data(
|
DATA: {Name: "data", Help: "数据表格", Value: kit.Data(
|
||||||
kit.MDB_SHORT, "name", "path", "", "regs", ".*\\.csv",
|
"path", "usr/export", "regs", ".*\\.csv",
|
||||||
)},
|
)},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
@ -31,7 +33,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if !_wiki_list(m, DATA, kit.Select("./", arg, 0)) {
|
if !_wiki_list(m, DATA, kit.Select("./", arg, 0)) {
|
||||||
_data_show(m, arg[0])
|
_data_show(m, path.Join(m.Conf(DATA, "meta.path"), arg[0]))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@ func init() {
|
|||||||
Index.Merge(&ice.Context{Name: "feel", Help: "影音媒体",
|
Index.Merge(&ice.Context{Name: "feel", Help: "影音媒体",
|
||||||
Configs: map[string]*ice.Config{
|
Configs: map[string]*ice.Config{
|
||||||
FEEL: {Name: "feel", Help: "影音媒体", Value: kit.Data(
|
FEEL: {Name: "feel", Help: "影音媒体", Value: kit.Data(
|
||||||
"path", "", "regs", ".*.(qrc|png|PNG|jpg|jpeg|JPG|MOV|m4v|mp4)",
|
"path", "usr/image", "regs", ".*.(qrc|png|PNG|jpg|jpeg|JPG|MOV|m4v|mp4)",
|
||||||
)},
|
)},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
@ -44,14 +44,11 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
m.Option("prefix", m.Conf(FEEL, "meta.path"))
|
||||||
if !_wiki_list(m, FEEL, kit.Select("./", arg, 0)) {
|
if !_wiki_list(m, FEEL, kit.Select("./", arg, 0)) {
|
||||||
m.Echo(path.Join(m.Conf(FEEL, "meta.path"), arg[0]))
|
m.Echo(path.Join(m.Conf(FEEL, "meta.path"), arg[0]))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Table(func(index int, value map[string]string, head []string) {
|
|
||||||
m.Push("show", m.Cmdx(mdb.RENDER, web.RENDER.IMG, path.Join("/share/local", value["path"])))
|
|
||||||
})
|
|
||||||
m.Sort(kit.MDB_TIME, "time_r")
|
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -33,7 +33,7 @@ func _wiki_save(m *ice.Message, cmd, name, text string, arg ...string) {
|
|||||||
}
|
}
|
||||||
func _wiki_upload(m *ice.Message, cmd string) {
|
func _wiki_upload(m *ice.Message, cmd string) {
|
||||||
m.Cmdy(web.CACHE, web.UPLOAD)
|
m.Cmdy(web.CACHE, web.UPLOAD)
|
||||||
m.Cmdy(web.CACHE, web.WATCH, m.Option(web.DATA), path.Join(m.Option("path"), m.Option("name")))
|
m.Cmdy(web.CACHE, web.WATCH, m.Option(web.DATA), path.Join(m.Conf(cmd, "meta.path"), m.Option("path"), m.Option("name")))
|
||||||
}
|
}
|
||||||
|
|
||||||
func reply(m *ice.Message, cmd string, arg ...string) bool {
|
func reply(m *ice.Message, cmd string, arg ...string) bool {
|
||||||
|
@ -13,7 +13,7 @@ field "编辑器" web.code.vimer args `[ src/ main.go ]`
|
|||||||
|
|
||||||
field "资料库" web.chat.meet.miss args `[ ]`
|
field "资料库" web.chat.meet.miss args `[ ]`
|
||||||
field "粘贴板" web.chat.paste.paste args `[ ]`
|
field "粘贴板" web.chat.paste.paste args `[ ]`
|
||||||
field "相册集" web.wiki.feel args `[ usr/export/web.chat.meet.miss/feel/ ]`
|
field "相册集" web.wiki.feel args `[ ]`
|
||||||
field "思维导图" web.wiki.draw.draw args `[ src/ main.svg ]`
|
field "思维导图" web.wiki.draw.draw args `[ src/ main.svg ]`
|
||||||
|
|
||||||
field "任务" web.team.task args `[ ]`
|
field "任务" web.team.task args `[ ]`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user