diff --git a/base/web/dream.go b/base/web/dream.go index f269cb44..4297aeba 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -28,27 +28,43 @@ func _dream_list(m *ice.Message, simple bool) *ice.Message { if value[aaa.ACCESS] == aaa.PRIVATE && (m.Option(ice.FROM_SPACE) != "" || !aaa.IsTechOrRoot(m)) { return } - m.Push("", value, kit.Slice(head, 0, -1)) if space, ok := list[value[mdb.NAME]]; ok { + m.Push("", value, kit.Slice(head, 0, -1)) if m.IsCliUA() || simple { m.Push(mdb.TYPE, space[mdb.TYPE]).Push(cli.STATUS, cli.START) m.Push(nfs.MODULE, space[nfs.MODULE]).Push(nfs.VERSION, space[nfs.VERSION]).Push(mdb.TEXT, "") - m.PushButton(cli.STOP) + if aaa.IsTechOrRoot(m) { + m.PushButton(cli.STOP) + } else { + m.PushButton() + } } else { - msg := gdb.Event(m.Spawn(value, space), DREAM_TABLES).Copy(m.Spawn().PushButton(cli.STOP)) + msg := gdb.Event(m.Spawn(value, space), DREAM_TABLES) + if aaa.IsTechOrRoot(m) { + msg.Copy(m.Spawn().PushButton(cli.STOP)) + } m.Push(mdb.TYPE, space[mdb.TYPE]).Push(cli.STATUS, cli.START) m.Push(nfs.MODULE, space[nfs.MODULE]).Push(nfs.VERSION, space[nfs.VERSION]).Push(mdb.TEXT, msg.Append(mdb.TEXT)) m.PushButton(strings.Join(msg.Appendv(ctx.ACTION), "")) } - } else { + } else if aaa.IsTechOrRoot(m) { + m.Push("", value, kit.Slice(head, 0, -1)) if m.Push(mdb.TYPE, WORKER); nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, value[mdb.NAME])) { m.Push(cli.STATUS, cli.STOP) m.Push(nfs.MODULE, "").Push(nfs.VERSION, "").Push(mdb.TEXT, "") - m.PushButton(cli.START, nfs.TRASH) + if aaa.IsTechOrRoot(m) { + m.PushButton(cli.START, nfs.TRASH) + } else { + m.PushButton() + } } else { m.Push(cli.STATUS, cli.BEGIN) m.Push(nfs.MODULE, "").Push(nfs.VERSION, "").Push(mdb.TEXT, "") - m.PushButton(cli.START, mdb.REMOVE) + if aaa.IsTechOrRoot(m) { + m.PushButton(cli.START, mdb.REMOVE) + } else { + m.PushButton() + } } } }) @@ -427,14 +443,19 @@ func init() { m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST) }}, DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { + if !aaa.IsTechOrRoot(m) { + m.PushButton(OPEN) + return + } + list := []ice.Any{} + kit.If(m.IsDebug(), func() { list = append(list, cli.RUNTIME) }) switch m.Option(mdb.TYPE) { case WORKER: - m.PushButton(cli.RUNTIME, "settings", tcp.SEND, OPEN) - case MASTER: - m.PushButton(cli.RUNTIME, DREAM, TOKEN, OPEN) + list = append(list, "settings", tcp.SEND, OPEN) default: - m.PushButton(cli.RUNTIME, DREAM, TOKEN, OPEN) + list = append(list, TOKEN, DREAM, OPEN) } + m.PushButton(list...) }}, "settings": {Name: "settings restart=manual,always access=public,private", Help: "设置", Hand: func(m *ice.Message, arg ...string) { kit.If(m.Option(cli.RESTART) == "manual", func() { m.Option(cli.RESTART, "") }) @@ -453,7 +474,7 @@ func init() { }, StatsAction(), DreamAction(), DreamTablesAction(), mdb.ImportantHashAction( mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icons,repos,binary,template,restart,access", html.BUTTON, kit.JoinWord(PORTAL, DESKTOP, ADMIN, MESSAGE, WORD, STATUS, VIMER, COMPILE, XTERM, DREAM), - ctx.TOOLS, kit.Simple(ROUTE, SPIDE, STORE, MATRIX), ONLINE, ice.TRUE, + ctx.TOOLS, kit.Simple(SPIDE, ROUTE), ONLINE, ice.TRUE, )), Hand: func(m *ice.Message, arg ...string) { if len(arg) == 0 { simple := m.Option("dream.simple") == ice.TRUE @@ -461,12 +482,12 @@ func init() { _dream_list(m, simple) _dream_list_icon(m) } - if !m.IsCliUA() { + if !m.IsCliUA() && aaa.IsTechOrRoot(m) { _dream_list_more(m, simple) } if ice.Info.NodeType == WORKER || !aaa.IsTechOrRoot(m) || m.IsCliUA() { m.Action() - } else if cli.SystemFindGo(m) { + } else if m.IsDebug() && cli.SystemFindGo(m) { m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL, cli.BUILD, PUBLISH) } else { m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL) @@ -474,7 +495,13 @@ func init() { m.Sort("type,status,name", []string{aaa.LOGIN, WORKER, SERVER, MASTER}, []string{cli.START, cli.STOP, cli.BEGIN}, ice.STR_R) m.StatusTimeCountStats(mdb.TYPE, mdb.STATUS) ctx.DisplayTableCard(m) - ctx.Toolkit(m) + if !m.IsDebug() { + m.Options(ice.MSG_TOOLKIT, "") + } + if !aaa.IsTechOrRoot(m) { + m.Options(ice.MSG_TOOLKIT, "") + m.Option(ice.MSG_ONLINE, ice.FALSE) + } } else if arg[0] == ctx.ACTION { gdb.Event(m, DREAM_ACTION, arg) } else { diff --git a/core/chat/message.css b/core/chat/message.css index 92ab3893..401bf0d4 100644 --- a/core/chat/message.css +++ b/core/chat/message.css @@ -10,6 +10,7 @@ fieldset.web.chat.message>div.output>div.project>div.item.text.filter>i { left:v fieldset.web.chat.message>div.output>div.project>div.item:not(.filter) { height:58px; padding:var(--input-padding); } fieldset.web.chat.message>div.output>div.project>div.item.select { border-right:unset; } fieldset.web.chat.message>div.output>div.project>div.item img { height:var(--header-height); width:var(--header-height); display:block; float:left; } +body.mobile fieldset.web.chat.message>div.output>div.project { border-right:none; } fieldset.web.chat.message>div.output>div.project>div.item span.time { color:var(--disable-fg-color); font-size:var(--status-font-size); } fieldset.web.chat.message>div.output>div.project>div.item div.container { width:calc(100% - var(--header-height)); float:left; } fieldset.web.chat.message>div.output>div.project>div.item div.title { display:flex; justify-content:space-between; } diff --git a/core/chat/message.js b/core/chat/message.js index ceb38d82..9587d2ce 100644 --- a/core/chat/message.js +++ b/core/chat/message.js @@ -90,6 +90,7 @@ Volcanos(chat.ONIMPORT, { }, layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth()) can.ui.title && can.page.style(can, can.ui.message, html.HEIGHT, can.ui.content.offsetHeight-can.ui.title.offsetHeight) + can.page.style(can, can._output, html.HEIGHT, can.ConfHeight()) }, }, [""]) Volcanos(chat.ONDAEMON, { @@ -100,7 +101,7 @@ Volcanos(chat.ONEXPORT, { return can.base.Max(html.STORY_HEIGHT, height, height/(can.base.isIn(value.index, html.IFRAME)? 1: 2)) }, plugWidth: function(can, value) { - return can.ui.content.offsetWidth-(can.user.isMobile? 60: 180) + return can.ui.content.offsetWidth-(can.user.isMobile? 80: 180) }, }) Volcanos(chat.ONDETAIL, { diff --git a/core/code/compile.go b/core/code/compile.go index 4070b357..8cf32938 100644 --- a/core/code/compile.go +++ b/core/code/compile.go @@ -6,6 +6,7 @@ import ( "strings" ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/cli" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/lex" @@ -105,7 +106,7 @@ func init() { m.Cmdy(INSTALL, web.DOWNLOAD, kit.Format("%s/go%s.%s-%s.%s", m.Option(SERVICE), m.Option(VERSION), runtime.GOOS, runtime.GOARCH, kit.Select("tar.gz", "zip", runtime.GOOS == cli.WINDOWS)), ice.USR_LOCAL) }}, web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { - kit.If(m.Option(mdb.TYPE) == web.WORKER && nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(mdb.NAME), ice.SRC_MAIN_GO)), func() { + kit.If(m.IsDebug() && aaa.IsTechOrRoot(m) && m.Option(mdb.TYPE) == web.WORKER && nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(mdb.NAME), ice.SRC_MAIN_GO)), func() { kit.If(cli.SystemFindGo(m), func() { m.PushButton(kit.Dict(m.CommandKey(), m.Commands("").Help)) }) }) }}, diff --git a/core/code/vimer.go b/core/code/vimer.go index 35fc3b9e..92dd88f8 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -216,6 +216,9 @@ func init() { chat.FAVOR_ACTION: {Hand: func(m *ice.Message, arg ...string) { kit.If(m.Option(mdb.TYPE) == nfs.FILE, func() { ctx.ProcessField(m, m.ShortKey(), nfs.SplitPath(m, m.Option(mdb.TEXT))) }) }}, + web.DREAM_TABLES: {Hand: func(m *ice.Message, _ ...string) { + kit.If(m.IsDebug(), func() { m.PushButton(kit.Dict(m.CommandKey(), "编程")) }) + }}, }, chat.FavorAction(), web.DreamTablesAction("编程"), ctx.ConfAction(ctx.TOOLS, "xterm,compile,runtime", web.ONLINE, ice.TRUE)), Hand: func(m *ice.Message, arg ...string) { if m.Cmdy(INNER, arg); arg[0] != ctx.ACTION { if web.IsLocalHost(m) { diff --git a/core/code/xterm.go b/core/code/xterm.go index de0ece3e..7717cec3 100644 --- a/core/code/xterm.go +++ b/core/code/xterm.go @@ -155,7 +155,7 @@ func init() { }) }}, web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { - kit.If(aaa.IsTechOrRoot(m), func() { m.PushButton(kit.Dict(m.CommandKey(), m.Commands("").Help)) }) + kit.If(m.IsDebug() && aaa.IsTechOrRoot(m), func() { m.PushButton(kit.Dict(m.CommandKey(), m.Commands("").Help)) }) }}, web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, "", cli.SH, arg...) diff --git a/core/wiki/portal.js b/core/wiki/portal.js index 12cd0894..d531d0e3 100644 --- a/core/wiki/portal.js +++ b/core/wiki/portal.js @@ -1,5 +1,8 @@ Volcanos(chat.ONIMPORT, { - _init: function(can, msg, cb) { can.require(["/plugin/local/wiki/word.js"]), can.isCmdMode() && can.onappend.style(can, html.OUTPUT) + _init: function(can, msg, cb) { + can.Conf(html.PADDING, 20) + can.require(["/plugin/local/wiki/word.js"]), can.isCmdMode() && can.onappend.style(can, html.OUTPUT) + can.Conf(html.PADDING, 20) var p = "/cmd/"+web.PORTAL; can.db.prefix = location.pathname.indexOf(p) > -1? location.pathname.split(p)[0]+p: nfs.WIKI_PORTAL var p = "/c/"+web.PORTAL; can.db.prefix = location.pathname.indexOf(p) > -1? location.pathname.split(p)[0]+p: nfs.WIKI_PORTAL can.db.current = can.isCmdMode()? can.base.trimPrefix(location.pathname, can.db.prefix+nfs.PS, can.db.prefix): can.Option(nfs.PATH) @@ -19,6 +22,7 @@ Volcanos(chat.ONIMPORT, { if (can.ConfWidth() < 1000) { can.onmotion.hidden(can, can.ui.aside) } } can.onmotion.delay(can, function() { can.Conf(html.PADDING, can.page.styleValueInt(can, "--portal-main-padding", can._output)), cb(msg) + can.user.isMobile && can.Conf(html.PADDING, 15) var file = can.isCmdMode()? can.db.hash[0]: can.Option(nfs.FILE); can.base.beginWith(file, nfs.SRC, nfs.USR) || (file = can.db.current+file) can.db.nav = {}, can.page.Select(can, can._output, wiki.STORY_ITEM, function(target) { var meta = target.dataset||{} can.core.CallFunc([can.onimport, can.onimport[meta.name]? meta.name: meta.type||target.tagName.toLowerCase()], [can, meta, target]) diff --git a/misc/git/status.go b/misc/git/status.go index a4c3073d..a350f48d 100644 --- a/misc/git/status.go +++ b/misc/git/status.go @@ -57,8 +57,7 @@ func init() { m.ProcessHold() }}, web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { - if !nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(mdb.NAME), _GIT)) { - m.Push(mdb.TEXT, "").PushButton(kit.Dict(m.CommandKey(), "源码")) + if !m.IsDebug() || !aaa.IsTechOrRoot(m) || !nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(mdb.NAME), _GIT)) { return } text := []string{}