From 9e1ff8d56491c69ac1967209097d2b3032b88150 Mon Sep 17 00:00:00 2001 From: shy Date: Fri, 24 May 2024 19:27:27 +0800 Subject: [PATCH] add some --- base/web/dream.go | 2 +- base/web/render.go | 3 ++- base/web/store.css | 13 ++++++------- base/web/store.go | 2 +- base/web/store.js | 21 +++++++++++---------- core/chat/chat.go | 1 + core/chat/flows.js | 21 +++++++++++++++++---- 7 files changed, 39 insertions(+), 24 deletions(-) diff --git a/base/web/dream.go b/base/web/dream.go index 70a5e258..82998e21 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -368,7 +368,7 @@ func init() { cli.RUNTIME: {Hand: func(m *ice.Message, arg ...string) { 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(aaa.ACCESS) == aaa.PUBLIC, func() { m.Option(aaa.ACCESS, "") }) mdb.HashModify(m, m.OptionSimple(mdb.NAME, cli.RESTART, aaa.ACCESS)) diff --git a/base/web/render.go b/base/web/render.go index 1817171d..2e3d5276 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -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(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)) } 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 { RenderResult(m, kit.Format("not found command %s", cmd)) } 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))) } } diff --git a/base/web/store.css b/base/web/store.css index 9d85d8c7..67c88576 100644 --- a/base/web/store.css +++ b/base/web/store.css @@ -1,7 +1,6 @@ -/* fieldset.web.store>div.output>div.project { width:160px; flex:0 0 160px; } */ -fieldset.web.store>div.output>div.project div.list { border-left:var(--box-notice3); margin-left:25px; } -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); } -fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item:hover { box-shadow:var(--notice-box-shadow); } -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); } -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); } -fieldset.web.store>div.output>div.layout>div.layout>div.content>div.item div.content { height:70px; } +$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); } +$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); } +$content>div.item div.title div.label span { padding:var(--input-padding); padding-right:var(--input-margin); } +$content>div.item div.content { height:70px; } \ No newline at end of file diff --git a/base/web/store.go b/base/web/store.go index 214832f9..95652b6c 100644 --- a/base/web/store.go +++ b/base/web/store.go @@ -51,7 +51,7 @@ func init() { m.Cmdy(DREAM, arg) return } - if m.Display(""); len(arg) == 0 { + if m.Display("").DisplayCSS(""); len(arg) == 0 { list := []string{} 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() { diff --git a/base/web/store.js b/base/web/store.js index b59c37ba..94ee66d6 100644 --- a/base/web/store.js +++ b/base/web/store.js @@ -1,24 +1,25 @@ Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { can.ui = can.onappend.layout(can), can.onimport._project(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) + _init: function(can, msg) { + 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 can.onimport.item(can, value, function(event, 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.onmotion.delay(can, function() { can.onappend._filter(can) }) }, _content: function(can, msg, dev, target) { var list = [] 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 } }) - can.onimport.itemlist(can, list, function(event, value) { - value.key = can.core.Keys(dev, value.name) - can.onimport.dream(event, can, value, event.currentTarget) + value.icons = can.misc.Resource(can, value.icons||"usr/icons/icebergs.png", "", value.origin) + if (value.type == web.SERVER) { list.push(value); return true } + }) + 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) }, - dream: function(event, can, value, target) { can.isCmdMode()? can.misc.SearchHash(can, value.name): can.sup.db._zone = value.name - can.page.Select(can, can.ui.project, html.DIV_ITEM, function(_target) { can.page.ClassList.set(can, _target, html.SELECT, _target == target) }) + dream: function(event, can, value, target) { 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.onimport._content(can, msg, value.name, target), can.onappend._status(can, msg), can.onimport.layout(can) diff --git a/core/chat/chat.go b/core/chat/chat.go index 765508a7..173394f3 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -15,6 +15,7 @@ func init() { HEADER, FOOTER, IFRAME, FAVOR, MESSAGE, TUTOR, + FLOWS, ) } diff --git a/core/chat/flows.js b/core/chat/flows.js index e0026857..cae5794a 100644 --- a/core/chat/flows.js +++ b/core/chat/flows.js @@ -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) { 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)) } - }, target) + }, target), can.onappend._status(can, msg) }, _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(":")) @@ -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) } _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 }) - } } + } } } else { 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++ @@ -91,7 +91,7 @@ Volcanos(chat.ONIMPORT, { 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.isCmdMode() && item._rect.scrollIntoViewIfNeeded() - item._rect.scrollIntoViewIfNeeded() + can.user.isChrome && item._rect.scrollIntoViewIfNeeded() can.onmotion.delay(can, function() { next() }, 30) can.user.toastProcess(can, index+" / "+list.length) }, 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, (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, { + _trans: { + style: { + addnext: "notice", + addto: "notice", + }, + icons: { + addnext: "bi bi-arrow-down-square", + addto: "bi bi-arrow-right-square", + }, + addnext: "添加下一步", + addto: "添加下一项", + }, _toolkit: [ "play", "prev", "next", ["travel", "deep", "wide"], @@ -177,7 +190,7 @@ Volcanos(chat.ONACTION, { }) Volcanos(chat.ONDETAIL, { _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 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)) {