forked from x/icebergs
opt some
This commit is contained in:
parent
19d6bb332e
commit
0a1f231ca3
@ -12,8 +12,11 @@ import (
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
PROCINFO: {Name: "procinfo PID auto filter:text", Help: "进程列表", Actions: ice.MergeActions(ice.Actions{
|
||||
PROCKILL: {Help: "结束进程", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(gdb.SIGNAL, gdb.STOP, m.Option("PID")).ProcessRefresh() }},
|
||||
PROCINFO: {Name: "procinfo PID auto filter:text docker monitor terminal", Help: "进程列表", Actions: ice.MergeActions(ice.Actions{
|
||||
PROCKILL: {Help: "结束进程", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(gdb.SIGNAL, gdb.STOP, m.Option("PID")).ProcessRefresh() }},
|
||||
"terminal": {Help: "终端", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Terminal.app") }},
|
||||
"monitor": {Help: "监控", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Activity Monitor.app") }},
|
||||
"docker": {Help: "容器", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Docker Desktop.app") }},
|
||||
}), Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 || arg[0] == "" {
|
||||
m.Split(m.Cmdx(SYSTEM, "ps", "u")).PushAction(PROCKILL).Sort("COMMAND").StatusTimeCount(m.Cmd(RUNTIME, HOSTINFO).AppendSimple("nCPU,MemTotal,MemFree"))
|
||||
|
@ -147,13 +147,13 @@ const RUNTIME = "runtime"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,procstat,procinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain,routine auto dark system finder docker monitor terminal", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
||||
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,procstat,procinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain,routine auto", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
aaa.White(m, ice.ETC_PATH)
|
||||
aaa.White(m, ice.LICENSE)
|
||||
_runtime_init(m)
|
||||
}},
|
||||
IFCONFIG: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy("tcp.host") }},
|
||||
IFCONFIG: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(tcp.HOST) }},
|
||||
DISKINFO: {Hand: func(m *ice.Message, arg ...string) { _runtime_diskinfo(m) }},
|
||||
HOSTINFO: {Hand: func(m *ice.Message, arg ...string) { _runtime_hostinfo(m) }},
|
||||
HOSTNAME: {Hand: func(m *ice.Message, arg ...string) {
|
||||
@ -197,9 +197,9 @@ func init() {
|
||||
m.StatusTimeCount()
|
||||
}},
|
||||
"routine": {Hand: func(m *ice.Message, arg ...string) {
|
||||
status := map[string]int{}
|
||||
buf := make([]byte, 4096*4096)
|
||||
runtime.Stack(buf, true)
|
||||
status := map[string]int{}
|
||||
outer:
|
||||
for _, v := range bytes.Split(buf, []byte(lex.NL+lex.NL)) {
|
||||
ls := bytes.Split(v, []byte(lex.NL))
|
||||
@ -235,17 +235,6 @@ func init() {
|
||||
m.Cmd(aaa.ROLE, func(value ice.Maps) { m.Push(mdb.KEY, kit.Keys(value[aaa.ROLE], value[mdb.ZONE], value[mdb.KEY])) })
|
||||
ctx.DisplayStorySpide(m.Options(nfs.DIR_ROOT, "ice."), mdb.FIELD, mdb.KEY, lex.SPLIT, nfs.PT)
|
||||
}},
|
||||
"terminal": {Help: "终端", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Terminal.app") }},
|
||||
"monitor": {Help: "监控", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Activity Monitor.app") }},
|
||||
"docker": {Help: "容器", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Docker Desktop.app") }},
|
||||
"finder": {Help: "资源", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Finder.app") }},
|
||||
"system": {Help: "系统", Hand: func(m *ice.Message, arg ...string) { Opens(m, "System Settings.app") }},
|
||||
"dark": {Help: "主题", Hand: func(m *ice.Message, arg ...string) {
|
||||
if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
|
||||
return
|
||||
}
|
||||
m.Cmd(SYSTEM, "osascript", "-e", `tell app "System Events" to tell appearance preferences to set dark mode to not dark mode`)
|
||||
}},
|
||||
}, ctx.CmdAction(), ctx.ConfAction("")), Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(len(arg) > 0 && arg[0] == BOOTINFO, func() { arg = arg[1:] })
|
||||
m.Cmdy(ctx.CONFIG, RUNTIME, arg)
|
||||
|
@ -184,9 +184,8 @@ func init() {
|
||||
}
|
||||
m.Cmdy(nfs.CAT, ice.ETC_PATH)
|
||||
}},
|
||||
FIND: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Echo(_system_find(m, arg[0], arg[1:]...))
|
||||
}},
|
||||
OPENS: {Hand: func(m *ice.Message, arg ...string) { Opens(m, arg...) }},
|
||||
FIND: {Hand: func(m *ice.Message, arg ...string) { m.Echo(_system_find(m, arg[0], arg[1:]...)) }},
|
||||
MAN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
arg = append(arg, "")
|
||||
|
@ -164,29 +164,14 @@ const DIR = "dir"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
DIR: {Name: "dir path auto upload", Help: "目录", Actions: ice.Actions{
|
||||
DIR: {Name: "dir path auto upload finder", Help: "目录", Actions: ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
aaa.White(m, ice.SRC, ice.BIN, ice.USR)
|
||||
aaa.Black(m, ice.USR_LOCAL)
|
||||
}},
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if mdb.IsSearchPreview(m, arg, nil) && m.Cmdx("host", "islocal", m.Option(ice.MSG_USERIP)) == ice.OK {
|
||||
return
|
||||
kit.For([]string{"Desktop", "Documents", "Downloads", "Pictures"}, func(p string) {
|
||||
p = kit.HomePath(p)
|
||||
m.Cmd(DIR, PWD, mdb.NAME, mdb.TIME, kit.Dict(DIR_ROOT, p)).SortStrR(mdb.TIME).TablesLimit(5, func(value ice.Maps) {
|
||||
name := value[mdb.NAME]
|
||||
kit.If(len(kit.TrimExt(name)) > 30, func() { name = name[:10] + ".." + name[len(name)-10:] })
|
||||
m.PushSearch(mdb.TYPE, OPENS, mdb.NAME, name, mdb.TEXT, path.Join(p, value[mdb.NAME]))
|
||||
})
|
||||
})
|
||||
}
|
||||
}}, mdb.UPLOAD: {},
|
||||
TRASH: {Hand: func(m *ice.Message, arg ...string) { m.Cmd(TRASH, mdb.CREATE, m.Option(PATH)) }},
|
||||
mdb.SHOW: {Hand: func(m *ice.Message, arg ...string) {
|
||||
Show(m, m.Option(PATH))
|
||||
m.ProcessInner()
|
||||
}},
|
||||
"finder": {Help: "本机", Hand: func(m *ice.Message, arg ...string) { m.Cmd("cli.system", "opens", "Finder.app") }},
|
||||
TRASH: {Hand: func(m *ice.Message, arg ...string) { m.Cmd(TRASH, mdb.CREATE, m.Option(PATH)) }},
|
||||
mdb.SHOW: {Hand: func(m *ice.Message, arg ...string) { Show(m.ProcessInner(), m.Option(PATH)) }},
|
||||
}, Hand: func(m *ice.Message, arg ...string) {
|
||||
root, dir := kit.Select(PWD, m.Option(DIR_ROOT)), kit.Select(PWD, arg, 0)
|
||||
kit.If(strings.HasPrefix(dir, PS), func() { root = "" })
|
||||
|
@ -138,7 +138,9 @@ func init() {
|
||||
_dream_start(m, m.OptionDefault(mdb.NAME, path.Base(m.Option(nfs.REPOS))))
|
||||
}
|
||||
}},
|
||||
cli.START: {Hand: func(m *ice.Message, arg ...string) { _dream_start(m, m.Option(mdb.NAME)) }},
|
||||
cli.START: {Hand: func(m *ice.Message, arg ...string) {
|
||||
_dream_start(m, m.Option(mdb.NAME))
|
||||
}},
|
||||
cli.STOP: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(SPACE, mdb.MODIFY, m.OptionSimple(mdb.NAME), mdb.STATUS, cli.STOP)
|
||||
m.Go(func() { m.Cmd(SPACE, m.Option(mdb.NAME), ice.EXIT) })
|
||||
|
@ -122,10 +122,12 @@ func RenderMain(m *ice.Message) *ice.Message {
|
||||
if m.IsCliUA() {
|
||||
return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH))
|
||||
}
|
||||
return RenderTemplate(m.Options(nfs.VERSION, renderVersion(m)), "main.html")
|
||||
m.OptionDefault(nfs.VERSION, RenderVersion(m))
|
||||
return RenderTemplate(m, "main.html")
|
||||
}
|
||||
func RenderCmds(m *ice.Message, list ...ice.Any) {
|
||||
RenderTemplate(m.Options(nfs.VERSION, renderVersion(m), mdb.LIST, kit.Format(list)), "cmds.html")
|
||||
m.OptionDefault(nfs.VERSION, RenderVersion(m))
|
||||
RenderTemplate(m.Options(mdb.LIST, kit.Format(list)), "cmds.html")
|
||||
}
|
||||
func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
||||
msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.PrefixKey(), cmd))
|
||||
@ -135,7 +137,7 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
||||
))
|
||||
}
|
||||
func RenderCmd(m *ice.Message, cmd string, arg ...ice.Any) { RenderPodCmd(m, "", cmd, arg...) }
|
||||
func renderVersion(m *ice.Message) string {
|
||||
func RenderVersion(m *ice.Message) string {
|
||||
if ice.Info.Make.Hash == "" {
|
||||
return ""
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ const SERVE = "serve"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
"/exit": {Hand: func(m *ice.Message, arg ...string) { m.Cmd(ice.EXIT) }},
|
||||
SERVE: {Name: "serve name auto start", Help: "服务器", Actions: ice.MergeActions(ice.Actions{
|
||||
SERVE: {Name: "serve name auto start dark system", Help: "服务器", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
cli.NodeInfo(m, ice.Info.Pathname, WORKER)
|
||||
gdb.Watch(m, SERVE_START)
|
||||
@ -194,6 +194,13 @@ func init() {
|
||||
ssh.PrintQRCode(m, tcp.PublishLocalhost(m, _serve_address(m)))
|
||||
})
|
||||
}},
|
||||
"system": {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }},
|
||||
"dark": {Help: "主题", Hand: func(m *ice.Message, arg ...string) {
|
||||
if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
|
||||
return
|
||||
}
|
||||
m.Cmd(cli.SYSTEM, "osascript", "-e", `tell app "System Events" to tell appearance preferences to set dark mode to not dark mode`)
|
||||
}},
|
||||
}, mdb.HashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,status,name,proto,host,port"), mdb.ClearOnExitHashAction())},
|
||||
})
|
||||
ice.AddMergeAction(func(c *ice.Context, key string, cmd *ice.Command, sub string, action *ice.Action) {
|
||||
|
@ -88,11 +88,6 @@ func _space_handle(m *ice.Message, safe bool, name string, c *websocket.Conn) {
|
||||
msg.Option(ice.MSG_USERROLE, aaa.VOID)
|
||||
}
|
||||
m.Go(func() { _space_exec(msg, source, target, c) }, strings.Join(kit.Simple(SPACE, name, msg.Detailv()), lex.SP))
|
||||
// if msg.Option("_exec") == "go" {
|
||||
// m.Go(func() { _space_exec(msg, source, target, c) }, strings.Join(kit.Simple(SPACE, name, msg.Detailv()), lex.SP))
|
||||
// } else {
|
||||
// _space_exec(msg, source, target, c)
|
||||
// }
|
||||
} else {
|
||||
done := false
|
||||
m.Warn(!mdb.HashSelectDetail(m, next, func(value ice.Map) {
|
||||
@ -174,7 +169,8 @@ func init() {
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { aaa.White(m, SPACE, ice.MAIN) }},
|
||||
ice.MAIN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(mdb.Config(m, ice.MAIN), func(cmd string) { RenderPodCmd(m, "", cmd) }, func() {
|
||||
m.RenderResult(nfs.Template(m.Options(nfs.VERSION, renderVersion(m)), "main.html"))
|
||||
m.OptionDefault(nfs.VERSION, RenderVersion(m))
|
||||
m.RenderResult(nfs.Template(m, "main.html"))
|
||||
})
|
||||
m.Optionv(ice.MSG_ARGS, kit.Simple(m.Optionv(ice.MSG_ARGS)))
|
||||
}},
|
||||
@ -222,16 +218,13 @@ func init() {
|
||||
if kit.IsIn(value[mdb.TYPE], CHROME, "send") {
|
||||
return
|
||||
}
|
||||
m.Push("", value, kit.Split("time,type,name,text"))
|
||||
m.Push("", value, kit.Split("time,type,name,text,status"))
|
||||
if kit.IsIn(value[mdb.TYPE], SERVER, WORKER) {
|
||||
m.Push(mdb.LINK, tcp.PublishLocalhost(m, m.MergePod(value[mdb.NAME])))
|
||||
} else {
|
||||
m.Push(mdb.LINK, "")
|
||||
}
|
||||
m.Debug("what %v", kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN))
|
||||
m.Debug("what %v", value)
|
||||
m.PushButton(kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN), mdb.REMOVE)
|
||||
m.Debug("what %v", m.FormatMeta())
|
||||
})
|
||||
kit.If(!m.IsCliUA(), func() { m.Cmdy("web.code.publish", "contexts", "misc") })
|
||||
kit.If(len(arg) == 1, func() { m.EchoIFrame(m.MergePod(arg[0])) })
|
||||
|
@ -3,19 +3,12 @@ package macos
|
||||
import (
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
)
|
||||
|
||||
const FINDER = "finder"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
FINDER: {Name: "finder list", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, DESKTOP, m.MergePodCmd("", DESKTOP)} })
|
||||
}},
|
||||
}, CmdHashAction(mdb.NAME))},
|
||||
})
|
||||
Index.MergeCommands(ice.Commands{FINDER: {Name: "finder list", Actions: CmdHashAction(mdb.NAME)}})
|
||||
}
|
||||
|
||||
func FinderAppend(m *ice.Message, name, index string, arg ...string) {
|
||||
|
@ -31,7 +31,7 @@ func init() {
|
||||
if m.Cmd(web.SPACE, arg[0]).Length() == 0 && nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, arg[0])) {
|
||||
m.Cmd(web.DREAM, cli.START, kit.Dict(mdb.NAME, arg[0]))
|
||||
}
|
||||
m.Cmdy(web.SPACE, arg[0], web.SPACE, ice.MAIN)
|
||||
m.Cmdy(web.SPACE, arg[0], web.SPACE, ice.MAIN, kit.Dict(nfs.VERSION, web.RenderVersion(m)))
|
||||
} else if arg[1] == CMD {
|
||||
web.RenderPodCmd(m, arg[0], arg[2], arg[3:])
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package chat
|
||||
|
||||
import (
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
)
|
||||
@ -12,12 +11,7 @@ const PORTAL = "portal"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
PORTAL: {Name: "portal path auto", Help: "门户", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
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) }},
|
||||
}), Hand: func(m *ice.Message, arg ...string) {
|
||||
web.RenderMain(m)
|
||||
}},
|
||||
}), Hand: func(m *ice.Message, arg ...string) { web.RenderMain(m) }},
|
||||
})
|
||||
}
|
||||
|
@ -65,9 +65,7 @@ func init() {
|
||||
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_JS)
|
||||
m.PushSearch(mdb.TYPE, web.LINK, mdb.NAME, "admin", mdb.TEXT, web.MergeURL2(m, nfs.PS))
|
||||
}
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||
}},
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch m.Option(ctx.ACTION) {
|
||||
|
@ -2,6 +2,7 @@ package code
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
@ -76,13 +77,7 @@ func init() {
|
||||
kit.If(m.Cmd("").Length() == 0, func() { m.Cmd("", mdb.CREATE, mdb.TYPE, ISH) })
|
||||
}},
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string {
|
||||
if nfs.Exists(m, "/bin/bash") {
|
||||
return []string{ssh.SHELL, BASH, "/bin/bash"}
|
||||
} else {
|
||||
return []string{ssh.SHELL, SH, "/bin/sh"}
|
||||
}
|
||||
})
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{ssh.SHELL, SH, kit.Select("/bin/sh", os.Getenv("SHELL"))} })
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{ssh.SHELL, ISH, "/bin/ish"} })
|
||||
}},
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -58,9 +58,6 @@ func init() {
|
||||
PLAN: {Name: "plan scale=week,day,week,month,year,long begin_time@date list prev next", Help: "计划表", Actions: ice.MergeActions(ice.Actions{
|
||||
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.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||
}},
|
||||
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.PrefixKey(), ice.RUN, arg) {
|
||||
return
|
||||
|
@ -20,9 +20,6 @@ func init() {
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.TYPE, nfs.SVG, mdb.NAME, m.PrefixKey())
|
||||
}},
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||
}},
|
||||
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
|
||||
defer m.Echo("<html><body>").Echo("</body></html>")
|
||||
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
||||
|
@ -22,9 +22,6 @@ func init() {
|
||||
)
|
||||
Index.MergeCommands(ice.Commands{
|
||||
PORTAL: {Name: "portal path auto", Help: "网站门户", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, PORTAL, m.MergePodCmd("", "")} })
|
||||
}},
|
||||
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { web.RenderCmd(m, "", arg) }},
|
||||
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if p := path.Join(ice.USR_PORTAL, path.Join(arg...)); (m.Option(ice.DEBUG) == ice.TRUE || !nfs.ExistsFile(m, p)) && aaa.Right(m.Spawn(), arg) {
|
||||
|
@ -1,12 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.require(["/plugin/local/wiki/word.js"]), can.Conf(html.PADDING, can.user.isMobile? 10: 40)
|
||||
can.db = {nav: {}}, can.sup.onexport.link = function() { return can.db.prefix }
|
||||
can.db.prefix = location.pathname.indexOf("/chat/cmd/web.wiki.portal/") == 0? "/chat/cmd/web.wiki.portal/":
|
||||
location.pathname.indexOf("/chat/cmd/web.wiki.portal") == 0? "/chat/cmd/web.wiki.portal": "/wiki/portal/"
|
||||
if (location.pathname.indexOf("/chat/pod/") == 0) { var args = can.misc.ParseURL(can)
|
||||
can.db.prefix = can.base.trimPrefix(can.misc.MergeURL(can, args)+"/", location.origin)
|
||||
}
|
||||
can.db.current = can.isCmdMode()? can.base.trimPrefix(location.pathname, can.db.prefix): can.Option(nfs.PATH)
|
||||
var p = "/cmd/web.wiki.portal"
|
||||
can.db.prefix = location.pathname.indexOf(p) > 0? location.pathname.split(p)[0]+p: "/wiki/portal"
|
||||
can.db.current = can.isCmdMode()? can.base.trimPrefix(location.pathname, can.db.prefix+"/", can.db.prefix): can.Option(nfs.PATH)
|
||||
can.onmotion.clear(can)
|
||||
can.ui = can.onappend.layout(can, [html.HEADER, [html.NAV, html.MAIN, html.ASIDE]], html.FLOW), can.onimport._scroll(can)
|
||||
can.ui.header.innerHTML = msg.Append(html.HEADER), can.ui.nav.innerHTML = msg.Append(html.NAV)
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/ssh"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/icebergs/core/code"
|
||||
"shylinux.com/x/icebergs/misc/git"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
@ -34,9 +33,6 @@ func init() {
|
||||
WordAlias(m, CHAIN, CHART, CHAIN)
|
||||
WordAlias(m, SEQUENCE, CHART, SEQUENCE)
|
||||
}},
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{web.LINK, m.CommandKey(), m.MergePodCmd("", "")} })
|
||||
}},
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(git.REPOS, ice.OptionFields(nfs.PATH)).Table(func(value ice.Maps) {
|
||||
if m.Option(nfs.DIR_DEEP, ice.TRUE); kit.Path(value[nfs.PATH]) == kit.Path("") {
|
||||
@ -47,14 +43,11 @@ func init() {
|
||||
})
|
||||
m.Cut("path,size,time")
|
||||
}}, "play": {Help: "演示"},
|
||||
ice.STORY: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(arg[0], ice.RUN, arg[2:])
|
||||
}},
|
||||
code.COMPLETE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ls := kit.Split(m.Option(mdb.TEXT))
|
||||
kit.If(kit.IsIn(ls[0], IMAGE, VIDEO, AUDIO), func() { m.Cmdy(FEEL).CutTo(nfs.PATH, mdb.NAME) })
|
||||
}},
|
||||
}, aaa.RoleAction("story.field"), ctx.CmdAction(), WikiAction("", nfs.SHY)), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, aaa.RoleAction(ctx.COMMAND, ctx.RUN), ctx.CmdAction(), WikiAction("", nfs.SHY)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Option(nfs.DIR_DEEP, ice.TRUE); len(arg) == 0 {
|
||||
arg = append(arg, nfs.SRC)
|
||||
}
|
||||
|
@ -390,9 +390,6 @@ func init() {
|
||||
m.Cmd(nfs.DIR, nfs.USR, func(value ice.Maps) { _repos_insert(m, value[nfs.PATH]) })
|
||||
_repos_insert(m, kit.Path(""))
|
||||
}},
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchPreview(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
||||
}},
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case COMMENT:
|
||||
|
@ -126,9 +126,6 @@ func init() {
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
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.IsSearchPreview(m, arg, func() []string { return []string{ice.CMD, m.PrefixKey()} })
|
||||
}},
|
||||
mdb.CREATE: {Name: "create name*=demo", Hand: func(m *ice.Message, arg ...string) {
|
||||
_repos_init(m, _service_path(m, m.Option(mdb.NAME)))
|
||||
_repos_insert(m, _service_path(m, m.Option(mdb.NAME)))
|
||||
|
@ -101,7 +101,7 @@ func (m *Message) ProcessRefresh(arg ...string) {
|
||||
func (m *Message) ProcessRewrite(arg ...Any) { m.Process(PROCESS_REWRITE, arg...) }
|
||||
func (m *Message) ProcessDisplay(arg ...Any) { m.Process(PROCESS_DISPLAY).Option(MSG_DISPLAY, arg...) }
|
||||
func (m *Message) ProcessField(arg ...Any) { m.Process(PROCESS_FIELD).Option(FIELD_PREFIX, arg...) }
|
||||
func (m *Message) ProcessInner() { m.Process(PROCESS_INNER) }
|
||||
func (m *Message) ProcessInner() *Message { return m.Process(PROCESS_INNER) }
|
||||
func (m *Message) ProcessAgain() { m.Process(PROCESS_AGAIN) }
|
||||
func (m *Message) ProcessHold(text ...Any) { m.Process(PROCESS_HOLD, text...) }
|
||||
func (m *Message) ProcessBack() { m.Process(PROCESS_BACK) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user