mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 18:37:29 +08:00
opt inner.js
This commit is contained in:
parent
43c35e0d1f
commit
27e0f84c07
@ -44,6 +44,7 @@ func _command_search(m *ice.Message, kind, name, text string) {
|
||||
m.PushSearch(ice.CTX, kit.PathName(1), ice.CMD, kit.FileName(1),
|
||||
kit.SimpleKV("", s.Cap(ice.CTX_FOLLOW), cmd.Name, cmd.Help),
|
||||
CONTEXT, s.Cap(ice.CTX_FOLLOW), COMMAND, key,
|
||||
INDEX, kit.Keys(s.Cap(ice.CTX_FOLLOW), key),
|
||||
)
|
||||
})
|
||||
}
|
||||
@ -78,10 +79,12 @@ func init() {
|
||||
m.Cmd(mdb.SEARCH, mdb.CREATE, m.CommandKey(), m.PrefixKey())
|
||||
}},
|
||||
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
|
||||
if arg[0] == COMMAND || arg[1] != "" {
|
||||
_command_search(m, arg[0], arg[1], arg[2])
|
||||
if arg[0] == COMMAND {
|
||||
_command_search(m, arg[0], kit.Select("", arg, 1), kit.Select("", arg, 2))
|
||||
}
|
||||
}},
|
||||
INDEX: {Name: "index", Help: "索引", Hand: func(m *ice.Message, arg ...string) {
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
arg = append(arg, "")
|
||||
|
@ -194,7 +194,7 @@ func HashActionStatus(args ...interface{}) map[string]*ice.Action {
|
||||
func HashSelect(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.Fields(len(arg), m.Config(FIELD))
|
||||
m.Cmdy(SELECT, m.PrefixKey(), "", HASH, m.Config(SHORT), arg)
|
||||
m.PushAction(REMOVE)
|
||||
m.PushAction(m.Config("action"), REMOVE)
|
||||
m.StatusTimeCount()
|
||||
return m
|
||||
}
|
||||
|
@ -155,6 +155,10 @@ 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")
|
||||
case ice.ARG:
|
||||
|
||||
case "index":
|
||||
m.OptionFields(arg[0])
|
||||
m.Cmdy("command", SEARCH, "command", kit.Select("", arg, 1))
|
||||
|
||||
case _zone(m):
|
||||
m.Cmdy(INPUTS, m.PrefixKey(), "", HASH, arg)
|
||||
default:
|
||||
|
15
core/code/sess.go
Normal file
15
core/code/sess.go
Normal file
@ -0,0 +1,15 @@
|
||||
package code
|
||||
|
||||
import (
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||
"sess": {Name: "sess hash auto save load", Help: "会话", Action: mdb.HashAction(
|
||||
mdb.FIELD, "time,hash,tabs,tool",
|
||||
"action", "load",
|
||||
)},
|
||||
}})
|
||||
}
|
2
go.sum
2
go.sum
@ -1,4 +1,6 @@
|
||||
shylinux.com/x/go-qrcode v0.0.1 h1:/eOGqMj1qtgs9Ymd12zTUa1gcJZs9S92kj2lb0QzKsE=
|
||||
shylinux.com/x/go-qrcode v0.0.1/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
|
||||
shylinux.com/x/toolkits v0.4.6 h1:BchBlYWmz5txVLXmJ8TgY3xzcV9dFBw/g69077ZuPQ4=
|
||||
shylinux.com/x/toolkits v0.4.6/go.mod h1:8LbYHe7oxBIqb6s4MSOD+4d28QvPdvkyCVtwB/JW7AA=
|
||||
shylinux.com/x/websocket v0.0.1 h1:OBc21DxqsGlQ2+Pz76xqLyDNo1LV+PUUqfWi+1PZPDE=
|
||||
shylinux.com/x/websocket v0.0.1/go.mod h1:AaSpMToOxbMULKQytzczeHPuqb708vK1vrAzCxLo/XE=
|
||||
|
@ -109,6 +109,7 @@ func init() {
|
||||
return
|
||||
}
|
||||
|
||||
arg[0] = kit.Replace(arg[0], "src", "contexts")
|
||||
if arg[0] == path.Base(kit.Pwd()) {
|
||||
m.Option(nfs.DIR_ROOT, path.Join(ice.SRC)+ice.PS)
|
||||
} else {
|
||||
|
@ -40,6 +40,7 @@ func init() {
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if len(arg) > 0 { // 提交详情
|
||||
arg[0] = kit.Replace(arg[0], "src", "contexts")
|
||||
m.Cmd(REPOS, ice.OptionFields("name,path")).Table(func(index int, value map[string]string, head []string) {
|
||||
if value[mdb.NAME] == arg[0] {
|
||||
m.Cmdy("_sum", value[nfs.PATH], arg[1:])
|
||||
|
@ -23,7 +23,7 @@ func init() {
|
||||
m.Cmdy(REPOS)
|
||||
return
|
||||
}
|
||||
|
||||
arg[0] = kit.Replace(arg[0], "src", "contexts")
|
||||
m.Cmdy(TOTAL, arg)
|
||||
}},
|
||||
}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user