1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-09-16 12:04:17 +08:00
parent 695284c469
commit df554384ef
11 changed files with 95 additions and 52 deletions

View File

@ -244,14 +244,14 @@ func init() {
kit.For(_path_split(os.Getenv(PATH)), func(p string) { m.Push(nfs.PATH, p) })
}},
"chain": {Hand: func(m *ice.Message, arg ...string) { m.Echo(m.FormatChain()) }},
"upgrade": {Hand: func(m *ice.Message, arg ...string) {
"upgrade": {Help: "升级", Hand: func(m *ice.Message, arg ...string) {
if nfs.Exists(m, ".git") {
m.Cmdy("web.code.compile")
} else {
m.Cmdy("web.code.upgrade")
}
}},
RESTART: {Hand: func(m *ice.Message, arg ...string) {
RESTART: {Help: "重启", Hand: func(m *ice.Message, arg ...string) {
m.Go(func() { m.Sleep("30ms", ice.EXIT, 1) })
}},
"logs": {Help: "日志", Hand: func(m *ice.Message, arg ...string) {

View File

@ -57,6 +57,7 @@ const (
DISPLAY = "display"
ACTION = "action"
RUN = "run"
TOOLS = "tools"
)
const COMMAND = "command"

View File

@ -141,6 +141,10 @@ func init() {
}
}},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
if m.Option(ctx.ACTION) == ice.MAIN {
m.Cmdy(SPACE, m.Option(mdb.NAME), SPACE, mdb.INPUTS, arg)
return
}
switch arg[0] {
case mdb.NAME, nfs.TEMPLATE:
_dream_list(m).Cut("name,status,time")
@ -218,7 +222,10 @@ func init() {
}
}},
DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
kit.Switch(m.Option(mdb.TYPE), []string{SERVER, WORKER}, func() { m.PushButton(OPEN) })
kit.Switch(m.Option(mdb.TYPE), []string{WORKER, SERVER}, func() { m.PushButton(OPEN, ice.MAIN) })
}},
ice.MAIN: {Name: "main index", Help: "首页", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(SPACE, m.Option(mdb.NAME), SPACE, ice.MAIN, m.Option(ctx.INDEX))
}},
OPEN: {Hand: func(m *ice.Message, arg ...string) { ctx.ProcessOpen(m, m.MergePod(m.Option(mdb.NAME))) }},
"origin": {Name: "origin", Help: "仓库", Hand: func(m *ice.Message, arg ...string) {

View File

@ -59,6 +59,7 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
}
if m.Logs(r.Header.Get(ice.MSG_USERIP), r.Method, r.URL.String()); r.Method == http.MethodGet {
ispod := kit.Contains(r.Header.Get("Referer"), "/chat/pod/", "pod=")
if msg := m.Spawn(w, r).Options(ice.MSG_USERUA, r.UserAgent()); path.Join(r.URL.Path) == nfs.PS {
if !msg.IsCliUA() {
if r.URL.Path = kit.Select(nfs.PS, mdb.Config(m, ice.MAIN)); path.Join(r.URL.Path) != nfs.PS {
@ -70,7 +71,7 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
return !Render(msg, ice.RENDER_DOWNLOAD, p)
} else if p = path.Join(nfs.USR, r.URL.Path); kit.HasPrefix(r.URL.Path, "/volcanos/", "/intshell/") && nfs.Exists(msg, p) {
return !Render(msg, ice.RENDER_DOWNLOAD, p)
} else if p = strings.TrimPrefix(r.URL.Path, "/require/"); kit.HasPrefix(r.URL.Path, "/require/src/", "/require/usr/icons/", "/require/usr/icebergs/") && nfs.Exists(msg, p) {
} else if p = strings.TrimPrefix(r.URL.Path, "/require/"); kit.HasPrefix(r.URL.Path, "/require/src/", "/require/usr/icons/", "/require/usr/icebergs/") && nfs.Exists(msg, p) && !ispod {
return !Render(msg, ice.RENDER_DOWNLOAD, p)
} else if p = path.Join("usr/node_modules/", strings.TrimPrefix(r.URL.Path, "/require/modules/")); kit.HasPrefix(r.URL.Path, "/require/modules/") && nfs.Exists(msg, p) {
return !Render(msg, ice.RENDER_DOWNLOAD, p)
@ -182,7 +183,7 @@ func init() {
P(ice.EXIT): {Hand: func(m *ice.Message, arg ...string) { m.Cmd(ice.EXIT) }},
PP(ice.VOLCANOS): {Hand: func(m *ice.Message, arg ...string) { m.RenderDownload(path.Join(ice.USR_VOLCANOS, path.Join(arg...))) }},
PP(ice.INTSHELL): {Hand: func(m *ice.Message, arg ...string) { m.RenderDownload(path.Join(ice.USR_INTSHELL, path.Join(arg...))) }},
SERVE: {Name: "serve name auto start dark system", Help: "服务器", Actions: ice.MergeActions(ice.Actions{
SERVE: {Name: "serve name auto start main dark system publicip", 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)
@ -206,16 +207,23 @@ func init() {
})
}},
cli.SYSTEM: {Help: "系统", Hand: func(m *ice.Message, arg ...string) { cli.Opens(m, "System Settings.app") }},
"publicip": {Hand: func(m *ice.Message, arg ...string) {
m.Echo(kit.Formats(PublicIP(m)))
}},
"dark": {Help: "主题", Hand: func(m *ice.Message, arg ...string) {
if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
return
ice.MAIN: {Name: "main index", Help: "首页", Hand: func(m *ice.Message, arg ...string) {
if m.Option(ctx.INDEX) == "" {
mdb.Config(m, ice.MAIN, "")
} else {
mdb.Config(m, ice.MAIN, CHAT_CMD+m.Option(ctx.INDEX)+"/")
}
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())},
"publicip": {Help: "公网", Hand: func(m *ice.Message, arg ...string) { m.Echo(kit.Formats(PublicIP(m))) }},
"dark": {Help: "主题", Hand: func(m *ice.Message, arg ...string) {
if tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
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()), Hand: func(m *ice.Message, arg ...string) {
mdb.HashSelect(m, arg...)
m.StatusTimeCount(ice.MAIN, mdb.Config(m, ice.MAIN))
}},
})
ice.AddMergeAction(func(c *ice.Context, key string, cmd *ice.Command, sub string, action *ice.Action) {
if strings.HasPrefix(sub, nfs.PS) {
@ -239,10 +247,10 @@ func Script(m *ice.Message, str string, arg ...ice.Any) string {
}
func ChatCmdPath(m *ice.Message, arg ...string) string {
if p := m.Option(ice.MSG_USERPOD); p != "" {
return path.Join("/chat/pod/", p, "/cmd/", kit.Select(m.PrefixKey(), path.Join(arg...)))
return path.Join(CHAT_POD, p, "/cmd/", kit.Select(m.PrefixKey(), path.Join(arg...)))
}
return path.Join("/chat/cmd/", kit.Select(m.PrefixKey(), path.Join(arg...)))
return path.Join(CHAT_CMD, kit.Select(m.PrefixKey(), path.Join(arg...)))
}
func RequireFile(m *ice.Message, file string) string {
if strings.HasPrefix(file, nfs.PS) || strings.HasPrefix(file, ice.HTTP) {

View File

@ -136,8 +136,9 @@ func _space_exec(m *ice.Message, source, target []string, c *websocket.Conn) {
_space_echo(m.Set(ice.MSG_OPTS).Options(log.DEBUG, m.Option(log.DEBUG)), []string{}, kit.Reverse(kit.Simple(source)), c)
}
func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
defer func() { m.Warn(recover()) }()
if m.Options(ice.MSG_SOURCE, source, ice.MSG_TARGET, target[1:]); !m.Warn(c.WriteMessage(1, []byte(m.FormatMeta()))) {
// m.Log(tcp.SEND, "%v->%v %v %v", source, target, m.Detailv(), m.FormatsMeta(nil))
m.Log(tcp.SEND, "%v->%v %v %v", source, target, m.Detailv(), m.FormatsMeta(nil))
}
}
func _space_send(m *ice.Message, name string, arg ...string) (h string) {
@ -177,7 +178,11 @@ func init() {
Index.MergeCommands(ice.Commands{
SPACE: {Name: "space name cmds auto", Help: "空间站", Actions: ice.MergeActions(ice.Actions{
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) {
ice.MAIN: {Name: "main index", Hand: func(m *ice.Message, arg ...string) {
if len(arg) > 0 {
mdb.Config(m, ice.MAIN, m.Option(ctx.INDEX))
return
}
kit.If(mdb.Config(m, ice.MAIN), func(cmd string) { RenderPodCmd(m, "", cmd) }, func() {
m.OptionDefault(nfs.VERSION, RenderVersion(m))
m.RenderResult(nfs.Template(m, "main.html"))
@ -188,6 +193,8 @@ func init() {
switch arg[0] {
case SPACE:
m.Cmdy("").CutTo(mdb.NAME, arg[0])
default:
mdb.HashInputs(m, arg)
}
}},
tcp.DIAL: {Name: "dial dev=ops name", Hand: func(m *ice.Message, arg ...string) {
@ -231,7 +238,7 @@ func init() {
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
}, mdb.HashAction(mdb.LIMIT, 1000, mdb.LEAST, 1000, mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,text,module,version", ctx.ACTION, OPEN, REDIAL, kit.Dict("a", 3000, "b", 1000, "c", 1000)), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
if len(arg) < 2 {
defer m.StatusTimeCount()
defer m.StatusTimeCount(ice.MAIN, mdb.Config(m, ice.MAIN))
m.Option(ice.MSG_USERWEB, tcp.PublishLocalhost(m, m.Option(ice.MSG_USERWEB)))
mdb.HashSelect(m.Spawn(), arg...).Sort("").Table(func(index int, value ice.Maps, field []string) {
if m.Push("", value, kit.Split(mdb.Config(m, mdb.FIELD))); len(arg) > 0 && arg[0] != "" {
@ -246,7 +253,7 @@ func init() {
}
m.PushButton(kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN), mdb.REMOVE)
})
kit.If(len(arg) == 1, func() { m.EchoIFrame(m.MergePod(arg[0])) })
kit.If(len(arg) == 1, func() { m.EchoIFrame(m.MergePod(arg[0])) }, func() { m.Action(ice.MAIN) })
} else {
_space_send(m, arg[0], kit.Simple(kit.Split(arg[1]), arg[2:])...)
}

View File

@ -14,6 +14,8 @@ import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/log"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/tcp"
@ -48,7 +50,9 @@ func _spide_show(m *ice.Message, name string, arg ...string) {
return
}
mdb.HashSelectDetail(m, name, func(value ice.Map) { _spide_head(m, req, head, value) })
kit.For(req.Header, func(k string, v []string) { m.Logs(REQUEST, k, v) })
if m.Option(log.DEBUG) == ice.TRUE {
kit.For(req.Header, func(k string, v []string) { m.Logs(REQUEST, k, v) })
}
res, e := _spide_send(m, name, req, kit.Format(m.OptionDefault(CLIENT_TIMEOUT, msg.Append(CLIENT_TIMEOUT))))
if m.Warn(e, ice.ErrNotFound, uri) {
return
@ -59,7 +63,9 @@ func _spide_show(m *ice.Message, name string, arg ...string) {
m.Push(mdb.VALUE, res.Status)
m.Cost(cli.STATUS, res.Status, nfs.SIZE, kit.FmtSize(kit.Int64(res.Header.Get(ContentLength))), mdb.TYPE, res.Header.Get(ContentType))
kit.For(res.Header, func(k string, v []string) {
m.Logs(RESPONSE, k, v)
if m.Option(log.DEBUG) == ice.TRUE {
m.Logs(RESPONSE, k, v)
}
m.Push(mdb.TYPE, SPIDE_HEADER)
m.Push(mdb.NAME, k)
m.Push(mdb.VALUE, v[0])
@ -67,7 +73,9 @@ func _spide_show(m *ice.Message, name string, arg ...string) {
mdb.HashSelectUpdate(m, name, func(value ice.Map) {
kit.For(res.Cookies(), func(v *http.Cookie) {
kit.Value(value, kit.Keys(SPIDE_COOKIE, v.Name), v.Value)
m.Logs(RESPONSE, v.Name, v.Value)
if m.Option(log.DEBUG) == ice.TRUE {
m.Logs(RESPONSE, v.Name, v.Value)
}
m.Push(mdb.TYPE, COOKIE)
m.Push(mdb.NAME, v.Name)
m.Push(mdb.VALUE, v.Value)
@ -155,26 +163,11 @@ func _spide_part(m *ice.Message, arg ...string) (string, io.Reader) {
}
func _spide_head(m *ice.Message, req *http.Request, head ice.Maps, value ice.Map) {
m.Logs(req.Method, req.URL.String())
kit.For(value[SPIDE_COOKIE], func(k string, v string) {
req.AddCookie(&http.Cookie{Name: k, Value: v})
m.Logs("Cookie", k, v)
})
kit.For(kit.Simple(m.Optionv(SPIDE_COOKIE)), func(k, v string) {
req.AddCookie(&http.Cookie{Name: k, Value: v})
m.Logs("Cookie", k, v)
})
kit.For(value[SPIDE_HEADER], func(k string, v string) {
req.Header.Set(k, v)
m.Logs("Header", k, v)
})
kit.For(kit.Simple(m.Optionv(SPIDE_HEADER)), func(k, v string) {
req.Header.Set(k, v)
m.Logs("Header", k, v)
})
kit.For(head, func(k, v string) {
req.Header.Set(k, v)
m.Logs("Header", k, v)
})
kit.For(head, func(k, v string) { req.Header.Set(k, v) })
kit.For(value[SPIDE_HEADER], func(k string, v string) { req.Header.Set(k, v) })
kit.For(value[SPIDE_COOKIE], func(k string, v string) { req.AddCookie(&http.Cookie{Name: k, Value: v}) })
kit.For(kit.Simple(m.Optionv(SPIDE_COOKIE)), func(k, v string) { req.AddCookie(&http.Cookie{Name: k, Value: v}) })
kit.For(kit.Simple(m.Optionv(SPIDE_HEADER)), func(k, v string) { req.Header.Set(k, v) })
kit.If(req.Method == http.MethodPost, func() { m.Logs(kit.Select(ice.AUTO, req.Header.Get(ContentLength)), req.Header.Get(ContentType)) })
}
func _spide_send(m *ice.Message, name string, req *http.Request, timeout string) (*http.Response, error) {
@ -270,7 +263,8 @@ const SPIDE = "spide"
func init() {
Index.MergeCommands(ice.Commands{
SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg run create", Help: "蜘蛛侠", Actions: ice.MergeActions(ice.Actions{
// SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg run create", Help: "蜘蛛侠", Actions: ice.MergeActions(ice.Actions{
SPIDE: {Name: "spide client.name auto", Help: "蜘蛛侠", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
conf := mdb.Confm(m, cli.RUNTIME, cli.CONF)
m.Cmd("", mdb.CREATE, ice.OPS, kit.Select("http://127.0.0.1:9020", conf[cli.CTX_OPS]))
@ -281,7 +275,26 @@ func init() {
m.Cmd("", mdb.CREATE, ice.SHY, kit.Select(kit.Select("https://shylinux.com", ice.Info.Make.Remote), conf[cli.CTX_SHY]))
}},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
mdb.HashSelectValue(m.Spawn(), func(value ice.Map) { m.Push(kit.Select(ORIGIN, arg, 0), kit.Value(value, CLIENT_ORIGIN)) })
switch m.Option(ctx.ACTION) {
case COOKIE:
switch arg[0] {
case mdb.KEY:
m.Push(arg[0], "sessid")
}
case HEADER:
switch arg[0] {
case mdb.KEY:
m.Push(arg[0], "Authorization")
}
default:
mdb.HashSelectValue(m.Spawn(), func(value ice.Map) { m.Push(kit.Select(ORIGIN, arg, 0), kit.Value(value, CLIENT_ORIGIN)) })
}
}},
HEADER: {Name: "header key* value", Hand: func(m *ice.Message, arg ...string) {
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME), kit.Keys(HEADER, m.Option(mdb.KEY)), m.Option(mdb.VALUE))
}},
COOKIE: {Name: "cookie key* value", Hand: func(m *ice.Message, arg ...string) {
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME), kit.Keys(COOKIE, m.Option(mdb.KEY)), m.Option(mdb.VALUE))
}},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if mdb.IsSearchPreview(m, arg) {
@ -297,6 +310,9 @@ func init() {
}, mdb.HashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,client.name,client.url")), Hand: func(m *ice.Message, arg ...string) {
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort(CLIENT_NAME)
if len(arg) > 0 && arg[0] != "" {
m.Action(COOKIE, HEADER)
}
} else {
_spide_show(m, arg[0], arg[1:]...)
}

View File

@ -3,6 +3,9 @@ fieldset.macos.desktop>div.output { background-color:transparent; }
fieldset.macos.desktop>div.output>fieldset.macos { background-color:var(--plugin-bg-color); }
fieldset.macos.desktop>div.output>fieldset.macos>div.output { background-color:transparent; }
fieldset.macos.desktop>div.output>fieldset.macos.menu { line-height:25px; border-radius:0; height:25px; width:100%; position:absolute; top:0; overflow:hidden; }
fieldset.macos.desktop>div.output>fieldset.macos.menu div.menu:hover { background-color:var(--hover-bg-color); }
fieldset.macos.desktop>div.output>fieldset.macos.menu div.menu.create { font-size:24px; line-height:20px; height:25px; }
fieldset.macos.desktop>div.output>fieldset.macos.menu>div.output { overflow:hidden; }
fieldset.macos.desktop>div.output>fieldset.macos.dock { border:var(--box-border); border-radius:20px; position:absolute; bottom:10px; transition:margin-left 0.3s; }
fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; z-index:100; }
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { background-color:transparent; width:320px; }
@ -35,12 +38,12 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content td>input { margin:5px; }
fieldset.macos.desktop>div.output>div.desktop>fieldset input:not([type=button]) { width:150px; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
// fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:360px; }
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
fieldset.macos.menu>div.output>div.item { padding:0 5px; float:right; }
fieldset.macos.menu>div.output>div.item { padding:0 5px; height:25px; float:right; }
fieldset.macos.menu>div.output>div.item.avatar>img { height:25px; }
fieldset.macos.menu>div.output>div.menu { padding:0 20px; float:left; }
fieldset.macos.menu>div.output>div.tabs { font-style:italic; padding:0 10px; float:left; }

View File

@ -6,6 +6,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
return {view: [html.ITEM], list: [{img: can.page.drawText(can, item.name||item.index, 25, 0, 20)}], onclick: function(event) { can.sup.onexport.record(can, item) }}
}), [
{view: [html.MENU, "", can.ConfSpace()||can.misc.Search(can, ice.POD)||location.host], onclick: function(event) { can.sup.onexport.record(can, html.DESKTOP) }},
{view: [html.MENU, "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},
{view: [[html.MENU, mdb.CREATE], "", "+"], onclick: function(event) { can.sup.onexport.record(can, mdb.CREATE) }},
])), cb && cb(msg), can.page.style(can, can._output, html.MAX_WIDTH, "")
}})

View File

@ -82,7 +82,7 @@ func _autogen_git(m *ice.Message, arg ...string) ice.Map {
return kit.Dict(arg, aaa.USERNAME, ice.Info.Username, tcp.HOSTNAME, ice.Info.Hostname, nfs.PATH, kit.Path("")+nfs.PS, mdb.TIME, m.Time(),
GIT, m.Cmdx(cli.SYSTEM, GIT, VERSION), GO, m.Cmdx(cli.SYSTEM, GO, VERSION),
msg.AppendSimple("remote,branch,version,forword,author,email,hash,when,message"),
web.DOMAIN, tcp.PublishLocalhost(m, m.Option(ice.MSG_USERWEB)),
web.DOMAIN, strings.ReplaceAll(tcp.PublishLocalhost(m, m.Option(ice.MSG_USERWEB)), "%2F", "/"),
nfs.MODULE, _autogen_mod(m, ice.GO_MOD),
cli.SYSTEM, ice.Info.System,
)

View File

@ -192,12 +192,12 @@ func init() {
kit.Switch(m.Option(mdb.TYPE), kit.Simple(web.SERVER, web.WORKER), func() { m.PushButton(kit.Dict(m.CommandKey(), "编程")) })
}},
web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, []string{}, arg...) }},
}, aaa.RoleAction(ctx.COMMAND), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path")), Hand: func(m *ice.Message, arg ...string) {
}, aaa.RoleAction(ctx.COMMAND), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path", ctx.TOOLS, "xterm,compile,runtime")), Hand: func(m *ice.Message, arg ...string) {
if m.Cmdy(INNER, arg); arg[0] != ctx.ACTION {
kit.If(len(arg) > 1, func() { mdb.HashCreate(m.Spawn(), nfs.PATH, path.Join(kit.Slice(arg, 0, 2)...)) })
m.Action(nfs.SAVE, COMPILE, "show", "exec")
ctx.Toolkit(m, COMPILE, cli.RUNTIME)
ctx.DisplayLocal(m, "")
ctx.Toolkit(m)
}
}},
})

View File

@ -74,7 +74,7 @@ const XTERM = "xterm"
func init() {
Index.MergeCommands(ice.Commands{
XTERM: {Name: "xterm hash auto install terminal", Icon: "usr/icons/Terminal.png", Help: "命令行", Actions: ice.MergeActions(ice.Actions{
XTERM: {Name: "xterm hash auto", Icon: "usr/icons/Terminal.png", Help: "命令行", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
kit.If(m.Cmd("").Length() == 0, func() { m.Cmd("", mdb.CREATE, mdb.TYPE, ISH) })
}},
@ -154,7 +154,7 @@ func init() {
if m.Length() == 0 {
m.Action(mdb.CREATE)
} else {
m.PushAction(web.OUTPUT, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES)
m.PushAction(web.OUTPUT, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES, "terminal")
}
} else {
if m.Length() == 0 {
@ -163,6 +163,7 @@ func init() {
}
m.Push(mdb.HASH, arg[0])
ctx.DisplayLocal(m, "")
m.Action("terminal")
}
}},
})