mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt chrome
This commit is contained in:
parent
66b6ba2276
commit
c555545cea
@ -143,8 +143,19 @@ func _hash_inputs(m *ice.Message, prefix, chain string, field, value string) {
|
|||||||
m.SortIntR(kit.MDB_COUNT)
|
m.SortIntR(kit.MDB_COUNT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func selectAction(list map[string]*ice.Action, fields ...string) map[string]*ice.Action {
|
||||||
|
if len(fields) == 0 {
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
res := map[string]*ice.Action{}
|
||||||
|
for _, field := range fields {
|
||||||
|
res[field] = list[field]
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
func HashAction(fields ...string) map[string]*ice.Action {
|
func HashAction(fields ...string) map[string]*ice.Action {
|
||||||
list := map[string]*ice.Action{
|
return selectAction(map[string]*ice.Action{
|
||||||
MODIFY: {Name: "modify", Help: "编辑", Hand: func(m *ice.Message, arg ...string) {
|
MODIFY: {Name: "modify", Help: "编辑", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(MODIFY, m.PrefixKey(), "", HASH, m.OptionSimple(kit.MDB_HASH), arg)
|
m.Cmdy(MODIFY, m.PrefixKey(), "", HASH, m.OptionSimple(kit.MDB_HASH), arg)
|
||||||
}},
|
}},
|
||||||
@ -172,16 +183,7 @@ func HashAction(fields ...string) map[string]*ice.Action {
|
|||||||
INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(INPUTS, m.PrefixKey(), "", HASH, arg)
|
m.Cmdy(INPUTS, m.PrefixKey(), "", HASH, arg)
|
||||||
}},
|
}},
|
||||||
}
|
})
|
||||||
if len(fields) == 0 {
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
|
|
||||||
res := map[string]*ice.Action{}
|
|
||||||
for _, field := range fields {
|
|
||||||
res[field] = list[field]
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const HASH = "hash"
|
const HASH = "hash"
|
||||||
|
@ -131,3 +131,35 @@ func _list_inputs(m *ice.Message, prefix, chain string, field, value string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const LIST = "list"
|
const LIST = "list"
|
||||||
|
|
||||||
|
func ListAction(fields ...string) map[string]*ice.Action {
|
||||||
|
return selectAction(map[string]*ice.Action{
|
||||||
|
INSERT: {Name: "insert type=go name=hi text=hello", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(INSERT, m.PrefixKey(), "", LIST, arg)
|
||||||
|
}},
|
||||||
|
MODIFY: {Name: "modify", Help: "编辑", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(MODIFY, m.PrefixKey(), "", LIST, m.OptionSimple(kit.MDB_ID), arg)
|
||||||
|
}},
|
||||||
|
REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(DELETE, m.PrefixKey(), "", LIST, m.OptionSimple(kit.MDB_ID))
|
||||||
|
}},
|
||||||
|
EXPORT: {Name: "export", Help: "导出", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.OptionFields(m.Conf(m.PrefixKey(), kit.META_FIELD))
|
||||||
|
m.Cmdy(EXPORT, m.PrefixKey(), "", LIST)
|
||||||
|
m.Conf(m.PrefixKey(), kit.MDB_LIST, "")
|
||||||
|
m.Conf(m.PrefixKey(), kit.Keym(kit.MDB_COUNT), 0)
|
||||||
|
}},
|
||||||
|
IMPORT: {Name: "import", Help: "导入", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(IMPORT, m.PrefixKey(), "", LIST)
|
||||||
|
}},
|
||||||
|
INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(INPUTS, m.PrefixKey(), "", LIST, arg)
|
||||||
|
}},
|
||||||
|
PREV: {Name: "prev", Help: "上一页", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
PrevPage(m, m.Conf(m.PrefixKey(), kit.Keym(kit.MDB_COUNT)), kit.Slice(arg, 1)...)
|
||||||
|
}},
|
||||||
|
NEXT: {Name: "next", Help: "下一页", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
NextPage(m, m.Conf(m.PrefixKey(), kit.Keym(kit.MDB_COUNT)), kit.Slice(arg, 1)...)
|
||||||
|
}},
|
||||||
|
}, fields...)
|
||||||
|
}
|
||||||
|
@ -5,11 +5,13 @@ import (
|
|||||||
kit "github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const ZONE_FIELD = "time,zone,count"
|
||||||
|
|
||||||
func ZoneAction(fields ...string) map[string]*ice.Action {
|
func ZoneAction(fields ...string) map[string]*ice.Action {
|
||||||
_zone := func(m *ice.Message) string {
|
_zone := func(m *ice.Message) string {
|
||||||
return kit.Select(kit.MDB_ZONE, m.Conf(m.PrefixKey(), kit.Keym(kit.MDB_SHORT)))
|
return kit.Select(kit.MDB_ZONE, m.Conf(m.PrefixKey(), kit.Keym(kit.MDB_SHORT)))
|
||||||
}
|
}
|
||||||
list := map[string]*ice.Action{
|
return selectAction(map[string]*ice.Action{
|
||||||
CREATE: {Name: "create zone", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
CREATE: {Name: "create zone", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(INSERT, m.PrefixKey(), "", HASH, arg)
|
m.Cmdy(INSERT, m.PrefixKey(), "", HASH, arg)
|
||||||
}},
|
}},
|
||||||
@ -40,14 +42,5 @@ func ZoneAction(fields ...string) map[string]*ice.Action {
|
|||||||
m.Cmdy(INPUTS, m.PrefixKey(), "", ZONE, m.Option(_zone(m)), arg)
|
m.Cmdy(INPUTS, m.PrefixKey(), "", ZONE, m.Option(_zone(m)), arg)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}
|
}, fields...)
|
||||||
if len(fields) == 0 {
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
|
|
||||||
res := map[string]*ice.Action{}
|
|
||||||
for _, field := range fields {
|
|
||||||
res[field] = list[field]
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
11
misc.go
11
misc.go
@ -444,3 +444,14 @@ func MergeAction(list ...map[string]*Action) map[string]*Action {
|
|||||||
}
|
}
|
||||||
return list[0]
|
return list[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Message) AppendSimple(key ...string) (res []string) {
|
||||||
|
if len(key) == 0 {
|
||||||
|
key = append(key, m.Appendv(MSG_APPEND)...)
|
||||||
|
}
|
||||||
|
for _, k := range key {
|
||||||
|
res = append(res, k, m.Append(k))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典",
|
|||||||
"audio", "bnc", "collins", "definition", "detail", "exchange", "frq", "id", "oxford", "phonetic", "pos", "tag", "time", "translation", "word",
|
"audio", "bnc", "collins", "definition", "detail", "exchange", "frq", "id", "oxford", "phonetic", "pos", "tag", "time", "translation", "word",
|
||||||
},
|
},
|
||||||
)},
|
)},
|
||||||
|
"_cache": {Name: "_cache", Value: kit.Data(kit.MDB_SHORT, "mw")},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
@ -81,7 +82,7 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典",
|
|||||||
}},
|
}},
|
||||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
||||||
|
|
||||||
ALPHA: {Name: "alpha method=word,line word auto", Help: "英汉", Action: map[string]*ice.Action{
|
ALPHA: {Name: "alpha method=word,line word auto _cache", Help: "英汉", Action: map[string]*ice.Action{
|
||||||
mdb.IMPORT: {Name: "import file=usr/word-dict/ecdict name", Help: "加载词库", Hand: func(m *ice.Message, arg ...string) {
|
mdb.IMPORT: {Name: "import file=usr/word-dict/ecdict name", Help: "加载词库", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_alpha_load(m, m.Option(kit.MDB_FILE), kit.Select(path.Base(m.Option(kit.MDB_FILE)), m.Option(kit.MDB_NAME)))
|
_alpha_load(m, m.Option(kit.MDB_FILE), kit.Select(path.Base(m.Option(kit.MDB_FILE)), m.Option(kit.MDB_NAME)))
|
||||||
}},
|
}},
|
||||||
@ -90,9 +91,19 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典",
|
|||||||
_alpha_find(m, kit.Select(WORD, arg, 2), arg[1])
|
_alpha_find(m, kit.Select(WORD, arg, 2), arg[1])
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
"_cache": {Name: "_cache", Help: "缓存", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.OptionFields("time,id,word,translation,definition")
|
||||||
|
m.Cmdy(mdb.SELECT, m.Prefix("_cache"), "", mdb.HASH)
|
||||||
|
}},
|
||||||
}, 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(mdb.FIELDS, "id,word,translation,definition")
|
defer m.StatusTimeCount()
|
||||||
_alpha_find(m, arg[0], arg[1])
|
m.OptionFields("id,word,translation,definition")
|
||||||
|
if m.Cmdy(mdb.SELECT, m.Prefix("_cache"), "", mdb.HASH, "mw", arg[0]+arg[1]); len(m.Appendv("id")) > 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _alpha_find(m, arg[0], arg[1]); len(m.Appendv("id")) > 0 {
|
||||||
|
m.Cmd(mdb.INSERT, m.Prefix("_cache"), "", mdb.HASH, "mw", arg[0]+arg[1], m.AppendSimple())
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"path"
|
"path"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
|
@ -10,6 +10,7 @@ field chrome web.code.chrome.chrome
|
|||||||
chapter "应用"
|
chapter "应用"
|
||||||
field "同步流" web.code.chrome.sync
|
field "同步流" web.code.chrome.sync
|
||||||
field "收藏夹" web.code.chrome.favor
|
field "收藏夹" web.code.chrome.favor
|
||||||
|
field "样式表" web.code.chrome.style
|
||||||
field "蜘蛛侠" web.code.chrome.spide
|
field "蜘蛛侠" web.code.chrome.spide
|
||||||
field "缓存池" web.code.chrome.cache
|
field "缓存池" web.code.chrome.cache
|
||||||
field "相册簿" web.wiki.feel
|
field "相册簿" web.wiki.feel
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
@ -10,36 +10,38 @@ import (
|
|||||||
const Page = "page"
|
const Page = "page"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{
|
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
|
||||||
Configs: map[string]*ice.Config{
|
Page: {Name: "page", Help: "网页", Value: kit.Data()},
|
||||||
Page: {Name: "page", Help: "网页", Value: kit.Data()},
|
}, Commands: map[string]*ice.Command{
|
||||||
},
|
"/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{
|
||||||
Commands: map[string]*ice.Command{
|
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||||
"/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{
|
if len(arg) == 0 {
|
||||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
m.Cmdy(STYLE, SYNC, m.OptionSimple("hostname"))
|
||||||
if arg[0] == "get" {
|
|
||||||
switch m.Option("hostname") {
|
|
||||||
case "music.163.com":
|
|
||||||
m.Option("top", "200")
|
|
||||||
m.Result(SPIDE, "", m.Option("tid"))
|
|
||||||
return
|
|
||||||
case "localhost", "fib.woa.com":
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return
|
|
||||||
m.Option("top", "200")
|
|
||||||
m.Echo("cli.runtime")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if arg[0] == cli.RUN {
|
|
||||||
m.Cmdy(arg[1:])
|
|
||||||
return
|
|
||||||
}
|
|
||||||
m.Cmdy(ctx.COMMAND, arg)
|
|
||||||
}},
|
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
|
||||||
|
|
||||||
|
switch m.Option("hostname") {
|
||||||
|
case "golang.google.cn":
|
||||||
|
m.Option("top", "200")
|
||||||
|
m.Option("selection", "word")
|
||||||
|
m.Result("web.wiki.alpha.alpha")
|
||||||
|
|
||||||
|
case "music.163.com":
|
||||||
|
m.Option("top", "200")
|
||||||
|
m.Result(SPIDE, "", m.Option("tid"))
|
||||||
|
case "localhost", "fib.woa.com":
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
m.Option("top", "200")
|
||||||
|
m.Echo("cli.runtime")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
m.Cmdy(ctx.COMMAND, arg)
|
||||||
}},
|
}},
|
||||||
},
|
cli.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||||
})
|
m.Cmdy(arg)
|
||||||
|
}},
|
||||||
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
|
||||||
|
}},
|
||||||
|
}})
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
|
33
misc/chrome/style.go
Normal file
33
misc/chrome/style.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package chrome
|
||||||
|
|
||||||
|
import (
|
||||||
|
ice "github.com/shylinux/icebergs"
|
||||||
|
"github.com/shylinux/icebergs/base/mdb"
|
||||||
|
"github.com/shylinux/icebergs/base/web"
|
||||||
|
kit "github.com/shylinux/toolkits"
|
||||||
|
)
|
||||||
|
|
||||||
|
const STYLE = "style"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
|
||||||
|
STYLE: {Name: "style", Help: "样式", Value: kit.Data(
|
||||||
|
kit.MDB_SHORT, "zone", kit.MDB_FIELD, "time,id,target,style",
|
||||||
|
)},
|
||||||
|
}, Commands: map[string]*ice.Command{
|
||||||
|
STYLE: {Name: "style zone id auto insert", Help: "样式", Action: ice.MergeAction(map[string]*ice.Action{
|
||||||
|
mdb.INSERT: {Name: "insert zone=golang.google.cn target=. style:textarea", Help: "添加"},
|
||||||
|
SYNC: {Name: "sync hostname", Help: "同步", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Fields(0, m.Conf(STYLE, kit.META_FIELD))
|
||||||
|
m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.ZONE, m.Option("hostname")).Table(func(index int, value map[string]string, head []string) {
|
||||||
|
m.Cmd(web.SPACE, CHROME, CHROME, "1", m.Option("tid"), STYLE, value["target"], value["style"])
|
||||||
|
})
|
||||||
|
}},
|
||||||
|
}, mdb.ZoneAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
m.Fields(len(arg), mdb.ZONE_FIELD, m.Conf(STYLE, kit.META_FIELD))
|
||||||
|
if m.Cmdy(mdb.SELECT, m.PrefixKey(), "", mdb.ZONE, arg); len(arg) == 0 {
|
||||||
|
m.PushAction(mdb.REMOVE)
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
}})
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package crx
|
package chrome
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
@ -8,56 +8,33 @@ import (
|
|||||||
|
|
||||||
const _sync_index = 1
|
const _sync_index = 1
|
||||||
|
|
||||||
func _sync_count(m *ice.Message) string {
|
func _sync_count(m *ice.Message) string { return m.Conf(SYNC, kit.Keym(kit.MDB_COUNT)) }
|
||||||
return m.Conf(SYNC, kit.Keym(kit.MDB_COUNT))
|
|
||||||
}
|
|
||||||
|
|
||||||
const SYNC = "sync"
|
const SYNC = "sync"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{
|
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
|
||||||
Configs: map[string]*ice.Config{
|
SYNC: {Name: SYNC, Help: "同步流", Value: kit.Data(kit.MDB_FIELD, "time,id,type,name,text")},
|
||||||
SYNC: {Name: SYNC, Help: "同步流", Value: kit.Data(
|
}, Commands: map[string]*ice.Command{
|
||||||
kit.MDB_FIELD, "time,id,type,name,text",
|
"/sync": {Name: "/sync", Help: "同步", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
)},
|
m.Cmdy(SYNC, mdb.INSERT, arg)
|
||||||
},
|
}},
|
||||||
Commands: map[string]*ice.Command{
|
SYNC: {Name: "sync id auto page export import", Help: "同步流", Action: ice.MergeAction(map[string]*ice.Action{
|
||||||
"/sync": {Name: "/sync", Help: "同步", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(SYNC, mdb.INSERT, arg)
|
switch arg[0] {
|
||||||
|
case kit.MDB_ZONE:
|
||||||
|
m.Cmdy(FAVOR, ice.OptionFields("zone,count,time"))
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
SYNC: {Name: "sync id auto page export import", Help: "同步流", Action: map[string]*ice.Action{
|
FAVOR: {Name: "favor zone=some name", Help: "收藏", Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.PREV: {Name: "prev", Help: "上一页", Hand: func(m *ice.Message, arg ...string) {
|
m.Cmdy(FAVOR, mdb.INSERT, m.OptionSimple("zone,type,name,text"))
|
||||||
mdb.PrevPage(m, _sync_count(m), kit.Slice(arg, _sync_index)...)
|
|
||||||
}},
|
|
||||||
mdb.NEXT: {Name: "next", Help: "下一页", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
mdb.NextPage(m, _sync_count(m), kit.Slice(arg, _sync_index)...)
|
|
||||||
}},
|
|
||||||
mdb.INSERT: {Name: "insert type name text", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(mdb.INSERT, m.Prefix(SYNC), "", mdb.LIST, m.OptionSimple("type,name,text"))
|
|
||||||
}},
|
|
||||||
mdb.EXPORT: {Name: "export", Help: "导出", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.OptionFields(m.Conf(SYNC, kit.META_FIELD))
|
|
||||||
m.Cmdy(mdb.EXPORT, m.Prefix(SYNC), "", mdb.LIST)
|
|
||||||
}},
|
|
||||||
mdb.IMPORT: {Name: "import", Help: "导入", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(mdb.IMPORT, m.Prefix(SYNC), "", mdb.LIST)
|
|
||||||
}},
|
|
||||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
switch arg[0] {
|
|
||||||
case kit.MDB_ZONE:
|
|
||||||
m.Cmdy(FAVOR, ice.OptionFields("zone,count,time"))
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
FAVOR: {Name: "favor zone=some name", Help: "收藏", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(m.Prefix(FAVOR), mdb.INSERT, m.OptionSimple("zone,type,name,text"))
|
|
||||||
}},
|
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
|
||||||
m.OptionPage(kit.Slice(arg, _sync_index)...)
|
|
||||||
m.Fields(len(kit.Slice(arg, 0, 1)), m.Conf(SYNC, kit.META_FIELD))
|
|
||||||
m.Cmdy(mdb.SELECT, m.Prefix(SYNC), "", mdb.LIST, kit.MDB_ID, arg)
|
|
||||||
m.StatusTimeCountTotal(_sync_count(m))
|
|
||||||
m.PushAction(FAVOR)
|
|
||||||
}},
|
}},
|
||||||
},
|
}, mdb.ListAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
})
|
m.OptionPage(kit.Slice(arg, _sync_index)...)
|
||||||
|
m.Fields(len(kit.Slice(arg, 0, 1)), m.Conf(SYNC, kit.META_FIELD))
|
||||||
|
m.Cmdy(mdb.SELECT, m.PrefixKey(), "", mdb.LIST, kit.MDB_ID, arg)
|
||||||
|
m.StatusTimeCountTotal(_sync_count(m))
|
||||||
|
m.PushAction(FAVOR)
|
||||||
|
}},
|
||||||
|
}})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user