1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-05-07 15:21:25 +08:00
parent d8c381a933
commit 63cbd6d4c0
2 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,6 @@
package nfs
import (
"path"
"strings"
ice "shylinux.com/x/icebergs"
@ -20,13 +19,15 @@ func init() {
Index.MergeCommands(ice.Commands{
GREP: {Name: "grep word file auto", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
kit.If(len(arg) == 0, func() { arg = append(arg, ice.MAIN) })
m.Options(mdb.VALUE, arg[0], CMD_DIR, kit.Select("", arg, 2))
kit.For(strings.Split(m.System(GREP, "--exclude=.[a-z]*", "--exclude-dir=.[a-z]*", "-rni", arg[0], path.Join(kit.Select(SRC, arg, 1))).Result(), ice.NL), func(s string) {
kit.If(len(arg) == 1, func() { arg = append(arg, ice.SRC) })
m.Options(mdb.VALUE, arg[0])
kit.For(kit.SplitLine(m.System(GREP, "--exclude=.[a-z]*", "--exclude-dir=.[a-z]*", "-rni", arg[0], kit.AddUniq([]string{}, arg[1:]...)).Result()), func(s string) {
if ls := strings.SplitN(s, DF, 3); len(ls) > 2 {
m.Push(FILE, strings.TrimPrefix(ls[0], PWD)).Push(LINE, ls[1]).Push(mdb.TEXT, ls[2])
_ls := SplitPath(m, ls[0])
m.Push(PATH, _ls[0]).Push(FILE, _ls[1]).Push(LINE, ls[1]).Push(mdb.TEXT, ls[2])
}
})
m.StatusTimeCount(kit.Dict(PATH, m.Option(CMD_DIR)))
m.Sort("path,file,line")
}},
})
}

View File

@ -152,7 +152,7 @@ Volcanos(chat.ONEXPORT, {
tabs: function(can) {
var list = can.page.Select(can, can.ui.menu._output, html.DIV_TABS, function(target) { return {
select: can.page.ClassList.has(can, target, html.SELECT),
name: can.page.SelectOne(can, target, html.SPAN_NAME).innerHTML,
name: can.page.SelectOne(can, target, html.SPAN).innerHTML,
list: can.page.SelectChild(can, target._desktop, html.FIELDSET, function(target) { return target._meta })
} }); can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS], JSON.stringify(list))
},