forked from x/icebergs
opt chrome
This commit is contained in:
parent
272255aecc
commit
564c5a4f68
@ -68,7 +68,6 @@ func init() {
|
|||||||
mdb.CREATE: {Name: "create username", Help: "创建"},
|
mdb.CREATE: {Name: "create username", Help: "创建"},
|
||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
mdb.HashSelect(m, arg...)
|
mdb.HashSelect(m, arg...)
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,6 @@ func init() {
|
|||||||
m.Echo(_totp_get(value[SECRET], kit.Int(value[NUMBER]), kit.Int64(value[PERIOD])))
|
m.Echo(_totp_get(value[SECRET], kit.Int(value[NUMBER]), kit.Int64(value[PERIOD])))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,6 @@ func init() {
|
|||||||
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
||||||
m.Push(USERROLE, UserRole(m, value[USERNAME]))
|
m.Push(USERROLE, UserRole(m, value[USERNAME]))
|
||||||
})
|
})
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,8 @@ func HashActionStatus(fields ...string) map[string]*ice.Action {
|
|||||||
func HashSelect(m *ice.Message, arg ...string) *ice.Message {
|
func HashSelect(m *ice.Message, arg ...string) *ice.Message {
|
||||||
m.Fields(len(arg), m.Config(kit.MDB_FIELD))
|
m.Fields(len(arg), m.Config(kit.MDB_FIELD))
|
||||||
m.Cmdy(SELECT, m.PrefixKey(), "", HASH, m.Config(kit.MDB_SHORT), arg)
|
m.Cmdy(SELECT, m.PrefixKey(), "", HASH, m.Config(kit.MDB_SHORT), arg)
|
||||||
|
m.PushAction(REMOVE)
|
||||||
|
m.StatusTimeCount()
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
func HashPrunes(m *ice.Message, cb func(map[string]string) bool) *ice.Message {
|
func HashPrunes(m *ice.Message, cb func(map[string]string) bool) *ice.Message {
|
||||||
|
@ -92,7 +92,8 @@ func _cache_download(m *ice.Message, r *http.Response) (file, size string) {
|
|||||||
f.Write(buf[0:n])
|
f.Write(buf[0:n])
|
||||||
s := size * 100 / total
|
s := size * 100 / total
|
||||||
|
|
||||||
switch cb := m.Optionv(kit.Keycb(DOWNLOAD)).(type) {
|
m.Debug("what %v", kit.FileLine(m.OptionCB(SPIDE), 3))
|
||||||
|
switch cb := m.OptionCB(SPIDE).(type) {
|
||||||
case func(int, int):
|
case func(int, int):
|
||||||
cb(size, total)
|
cb(size, total)
|
||||||
case []string:
|
case []string:
|
||||||
|
@ -145,7 +145,11 @@ func _serve_handle(key string, cmd *ice.Command, msg *ice.Message, w http.Respon
|
|||||||
r.ParseMultipartForm(kit.Int64(kit.Select("4096", r.Header.Get(ContentLength))))
|
r.ParseMultipartForm(kit.Int64(kit.Select("4096", r.Header.Get(ContentLength))))
|
||||||
if r.ParseForm(); len(r.PostForm) > 0 {
|
if r.ParseForm(); len(r.PostForm) > 0 {
|
||||||
for k, v := range r.PostForm {
|
for k, v := range r.PostForm {
|
||||||
msg.Logs("form", k, v)
|
if len(v) > 1 {
|
||||||
|
msg.Logs("form", k, len(v), v)
|
||||||
|
} else {
|
||||||
|
msg.Logs("form", k, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,6 @@ func init() {
|
|||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...)
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...)
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_spide_list(m, arg...)
|
_spide_list(m, arg...)
|
||||||
|
@ -32,7 +32,6 @@ func init() {
|
|||||||
m.PushImages(kit.MDB_IMAGE, link)
|
m.PushImages(kit.MDB_IMAGE, link)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ func init() {
|
|||||||
m.PushScript(ssh.SCRIPT, m.Append(kit.MDB_TEXT))
|
m.PushScript(ssh.SCRIPT, m.Append(kit.MDB_TEXT))
|
||||||
m.PushQRCode(cli.QRCODE, m.Append(kit.MDB_TEXT))
|
m.PushQRCode(cli.QRCODE, m.Append(kit.MDB_TEXT))
|
||||||
}
|
}
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ func init() {
|
|||||||
m.PushScript(ssh.SCRIPT, m.Append(kit.MDB_TEXT))
|
m.PushScript(ssh.SCRIPT, m.Append(kit.MDB_TEXT))
|
||||||
m.PushQRCode(cli.QRCODE, m.Append(kit.MDB_TEXT))
|
m.PushQRCode(cli.QRCODE, m.Append(kit.MDB_TEXT))
|
||||||
}
|
}
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func _install_download(m *ice.Message) {
|
|||||||
value = kit.GetMeta(value)
|
value = kit.GetMeta(value)
|
||||||
|
|
||||||
p := 0
|
p := 0
|
||||||
m.Optionv(kit.Keycb(web.DOWNLOAD), func(size int, total int) {
|
m.OptionCB(web.SPIDE, func(size int, total int) {
|
||||||
if n := size * 100 / total; p != n {
|
if n := size * 100 / total; p != n {
|
||||||
value[kit.MDB_STEP], value[kit.MDB_SIZE], value[kit.MDB_TOTAL] = n, size, total
|
value[kit.MDB_STEP], value[kit.MDB_SIZE], value[kit.MDB_TOTAL] = n, size, total
|
||||||
toast(name, size, total)
|
toast(name, size, total)
|
||||||
|
2
meta.go
2
meta.go
@ -390,7 +390,7 @@ func (m *Message) Appendv(key string, arg ...interface{}) []string {
|
|||||||
return m.meta[key]
|
return m.meta[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.FieldsIsDetail() {
|
if m.FieldsIsDetail() && key != kit.MDB_KEY {
|
||||||
for i, k := range m.meta[kit.MDB_KEY] {
|
for i, k := range m.meta[kit.MDB_KEY] {
|
||||||
if k == key {
|
if k == key {
|
||||||
if len(arg) > 0 {
|
if len(arg) > 0 {
|
||||||
|
14
misc.go
14
misc.go
@ -87,6 +87,12 @@ func (m *Message) FieldsIsDetail() bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
func (m *Message) OptionCB(key string, cb ...interface{}) interface{} {
|
||||||
|
if len(cb) > 0 {
|
||||||
|
return m.Optionv(kit.Keycb(key), cb)
|
||||||
|
}
|
||||||
|
return m.Optionv(kit.Keycb(key))
|
||||||
|
}
|
||||||
func (m *Message) OptionUserWeb() *url.URL {
|
func (m *Message) OptionUserWeb() *url.URL {
|
||||||
return kit.ParseURL(m.Option(MSG_USERWEB))
|
return kit.ParseURL(m.Option(MSG_USERWEB))
|
||||||
}
|
}
|
||||||
@ -101,7 +107,11 @@ func (m *Message) RenameAppend(from, to string) {
|
|||||||
}
|
}
|
||||||
func (m *Message) AppendSimple(key ...string) (res []string) {
|
func (m *Message) AppendSimple(key ...string) (res []string) {
|
||||||
if len(key) == 0 {
|
if len(key) == 0 {
|
||||||
key = append(key, m.Appendv(MSG_APPEND)...)
|
if m.FieldsIsDetail() {
|
||||||
|
key = append(key, m.Appendv(kit.MDB_KEY)...)
|
||||||
|
} else {
|
||||||
|
key = append(key, m.Appendv(MSG_APPEND)...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, k := range key {
|
for _, k := range key {
|
||||||
res = append(res, k, m.Append(k))
|
res = append(res, k, m.Append(k))
|
||||||
@ -164,7 +174,7 @@ func (m *Message) cmd(arg ...interface{}) *Message {
|
|||||||
ok := false
|
ok := false
|
||||||
run := func(msg *Message, ctx *Context, cmd *Command, key string, arg ...string) {
|
run := func(msg *Message, ctx *Context, cmd *Command, key string, arg ...string) {
|
||||||
if ok = true; cbs != nil {
|
if ok = true; cbs != nil {
|
||||||
msg.Option(kit.Keycb(list[0]), cbs)
|
msg.Option(kit.Keycb(kit.Slice(kit.Split(list[0], PT), -1)[0]), cbs)
|
||||||
}
|
}
|
||||||
for k, v := range opts {
|
for k, v := range opts {
|
||||||
msg.Option(k, v)
|
msg.Option(k, v)
|
||||||
|
@ -25,8 +25,13 @@ func _alpha_find(m *ice.Message, method, word string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 搜索词汇
|
// 搜索词汇
|
||||||
msg := m.Cmd(cli.SYSTEM, "grep", "-rh", word, m.Config(kit.MDB_STORE))
|
msg := m.Cmd(cli.SYSTEM, "grep", "-rih", word, m.Config(kit.MDB_STORE))
|
||||||
msg.CSV(msg.Result(), kit.Split(m.Config(kit.MDB_FIELD))...).Table(func(index int, value map[string]string, head []string) {
|
msg.CSV(msg.Result(), kit.Split(m.Config(kit.MDB_FIELD))...).Table(func(index int, value map[string]string, head []string) {
|
||||||
|
if m.FieldsIsDetail() {
|
||||||
|
m.Push(mdb.DETAIL, value, kit.Split(m.Config(kit.MDB_FIELD)))
|
||||||
|
m.Push(kit.MDB_TIME, m.Time())
|
||||||
|
return
|
||||||
|
}
|
||||||
m.PushSearch(ice.CMD, ALPHA, kit.MDB_TYPE, method, kit.MDB_NAME, value[WORD], kit.MDB_TEXT, value["translation"], value)
|
m.PushSearch(ice.CMD, ALPHA, kit.MDB_TYPE, method, kit.MDB_NAME, value[WORD], kit.MDB_TEXT, value["translation"], value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -79,10 +84,13 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典", Configs: map[string]
|
|||||||
m.Copy(msg)
|
m.Copy(msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
m.OptionFields(mdb.DETAIL)
|
||||||
|
} else {
|
||||||
|
m.OptionFields(m.Config(kit.MDB_FIELD))
|
||||||
}
|
}
|
||||||
m.OptionFields(m.Config(kit.MDB_FIELD))
|
|
||||||
if _alpha_find(m, arg[0], arg[1]); arg[0] == WORD && m.Length() > 0 {
|
if _alpha_find(m, arg[0], arg[1]); arg[0] == WORD && m.Length() > 0 {
|
||||||
m.Cmd(CACHE, mdb.CREATE, m.AppendSimple())
|
m.Cmd(CACHE, mdb.CREATE, m.AppendSimple())
|
||||||
|
m.Sort(kit.MDB_KEY)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}}
|
}}
|
||||||
|
@ -70,8 +70,6 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
mdb.HashSelect(m, arg...)
|
mdb.HashSelect(m, arg...)
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
m.StatusTimeCount()
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -13,42 +13,33 @@ import (
|
|||||||
const CACHE = "cache"
|
const CACHE = "cache"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.Merge(&ice.Context{
|
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
|
||||||
Configs: map[string]*ice.Config{
|
CACHE: {Name: CACHE, Help: "爬虫缓存", Value: kit.Data(
|
||||||
CACHE: {Name: CACHE, Help: "爬虫缓存", Value: kit.Data(
|
kit.MDB_SHORT, kit.MDB_LINK, kit.MDB_FIELD, "time,hash,step,size,total,type,name,text,link",
|
||||||
kit.MDB_SHORT, kit.MDB_LINK, kit.MDB_FIELD, "time,hash,step,size,total,type,name,text,link",
|
kit.MDB_PATH, ice.USR_LOCAL_IMAGE,
|
||||||
kit.MDB_PATH, ice.USR_LOCAL_IMAGE,
|
)},
|
||||||
)},
|
}, Commands: map[string]*ice.Command{
|
||||||
},
|
CACHE: {Name: "cache hash auto prunes", Help: "爬虫缓存", Action: ice.MergeAction(map[string]*ice.Action{
|
||||||
Commands: map[string]*ice.Command{
|
mdb.CREATE: {Name: "create", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||||
CACHE: {Name: "cache hash auto create prunes", Help: "爬虫缓存", Action: map[string]*ice.Action{
|
if m.Cmdy(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, m.OptionSimple(kit.MDB_LINK)); m.Length() > 0 {
|
||||||
mdb.CREATE: {Name: "create", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
return // 已经下载
|
||||||
if m.Cmdy(mdb.SELECT, m.Prefix(CACHE), "", mdb.HASH, m.OptionSimple(kit.MDB_LINK)); len(m.Appendv(kit.MDB_TOTAL)) > 0 {
|
}
|
||||||
return // 已经下载
|
|
||||||
}
|
|
||||||
|
|
||||||
h := m.Cmdx(mdb.INSERT, m.Prefix(CACHE), "", mdb.HASH, m.OptionSimple("type,name,text,link"))
|
h := m.Cmdx(mdb.INSERT, m.PrefixKey(), "", mdb.HASH, m.OptionSimple("type,name,text,link"))
|
||||||
value := kit.GetMeta(m.Confm(CACHE, kit.Keys(kit.MDB_HASH, h)))
|
value := kit.GetMeta(m.Confm(m.PrefixKey(), kit.Keys(kit.MDB_HASH, h)))
|
||||||
m.Option(kit.Keycb(web.DOWNLOAD), func(size, total int) {
|
msg := m.Cmd("web.spide", ice.DEV, web.SPIDE_CACHE, web.SPIDE_GET, m.Option(kit.MDB_LINK), func(size, total int) {
|
||||||
value[kit.MDB_TOTAL], value[kit.MDB_SIZE], value[kit.MDB_STEP] = total, size, kit.Format(size*100/total)
|
value[kit.MDB_TOTAL], value[kit.MDB_SIZE], value[kit.MDB_STEP] = total, size, kit.Format(size*100/total)
|
||||||
})
|
})
|
||||||
msg := m.Cmd("web.spide", ice.DEV, web.SPIDE_CACHE, web.SPIDE_GET, m.Option(kit.MDB_LINK))
|
|
||||||
|
|
||||||
p := path.Join(m.Conf(CACHE, kit.META_PATH), m.Option(kit.MDB_NAME))
|
p := path.Join(m.Config(kit.MDB_PATH), m.Option(kit.MDB_NAME))
|
||||||
m.Cmdy(nfs.LINK, p, msg.Append(kit.MDB_FILE))
|
m.Cmdy(nfs.LINK, p, msg.Append(kit.MDB_FILE))
|
||||||
m.Toast("下载成功")
|
m.Toast("下载成功")
|
||||||
}},
|
|
||||||
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(mdb.DELETE, m.Prefix(CACHE), "", mdb.HASH, kit.MDB_HASH, m.Option(kit.MDB_HASH))
|
|
||||||
}},
|
|
||||||
mdb.PRUNES: {Name: "prunes", Help: "清理", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmdy(mdb.PRUNES, m.Prefix(CACHE), "", mdb.HASH, kit.MDB_STEP, "100")
|
|
||||||
}},
|
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
|
||||||
m.Fields(len(arg), m.Conf(CACHE, kit.META_FIELD))
|
|
||||||
m.Cmdy(mdb.SELECT, m.Prefix(CACHE), "", mdb.HASH, kit.MDB_HASH, arg)
|
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
},
|
mdb.PRUNES: {Name: "prunes", Help: "清理", Hand: func(m *ice.Message, arg ...string) {
|
||||||
})
|
m.Cmdy(mdb.PRUNES, m.PrefixKey(), "", mdb.HASH, kit.MDB_STEP, "100")
|
||||||
|
}},
|
||||||
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
mdb.HashSelect(m, arg...)
|
||||||
|
}},
|
||||||
|
}})
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,13 @@ func init() {
|
|||||||
Page: {Name: "page", Help: "网页", Value: kit.Data()},
|
Page: {Name: "page", Help: "网页", Value: kit.Data()},
|
||||||
}, Commands: map[string]*ice.Command{
|
}, Commands: map[string]*ice.Command{
|
||||||
"/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{
|
"/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{
|
||||||
|
FIELD: {Name: "field", Help: "工具"},
|
||||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(STYLE, ctx.ACTION, ctx.COMMAND, arg)
|
m.Cmdy(STYLE, ctx.ACTION, ctx.COMMAND, arg)
|
||||||
m.Cmdy(FIELD, ctx.ACTION, ctx.COMMAND, arg)
|
m.Cmdy(FIELD, ctx.ACTION, ctx.COMMAND, arg)
|
||||||
}},
|
}},
|
||||||
ice.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
ice.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(FIELD, ice.RUN, arg)
|
m.Cmdy(FIELD, ctx.ACTION, ice.RUN, arg)
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
|
@ -14,6 +14,7 @@ func init() {
|
|||||||
SPIDE: {Name: "spide wid tid cmd auto", Help: "网页爬虫", Action: map[string]*ice.Action{
|
SPIDE: {Name: "spide wid tid cmd auto", Help: "网页爬虫", Action: map[string]*ice.Action{
|
||||||
web.DOWNLOAD: {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
|
web.DOWNLOAD: {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(CACHE, mdb.CREATE, arg)
|
m.Cmd(CACHE, mdb.CREATE, arg)
|
||||||
|
m.ProcessHold()
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
switch msg := m.Cmd(web.SPACE, CHROME, CHROME, arg); kit.Select(SPIDE, arg, 2) {
|
switch msg := m.Cmd(web.SPACE, CHROME, CHROME, arg); kit.Select(SPIDE, arg, 2) {
|
||||||
|
@ -22,6 +22,8 @@ func init() {
|
|||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case kit.MDB_ZONE:
|
case kit.MDB_ZONE:
|
||||||
m.Cmdy(CHROME, mdb.INPUTS)
|
m.Cmdy(CHROME, mdb.INPUTS)
|
||||||
|
default:
|
||||||
|
m.Cmdy(mdb.INPUTS, m.PrefixKey(), "", mdb.ZONE, m.Option(m.Config(kit.MDB_SHORT)), arg)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
mdb.INSERT: {Name: "insert zone=golang.google.cn target=. style:textarea", Help: "添加"},
|
mdb.INSERT: {Name: "insert zone=golang.google.cn target=. style:textarea", Help: "添加"},
|
||||||
|
@ -99,7 +99,9 @@ func init() {
|
|||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) == 0 { // 通道列表
|
if len(arg) == 0 { // 通道列表
|
||||||
m.Action(mdb.PRUNES)
|
m.Action(mdb.PRUNES)
|
||||||
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
mdb.HashSelect(m, arg...)
|
||||||
|
m.Set(ice.MSG_APPEND, ctx.ACTION)
|
||||||
|
m.Table(func(index int, value map[string]string, head []string) {
|
||||||
m.PushButton(kit.Select("", ctx.COMMAND, value[kit.MDB_STATUS] == tcp.OPEN), mdb.REMOVE)
|
m.PushButton(kit.Select("", ctx.COMMAND, value[kit.MDB_STATUS] == tcp.OPEN), mdb.REMOVE)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -84,7 +84,9 @@ func init() {
|
|||||||
}, mdb.HashActionStatus()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashActionStatus()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.Action(mdb.PRUNES)
|
m.Action(mdb.PRUNES)
|
||||||
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
mdb.HashSelect(m, arg...)
|
||||||
|
m.Set(ice.MSG_APPEND, ctx.ACTION)
|
||||||
|
m.Table(func(index int, value map[string]string, head []string) {
|
||||||
m.PushButton(kit.Select("", ctx.COMMAND, value[kit.MDB_STATUS] == tcp.OPEN), mdb.REMOVE)
|
m.PushButton(kit.Select("", ctx.COMMAND, value[kit.MDB_STATUS] == tcp.OPEN), mdb.REMOVE)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -18,7 +18,6 @@ func init() {
|
|||||||
mdb.CREATE: {Name: "create type=shell,tmux,vim name=hi text:textarea=pwd", Help: "添加"},
|
mdb.CREATE: {Name: "create type=shell,tmux,vim name=hi text:textarea=pwd", Help: "添加"},
|
||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
mdb.HashSelect(m, arg...)
|
mdb.HashSelect(m, arg...)
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,6 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
mdb.HashSelect(m, arg...)
|
mdb.HashSelect(m, arg...)
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
m.StatusTimeCount()
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ func init() {
|
|||||||
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
mdb.HashSelect(m, arg...).Table(func(index int, value map[string]string, head []string) {
|
||||||
m.PushQRCode(kit.MDB_SCAN, kit.MergeURL("https://open.weixin.qq.com/qr/code", aaa.USERNAME, value[kit.MDB_TEXT]))
|
m.PushQRCode(kit.MDB_SCAN, kit.MergeURL("https://open.weixin.qq.com/qr/code", aaa.USERNAME, value[kit.MDB_TEXT]))
|
||||||
})
|
})
|
||||||
m.PushAction(mdb.REMOVE)
|
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,7 @@ func (m *Message) PushDownload(key string, arg ...interface{}) { // [name] file
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Message) PushAction(list ...interface{}) {
|
func (m *Message) PushAction(list ...interface{}) {
|
||||||
|
m.Set(MSG_APPEND, "action")
|
||||||
m.Table(func(index int, value map[string]string, head []string) {
|
m.Table(func(index int, value map[string]string, head []string) {
|
||||||
m.PushButton(list...)
|
m.PushButton(list...)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user