diff --git a/base/web/render.go b/base/web/render.go index 2e3d5276..cdbf8a11 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -148,9 +148,9 @@ func RenderMain(m *ice.Message) *ice.Message { if m.IsCliUA() { return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH)) } - 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, m.Resource(ice.Info.NodeIcon)+m.Option(nfs.VERSION)) + m.OptionDefault(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD))) return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m)) } func RenderCmds(m *ice.Message, cmds ...ice.Any) { @@ -161,6 +161,7 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) { RenderResult(m, kit.Format("not found command %s", cmd)) } else { m.OptionDefault(mdb.ICONS, m.Resource(msg.Append(mdb.ICONS))) + m.OptionDefault(TITLE, kit.Select(cmd, msg.Append(mdb.HELP)+kit.Select("", " "+pod, pod != ""), !m.IsEnglish())) RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY))) } } diff --git a/base/web/store.go b/base/web/store.go index 95652b6c..1f692b66 100644 --- a/base/web/store.go +++ b/base/web/store.go @@ -49,9 +49,7 @@ func init() { }, ctx.ConfAction(CLIENT_TIMEOUT, cli.TIME_3s), DREAM), Hand: func(m *ice.Message, arg ...string) { if kit.HasPrefixList(arg, ctx.ACTION) { m.Cmdy(DREAM, arg) - return - } - if m.Display("").DisplayCSS(""); len(arg) == 0 { + } else 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() { @@ -78,14 +76,13 @@ func init() { } else { origin = tcp.PublishLocalhost(m, origin) } - list := m.Spawn(ice.Maps{ice.MSG_FIELDS: ""}).CmdMap(DREAM, mdb.NAME) stat := map[string]int{} + list := m.Spawn(ice.Maps{ice.MSG_FIELDS: ""}).CmdMap(DREAM, mdb.NAME) m.SetAppend().Spawn().SplitIndex(m.Cmdx(SPIDE, arg[0], dream, kit.Dict(mdb.ConfigSimple(m, CLIENT_TIMEOUT)))).Table(func(value ice.Maps) { stat[value[mdb.TYPE]]++ m.Push("", value, kit.Split("time,type,name,icons,repos,binary,module,version")) if value[mdb.TYPE] == SERVER { - m.Push(mdb.TEXT, value[mdb.TEXT]).Push(ORIGIN, value[mdb.TEXT]) - m.PushButton() + m.Push(mdb.TEXT, value[mdb.TEXT]).Push(ORIGIN, value[mdb.TEXT]).PushButton() return } m.Push(mdb.TEXT, value[nfs.REPOS]).Push(ORIGIN, origin) diff --git a/base/web/store.js b/base/web/store.js index 94ee66d6..227eb241 100644 --- a/base/web/store.js +++ b/base/web/store.js @@ -1,28 +1,27 @@ Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { - can.ui = can.onappend.layout(can), can.onimport._project(can, msg) + _init: function(can, msg, cb) { + can.db.hash[0] = 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, []) + cb && cb(msg), + can.onappend._filter(can) }, - _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) }) - }, - _content: function(can, msg, dev, target) { var list = [] - can.onimport.card(can, msg, null, function(value) { + _project: function(can, msg, dev, target) { + msg.Table(function(value) { if (value.type == web.WORKER) { return } + value._hash = dev.concat([value.name]).join(":"), value._select = can.base.beginWith(can.db.hash.join(":"), value._hash) 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) { - 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) + can.onimport.itemlist(can, [value], function(event, item, show, target) { + can.onimport.tabsCache(can, value, target, function(event) { + can.run(event, [value.origin], function(msg) { + can.onimport._project(can, msg, dev.concat([value.name]), target) + can.onimport._content(can, msg), can.onappend._status(can, msg) + }) + }) + }, null, target) }) }, -}, [""]) + _content: function(can, msg) { + can.onimport.card(can, msg, null, function(value) { if (value.type == web.SERVER) { return true } + value.icons = can.misc.Resource(can, value.icons||"usr/icons/icebergs.png", "", value.origin) + }), can.onappend.style(can, "output card", can.ui.content), can.onimport.layout(can) + }, +}) diff --git a/core/chat/flows.js b/core/chat/flows.js index cae5794a..02f38e97 100644 --- a/core/chat/flows.js +++ b/core/chat/flows.js @@ -1,46 +1,44 @@ Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { - if (can.Option(mdb.ZONE)) { - can.onimport._content(can, msg, can.db.value = {zone: can.Option(mdb.ZONE)}) - } else { msg.Push(mdb.ZONE, ctx.COMMAND) - can.ui = can.onappend.layout(can), can.ui.toggle = can.onappend.toggle(can), can.onimport._project(can, msg) - } + _init: function(can, msg) { msg.Push(mdb.ZONE, ctx.COMMAND) + can.ui = can.onappend.layout(can), can.onimport._project(can, msg), can.ui.toggle = can.onappend.toggle(can) }, - _project: function(can, msg) { msg.Table(function(value) { value._select = value.zone == can.db.hash[0] + _project: function(can, msg) { msg.Table(function(value) { can.onimport.item(can, value, function(event, item, show, target) { - can.onimport.tabsCache(can, can.request(), item.zone, item, target, function() { + can.onimport.tabsCache(can, item, target, function() { if (value.zone == ctx.COMMAND) { - can.run(event, [ctx.RUN, ctx.COMMAND], function(msg) { var res = can.request(), cmds = {ice: []} - res.Push(mdb.HASH, "ice").Push(mdb.NAME, "ice").Push(ctx.INDEX, "").Push("prev", "").Push("from", "") - msg.Table(function(value) { can.core.List(value.index.split("."), function(cmd, index, list) { if (list[0] == "ice") { return } - var _mod = list.slice(0, index).join(".")||"ice", _cmd = list.slice(0, index+1).join(".") - var last = (cmds[_mod][cmds[_mod].length-1])||_mod; _cmd != last && cmds[_mod].push(_cmd) - var prev = "", from = ""; if (index % 2 == 0) { prev = last } else { from = last } - if (!cmds[_cmd]) { if (index < list.length-1) { cmds[_cmd] = [] } - res.Push(mdb.HASH, _cmd).Push(mdb.NAME, cmd).Push(ctx.INDEX, index < list.length-1? "": _cmd).Push("prev", prev).Push("from", from) - } - }) }), can.onimport._content(can, res, value) - }) + can.onimport._command(can, value) } else { can.run(event, [value.zone], function(msg) { can.onimport._content(can, msg, value) }) } - }) + }), value._current && can.onimport._profile(can, value._current, value) }) }) }, - _content: function(can, msg, value) { var target = can.ui.content||can._output; can.onmotion.clear(can, target) - 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), can.onappend._status(can, msg) + _command: function(can, value) { + can.run(event, [ctx.RUN, ctx.COMMAND], function(msg) { var res = can.request(), cmds = {ice: []} + res.Push(mdb.HASH, "ice").Push(mdb.NAME, "ice").Push(ctx.INDEX, "").Push("prev", "").Push("from", "") + msg.Table(function(value) { can.core.List(value.index.split("."), function(cmd, index, list) { if (list[0] == "ice") { return } + var _mod = list.slice(0, index).join(".")||"ice", _cmd = list.slice(0, index+1).join(".") + var last = (cmds[_mod][cmds[_mod].length-1])||_mod; _cmd != last && cmds[_mod].push(_cmd) + var prev = "", from = ""; if (index % 2 == 0) { prev = last } else { from = last } + if (!cmds[_cmd]) { if (index < list.length-1) { cmds[_cmd] = [] } + res.Push(mdb.HASH, _cmd).Push(mdb.NAME, cmd).Push(ctx.INDEX, index < list.length-1? "": _cmd).Push("prev", prev).Push("from", from) + } + }) }), can.onimport._content(can, res, value) + }) }, - _toolkit: function(can, msg, value) { var target = can.ui.content||can._output + _content: function(can, msg, value) { + can.onappend.plugin(can, {display: "/plugin/local/wiki/draw.js"}, function(sub) { + sub.onexport.output = function() { value._content_plugin = sub, can.onimport._toolkit(can, msg, value) } + }), can.onappend._status(can, msg) + }, + _toolkit: function(can, msg, value) { can.onappend.plugin(can, {index: "can._action"}, function(sub) { sub.ConfSpace(can.ConfSpace()), sub.ConfIndex([can.ConfIndex(), value.zone].join(":")) sub.run = function(event, cmds, cb) { cmds[0] == ctx.ACTION? can.core.CallFunc(can.onaction[cmds[1]], [event, can, value]): cb && cb(can.request(event)) } - sub.onexport.output = function() { sub.onappend._action(sub, can.onaction._toolkit, null, null, false, 100), value._toolkit_plugin = sub, sub.onaction._select(), can.onimport.layout(can) } + sub.onexport.output = function() { value._toolkit_plugin = sub, sub.onappend._action(sub, can.onaction._toolkit), sub.onaction._select(), can.onimport.layout(can) } sub.onaction._select = function() { can.onimport._display(can, msg, value), can.onimport._flows(can, value) } - }, target) + }) }, - _display: function(can, msg, value) { if (!can.ui.display) { return } can.onmotion.clear(can, can.ui.display) + _display: function(can, msg, value) { var list = {}; msg.Table(function(value) { list[value.hash] = value }) can.core.Item(list, function(key, item) { if (!item.prev && !item.from) { return value._root = item } if (item.prev) { list[item.prev].next = item, item.prev = list[item.prev] } @@ -50,19 +48,20 @@ Volcanos(chat.ONIMPORT, { _msg.Push(mdb.TIME, item.time), _msg.Push(mdb.HASH, item.hash), _msg.Push(mdb.NAME, item.name) _msg.Push(web.SPACE, item.space), _msg.Push(ctx.INDEX, item.index||""), _msg.Push(ctx.ARGS, item.args||""), _msg.Push(ctx.ACTION, item.action||"") }); var table = can.onappend.table(can, _msg, null, can.ui.display); can.page.Select(can, table, "tbody>tr", function(target, index) { _list[index]._tr = target }) - // can.onappend._status(can, can.base.Obj(msg.Option(ice.MSG_STATUS))) }, - _profile: function(can, item, value) { if (!can.ui.profile) { return } can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can) - value._profile_plugin = item._profile_plugin, value._current = item, can.onexport.hash(can, value.zone, item.hash) + _profile: function(can, item, value) { value._profile_plugin = item._profile_plugin, value._current = item + can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can) + can.onexport.hash(can, value.zone, item.hash), can.onexport.title(can, value.zone, item.name||item.index.split(".").pop()) if (can.onmotion.cache(can, function() { return can.core.Keys(value.zone, item.hash) }, can.ui.profile)) { return } - item.index && can.onappend.plugin(can, {pod: item.space, index: item.index, args: item.args, width: can.ui.profileWidth-1}, function(sub) { value._profile_plugin = item._profile_plugin = sub + item.index && can.onappend.plugin(can, {pod: item.space, index: item.index, args: item.args}, function(sub) { value._profile_plugin = item._profile_plugin = sub sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) } sub.onexport.output = function() { can.onimport.layout(can) } }, can.ui.profile) }, _flows: function(can, value) { var sub = value._toolkit_plugin.sub, _sub = value._content_plugin.sub var margin = can.onexport.margin(sub), height = can.onexport.height(sub), width = can.onexport.width(sub) - var matrix = {}, lines = [], rects = [], horizon = sub.Action("direct") == "horizon"; can.onmotion.clear(can, _sub.ui.svg) + var matrix = {}, lines = [], rects = [], horizon = sub.Action("direct") == "horizon" + can.onmotion.clear(can, _sub.ui.svg), _sub.ui.svg.Value("font-size", sub.Action("font-size")+"px") function show(item, main, deep) { var prev = "from", from = "prev"; if (horizon) { var prev = "prev", from = "from" } while (matrix[can.core.Keys(item.x, item.y)]) { if (horizon && main || !horizon && !main) { @@ -84,21 +83,16 @@ Volcanos(chat.ONIMPORT, { if (item.prev || item.from) { lines.length <= deep && lines.push(_sub.onimport.group(_sub, "line"+deep)) item._line = _sub.onimport.draw(_sub, {shape: svg.LINE, points: horizon && item.from || !horizon && !item.from? [{x: item.x*width+width/2, y: item.y*height-margin}, {x: item.x*width+width/2, y: item.y*height+margin}]: - [{x: item.x*width-margin, y: item.y*height+height/2}, {x: item.x*width+margin, y: item.y*height+height/2}] + [{x: item.x*width-margin, y: item.y*height+height/2}, {x: item.x*width+margin, y: item.y*height+height/2}] }, lines[deep]) } rects.length <= deep && rects.push(_sub.onimport.group(_sub, "rect"+deep)), can.onimport._block(can, value, item, item.x*width, item.y*height, rects[deep]) - } value._root.x = 0, value._root.y = 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.isCmdMode() && item._rect.scrollIntoViewIfNeeded() - can.user.isChrome && item._rect.scrollIntoViewIfNeeded() - can.onmotion.delay(can, function() { next() }, 30) - can.user.toastProcess(can, index+" / "+list.length) - }, function() { - can.user.toastSuccess(can) - }) + } value._root.x = 0, value._root.y = 0; var list = can.onexport.travel(can, value, value._root, true, 0) + can.core.Next(list, function(item, next, index) { can.user.toastProcess(can, index+" / "+list.length, "", index/list.length*100) + show(item, item._main, item._deep), can.onmotion.delay(can, function() { next() }, 30) + can.isCmdMode() && can.user.isChrome && item._rect.scrollIntoViewIfNeeded() + }, function() { can.user.toastSuccess(can) }) var max_x = 0, max_y = 0; can.core.List(list, function(item) { item.x > max_x && (max_x = item.x), item.y > max_y && (max_y = item.y) }) - _sub.ui.svg.Value(html.HEIGHT, max_y*height), _sub.ui.svg.Value(html.WIDTH, max_x*width), _sub.ui.svg.Value("font-size", sub.Action("font-size")+"px") + _sub.ui.svg.Value(html.HEIGHT, max_y*height), _sub.ui.svg.Value(html.WIDTH, max_x*width) }, _block: function(can, value, item, x, y, group) { var sub = value._toolkit_plugin.sub, _sub = value._content_plugin.sub var margin = can.onexport.margin(sub), height = can.onexport.height(sub), width = can.onexport.width(sub) @@ -114,7 +108,6 @@ 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, { @@ -155,18 +148,14 @@ Volcanos(chat.ONACTION, { can.ondetail._select(event, can, sub.Action("travel") == "wide" && can.db.current.next || can.db.current.to, value) }, - create: function(event, can) { - can.user.input(event, can, can.Conf("feature.create"), function(data) { - can.runAction(can.request(event, data), mdb.CREATE, [], function(msg) { - can.db.hash = can.onexport.hash(can, data.zone) - msg = can.request(), msg.Push(data), can.onimport._project(can, msg) - }) + create: function(event, can) { can.user.input(event, can, can.Conf("feature.create"), function(data) { + can.runAction(can.request(event, data), mdb.CREATE, [], function(msg) { can.db.hash = can.onexport.hash(can, data.zone) + msg = can.request(), msg.Push(data), can.onimport._project(can, msg) }) - }, + }) }, addnext: function(event, can) { can.onaction._insert(event, can, "prev") }, addto: function(event, can) { can.onaction._insert(event, can, "from") }, - toggles: function(event, can) { - var msg = can.request(event) + toggles: function(event, can) { var msg = can.request(event) can.db.value._list[msg.Option(mdb.HASH)]._close = !can.db.value._list[msg.Option(mdb.HASH)]._close can.onimport._flows(can, can.db.value) }, @@ -190,7 +179,6 @@ Volcanos(chat.ONACTION, { }) Volcanos(chat.ONDETAIL, { _select: function(event, can, item, value) { can.onimport._profile(can, item, value) - 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)) { @@ -201,20 +189,19 @@ Volcanos(chat.ONDETAIL, { }) can.page.Select(can, item._tr.parentNode, "", function(target) { can.page.ClassList.set(can, target, html.SELECT, target == item._tr) can.onmotion.scrollIntoView(can, item._tr, 45, can.ui.display) - }) + }), can.isCmdMode() && can.user.isChrome && item._rect.scrollIntoViewIfNeeded() }, onclick: function(event, can, item, value) { can.request(event, item, {zone: value.zone}) var sub = value._toolkit_plugin.sub, _sub = value._content_plugin.sub switch (_sub.ui.svg.style.cursor) { - case "e-resize": if (sub.Action("direct") == "horizon") { can.onaction.addnext(event, can) } else { can.onaction.addto(event, can) } break - case "s-resize": if (sub.Action("direct") == "horizon") { can.onaction.addto(event, can) } else { can.onaction.addnext(event, can) } break - default: can.ondetail._select(event, can, item, value) + case "e-resize": if (sub.Action("direct") == "horizon") { can.onaction.addnext(event, can) } else { can.onaction.addto(event, can) } break + case "s-resize": if (sub.Action("direct") == "horizon") { can.onaction.addto(event, can) } else { can.onaction.addnext(event, can) } break + default: can.ondetail._select(event, can, item, value) } }, oncontextmenu: function(event, can, item, value) { item.action? can.user.carteItem(event, can, can.base.CopyStr({action: item.action, zone: value.zone}, item)): can.user.carte(can.request(event, item, value), can, can.onaction, ["toggles"], function(event, button) { - can.request(event, item, value) - can.onaction[button](event, can, button) + can.request(event, item, value), can.onaction[button](event, can, button) }) }, }) @@ -222,8 +209,7 @@ Volcanos(chat.ONEXPORT, { margin: function(can) { var margin = can.Action(html.MARGIN); return parseFloat(margin)||10 }, height: function(can) { var height = can.Action(html.HEIGHT); return parseFloat(height)||60 }, width: function(can) { var width = can.Action(html.WIDTH); return parseFloat(width)||200 }, - travel: function(can, value, root, main, deep) { if (!root) { return [] } - root._deep = deep||0 + travel: function(can, value, root, main, deep) { if (!root) { return [] } root._deep = deep||0 var list = [root]; if (root._close) { return list } var sub = value._toolkit_plugin.sub if (sub.Action("travel") == "deep") { main == undefined && (main = true), root._main = main var horizon = sub.Action("direct") == "horizon" diff --git a/core/chat/macos/desktop.js b/core/chat/macos/desktop.js index f1af6ccf..86531760 100644 --- a/core/chat/macos/desktop.js +++ b/core/chat/macos/desktop.js @@ -92,7 +92,7 @@ Volcanos(chat.ONIMPORT, { sub._target._meta.args = can.base.trim(can.page.SelectArgs(can, sub._option, "", function(target) { return target.value })), can.onexport.tabs(can) }, sub.onimport.size(sub, item.height, can.base.Min(sub._target.offsetWidth, item.width), false) sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) } - sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {index: web.CHAT_IFRAME, args: [arg]}) } + sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {title: msg.Option(html.TITLE), index: web.CHAT_IFRAME, args: [arg]}) } sub.onimport._field = function(sub, msg) { msg.Table(function(item) { can.onimport._window(can, item) }) } sub.onappend.dock = function(item) { can.ui.dock.runAction(can.request(event, item), mdb.CREATE, [], function() { can.ui.dock.Update() }) } sub.onaction._close = function() { can.page.Remove(can, sub._target), can.onexport.tabs(can) } diff --git a/core/chat/message.js b/core/chat/message.js index af17cfc4..8f752a48 100644 --- a/core/chat/message.js +++ b/core/chat/message.js @@ -1,6 +1,5 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - // if (can.isCmdMode()) { can.onappend.style(can, html.OUTPUT) } can.ui = can.onappend.layout(can), can.onimport._project(can, msg) }, _project: function(can, msg) { var select, current = can.db.hash[0]||can.sup.db.current||ice.DEV @@ -15,7 +14,9 @@ Volcanos(chat.ONIMPORT, { {view: wiki.TITLE, list: [{text: can.base.trimPrefix(value.title||value.zone, "ops.")||"[未命名]"}]}, {view: wiki.CONTENT, list: [{text: can.base.trimPrefix(value.target, "ops.")||"[未知消息]"}, {text: [can.base.TimeTrim(value.time), "", mdb.TIME]}]}, ]}, - ], onclick: function(event) { can.isCmdMode() && can.misc.SearchHash(can, value.zone), can.onimport._switch(can, false) + ], onclick: function(event) { + can.onexport.hash(can, value.zone), can.onexport.title(can, value.zone) + can.onimport._switch(can, false) can.sup.db.current = value.zone can.db.zone = value, can.db.hash = value.hash, can.onmotion.select(can, can.ui.project, html.DIV_ITEM, _target) if (can.onmotion.cache(can, function(save, load) { diff --git a/core/wiki/portal.css b/core/wiki/portal.css index 1e19ab57..ee8d6391 100644 --- a/core/wiki/portal.css +++ b/core/wiki/portal.css @@ -37,7 +37,8 @@ fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output di --code-function:cyan; --code-constant:silver; --code-string:silver; --code-package:silver; --code-datatype:silver; --code-object:silver; } -body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border:var(--box-border); border-left:var(--box-notice3); } +body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border-left:var(--box-notice3); } +// body.dark fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { border:var(--box-border); } fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { box-shadow:var(--th-box-shadow); border:0; border-left:var(--box-notice3); } fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell]:hover { box-shadow:var(--notice-box-shadow); } fieldset.web.wiki.portal>div.output>div.layout>div.main div.story[data-type=spark][data-name=shell] { background-color:var(--code-bg-color); color:var(--code-fg-color); padding:var(--button-padding); margin-top:var(--button-margin); } diff --git a/core/wiki/portal.go b/core/wiki/portal.go index 75e795ee..f451798d 100644 --- a/core/wiki/portal.go +++ b/core/wiki/portal.go @@ -61,9 +61,9 @@ func _portal_commands(m *ice.Message, arg ...string) { } const ( + INDEX_SHY = "index.shy" HEADER = "header" NAV = "nav" - INDEX_SHY = "index.shy" ) const PORTAL = "portal" @@ -71,9 +71,7 @@ const PORTAL = "portal" func init() { Index.MergeCommands(ice.Commands{ PORTAL: {Name: "portal path auto", Help: "官网", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{ - ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { - aaa.White(m, ice.VAR_PORTAL) - }}, + ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { aaa.White(m, ice.VAR_PORTAL) }}, ctx.RUN: {Hand: func(m *ice.Message, arg ...string) { if p := path.Join(ice.VAR_PORTAL, path.Join(arg...)); (m.Option(ice.DEBUG) == ice.TRUE || !nfs.ExistsFile(m, p)) && aaa.Right(m.Spawn(), arg) { ctx.Run(m, arg...) diff --git a/misc/ssh/relay/relay.go b/misc/ssh/relay/relay.go index c3af90c5..248da117 100644 --- a/misc/ssh/relay/relay.go +++ b/misc/ssh/relay/relay.go @@ -354,9 +354,10 @@ func init() { ice.Cmd(SSH_RELAY, relay{}) } func (s relay) iframe(m *ice.Message, cmd string, arg ...string) { p := kit.MergeURL2(m.Option(web.LINK), web.C(kit.Select(m.ActionKey(), cmd))) if m.IsChromeUA() && m.UserWeb().Scheme == ice.HTTP && strings.HasPrefix(p, ice.HTTPS) { + m.Option(web.TITLE, kit.Keys(m.Option(MACHINE), kit.Select(m.ActionKey(), cmd))) m.ProcessOpen(p) } else { - m.ProcessIframe(m.Option(MACHINE), p, arg...) + m.ProcessIframe(kit.Keys(m.Option(MACHINE), kit.Select(m.ActionKey(), cmd)), p, arg...) } } func (s relay) shell(m *ice.Message, init string, arg ...string) { diff --git a/misc/ssh/relay/trans.json b/misc/ssh/relay/trans.json index 1bf141a0..b805974c 100644 --- a/misc/ssh/relay/trans.json +++ b/misc/ssh/relay/trans.json @@ -5,6 +5,9 @@ "adminCmd": "命令", "pushbin": "部署", "pushkey": "授权", + "icons": { + "spide": "bi bi-telephone-forward" + }, "input": { "machine": "机器", "package": "软件包",