1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-06 01:36:38 +08:00
parent af80b9e2d4
commit 53686b9c4b
8 changed files with 56 additions and 20 deletions

View File

@ -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 {

View File

@ -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; }

View File

@ -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, {

View File

@ -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)) })
})
}},

View File

@ -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) {

View File

@ -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...)

View File

@ -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])

View File

@ -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{}