From 92154621ce3d5e3e0729a28c7c60130cf703eb0b Mon Sep 17 00:00:00 2001 From: harveyshao Date: Tue, 13 Apr 2021 22:57:53 +0800 Subject: [PATCH] opt some --- base/web/spide.go | 15 +++++++++++++++ core/wiki/feel.go | 4 ++-- core/wiki/word.go | 5 ++++- misc/alpha/alpha.go | 2 +- misc/input/input.go | 2 +- misc/mp/mp.shy | 2 +- misc/trash/web/_favor.go | 2 +- misc/wx/wx.shy | 2 +- 8 files changed, 26 insertions(+), 8 deletions(-) diff --git a/base/web/spide.go b/base/web/spide.go index 85b2fac4..a2950598 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -90,6 +90,21 @@ func init() { SPIDE: {Name: SPIDE, Help: "蜘蛛侠", Value: kit.Data(kit.MDB_SHORT, "client.name")}, }, Commands: map[string]*ice.Command{ + SPIDE_GET: {Name: "GET url key value 执行:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{ + mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) { + m.Cmdy(mdb.DELETE, SPIDE, "", mdb.HASH, "client.name", m.Option("client.name")) + }}, + }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, SPIDE_DEV, SPIDE_RAW, SPIDE_GET, arg[0], arg[1:])))) + }}, + SPIDE_POST: {Name: "POST url key value 执行:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{ + mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) { + m.Cmdy(mdb.DELETE, SPIDE, "", mdb.HASH, "client.name", m.Option("client.name")) + }}, + }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, SPIDE_DEV, SPIDE_RAW, SPIDE_POST, arg[0], SPIDE_JSON, arg[1:])))) + }}, + SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg 执行:button create", Help: "蜘蛛侠", Action: map[string]*ice.Action{ mdb.CREATE: {Name: "create name address", Help: "添加", Hand: func(m *ice.Message, arg ...string) { if arg[0] != "name" { diff --git a/core/wiki/feel.go b/core/wiki/feel.go index 1ccd74de..648dda99 100644 --- a/core/wiki/feel.go +++ b/core/wiki/feel.go @@ -12,12 +12,12 @@ func init() { Index.Merge(&ice.Context{ Configs: map[string]*ice.Config{ FEEL: {Name: FEEL, Help: "影音媒体", Value: kit.Data( - kit.MDB_PATH, "usr/image", "regs", ".*.(png|PNG|jpg|JPG|jpeg|mp4|m4v|MOV)", + kit.MDB_PATH, "usr/local/image", "regs", ".*.(png|PNG|jpg|JPG|jpeg|mp4|m4v|MOV)", )}, }, Commands: map[string]*ice.Command{ FEEL: {Name: "feel path auto upload 上一页 下一页 参数", Help: "影音媒体", Meta: kit.Dict( - "display", "/plugin/local/wiki/feel.js", + kit.MDB_DISPLAY, "/plugin/local/wiki/feel.js", ), Action: map[string]*ice.Action{ web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { _wiki_upload(m, FEEL, m.Option(kit.MDB_PATH)) diff --git a/core/wiki/word.go b/core/wiki/word.go index 10816639..d476cd77 100644 --- a/core/wiki/word.go +++ b/core/wiki/word.go @@ -163,6 +163,9 @@ func _image_show(m *ice.Message, name, text string, arg ...string) { m.EchoQRCode(text) return } + if !strings.HasPrefix(text, "http") && !strings.HasPrefix(text, "/") { + text = "/share/local/usr/local/image/" + text + } _option(m, IMAGE, name, text, arg...) m.Render(ice.RENDER_TEMPLATE, m.Conf(IMAGE, "meta.template")) @@ -463,7 +466,7 @@ func init() { }}, WORD: {Name: "word path=src/main.shy auto 演示", Help: "语言文字", Meta: kit.Dict( - "display", "/plugin/local/wiki/word.js", "style", "word", + kit.MDB_DISPLAY, "/plugin/local/wiki/word.js", kit.MDB_STYLE, WORD, ), Action: map[string]*ice.Action{ web.STORY: {Name: "story", Help: "运行", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(arg[0], kit.MDB_ACTION, "run", arg[1:]) diff --git a/misc/alpha/alpha.go b/misc/alpha/alpha.go index 7baacbcd..3fc5bab5 100644 --- a/misc/alpha/alpha.go +++ b/misc/alpha/alpha.go @@ -63,7 +63,7 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典", Configs: map[string]*ice.Config{ ALPHA: {Name: ALPHA, Help: "英汉词典", Value: kit.Data( kit.MDB_LIMIT, "50000", kit.MDB_LEAST, "1000", - kit.MDB_STORE, "usr/export/alpha", kit.MDB_FSIZE, "2000000", + kit.MDB_STORE, "usr/local/export/alpha", kit.MDB_FSIZE, "2000000", kit.SSH_REPOS, "word-dict", kit.MDB_FIELD, []interface{}{"audio", "bnc", "collins", "definition", "detail", "exchange", "frq", "id", "oxford", "phonetic", "pos", "tag", "time", "translation", "word"}, )}, }, diff --git a/misc/input/input.go b/misc/input/input.go index 59be3531..84e79d4f 100644 --- a/misc/input/input.go +++ b/misc/input/input.go @@ -157,7 +157,7 @@ const INPUT = "input" var Index = &ice.Context{Name: INPUT, Help: "输入法", Configs: map[string]*ice.Config{ INPUT: {Name: INPUT, Help: "输入法", Value: kit.Data( - kit.MDB_STORE, "usr/export/input", kit.MDB_FSIZE, "200000", + kit.MDB_STORE, "usr/local/export/input", kit.MDB_FSIZE, "200000", kit.MDB_LIMIT, "5000", kit.MDB_LEAST, "1000", kit.MDB_SHORT, "zone", "repos", "wubi-dict", )}, diff --git a/misc/mp/mp.shy b/misc/mp/mp.shy index 89d30581..aefab457 100644 --- a/misc/mp/mp.shy +++ b/misc/mp/mp.shy @@ -5,7 +5,7 @@ refer "" ` 文档 https://developers.weixin.qq.com/miniprogram/dev/api/ 源码 https://github.com/shylinux/icebergs/blob/master/misc/mp/mp.go ` -image `/share/local/usr/image/gh_61ea404535e4_258.jpg` +image `gh_61ea404535e4_258.jpg` chapter "应用" field scan web.chat.scan diff --git a/misc/trash/web/_favor.go b/misc/trash/web/_favor.go index 1b29b768..76fecf68 100644 --- a/misc/trash/web/_favor.go +++ b/misc/trash/web/_favor.go @@ -262,7 +262,7 @@ func FavorShow(m *ice.Message, kind string, name, text interface{}, arg ...strin } const ( - _EXPORT = "usr/export/web.favor/favor.csv" + _EXPORT = "usr/local/export/web.favor/favor.csv" ) const FAVOR = "favor" diff --git a/misc/wx/wx.shy b/misc/wx/wx.shy index 6e637168..5fce745c 100644 --- a/misc/wx/wx.shy +++ b/misc/wx/wx.shy @@ -5,7 +5,7 @@ refer ` 文档 https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html 源码 https://github.com/shylinux/icebergs/blob/master/misc/wx/wx.go ` -image `/share/local/usr/image/qrcode_for_gh_1c21ed4eb46b_258.jpg` +image `qrcode_for_gh_1c21ed4eb46b_258.jpg` chapter "应用" field scan web.chat.scan