mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt portal
This commit is contained in:
parent
54e5ba6e79
commit
5af0bee1c6
@ -159,7 +159,7 @@ func init() {
|
|||||||
SYSTEM: {Name: "system cmd", Help: "系统命令", Actions: ice.MergeActions(ice.Actions{
|
SYSTEM: {Name: "system cmd", Help: "系统命令", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if runtime.GOOS == DARWIN && tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
|
if runtime.GOOS == DARWIN && tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
return
|
return
|
||||||
list := map[string]bool{"Terminal.app": true, "Docker.app": true, "Google Chrome.app": true}
|
list := map[string]bool{"Terminal.app": true, "Docker.app": true, "Google Chrome.app": true}
|
||||||
for _, p := range strings.Split(m.Cmdx("", nfs.SH, "-c", `ps aux|grep /Applications/|grep -v Cache|grep -v Helper|grep -v Widget|grep -v Extension|grep -v Chrome|grep -v com.app|grep -v grep|grep -o "[^/]*.app"|sort|uniq`), lex.NL) {
|
for _, p := range strings.Split(m.Cmdx("", nfs.SH, "-c", `ps aux|grep /Applications/|grep -v Cache|grep -v Helper|grep -v Widget|grep -v Extension|grep -v Chrome|grep -v com.app|grep -v grep|grep -o "[^/]*.app"|sort|uniq`), lex.NL) {
|
||||||
|
@ -54,6 +54,7 @@ const (
|
|||||||
DISPLAY = "display"
|
DISPLAY = "display"
|
||||||
ACTION = "action"
|
ACTION = "action"
|
||||||
SHIP = "ship"
|
SHIP = "ship"
|
||||||
|
RUN = "run"
|
||||||
)
|
)
|
||||||
const COMMAND = "command"
|
const COMMAND = "command"
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ func init() {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func IsSearchForEach(m *ice.Message, arg []string, cb func() []string) bool {
|
func IsSearchPreview(m *ice.Message, arg []string, cb func() []string) bool {
|
||||||
if arg[0] == FOREACH && arg[1] == "" {
|
if arg[0] == FOREACH && arg[1] == "" {
|
||||||
if cb != nil {
|
if cb != nil {
|
||||||
if args := cb(); len(args) > 0 {
|
if args := cb(); len(args) > 0 {
|
||||||
|
@ -132,9 +132,8 @@ const (
|
|||||||
SRC = "src/"
|
SRC = "src/"
|
||||||
BIN = "bin/"
|
BIN = "bin/"
|
||||||
USR = "usr/"
|
USR = "usr/"
|
||||||
USR_PORTAL = "usr/portal/"
|
USR_PORTAL = ice.USR_PORTAL
|
||||||
USR_INSTALL = "usr/install/"
|
SRC_DOCUMENT = ice.SRC_DOCUMENT
|
||||||
SRC_DOCUMENT = "src/document/"
|
|
||||||
REQUIRE = "/require/"
|
REQUIRE = "/require/"
|
||||||
|
|
||||||
TYPE_ALL = "all"
|
TYPE_ALL = "all"
|
||||||
@ -171,7 +170,7 @@ func init() {
|
|||||||
aaa.Black(m, ice.USR_LOCAL)
|
aaa.Black(m, ice.USR_LOCAL)
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) && m.Cmdx("host", "islocal", m.Option(ice.MSG_USERIP)) == ice.OK {
|
if mdb.IsSearchPreview(m, arg, nil) && m.Cmdx("host", "islocal", m.Option(ice.MSG_USERIP)) == ice.OK {
|
||||||
return
|
return
|
||||||
kit.For([]string{"Desktop", "Documents", "Downloads", "Pictures"}, func(p string) {
|
kit.For([]string{"Desktop", "Documents", "Downloads", "Pictures"}, func(p string) {
|
||||||
p = kit.HomePath(p)
|
p = kit.HomePath(p)
|
||||||
|
@ -57,7 +57,7 @@ func init() {
|
|||||||
mdb.HashCreate(m, mdb.TYPE, m.ActionKey(), m.OptionSimple(mdb.NAME, mdb.TEXT))
|
mdb.HashCreate(m, mdb.TYPE, m.ActionKey(), m.OptionSimple(mdb.NAME, mdb.TEXT))
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
ip := m.Cmdv(HOST, GATEWAY, aaa.IP)
|
ip := m.Cmdv(HOST, GATEWAY, aaa.IP)
|
||||||
m.PushSearch(mdb.TYPE, GATEWAY, mdb.NAME, ip, mdb.TEXT, "http://"+ip)
|
m.PushSearch(mdb.TYPE, GATEWAY, mdb.NAME, ip, mdb.TEXT, "http://"+ip)
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
BROAD: {Name: "broad hash auto", Help: "广播", Actions: ice.MergeActions(ice.Actions{
|
BROAD: {Name: "broad hash auto", Help: "广播", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
host, domain := m.Cmdv(tcp.HOST, aaa.IP), UserWeb(m).Hostname()
|
host, domain := m.Cmdv(tcp.HOST, aaa.IP), UserWeb(m).Hostname()
|
||||||
m.Cmds("", func(value ice.Maps) {
|
m.Cmds("", func(value ice.Maps) {
|
||||||
switch kit.If(value[tcp.HOST] == host, func() { value[tcp.HOST] = domain }); value[mdb.TYPE] {
|
switch kit.If(value[tcp.HOST] == host, func() { value[tcp.HOST] = domain }); value[mdb.TYPE] {
|
||||||
|
@ -114,7 +114,7 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
DREAM: {Name: "dream name@key auto create", Help: "梦想家", Actions: ice.MergeActions(ice.Actions{
|
DREAM: {Name: "dream name@key auto create", Help: "梦想家", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
m.Cmds("", func(value ice.Maps) { m.PushSearch(mdb.TEXT, m.MergePod(value[mdb.NAME]), value) })
|
m.Cmds("", func(value ice.Maps) { m.PushSearch(mdb.TEXT, m.MergePod(value[mdb.NAME]), value) })
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -191,7 +191,7 @@ func init() {
|
|||||||
m.Cmd("", m.Option(mdb.NAME), ice.EXIT)
|
m.Cmd("", m.Option(mdb.NAME), ice.EXIT)
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
m.Cmds("", func(value ice.Maps) {
|
m.Cmds("", func(value ice.Maps) {
|
||||||
switch value[mdb.TYPE] {
|
switch value[mdb.TYPE] {
|
||||||
case MASTER:
|
case MASTER:
|
||||||
|
@ -256,7 +256,7 @@ func init() {
|
|||||||
m.Cmd("", mdb.CREATE, ice.SHY, kit.Select(kit.Select("https://shylinux.com", ice.Info.Make.Remote), conf[cli.CTX_SHY]))
|
m.Cmd("", mdb.CREATE, ice.SHY, kit.Select(kit.Select("https://shylinux.com", ice.Info.Make.Remote), conf[cli.CTX_SHY]))
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.DEV, mdb.TEXT, mdb.HashSelectField(m, ice.DEV, CLIENT_ORIGIN))
|
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.DEV, mdb.TEXT, mdb.HashSelectField(m, ice.DEV, CLIENT_ORIGIN))
|
||||||
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.COM, mdb.TEXT, mdb.HashSelectField(m, ice.COM, CLIENT_ORIGIN))
|
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.COM, mdb.TEXT, mdb.HashSelectField(m, ice.COM, CLIENT_ORIGIN))
|
||||||
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.SHY, mdb.TEXT, mdb.HashSelectField(m, ice.SHY, CLIENT_ORIGIN))
|
m.PushSearch(mdb.TYPE, LINK, mdb.NAME, ice.SHY, mdb.TEXT, mdb.HashSelectField(m, ice.SHY, CLIENT_ORIGIN))
|
||||||
|
@ -576,6 +576,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
|
||||||
loaded := kit.Dict()
|
loaded := kit.Dict()
|
||||||
ice.AddMergeAction(func(c *ice.Context, key string, cmd *ice.Command, sub string, action *ice.Action) (init ice.Handler) {
|
ice.AddMergeAction(func(c *ice.Context, key string, cmd *ice.Command, sub string, action *ice.Action) (init ice.Handler) {
|
||||||
kit.IfNoKey(loaded, ice.SRC_SCRIPT+c.Prefix(key)+nfs.PS, func(p string) { kit.If(nfs.Exists(ice.Pulse, p), func() { init = StackHandler }) })
|
kit.IfNoKey(loaded, ice.SRC_SCRIPT+c.Prefix(key)+nfs.PS, func(p string) { kit.If(nfs.Exists(ice.Pulse, p), func() { init = StackHandler }) })
|
||||||
|
6
conf.go
6
conf.go
@ -108,7 +108,6 @@ const ( // DIR
|
|||||||
|
|
||||||
ISH_PLUGED = ".ish/pluged/"
|
ISH_PLUGED = ".ish/pluged/"
|
||||||
USR_MODULES = "usr/node_modules/"
|
USR_MODULES = "usr/node_modules/"
|
||||||
USR_SCRIPT = "usr/script/"
|
|
||||||
USR_INSTALL = "usr/install/"
|
USR_INSTALL = "usr/install/"
|
||||||
USR_REQUIRE = "usr/require/"
|
USR_REQUIRE = "usr/require/"
|
||||||
USR_PUBLISH = "usr/publish/"
|
USR_PUBLISH = "usr/publish/"
|
||||||
@ -118,6 +117,7 @@ const ( // DIR
|
|||||||
USR_TOOLKITS = "usr/toolkits/"
|
USR_TOOLKITS = "usr/toolkits/"
|
||||||
USR_VOLCANOS = "usr/volcanos/"
|
USR_VOLCANOS = "usr/volcanos/"
|
||||||
USR_LEARNING = "usr/learning/"
|
USR_LEARNING = "usr/learning/"
|
||||||
|
USR_PORTAL = "usr/portal/"
|
||||||
|
|
||||||
USR_LOCAL = "usr/local/"
|
USR_LOCAL = "usr/local/"
|
||||||
USR_LOCAL_GO = "usr/local/go/"
|
USR_LOCAL_GO = "usr/local/go/"
|
||||||
@ -146,9 +146,6 @@ const ( // DIR
|
|||||||
ETC_EXIT_SHY = "etc/exit.shy"
|
ETC_EXIT_SHY = "etc/exit.shy"
|
||||||
ETC_MISS_SH = "etc/miss.sh"
|
ETC_MISS_SH = "etc/miss.sh"
|
||||||
ETC_PATH = "etc/path"
|
ETC_PATH = "etc/path"
|
||||||
SRC_HELP = "src/help/"
|
|
||||||
SRC_DEBUG = "src/debug/"
|
|
||||||
SRC_RELEASE = "src/release/"
|
|
||||||
SRC_MAIN_SHY = "src/main.shy"
|
SRC_MAIN_SHY = "src/main.shy"
|
||||||
SRC_MAIN_SH = "src/main.sh"
|
SRC_MAIN_SH = "src/main.sh"
|
||||||
SRC_MAIN_JS = "src/main.js"
|
SRC_MAIN_JS = "src/main.js"
|
||||||
@ -159,6 +156,7 @@ const ( // DIR
|
|||||||
SRC_DOCUMENT = "src/document/"
|
SRC_DOCUMENT = "src/document/"
|
||||||
SRC_TEMPLATE = "src/template/"
|
SRC_TEMPLATE = "src/template/"
|
||||||
SRC_SCRIPT = "src/script/"
|
SRC_SCRIPT = "src/script/"
|
||||||
|
USR_SCRIPT = "usr/script/"
|
||||||
README_MD = "README.md"
|
README_MD = "README.md"
|
||||||
MAKEFILE = "Makefile"
|
MAKEFILE = "Makefile"
|
||||||
LICENSE = "LICENSE"
|
LICENSE = "LICENSE"
|
||||||
|
@ -64,7 +64,7 @@ func init() {
|
|||||||
"scanQRCode": {Name: "favor create", Help: "扫码"},
|
"scanQRCode": {Name: "favor create", Help: "扫码"},
|
||||||
"record1": {Name: "favor upload", Help: "截图"},
|
"record1": {Name: "favor upload", Help: "截图"},
|
||||||
"record2": {Name: "favor upload", Help: "录屏"},
|
"record2": {Name: "favor upload", Help: "录屏"},
|
||||||
mdb.CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create type name text*", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if strings.HasPrefix(m.Option(mdb.TEXT), ice.HTTP) {
|
if strings.HasPrefix(m.Option(mdb.TEXT), ice.HTTP) {
|
||||||
m.OptionDefault(mdb.TYPE, mdb.LINK, mdb.NAME, kit.ParseURL(m.Option(mdb.TEXT)).Host)
|
m.OptionDefault(mdb.TYPE, mdb.LINK, mdb.NAME, kit.ParseURL(m.Option(mdb.TEXT)).Host)
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package macos
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
@ -26,7 +27,7 @@ func init() {
|
|||||||
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "桌面")) })
|
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "桌面")) })
|
||||||
}},
|
}},
|
||||||
}, CmdHashAction(), mdb.ImportantHashAction())},
|
}, aaa.RoleAction(ctx.COMMAND, ctx.RUN), CmdHashAction(), mdb.ImportantHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package macos
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
)
|
)
|
||||||
@ -19,7 +20,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { mdb.HashExport(m) }},
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { mdb.HashExport(m) }},
|
||||||
}, CmdHashAction(), mdb.ImportantHashAction())}})
|
}, aaa.RoleAction(), CmdHashAction(), mdb.ImportantHashAction())}})
|
||||||
}
|
}
|
||||||
|
|
||||||
func DockAppend(m *ice.Message, name, index string, arg ...string) {
|
func DockAppend(m *ice.Message, name, index string, arg ...string) {
|
||||||
|
@ -12,7 +12,7 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
FINDER: {Name: "finder list", Actions: ice.MergeActions(ice.Actions{
|
FINDER: {Name: "finder list", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, DESKTOP, m.MergePodCmd("", DESKTOP)} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, DESKTOP, m.MergePodCmd("", DESKTOP)} })
|
||||||
}},
|
}},
|
||||||
}, CmdHashAction(mdb.NAME))},
|
}, CmdHashAction(mdb.NAME))},
|
||||||
})
|
})
|
||||||
|
@ -2,6 +2,7 @@ package macos
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ const MENU = "menu"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
MENU: {Actions: ice.MergeActions(CmdHashAction(), mdb.ImportantHashAction())},
|
MENU: {Actions: ice.MergeActions(aaa.RoleAction(), CmdHashAction(), mdb.ImportantHashAction())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func MenuAppend(m *ice.Message, name, index string, arg ...string) {
|
func MenuAppend(m *ice.Message, name, index string, arg ...string) {
|
||||||
|
@ -13,7 +13,7 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
PORTAL: {Name: "portal path auto", Help: "门户", Actions: ice.MergeActions(ice.Actions{
|
PORTAL: {Name: "portal path auto", Help: "门户", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, PORTAL, m.MergePodCmd("", "") + nfs.PS} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, PORTAL, m.MergePodCmd("", "") + nfs.PS} })
|
||||||
}},
|
}},
|
||||||
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { web.RenderMain(m) }},
|
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { web.RenderMain(m) }},
|
||||||
}), Hand: func(m *ice.Message, arg ...string) {}},
|
}), Hand: func(m *ice.Message, arg ...string) {}},
|
||||||
|
@ -43,7 +43,7 @@ func init() {
|
|||||||
COMPILE: {Name: "compile arch=amd64,386,arm,arm64,mipsle os=linux,darwin,windows src=src/main.go@key run binpack webpack devpack install", Help: "编译", Actions: ice.MergeActions(ice.Actions{
|
COMPILE: {Name: "compile arch=amd64,386,arm,arm64,mipsle os=linux,darwin,windows src=src/main.go@key run binpack webpack devpack install", Help: "编译", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { cli.IsAlpine(m, GO, "go git") }},
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { cli.IsAlpine(m, GO, "go git") }},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string {
|
mdb.IsSearchPreview(m, arg, func() []string {
|
||||||
return []string{ice.CMD, m.CommandKey(), kit.Format(kit.Simple(runtime.GOARCH, runtime.GOOS))}
|
return []string{ice.CMD, m.CommandKey(), kit.Format(kit.Simple(runtime.GOARCH, runtime.GOOS))}
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
|
@ -60,14 +60,14 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
VIMER: {Name: "vimer path=src/@key file=main.go line=1 list", Help: "编辑器", Meta: kit.Dict(ctx.STYLE, INNER), Actions: ice.MergeActions(ice.Actions{
|
VIMER: {Name: "vimer path=src/@key file=main.go line=1 list", Help: "编辑器", Meta: kit.Dict(ctx.STYLE, INNER), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_SH)
|
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_SH)
|
||||||
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_SHY)
|
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_SHY)
|
||||||
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_GO)
|
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_GO)
|
||||||
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_JS)
|
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, "main", mdb.TEXT, ice.SRC_MAIN_JS)
|
||||||
m.PushSearch(mdb.TYPE, web.LINK, mdb.NAME, "admin", mdb.TEXT, web.MergeURL2(m, nfs.PS))
|
m.PushSearch(mdb.TYPE, web.LINK, mdb.NAME, "admin", mdb.TEXT, web.MergeURL2(m, nfs.PS))
|
||||||
}
|
}
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch m.Option(ctx.ACTION) {
|
switch m.Option(ctx.ACTION) {
|
||||||
|
@ -79,14 +79,14 @@ func init() {
|
|||||||
kit.If(m.Cmd("").Length() == 0, func() { m.Cmd("", mdb.CREATE, mdb.TYPE, ISH) })
|
kit.If(m.Cmd("").Length() == 0, func() { m.Cmd("", mdb.CREATE, mdb.TYPE, ISH) })
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string {
|
mdb.IsSearchPreview(m, arg, func() []string {
|
||||||
if nfs.Exists(m, "/bin/bash") {
|
if nfs.Exists(m, "/bin/bash") {
|
||||||
return []string{ssh.SHELL, BASH, "/bin/bash"}
|
return []string{ssh.SHELL, BASH, "/bin/bash"}
|
||||||
} else {
|
} else {
|
||||||
return []string{ssh.SHELL, SH, "/bin/sh"}
|
return []string{ssh.SHELL, SH, "/bin/sh"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{ssh.SHELL, ISH, "/bin/ish"} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{ssh.SHELL, ISH, "/bin/ish"} })
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch mdb.HashInputs(m, arg); arg[0] {
|
switch mdb.HashInputs(m, arg); arg[0] {
|
||||||
|
@ -59,7 +59,7 @@ func init() {
|
|||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }},
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }},
|
||||||
mdb.PLUGIN: {Name: "plugin extra.index extra.args", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }},
|
mdb.PLUGIN: {Name: "plugin extra.index extra.args", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||||
}},
|
}},
|
||||||
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.PrefixKey(), ice.RUN, arg) {
|
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.PrefixKey(), ice.RUN, arg) {
|
||||||
|
@ -20,7 +20,7 @@ func init() {
|
|||||||
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.TYPE, nfs.SVG, mdb.NAME, m.PrefixKey())
|
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.TYPE, nfs.SVG, mdb.NAME, m.PrefixKey())
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||||
}},
|
}},
|
||||||
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
defer m.Echo("<html><body>").Echo("</body></html>")
|
defer m.Echo("<html><body>").Echo("</body></html>")
|
||||||
|
@ -1,33 +1,27 @@
|
|||||||
fieldset.web.wiki.portal { --portal-max-width:1200px; --portal-header-height:64px; }
|
fieldset.web.wiki.portal { --portal-max-width:1200px; --portal-header-height:64px; } fieldset.web.wiki.portal.home { --portal-max-width:1500px; }
|
||||||
fieldset.web.wiki.portal.home { --portal-max-width:1400px; }
|
fieldset.web.wiki.portal>div.output { padding:0; }
|
||||||
fieldset.web.wiki.portal>div.output>div.header { background-color:rgb(22 31 49); color:var(--code-fg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); }
|
fieldset.web.wiki.portal>div.output>div.header { background-color:rgb(22 31 49); color:var(--code-fg-color); height:var(--portal-header-height); --hover-bg-color:var(--plugin-bg-color); }
|
||||||
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { display:flex; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] { display:flex; justify-content:center; }
|
||||||
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { padding:20px; height:var(--portal-header-height); }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item { padding:20px; height:var(--portal-header-height); }
|
||||||
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.space { padding:0px; margin:0 40px; }
|
fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.item.space { padding:0px; margin:0 40px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout { display:flex; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.layout { display:flex; justify-content:center; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav { padding:40px 40px; border-right:lightgray solid 1px; overflow:auto; min-width:240px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav { padding:40px 40px; border-right:lightgray solid 1px; min-width:240px; overflow:auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:5px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:5px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:20px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:20px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:40px; height:600px; min-width:400px; max-width:var(--portal-max-width); overflow:auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:40px; height:600px; min-width:400px; max-width:var(--portal-max-width); overflow:auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside { padding:40px 20px; overflow:auto; min-width:200px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside { padding:40px 20px; min-width:200px; overflow:auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item { padding:5px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item { padding:5px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.section { padding-left:20px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.section { padding-left:20px; }
|
||||||
body.dark fieldset.web.wiki.portal>div.output>div.layout { background-color:var(--plugin-bg-color); --code-bg-color:var(--output-bg-color); }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout { background-color:var(--plugin-bg-color); --code-bg-color:var(--output-bg-color); }
|
||||||
body.dark fieldset.web.wiki.portal>div.output>div.layout>div.nav { border-right:gray solid 1px; }
|
body.dark fieldset.web.wiki.portal>div.output>div.layout>div.nav { border-right:gray solid 1px; }
|
||||||
|
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main>div.story.flex>* { padding:20px; }
|
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main div.story.flex { display:flex; justify-content:center; }
|
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main h2 { text-align:center; }
|
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main>h2 { margin-top:40px; }
|
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; text-align:center; }
|
fieldset.web.wiki.portal.home>div.output>div.layout>div.main p { white-space:pre-wrap; text-align:center; }
|
||||||
fieldset.web.wiki.portal.home>div.output>div.layout>div.main input.story[type=button] { font-family:system-ui; font-weight:bold; padding:20px 40px; margin:10px; height:64px; }
|
|
||||||
|
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main>* { margin:20px auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main>* { margin:10px auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main h2 { margin-top:20px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main h2 { margin-top:40px; }
|
||||||
|
fieldset.web.wiki.portal>div.output>div.layout>div.main h3 { margin-top:20px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main p code { background-color:var(--code-bg-color); color:var(--code-fg-color); padding:0 10px; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main p code { background-color:var(--code-bg-color); color:var(--code-fg-color); padding:0 10px; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { background-color:var(--code-bg-color); color:var(--code-fg-color); margin:10px auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { background-color:var(--code-bg-color); color:var(--code-fg-color); margin:10px auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main table { width:100%; text-align:center; }
|
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main iframe { height:50%; width:100%; }
|
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset:not(.hide) { display:flex; flex-wrap:wrap; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset:not(.hide) { display:flex; flex-wrap:wrap; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content {
|
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content {
|
||||||
background-color:var(--code-bg-color);
|
background-color:var(--code-bg-color);
|
||||||
|
@ -21,20 +21,20 @@ func init() {
|
|||||||
INDEX_SHY = "index.shy"
|
INDEX_SHY = "index.shy"
|
||||||
)
|
)
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
PORTAL: {Name: "portal path auto", Help: "网站/门户", Actions: ice.MergeActions(ice.Actions{
|
PORTAL: {Name: "portal path auto", Help: "网站门户", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, PORTAL, m.MergePodCmd("", "") + nfs.PS} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, PORTAL, m.MergePodCmd("", "") + nfs.PS} })
|
||||||
}},
|
}},
|
||||||
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { web.RenderCmd(m, "", arg) }},
|
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { web.RenderCmd(m, "", arg) }},
|
||||||
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if p := path.Join("usr/portal/", path.Join(arg...)); nfs.ExistsFile(m, p) && !(m.Option(ice.DEBUG) == ice.TRUE && aaa.Right(m.Spawn(), arg)) {
|
if p := path.Join(ice.USR_PORTAL, path.Join(arg...)); nfs.ExistsFile(m, p) && !(m.Option(ice.DEBUG) == ice.TRUE && aaa.Right(m.Spawn(), arg)) {
|
||||||
m.Copy(m.Spawn([]byte(m.Cmdx(nfs.CAT, p))))
|
m.Copy(m.Spawn([]byte(m.Cmdx(nfs.CAT, p))))
|
||||||
} else {
|
} else {
|
||||||
ctx.Run(m, arg...)
|
ctx.Run(m, arg...)
|
||||||
m.Cmd(nfs.SAVE, p, kit.Dict(nfs.CONTENT, m.FormatMeta()))
|
m.Cmd(nfs.SAVE, p, kit.Dict(nfs.CONTENT, m.FormatMeta()))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, ctx.CmdAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, aaa.RoleAction(ctx.COMMAND, ctx.RUN), ctx.CmdAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Push(HEADER, m.Cmdx(WORD, path.Join(nfs.SRC_DOCUMENT, INDEX_SHY))); len(arg) > 0 {
|
if m.Push(HEADER, m.Cmdx(WORD, path.Join(nfs.SRC_DOCUMENT, INDEX_SHY))); len(arg) > 0 {
|
||||||
m.Push(NAV, m.Cmdx(WORD, path.Join(nfs.SRC_DOCUMENT, path.Join(arg...), INDEX_SHY)))
|
m.Push(NAV, m.Cmdx(WORD, path.Join(nfs.SRC_DOCUMENT, path.Join(arg...), INDEX_SHY)))
|
||||||
}
|
}
|
||||||
|
@ -25,17 +25,11 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
select = target, can.onmotion.select(can, can.ui.aside, html.DIV_ITEM, target._menu)
|
select = target, can.onmotion.select(can, can.ui.aside, html.DIV_ITEM, target._menu)
|
||||||
} })
|
} })
|
||||||
} },
|
} },
|
||||||
layout: function(can, height, width) { can.onmotion.delay(can, function() {
|
|
||||||
if (can.isCmdMode()) { can.onappend.style(can, html.OUTPUT), can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
|
||||||
can.ui.layout(height, width), can.ConfHeight(can.ui.main.offsetHeight), can.ConfWidth(can.ui.main.offsetWidth)
|
|
||||||
can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width")||(can.ConfWidth()-2*can.Conf(html.PADDING)), true) })
|
|
||||||
}, 100) },
|
|
||||||
navmenu: function(can, meta, target) {
|
navmenu: function(can, meta, target) {
|
||||||
can.onimport.list(can, can.base.Obj(meta.data), function(event, item) {
|
can.onimport.list(can, can.base.Obj(meta.data), function(event, item) {
|
||||||
can.page.Select(can, target, html.DIV_ITEM, function(target) { target != event.target && can.page.ClassList.del(can, target, html.SELECT) })
|
can.page.Select(can, target, html.DIV_ITEM, function(target) { target != event.target && can.page.ClassList.del(can, target, html.SELECT) })
|
||||||
item.list && item.list.length > 0 || can.onaction.route(event, can, item.meta.link)
|
item.list && item.list.length > 0 || can.onaction.route(event, can, item.meta.link)
|
||||||
}, target, can.page.ClassList.has(can, target.parentNode, html.HEADER)? function(target, item) {
|
}, target, can.page.ClassList.has(can, target.parentNode, html.HEADER)? function(target, item) {
|
||||||
if (item.meta.name == "_") { target.innerHTML = "", can.onappend.style(can, html.SPACE, target) }
|
|
||||||
item.meta.link == nfs.SRC_DOCUMENT+can.db.current && can.onappend.style(can, html.SELECT, target)
|
item.meta.link == nfs.SRC_DOCUMENT+can.db.current && can.onappend.style(can, html.SELECT, target)
|
||||||
}: function(target, item) { can.db.nav[can.base.trimPrefix(item.meta.link, nfs.SRC_DOCUMENT)] = target
|
}: function(target, item) { can.db.nav[can.base.trimPrefix(item.meta.link, nfs.SRC_DOCUMENT)] = target
|
||||||
location.hash || item.list && item.list.length > 0 || can.onaction.route({}, can, item.meta.link, true)
|
location.hash || item.list && item.list.length > 0 || can.onaction.route({}, can, item.meta.link, true)
|
||||||
@ -44,24 +38,18 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
button: function(can, meta, target) { var item = can.base.Obj(meta.meta)
|
button: function(can, meta, target) { var item = can.base.Obj(meta.meta)
|
||||||
target.onclick = function(event) { can.onaction.route(event, can, item.route) }
|
target.onclick = function(event) { can.onaction.route(event, can, item.route) }
|
||||||
},
|
},
|
||||||
field: function(can, meta, target) { var item = can.base.Obj(meta.meta), width = item.width
|
|
||||||
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
|
|
||||||
sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width", width)||(can.ConfWidth()-2*can.Conf(html.PADDING)), true)
|
|
||||||
}, can.ui.main, target)
|
|
||||||
},
|
|
||||||
content: function(can, file) {
|
content: function(can, file) {
|
||||||
can.runActionCommand(event, web.WIKI_WORD, [nfs.SRC_DOCUMENT+can.db.current+file], function(msg) { can.ui.main.innerHTML = msg.Result(), can.onmotion.clear(can, can.ui.aside)
|
can.runActionCommand(event, web.WIKI_WORD, [nfs.SRC_DOCUMENT+can.db.current+file], function(msg) { can.ui.main.innerHTML = msg.Result(), can.onmotion.clear(can, can.ui.aside)
|
||||||
can.page.Select(can, can.ui.main, wiki.STORY_ITEM, function(target) { var meta = target.dataset||{}
|
can.onimport._display(can, can.ui.main, function(target, meta) {
|
||||||
meta.type == wiki.TITLE && can.onappend.style(can, meta.name, target._menu = can.onimport.item(can, {name: meta.text}, function(event) { target.scrollIntoView() }, function() {}, can.ui.aside))
|
meta.type == wiki.TITLE && can.onappend.style(can, meta.name, target._menu = can.onimport.item(can, {name: meta.text}, function(event) { target.scrollIntoView() }, function() {}, can.ui.aside))
|
||||||
can.core.CallFunc([can.onimport, can.onimport[meta.name]? meta.name: meta.type||target.tagName.toLowerCase()], [can, meta, target, can.ui.main.offsetWidth-80])
|
|
||||||
var _meta = can.base.Obj(meta.meta); _meta && _meta.style && can.page.style(can, target, can.base.Obj(_meta.style))
|
|
||||||
meta.style && can.page.style(can, target, can.base.Obj(meta.style))
|
|
||||||
}), can.onmotion.select(can, can.ui.aside, html.DIV_ITEM, 0)
|
}), can.onmotion.select(can, can.ui.aside, html.DIV_ITEM, 0)
|
||||||
can.page.Select(can, can.ui.main, "a", function(target) {
|
|
||||||
target.innerText = target.innerText || target.href, target.href = target.href || target.innerText, target.target = target || "_blank"
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
layout: function(can, height, width) { can.onmotion.delay(can, function() { padding = can.Conf(html.PADDING)
|
||||||
|
if (can.isCmdMode()) { can.onappend.style(can, html.OUTPUT), can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
||||||
|
can.ui.layout(height, width), can.ConfHeight(can.ui.main.offsetHeight), can.ConfWidth(can.ui.main.offsetWidth)
|
||||||
|
can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width")||(can.ConfWidth()-2*padding), true) })
|
||||||
|
}, 100) },
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {
|
Volcanos(chat.ONACTION, {
|
||||||
route: function(event, can, route, internal) {
|
route: function(event, can, route, internal) {
|
||||||
|
@ -103,7 +103,7 @@ func init() {
|
|||||||
if arg[0] == "shell" && meta["with"] == "echo" {
|
if arg[0] == "shell" && meta["with"] == "echo" {
|
||||||
m.Option("echo", m.Cmdx(cli.SYSTEM, kit.Split(arg[1])))
|
m.Option("echo", m.Cmdx(cli.SYSTEM, kit.Split(arg[1])))
|
||||||
}
|
}
|
||||||
_spark_show(m, arg[0], strings.TrimSpace(arg[1]))
|
_spark_show(m, arg[0], strings.TrimSpace(arg[1]), arg[2:]...)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -20,8 +20,12 @@ func _name(m *ice.Message, arg []string) []string {
|
|||||||
}
|
}
|
||||||
func _option(m *ice.Message, kind, name, text string, arg ...string) *ice.Message {
|
func _option(m *ice.Message, kind, name, text string, arg ...string) *ice.Message {
|
||||||
extra := kit.Dict()
|
extra := kit.Dict()
|
||||||
kit.For(arg, func(k, v string) { extra[k] = kit.Format(kit.Parse(nil, "", kit.Split(v)...)) })
|
kit.For(arg, func(k, v string) {
|
||||||
return m.Options(mdb.TYPE, kind, mdb.NAME, name, mdb.TEXT, text, mdb.EXTRA, extra)
|
kit.If(k == "fg", func() { k = "style.color" })
|
||||||
|
kit.If(k == "bg", func() { k = "style.background" })
|
||||||
|
kit.Value(extra, k, kit.Format(kit.Parse(nil, "", kit.Split(v)...)))
|
||||||
|
})
|
||||||
|
return m.Options(mdb.TYPE, kind, mdb.NAME, name, mdb.TEXT, text, mdb.EXTRA, kit.Format(extra))
|
||||||
}
|
}
|
||||||
func _wiki_path(m *ice.Message, arg ...string) string {
|
func _wiki_path(m *ice.Message, arg ...string) string {
|
||||||
return path.Join(mdb.Config(m, nfs.PATH), path.Join(arg...))
|
return path.Join(mdb.Config(m, nfs.PATH), path.Join(arg...))
|
||||||
|
@ -35,7 +35,7 @@ func init() {
|
|||||||
WordAlias(m, SEQUENCE, CHART, SEQUENCE)
|
WordAlias(m, SEQUENCE, CHART, SEQUENCE)
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(git.REPOS, ice.OptionFields(nfs.PATH)).Table(func(value ice.Maps) {
|
m.Cmd(git.REPOS, ice.OptionFields(nfs.PATH)).Table(func(value ice.Maps) {
|
||||||
|
@ -23,7 +23,7 @@ type server struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s server) Search(m *ice.Message, arg ...string) {
|
func (s server) Search(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchForEach(m.Message, arg, nil) {
|
if mdb.IsSearchPreview(m.Message, arg, nil) {
|
||||||
s.Code.List(m.Spawn(kit.Dict(ice.MSG_FIELDS, "time,port,status,pid,cmd,dir")), "")
|
s.Code.List(m.Spawn(kit.Dict(ice.MSG_FIELDS, "time,port,status,pid,cmd,dir")), "")
|
||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
m.PushSearch(mdb.TYPE, value[cli.STATUS], mdb.NAME, value[nfs.PATH], mdb.TEXT, value[mdb.LINK])
|
m.PushSearch(mdb.TYPE, value[cli.STATUS], mdb.NAME, value[nfs.PATH], mdb.TEXT, value[mdb.LINK])
|
||||||
|
@ -391,7 +391,7 @@ func init() {
|
|||||||
_repos_insert(m, kit.Path(""))
|
_repos_insert(m, kit.Path(""))
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
|
@ -127,7 +127,7 @@ func init() {
|
|||||||
m.Cmd(nfs.DIR, ice.USR_LOCAL_REPOS, func(value ice.Maps) { _repos_insert(m, value[nfs.PATH]) })
|
m.Cmd(nfs.DIR, ice.USR_LOCAL_REPOS, func(value ice.Maps) { _repos_insert(m, value[nfs.PATH]) })
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.IsSearchForEach(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
mdb.IsSearchPreview(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
||||||
}},
|
}},
|
||||||
mdb.CREATE: {Name: "create name*=demo", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create name*=demo", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_repos_init(m, _service_path(m, m.Option(mdb.NAME)))
|
_repos_init(m, _service_path(m, m.Option(mdb.NAME)))
|
||||||
|
@ -25,10 +25,10 @@ func (s node) Init(m *ice.Message) {
|
|||||||
}
|
}
|
||||||
func (s node) Install(m *ice.Message, arg ...string) {
|
func (s node) Install(m *ice.Message, arg ...string) {
|
||||||
s.Code.Install(m, arg...)
|
s.Code.Install(m, arg...)
|
||||||
s.Code.System(m, nfs.USR_INSTALL, nfs.TAR, "xf", path.Base(s.Code.Link(m)))
|
s.Code.System(m, ice.USR_INSTALL, nfs.TAR, "xf", path.Base(s.Code.Link(m)))
|
||||||
}
|
}
|
||||||
func (s node) List(m *ice.Message, arg ...string) {
|
func (s node) List(m *ice.Message, arg ...string) {
|
||||||
s.Code.Source(m, path.Join(nfs.USR_INSTALL, kit.TrimExt(s.Code.Link(m), "tar.xz")), arg...)
|
s.Code.Source(m, path.Join(ice.USR_INSTALL, kit.TrimExt(s.Code.Link(m), "tar.xz")), arg...)
|
||||||
}
|
}
|
||||||
func (s node) Xterm(m *ice.Message, arg ...string) {
|
func (s node) Xterm(m *ice.Message, arg ...string) {
|
||||||
s.Code.Xterm(m, []string{mdb.TYPE, NODE}, arg...)
|
s.Code.Xterm(m, []string{mdb.TYPE, NODE}, arg...)
|
||||||
|
@ -85,7 +85,7 @@ func init() {
|
|||||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) { m.Cmd("", mdb.CREATE) }},
|
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) { m.Cmd("", mdb.CREATE) }},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
return
|
return
|
||||||
if mdb.IsSearchForEach(m, arg, nil) {
|
if mdb.IsSearchPreview(m, arg, nil) {
|
||||||
m.Cmd("", ice.OptionFields(""), func(value ice.Maps) {
|
m.Cmd("", ice.OptionFields(""), func(value ice.Maps) {
|
||||||
m.PushSearch(mdb.TYPE, ssh.SHELL, mdb.NAME, value[SESSION], mdb.TEXT, "tmux attach -t "+value[SESSION], value)
|
m.PushSearch(mdb.TYPE, ssh.SHELL, mdb.NAME, value[SESSION], mdb.TEXT, "tmux attach -t "+value[SESSION], value)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user