1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-05-24 19:27:27 +08:00
parent 598942a836
commit 9e1ff8d564
7 changed files with 39 additions and 24 deletions

View File

@ -368,7 +368,7 @@ func init() {
cli.RUNTIME: {Hand: func(m *ice.Message, arg ...string) { cli.RUNTIME: {Hand: func(m *ice.Message, arg ...string) {
ProcessPodCmd(m, m.Option(mdb.NAME), "", nil, arg...) ProcessPodCmd(m, m.Option(mdb.NAME), "", nil, arg...)
}}, }},
"settings": {Name: "settings restart=manual,always access=public,private", Help: "设置", Hand: func(m *ice.Message, arg ...string) { "settings": {Name: "settings restart=manual,always access=public,private", Help: "设置", Icon: "bi bi-gear", Hand: func(m *ice.Message, arg ...string) {
kit.If(m.Option(cli.RESTART) == "manual", func() { m.Option(cli.RESTART, "") }) kit.If(m.Option(cli.RESTART) == "manual", func() { m.Option(cli.RESTART, "") })
kit.If(m.Option(aaa.ACCESS) == aaa.PUBLIC, func() { m.Option(aaa.ACCESS, "") }) kit.If(m.Option(aaa.ACCESS) == aaa.PUBLIC, func() { m.Option(aaa.ACCESS, "") })
mdb.HashModify(m, m.OptionSimple(mdb.NAME, cli.RESTART, aaa.ACCESS)) mdb.HashModify(m, m.OptionSimple(mdb.NAME, cli.RESTART, aaa.ACCESS))

View File

@ -150,7 +150,7 @@ func RenderMain(m *ice.Message) *ice.Message {
} }
m.Options(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD))) m.Options(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD)))
m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m)) m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m))
m.OptionDefault(mdb.ICONS, nfs.P+ice.Info.NodeIcon+m.Option(nfs.VERSION)) m.OptionDefault(mdb.ICONS, m.Resource(ice.Info.NodeIcon)+m.Option(nfs.VERSION))
return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m)) return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m))
} }
func RenderCmds(m *ice.Message, cmds ...ice.Any) { func RenderCmds(m *ice.Message, cmds ...ice.Any) {
@ -160,6 +160,7 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
if msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.ShortKey(), cmd)); msg.Length() == 0 { if msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.ShortKey(), cmd)); msg.Length() == 0 {
RenderResult(m, kit.Format("not found command %s", cmd)) RenderResult(m, kit.Format("not found command %s", cmd))
} else { } else {
m.OptionDefault(mdb.ICONS, m.Resource(msg.Append(mdb.ICONS)))
RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY))) RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY)))
} }
} }

View File

@ -1,7 +1,6 @@
/* fieldset.web.store>div.output>div.project { width:160px; flex:0 0 160px; } */ $project div.list { border-left:var(--box-notice3); margin-left:25px; }
fieldset.web.store>div.output>div.project div.list { border-left:var(--box-notice3); margin-left:25px; } $content>div.item { box-shadow:var(--th-box-shadow); border:var(--plugin-border); border-radius:var(--plugin-radius); }
fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item { box-shadow:var(--th-box-shadow); border:var(--plugin-border); border-radius:var(--plugin-radius); } $content>div.item:hover { box-shadow:var(--notice-box-shadow); }
fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item:hover { box-shadow:var(--notice-box-shadow); } $content>div.item div.title div.label { font-size:var(--status-font-size); font-weight:normal; margin-top:var(--input-margin); }
fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item div.title div.label { font-size:var(--status-font-size); font-weight:normal; margin-top:var(--input-margin); } $content>div.item div.title div.label span { padding:var(--input-padding); padding-right:var(--input-margin); }
fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item div.title div.label span { padding:var(--input-padding); padding-right:var(--input-margin); } $content>div.item div.content { height:70px; }
fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item div.content { height:70px; }

View File

@ -51,7 +51,7 @@ func init() {
m.Cmdy(DREAM, arg) m.Cmdy(DREAM, arg)
return return
} }
if m.Display(""); len(arg) == 0 { if m.Display("").DisplayCSS(""); len(arg) == 0 {
list := []string{} list := []string{}
m.Cmd(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,icons,client.type,client.name,client.origin")).Table(func(value ice.Maps) { m.Cmd(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,icons,client.type,client.name,client.origin")).Table(func(value ice.Maps) {
kit.If(value[CLIENT_TYPE] == nfs.REPOS && value[CLIENT_NAME] != ice.SHY, func() { kit.If(value[CLIENT_TYPE] == nfs.REPOS && value[CLIENT_NAME] != ice.SHY, func() {

View File

@ -1,24 +1,25 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.ui = can.onappend.layout(can), can.onimport._project(can, msg) }, _init: function(can, msg) {
_project: function(can, msg) { var select, current = can.sup.db._zone||can.db.hash[0]||(can.user.info.nodetype == web.WORKER? ice.OPS: ice.DEV) can.ui = can.onappend.layout(can), can.onimport._project(can, msg)
},
_project: function(can, msg) { var current = can.db.hash[0]||(can.user.info.nodetype == web.WORKER? ice.OPS: ice.DEV)
msg.Table(function(value) { value._select = value.name == current msg.Table(function(value) { value._select = value.name == current
can.onimport.item(can, value, function(event, item, target) { can.onimport.item(can, value, function(event, item, target) {
can.onimport.dream(event, can, item, target) can.onimport.dream(event, can, item, target)
}) })
}) }), can.onmotion.delay(can, function() { can.onappend._filter(can) })
can.onappend.style(can, "output card", can.ui.content), can.onmotion.delay(can, function() { can.onimport.layout(can) }) can.onappend.style(can, "output card", can.ui.content), can.onmotion.delay(can, function() { can.onimport.layout(can) })
can.onmotion.delay(can, function() { can.onappend._filter(can) })
}, },
_content: function(can, msg, dev, target) { var list = [] _content: function(can, msg, dev, target) { var list = []
can.onimport.card(can, msg, null, function(value) { can.onimport.card(can, msg, null, function(value) {
value.icons = can.misc.Resource(can, value.icons||"usr/icons/icebergs.png", "", value.origin); if (value.type == web.SERVER) { list.push(value); return true } }) value.icons = can.misc.Resource(can, value.icons||"usr/icons/icebergs.png", "", value.origin)
can.onimport.itemlist(can, list, function(event, value) { if (value.type == web.SERVER) { list.push(value); return true }
value.key = can.core.Keys(dev, value.name) })
can.onimport.dream(event, can, value, event.currentTarget) can.onimport.itemlist(can, list, function(event, value, target) { value.key = can.core.Keys(dev, value.name)
can.onimport.dream(event, can, value, target)
}, null, target) }, null, target)
}, },
dream: function(event, can, value, target) { can.isCmdMode()? can.misc.SearchHash(can, value.name): can.sup.db._zone = value.name dream: function(event, can, value, target) {
can.page.Select(can, can.ui.project, html.DIV_ITEM, function(_target) { can.page.ClassList.set(can, _target, html.SELECT, _target == target) })
if (can.onmotion.cache(can, function() { return value.key||value.name }, can.ui.content, can._status)) { return can.onimport.layout(can) } if (can.onmotion.cache(can, function() { return value.key||value.name }, can.ui.content, can._status)) { return can.onimport.layout(can) }
can.run(can.request(event, {_toast: ice.PROCESS}), [value.origin], function(msg) { can.run(can.request(event, {_toast: ice.PROCESS}), [value.origin], function(msg) {
can.onimport._content(can, msg, value.name, target), can.onappend._status(can, msg), can.onimport.layout(can) can.onimport._content(can, msg, value.name, target), can.onappend._status(can, msg), can.onimport.layout(can)

View File

@ -15,6 +15,7 @@ func init() {
HEADER, FOOTER, HEADER, FOOTER,
IFRAME, FAVOR, IFRAME, FAVOR,
MESSAGE, TUTOR, MESSAGE, TUTOR,
FLOWS,
) )
} }

View File

@ -31,7 +31,7 @@ Volcanos(chat.ONIMPORT, {
can.onappend.plugin(can, {index: web.WIKI_DRAW, style: html.OUTPUT, display: "/plugin/local/wiki/draw.js", height: target.offsetHeight, width: target.offsetWidth}, function(sub) { can.onappend.plugin(can, {index: web.WIKI_DRAW, style: html.OUTPUT, display: "/plugin/local/wiki/draw.js", height: target.offsetHeight, width: target.offsetWidth}, function(sub) {
sub.onexport.output = function() { value._content_plugin = sub, can.onimport._toolkit(can, msg, value) } sub.onexport.output = function() { value._content_plugin = sub, can.onimport._toolkit(can, msg, value) }
sub.run = function(event, cmds, cb) { cb && cb(can.request(event)) } sub.run = function(event, cmds, cb) { cb && cb(can.request(event)) }
}, target) }, target), can.onappend._status(can, msg)
}, },
_toolkit: function(can, msg, value) { var target = can.ui.content||can._output _toolkit: function(can, msg, value) { var target = can.ui.content||can._output
can.onappend.plugin(can, {index: "can._action"}, function(sub) { sub.ConfSpace(can.ConfSpace()), sub.ConfIndex([can.ConfIndex(), value.zone].join(":")) can.onappend.plugin(can, {index: "can._action"}, function(sub) { sub.ConfSpace(can.ConfSpace()), sub.ConfIndex([can.ConfIndex(), value.zone].join(":"))
@ -71,7 +71,7 @@ Volcanos(chat.ONIMPORT, {
if ( _item._line) { _item != _head && _item._line.Val("y1", _item._line.Val("y1")+height), _item._line.Val("y2", _item._line.Val("y2")+height) } if ( _item._line) { _item != _head && _item._line.Val("y1", _item._line.Val("y1")+height), _item._line.Val("y2", _item._line.Val("y2")+height) }
_item._rect.Val("y", _item._rect.Val("y")+height), _item._text.Val("y", _item._text.Val("y")+height) _item._rect.Val("y", _item._rect.Val("y")+height), _item._text.Val("y", _item._text.Val("y")+height)
}), can.core.List(list, function(_item) { if (!_item._rect) { return } matrix[can.core.Keys(_item.x, _item.y)] = _item }) }), can.core.List(list, function(_item) { if (!_item._rect) { return } matrix[can.core.Keys(_item.x, _item.y)] = _item })
} } } }
} else { } else {
for(var _head = item[from]; _head; _head = _head[from]) { if (!_head[from]) { var list = can.onexport.travel(can, value, _head, main) for(var _head = item[from]; _head; _head = _head[from]) { if (!_head[from]) { var list = can.onexport.travel(can, value, _head, main)
can.core.List(list, function(_item) { if (!_item._rect) { return _item.x++ } delete(matrix[can.core.Keys(_item.x, _item.y)]), _item.x++ can.core.List(list, function(_item) { if (!_item._rect) { return _item.x++ } delete(matrix[can.core.Keys(_item.x, _item.y)]), _item.x++
@ -91,7 +91,7 @@ Volcanos(chat.ONIMPORT, {
var list = can.onexport.travel(can, value, value._root, true, 0) var list = can.onexport.travel(can, value, value._root, true, 0)
can.core.Next(list, function(item, next, index) { show(item, item._main, item._deep) can.core.Next(list, function(item, next, index) { show(item, item._main, item._deep)
// can.isCmdMode() && item._rect.scrollIntoViewIfNeeded() // can.isCmdMode() && item._rect.scrollIntoViewIfNeeded()
item._rect.scrollIntoViewIfNeeded() can.user.isChrome && item._rect.scrollIntoViewIfNeeded()
can.onmotion.delay(can, function() { next() }, 30) can.onmotion.delay(can, function() { next() }, 30)
can.user.toastProcess(can, index+" / "+list.length) can.user.toastProcess(can, index+" / "+list.length)
}, function() { }, function() {
@ -114,9 +114,22 @@ Volcanos(chat.ONIMPORT, {
can.page.style(can, sub._target, html.LEFT, 0), sub.onimport.size(sub, html.ACTION_HEIGHT, width, true) can.page.style(can, sub._target, html.LEFT, 0), sub.onimport.size(sub, html.ACTION_HEIGHT, width, true)
can.page.style(can, sub._target, html.LEFT, (can.ui.content.offsetWidth-sub._target.offsetWidth)/2) can.page.style(can, sub._target, html.LEFT, (can.ui.content.offsetWidth-sub._target.offsetWidth)/2)
} }
can.db.value && can.db.value.zone && can.onexport.title(can, can.db.value.zone)
}) }, }) },
}) })
Volcanos(chat.ONACTION, { Volcanos(chat.ONACTION, {
_trans: {
style: {
addnext: "notice",
addto: "notice",
},
icons: {
addnext: "bi bi-arrow-down-square",
addto: "bi bi-arrow-right-square",
},
addnext: "添加下一步",
addto: "添加下一项",
},
_toolkit: [ _toolkit: [
"play", "prev", "next", "play", "prev", "next",
["travel", "deep", "wide"], ["travel", "deep", "wide"],
@ -177,7 +190,7 @@ Volcanos(chat.ONACTION, {
}) })
Volcanos(chat.ONDETAIL, { Volcanos(chat.ONDETAIL, {
_select: function(event, can, item, value) { can.onimport._profile(can, item, value) _select: function(event, can, item, value) { can.onimport._profile(can, item, value)
can.isCmdMode() && item._rect.scrollIntoViewIfNeeded() can.user.isChrome && can.isCmdMode() && item._rect.scrollIntoViewIfNeeded()
var sub = value._toolkit_plugin.sub, _sub = value._content_plugin.sub var sub = value._toolkit_plugin.sub, _sub = value._content_plugin.sub
can.page.Select(can, _sub.ui.svg, "rect", function(target) { var _class = (target.Value(html.CLASS)||"").split(lex.SP) can.page.Select(can, _sub.ui.svg, "rect", function(target) { var _class = (target.Value(html.CLASS)||"").split(lex.SP)
if (can.base.isIn(target, item._line, item._rect, item._text)) { if (can.base.isIn(target, item._line, item._rect, item._text)) {