1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00

opt inner.js

This commit is contained in:
harveyshao 2022-01-17 08:06:22 +08:00
parent fdc1b5420a
commit d28a1e674a
3 changed files with 20 additions and 9 deletions

View File

@ -155,12 +155,6 @@ func ZoneAction(args ...interface{}) map[string]*ice.Action {
m.Cmdy("context", kit.Select(m.Option(ice.CTX), m.Option(kit.Keys(EXTRA, ice.CTX))), "command") m.Cmdy("context", kit.Select(m.Option(ice.CTX), m.Option(kit.Keys(EXTRA, ice.CTX))), "command")
case ice.ARG: case ice.ARG:
case "path":
m.Cmdy("nfs.dir", arg[1:]).Cut("path,size,time").ProcessAgain()
case "file":
m.Option("dir_root", m.Option("path"))
m.Cmdy("nfs.dir", arg[1:]).Cut("path,size,time").ProcessAgain()
case "index": case "index":
m.OptionFields(arg[0]) m.OptionFields(arg[0])
m.Cmdy("command", SEARCH, "command", kit.Select("", arg, 1)) m.Cmdy("command", SEARCH, "command", kit.Select("", arg, 1))

View File

@ -123,7 +123,10 @@ const (
BRANCH = "branch" BRANCH = "branch"
REPOS = "repos" REPOS = "repos"
// SAVE = "save"
LOAD = "load" LOAD = "load"
FIND = "find"
GREP = "grep"
) )
const ( const (
HTML = "html" HTML = "html"

View File

@ -89,8 +89,22 @@ func init() {
mdb.ENGINE: {Name: "engine", Help: "引擎", Hand: func(m *ice.Message, arg ...string) { mdb.ENGINE: {Name: "engine", Help: "引擎", Hand: func(m *ice.Message, arg ...string) {
_inner_exec(m, arg[0], arg[1], arg[2]) _inner_exec(m, arg[0], arg[1], arg[2])
}}, }},
mdb.INPUTS: {Name: "favor inputs", Help: "补全"}, mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
FAVOR: {Name: "favor", Help: "收藏"}, switch arg[0] {
case nfs.PATH:
m.Cmdy(nfs.DIR, arg[1:], "path,size,time").ProcessAgain()
case nfs.FILE:
m.Option(nfs.DIR_ROOT, m.Option(nfs.PATH))
m.Cmdy(nfs.DIR, ice.PWD, "path,size,time").ProcessAgain()
case "url":
m.Option(nfs.DIR_DEEP, ice.TRUE)
m.Option(nfs.DIR_ROOT, "usr/volcanos/plugin/local/code/")
m.Cmdy(nfs.DIR, ice.PWD, "path,size,time").ProcessAgain()
default:
m.Cmdy(FAVOR, mdb.INPUTS, arg)
}
}},
FAVOR: {Name: "favor", Help: "收藏"},
}, ctx.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { }, ctx.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if !strings.HasSuffix(arg[0], ice.PS) { if !strings.HasSuffix(arg[0], ice.PS) {
arg[1] = kit.Slice(strings.Split(arg[0], ice.PS), -1)[0] arg[1] = kit.Slice(strings.Split(arg[0], ice.PS), -1)[0]
@ -103,7 +117,7 @@ func init() {
m.Set(ice.MSG_STATUS) m.Set(ice.MSG_STATUS)
return return
} }
m.Option("plug", "inner/search.js?a=1,inner/favor.js,inner/sess.js") m.Option("plug", "inner/search.js?a=1,inner/favor.js")
arg[1] = kit.Split(arg[1])[0] arg[1] = kit.Split(arg[1])[0]
_inner_list(m, kit.Ext(arg[1]), arg[1], arg[0]) _inner_list(m, kit.Ext(arg[1]), arg[1], arg[0])
m.Set(ice.MSG_STATUS) m.Set(ice.MSG_STATUS)