mirror of
https://shylinux.com/x/icebergs
synced 2025-05-03 20:07:01 +08:00
mix hub
This commit is contained in:
commit
307bfdde0f
@ -1132,8 +1132,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
m.Info("routine %v", favor)
|
m.Info("routine %v", favor)
|
||||||
m.Gos(m, func(m *ice.Message) {
|
m.Gos(m, func(m *ice.Message) {
|
||||||
m.Grows(ice.WEB_FAVOR, kit.Keys(kit.MDB_HASH, key), "", "", func(index int, value map[string]interface{}) {
|
m.Grows(ice.WEB_FAVOR, kit.Keys(kit.MDB_HASH, key), "", "", func(index int, value map[string]interface{}) {
|
||||||
|
if strings.Contains(favor, arg[1]) || strings.Contains(kit.Format(value["name"]), arg[1]) || strings.Contains(kit.Format(value["text"]), arg[1]) {
|
||||||
if strings.Contains(kit.Format(value["name"]), arg[1]) || strings.Contains(kit.Format(value["text"]), arg[1]) {
|
|
||||||
m.Push("pod", strings.Join(kit.Simple(m.Optionv("user.pod")), "."))
|
m.Push("pod", strings.Join(kit.Simple(m.Optionv("user.pod")), "."))
|
||||||
m.Push("favor", favor)
|
m.Push("favor", favor)
|
||||||
m.Push("", value, []string{"id", "type", "name", "text"})
|
m.Push("", value, []string{"id", "type", "name", "text"})
|
||||||
@ -1775,11 +1774,22 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Richs(ice.WEB_SPACE, nil, kit.Select("*", arg, 0), func(key string, value map[string]interface{}) {
|
target, rest := "*", ""
|
||||||
|
if len(arg) > 0 {
|
||||||
|
ls := strings.SplitN(arg[0], ".", 2)
|
||||||
|
if target = ls[0]; len(ls) > 1 {
|
||||||
|
rest = ls[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Richs(ice.WEB_SPACE, nil, target, func(key string, value map[string]interface{}) {
|
||||||
if len(arg) > 1 {
|
if len(arg) > 1 {
|
||||||
|
ls := []interface{}{ice.WEB_SPACE, value[kit.MDB_NAME]}
|
||||||
m.Call(false, func(res *ice.Message) *ice.Message { return res })
|
m.Call(false, func(res *ice.Message) *ice.Message { return res })
|
||||||
// 发送命令
|
// 发送命令
|
||||||
m.Cmdy(ice.WEB_SPACE, value[kit.MDB_NAME], arg[1:])
|
if rest != "" {
|
||||||
|
ls = append(ls, ice.WEB_SPACE, rest)
|
||||||
|
}
|
||||||
|
m.Cmdy(ls, arg[1:])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ var Index = &ice.Context{Name: "alpha", Help: "英汉词典",
|
|||||||
m.Cmdy("list", "ecdict", count-rand.Intn(count), 1)
|
m.Cmdy("list", "ecdict", count-rand.Intn(count), 1)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
"search": {Name: "search [word [method]]", Help: "查找词汇", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
"trans": {Name: "trans [word [method]]", Help: "查找词汇", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
// 收藏列表
|
// 收藏列表
|
||||||
m.Cmdy(ice.WEB_FAVOR, "alpha.word")
|
m.Cmdy(ice.WEB_FAVOR, "alpha.word")
|
||||||
|
@ -50,6 +50,11 @@ var Index = &ice.Context{Name: "zsh", Help: "命令行",
|
|||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case "history":
|
case "history":
|
||||||
vs := strings.SplitN(strings.TrimSpace(m.Option("arg")), " ", 4)
|
vs := strings.SplitN(strings.TrimSpace(m.Option("arg")), " ", 4)
|
||||||
|
if strings.Contains(m.Option("SHELL"), "zsh") {
|
||||||
|
vs = []string{vs[0], "", "", strings.Join(vs[1:], " ")}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
cmds := []string{ice.WEB_FAVOR, m.Conf("zsh", "meta.history"), ice.TYPE_SHELL, vs[0], kit.Select("", vs, 3),
|
cmds := []string{ice.WEB_FAVOR, m.Conf("zsh", "meta.history"), ice.TYPE_SHELL, vs[0], kit.Select("", vs, 3),
|
||||||
"sid", m.Option("sid"), "pwd", m.Option("pwd"), "time", vs[1] + " " + vs[2]}
|
"sid", m.Option("sid"), "pwd", m.Option("pwd"), "time", vs[1] + " " + vs[2]}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user