mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
755c29eea3
commit
855aaac279
@ -208,6 +208,9 @@ var Index = &ice.Context{Name: MDB, Help: "数据模块", Commands: map[string]*
|
||||
}
|
||||
}},
|
||||
EXPORT: {Name: "export key sub type file", Help: "导出", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if m.Option(ice.CACHE_LIMIT) == "" {
|
||||
m.Option(ice.CACHE_LIMIT, "-1")
|
||||
}
|
||||
switch file := _file_name(m, arg...); arg[2] {
|
||||
case ZONE:
|
||||
_zone_export(m, arg[0], _domain_chain(m, arg[1]), file)
|
||||
|
@ -36,6 +36,8 @@ func _website_parse(m *ice.Message, text string, args ...string) (map[string]int
|
||||
), kit.Dict(), kit.Dict()
|
||||
prefix := ""
|
||||
|
||||
nriver := 0
|
||||
nstorm := 0
|
||||
m.Cmd(lex.SPLIT, "", mdb.KEY, mdb.NAME, func(deep int, ls []string, meta map[string]interface{}) []string {
|
||||
if deep == 1 {
|
||||
switch ls[0] {
|
||||
@ -126,9 +128,18 @@ func _website_parse(m *ice.Message, text string, args ...string) (map[string]int
|
||||
|
||||
switch deep {
|
||||
case 1:
|
||||
nriver++
|
||||
nstorm = 0
|
||||
storm = kit.Dict()
|
||||
if ls[0] == "auto" {
|
||||
ls[0] = kit.Format(nriver)
|
||||
}
|
||||
river[ls[0]] = kit.Dict(mdb.NAME, ls[1], STORM, storm, data, "order", len(river))
|
||||
case 2:
|
||||
nstorm++
|
||||
if ls[0] == "auto" {
|
||||
ls[0] = kit.Format(nstorm)
|
||||
}
|
||||
last = kit.Dict(mdb.NAME, ls[1], mdb.LIST, kit.List(), data, "order", len(storm))
|
||||
storm[ls[0]] = last
|
||||
prefix = ""
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
func _image_show(m *ice.Message, text string, arg ...string) {
|
||||
_wiki_template(m, IMAGE, "", _wiki_link(m, IMAGE, text), arg...)
|
||||
func _image_show(m *ice.Message, text string) {
|
||||
_wiki_template(m, IMAGE, "", _wiki_link(m, IMAGE, text))
|
||||
}
|
||||
|
||||
const (
|
||||
@ -23,7 +23,7 @@ const IMAGE = "image"
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||
IMAGE: {Name: "image url", Help: "图片", Action: map[string]*ice.Action{
|
||||
IMAGE: {Name: "image url height auto", Help: "图片", Action: map[string]*ice.Action{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.RENDER, mdb.CREATE, PNG, m.PrefixKey())
|
||||
}},
|
||||
@ -31,11 +31,15 @@ func init() {
|
||||
_image_show(m, path.Join(arg[2], arg[1]))
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
_image_show(m, arg[0], arg[1:]...)
|
||||
if len(arg) == 0 {
|
||||
return
|
||||
}
|
||||
m.Option("height", kit.Select("", arg, 1))
|
||||
_image_show(m, arg[0])
|
||||
}},
|
||||
}, Configs: map[string]*ice.Config{
|
||||
IMAGE: {Name: IMAGE, Help: "图片", Value: kit.Data(
|
||||
nfs.TEMPLATE, `<img {{.OptionTemplate}} title="{{.Option "text"}}" src="{{.Option "text"}}">`,
|
||||
nfs.TEMPLATE, `<img {{.OptionTemplate}} title="{{.Option "text"}}" src="{{.Option "text"}}" height="{{.Option "height"}}">`,
|
||||
nfs.PATH, ice.USR_LOCAL_IMAGE,
|
||||
)},
|
||||
}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user