forked from x/icebergs
add some
This commit is contained in:
parent
90469e941d
commit
9bdc7af5e9
@ -49,7 +49,7 @@ const QRCODE = "qrcode"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
QRCODE: {Name: "qrcode text fg@key bg@key size auto", Help: "二维码", Role: aaa.VOID, Meta: kit.Dict(
|
QRCODE: {Name: "qrcode text fg@key bg@key size auto", Help: "二维码", Icon: "Chess.png", Role: aaa.VOID, Meta: kit.Dict(
|
||||||
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict(mdb.TEXT, "文本", BG, "背景色", FG, "字体色")),
|
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict(mdb.TEXT, "文本", BG, "背景色", FG, "字体色")),
|
||||||
), Actions: ice.MergeActions(ice.Actions{
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -177,6 +177,7 @@ const (
|
|||||||
KILL = "kill"
|
KILL = "kill"
|
||||||
|
|
||||||
GO = "go"
|
GO = "go"
|
||||||
|
GOTAGS = "gotags"
|
||||||
GIT = "git"
|
GIT = "git"
|
||||||
MAN = "man"
|
MAN = "man"
|
||||||
YUM = "yum"
|
YUM = "yum"
|
||||||
|
@ -70,7 +70,7 @@ const SHARE = "share"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
SHARE: {Name: "share hash auto login", Help: "共享链", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
SHARE: {Name: "share hash auto login", Help: "共享链", Icon: "Freeform.png", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.CREATE: {Name: "create type name text space", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create type name text space", Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(m.Option(mdb.TYPE) == LOGIN && m.Option(mdb.TEXT) == "", func() { arg = append(arg, mdb.TEXT, tcp.PublishLocalhost(m, m.Option(ice.MSG_USERWEB))) })
|
kit.If(m.Option(mdb.TYPE) == LOGIN && m.Option(mdb.TEXT) == "", func() { arg = append(arg, mdb.TEXT, tcp.PublishLocalhost(m, m.Option(ice.MSG_USERWEB))) })
|
||||||
mdb.HashCreate(m, m.OptionSimple("type,name,text,space"), arg, aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE))
|
mdb.HashCreate(m, m.OptionSimple("type,name,text,space"), arg, aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE))
|
||||||
|
@ -44,8 +44,8 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div input { bo
|
|||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.text input:hover { border-top:var(--box-notice); }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.text input:hover { border-top:var(--box-notice); }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.text input:hover { border-top:var(--box-notice); }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.text input:hover { border-top:var(--box-notice); }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { box-shadow:none; margin:var(--button-margin) var(--input-margin); }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { box-shadow:none; margin:var(--button-margin) var(--input-margin); }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:100px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div:last-child { margin-right:100px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.tabs { display:none; }
|
/* fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.tabs { display:none; } */
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { min-height:240px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output { min-height:240px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content { width:100%; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content { width:100%; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content th { padding:var(--table-padding); }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content th { padding:var(--table-padding); }
|
||||||
|
@ -135,12 +135,12 @@ const (
|
|||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
ENV = "env"
|
ENV = "env"
|
||||||
DOC = "doc"
|
|
||||||
GET = "get"
|
GET = "get"
|
||||||
TAG = "tag"
|
TAG = "tag"
|
||||||
)
|
)
|
||||||
const SUM = "sum"
|
const SUM = "sum"
|
||||||
const MOD = "mod"
|
const MOD = "mod"
|
||||||
|
const DOC = "doc"
|
||||||
const GO = "go"
|
const GO = "go"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -166,6 +166,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, gdb.EventsAction(VIMER_SAVE), PlugAction())},
|
}, gdb.EventsAction(VIMER_SAVE), PlugAction())},
|
||||||
|
DOC: {Name: "doc path name auto", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if strings.Contains(arg[0], nfs.PS) {
|
||||||
|
arg[0] = kit.Path(arg[0])
|
||||||
|
}
|
||||||
|
m.Cmdy(cli.SYSTEM, cli.GO, DOC, arg)
|
||||||
|
}},
|
||||||
MOD: {Actions: ice.MergeActions(ice.Actions{
|
MOD: {Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { _mod_show(m, path.Join(arg[2], arg[1])) }},
|
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { _mod_show(m, path.Join(arg[2], arg[1])) }},
|
||||||
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _mod_show(m, path.Join(arg[2], arg[1])) }},
|
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { _mod_show(m, path.Join(arg[2], arg[1])) }},
|
||||||
|
@ -123,6 +123,7 @@ func init() {
|
|||||||
} else {
|
} else {
|
||||||
arg[1] = strings.Split(arg[1], mdb.FS)[0]
|
arg[1] = strings.Split(arg[1], mdb.FS)[0]
|
||||||
_inner_list(m, kit.Ext(arg[1]), arg[1], arg[0])
|
_inner_list(m, kit.Ext(arg[1]), arg[1], arg[0])
|
||||||
|
m.Options(nfs.PATH, arg[0], nfs.FILE, arg[1], nfs.LINE, kit.Select("", arg, 2))
|
||||||
if ctx.DisplayLocal(m, ""); !strings.HasPrefix(arg[0], ice.USR_INSTALL) {
|
if ctx.DisplayLocal(m, ""); !strings.HasPrefix(arg[0], ice.USR_INSTALL) {
|
||||||
m.Option(REPOS, kit.Join(m.Cmd(REPOS, ice.OptionFields(nfs.PATH)).Sort(nfs.PATH).Appendv(nfs.PATH)))
|
m.Option(REPOS, kit.Join(m.Cmd(REPOS, ice.OptionFields(nfs.PATH)).Sort(nfs.PATH).Appendv(nfs.PATH)))
|
||||||
}
|
}
|
||||||
|
@ -4,40 +4,47 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
|
"shylinux.com/x/icebergs/base/lex"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/nfs"
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
"shylinux.com/x/icebergs/base/web/html"
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
|
"shylinux.com/x/icebergs/core/code"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
const TAGS = "tags"
|
const TAGS = "tags"
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
TAGS: {Name: "tags path name auto", Meta: kit.Dict(
|
TAGS: {Name: "tags path name auto", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_ICONS, kit.Dict(mdb.CREATE, "bi bi-star"),
|
mdb.CREATE: {Icon: "bi bi-star"},
|
||||||
), Actions: ice.MergeActions(ice.Actions{
|
mdb.SHOW: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
"show": {Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
ctx.ProcessFloat(m, web.VIMER, []string{m.Option(nfs.PATH), m.Option(nfs.FILE), m.Option(nfs.LINE)}, arg...)
|
ctx.ProcessFloat(m, web.VIMER, []string{m.Option(nfs.PATH), m.Option(nfs.FILE), m.Option(nfs.LINE)}, arg...)
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.SHORT, "path,file,line", mdb.FIELD, "time,hash,type,name,text,path,file,line")), Hand: func(m *ice.Message, arg ...string) {
|
code.DOC: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
ctx.ProcessFloat(m, "web.code.doc", []string{m.Option(nfs.PATH), m.Option(mdb.NAME)}, arg...)
|
||||||
|
}},
|
||||||
|
}, mdb.ExportHashAction(mdb.SHORT, "path,file,line", mdb.FIELD, "time,path,file,line,type,name,text,hash")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
mdb.HashSelect(m)
|
mdb.HashSelect(m).PushAction(code.DOC, mdb.SHOW, mdb.REMOVE).Action()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(arg) > 1 {
|
||||||
|
m.Cmdy("web.code.doc", arg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer m.Action(html.FILTER)
|
|
||||||
list := map[string]bool{}
|
list := map[string]bool{}
|
||||||
mdb.HashSelect(m.Spawn()).Table(func(value ice.Maps) { list[kit.Fields(value[nfs.PATH], value[nfs.FILE], value[nfs.LINE])] = true })
|
mdb.HashSelect(m.Spawn()).Table(func(value ice.Maps) { list[kit.Fields(value[nfs.PATH], value[nfs.FILE], value[nfs.LINE])] = true })
|
||||||
kit.For(kit.SplitLine(m.Cmdx(cli.SYSTEM, "gotags", "-f", "-", "-R", kit.Path(arg[0]))), func(text string) {
|
kit.For(kit.SplitLine(m.Cmdx(cli.SYSTEM, cli.GOTAGS, "-f", "-", "-R", kit.Path(arg[0]))), func(text string) {
|
||||||
if strings.HasPrefix(text, "!_") {
|
if strings.HasPrefix(text, "!_") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ls := kit.Split(text)
|
ls := kit.Split(text)
|
||||||
t := kit.Split(ls[3])[0]
|
|
||||||
info := map[string]string{}
|
info := map[string]string{}
|
||||||
kit.For(kit.Split(ls[3][1:], "\t", "\t"), func(text string) {
|
kit.For(kit.Split(ls[3][1:], lex.TB, lex.TB), func(text string) {
|
||||||
if ls := strings.SplitN(text, ":", 2); len(ls) > 1 {
|
if ls := strings.SplitN(text, ":", 2); len(ls) > 1 {
|
||||||
info[ls[0]] = ls[1]
|
info[ls[0]] = ls[1]
|
||||||
}
|
}
|
||||||
@ -45,9 +52,10 @@ func init() {
|
|||||||
if strings.Contains(ls[1], "/internal/") || strings.HasSuffix(ls[1], "_test.go") {
|
if strings.Contains(ls[1], "/internal/") || strings.HasSuffix(ls[1], "_test.go") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(arg) == 1 && info["access"] == "private" {
|
if len(arg) == 1 && info[aaa.ACCESS] == aaa.PRIVATE {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
t := kit.Split(ls[3])[0]
|
||||||
if kit.IsIn(t, "p", "i") {
|
if kit.IsIn(t, "p", "i") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -60,11 +68,7 @@ func init() {
|
|||||||
} else if info["ctype"] != arg[1] && ls[0] != arg[1] {
|
} else if info["ctype"] != arg[1] && ls[0] != arg[1] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Push(mdb.STATUS, has)
|
text = info["signature"]
|
||||||
m.Push(mdb.TYPE, t)
|
|
||||||
m.Push(mdb.NAME, ls[0])
|
|
||||||
m.Push(nfs.FILE, file)
|
|
||||||
m.Push(nfs.LINE, ls[2])
|
|
||||||
if kit.IsIn(t, "f", "m") {
|
if kit.IsIn(t, "f", "m") {
|
||||||
p := "func "
|
p := "func "
|
||||||
if t == "m" {
|
if t == "m" {
|
||||||
@ -75,24 +79,27 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if info[mdb.TYPE] == "" {
|
if info[mdb.TYPE] == "" {
|
||||||
m.Push(mdb.TEXT, kit.Format("%s%s%s", p, ls[0], info["signature"]))
|
text = kit.Format("%s%s%s", p, ls[0], text)
|
||||||
} else if strings.Contains(info[mdb.TYPE], ",") {
|
} else if strings.Contains(info[mdb.TYPE], ",") {
|
||||||
m.Push(mdb.TEXT, kit.Format("%s%s%s (%s)", p, ls[0], info["signature"], info[mdb.TYPE]))
|
text = kit.Format("%s%s%s (%s)", p, ls[0], text, info[mdb.TYPE])
|
||||||
} else {
|
} else {
|
||||||
m.Push(mdb.TEXT, kit.Format("%s%s%s %s", p, ls[0], info["signature"], info[mdb.TYPE]))
|
text = kit.Format("%s%s%s %s", p, ls[0], text, info[mdb.TYPE])
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
m.Push(mdb.TEXT, info["signature"])
|
|
||||||
}
|
}
|
||||||
m.Push("what", ls[3])
|
m.Push(mdb.STATUS, has)
|
||||||
|
m.Push(mdb.TYPE, t)
|
||||||
|
m.Push(mdb.NAME, ls[0])
|
||||||
|
m.Push(nfs.FILE, file)
|
||||||
|
m.Push(nfs.LINE, ls[2])
|
||||||
|
m.Push(mdb.TEXT, text)
|
||||||
if has {
|
if has {
|
||||||
m.PushButton("show")
|
m.PushButton(code.DOC, mdb.SHOW)
|
||||||
} else {
|
} else {
|
||||||
m.PushButton("show", mdb.CREATE)
|
m.PushButton(code.DOC, mdb.SHOW, mdb.CREATE)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.StatusTimeCountStats(mdb.TYPE)
|
m.Action(html.FILTER).StatusTimeCountStats(mdb.TYPE)
|
||||||
m.Sort("status,type,name", []string{"true", "false"}, []string{"t", "n", "f", "v", "c"}, ice.STR)
|
m.Sort("status,type,name", []string{ice.TRUE, ice.FALSE}, []string{"t", "n", "f", "v", "c"}, ice.STR)
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user