mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
047375297d
commit
bf5fe5632d
11
frame.js
11
frame.js
@ -80,7 +80,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.requ
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONDAEMON, {_init: function(can, name) { if (can.user.isLocalFile) { return }
|
||||
can.misc.WSS(can, {type: html.CHROME, name: can.misc.Search(can, cli.DAEMON)||name||"", text: can.user.title(), theme: can.getHeaderTheme()}, function(event, msg, cmd, arg, cb) {
|
||||
can.misc.WSS(can, {type: html.CHROME, name: can.misc.Search(can, cli.DAEMON)||name||"", text: can.user.title(), theme: can.getHeaderTheme(), module: "shylinux.com/x/volcanos", version: can.base.trimPrefix(window._version, "?_v=")}, function(event, msg, cmd, arg, cb) {
|
||||
var sub = can.ondaemon._list[msg.Option(ice.MSG_TARGET)]||can; can.base.isFunc(sub.ondaemon[cmd])?
|
||||
can.core.CallFunc(sub.ondaemon[cmd], {can: can, msg: msg, sub: sub, cmd: cmd, arg: arg, cb: cb}):
|
||||
can.onengine._search({}, can, msg, can, [chat._SEARCH, cmd].concat(arg), cb)
|
||||
@ -252,7 +252,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
var last = can.core.Value(can, chat._OUTPUTS_CURRENT); last && can.core.CallFunc([last, "onaction.hidden"], {can: last})
|
||||
sub.run = function(event, cmds, cb, silent) {
|
||||
sub.request(event)._caller().RunAction(event, sub, cmds) || can.Update(event, can.Input(cmds, !silent), cb, silent)
|
||||
}, can._outputs = can._outputs||[], can._outputs.push(sub), sub.sup = can
|
||||
}, can._outputs = can._outputs||[], can._outputs.push(sub), sub.sup = can, can.sub = sub
|
||||
sub._index = can._index, can._msg = sub._msg = msg, sub.Conf(sub._args = can.base.ParseURL(display))
|
||||
sub._trans = can.base.Copy(can.base.Copy(sub._trans||{}, can._trans), can.core.Value(sub, [chat.ONACTION, chat._TRANS]))
|
||||
if (sub.onimport && can.base.isArray(sub.onimport.list) && sub.onimport.list.length > 0) {
|
||||
@ -261,7 +261,6 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
||||
action === false || can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
||||
action === false || sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
|
||||
// can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, ""), can.onappend.style(sub, sub.Conf(ctx.STYLE))
|
||||
can.onappend.style(sub, sub.Conf(ctx.STYLE))
|
||||
if (can.isFullMode() || can.isCmdMode()) { can.onimport.size(can, can.page.height(), can.page.width(), true) }
|
||||
can.onmotion.story.auto(can, can._output), can.onexport.output(sub, msg), can.base.isFunc(cb) && cb(msg)
|
||||
@ -373,10 +372,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
input.onkeyup = item.onkeyup||function(event) { if (item.name == html.FILTER) { can.user.toast(can, "filter out "+can.page.Select(can, can._output, html.TR, function(tr, index) {
|
||||
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(event.target.value) == -1)) { return tr }
|
||||
}).length+" lines") } }
|
||||
icon.push({icon: mdb.DELETE, onclick: function(event) {
|
||||
_input.value = "", input.onkeyup({target: event.target.previousSibling})
|
||||
// , item.name == html.FILTER && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) })
|
||||
}})
|
||||
icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", input.onkeyup({target: event.target.previousSibling}) }})
|
||||
} if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } }
|
||||
var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name])], list: [item.icon && {icon: item.icon}, input].concat(icon), _init: function(target, _input) {
|
||||
if (item.type == html.SELECT) { _input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item) }
|
||||
@ -568,7 +564,6 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
||||
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height) })
|
||||
}), can.onengine.signal(can, chat.ONSIZE, can.request({}, {height: height, width: width}))
|
||||
can.user.isMobile && can.user.isLandscape() || can.page.style(can, document.body, kit.Dict(html.OVERFLOW, html.HIDDEN))
|
||||
// can.user.isMobile && can.page.style(can, document.body, kit.Dict(html.OVERFLOW, html.HIDDEN))
|
||||
},
|
||||
expand: function(can, target, width) { var n = parseInt(target.offsetWidth/(width+20)); width = target.offsetWidth/n - 20
|
||||
can.page.SelectChild(can, target, "*", function(target) { can.page.styleWidth(can, target, width) })
|
||||
|
@ -360,6 +360,8 @@ fieldset.draw div.output svg { margin-bottom:-5px; }
|
||||
fieldset.draw>form.option>div.item.pid>input { width:60px; }
|
||||
// fieldset.draw div.output svg { margin-bottom:-4px; height:100%; width:100%; }
|
||||
fieldset.draw.trend div.output svg { background-color:#1b5b738c; }
|
||||
fieldset.draw.trend div.output { overflow:hidden; }
|
||||
fieldset.draw.spide div.output { overflow:hidden; }
|
||||
fieldset.draw.spide div.output svg text { cursor:pointer; }
|
||||
fieldset.draw.spide div.output svg path { stroke-width:1; }
|
||||
fieldset.web.code.git.status>div.output table.content { width:100%; }
|
||||
|
@ -91,8 +91,7 @@ Volcanos("misc", {
|
||||
var url = location.protocol.replace(ice.HTTP, "ws")+"//"+location.host+"/space/"
|
||||
if (url.indexOf(html.CHROME) == 0) { url = "ws://localhost:9020/space/" }
|
||||
try { var socket = new WebSocket(can.base.MergeURL(url, args)); _msg = _msg || can.request()._caller() } catch {}
|
||||
can._socket = socket
|
||||
socket.onclose = function() { can.misc.Log(html.WSS, cli.CLOSE, args)
|
||||
can._socket = socket, socket.onclose = function() { can.misc.Log(html.WSS, cli.CLOSE, args)
|
||||
can.base.isFunc(onclose)? onclose(socket): can.core.Timer(can.base.random(3000, 100), function() {
|
||||
args.name = args.name||can._wss_name, can.misc.WSS(can, args, cb, onopen, onerror, onclose, _msg)
|
||||
})
|
||||
|
@ -79,7 +79,6 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
onresize: function(can) { can.onaction.layout(can), window.setsize && window.setsize(can.page.width(), can.page.height()) },
|
||||
ontitle: function(can, msg) { can.onlayout._storage(can, "") },
|
||||
|
||||
flows: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.CHAT_FLOWS})) },
|
||||
portal: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL})) },
|
||||
desktop: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.CHAT_MACOS_DESKTOP})) },
|
||||
layout: function(can, button, skip) { can.page.ClassList.del(can, can._target, can._layout||can.onlayout._storage(can)), can._header_tabs && can.onmotion.hidden(can, can._header_tabs)
|
||||
@ -88,8 +87,8 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
can.isCmdMode() || can.core.List(can._plugins, function(sub) { sub._delay_refresh = false, can.page.ClassList.set(can, sub._target, html.OUTPUT, [TABVIEW, HORIZON, VERTICAL].indexOf(button) > -1) })
|
||||
var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can) || can.onlayout._plugin(can, button)
|
||||
},
|
||||
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "flows", "desktop", "portal"],
|
||||
_trans: kit.Dict("flows", "流程", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "desktop", "portal"],
|
||||
_trans: kit.Dict("portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
})
|
||||
Volcanos(chat.ONLAYOUT, {
|
||||
tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)+html.ACTION_MARGIN), can.ConfWidth(width-can.Conf(html.MARGIN_X)) })
|
||||
|
@ -48,7 +48,7 @@ Volcanos(chat.ONACTION, {_init: function(can) { can.onmotion.hidden(can) }, list
|
||||
},
|
||||
plugin: function(event, can, data) { if (can.base.isFunc(data.text)) { return can.onmotion.hidden(can), data.text(event) }
|
||||
var cmd = data.cmd == ctx.COMMAND? can.core.Keys(data.type, data.name.split(lex.SP)[0]): can.core.Keys(data.ctx, data.cmd)
|
||||
var meta = {type: chat.STORY, index: cmd||msg.Option(mdb.INDEX), args: cmd == web.WIKI_WORD? [data.name]: []}
|
||||
var meta = {type: chat.STORY, index: cmd||msg.Option(mdb.INDEX), args: cmd == web.WIKI_WORD? [data.name]: can.core.Split(data.text)}
|
||||
if (data.type == cli.OPENS) { return can.runAction(event, cli.OPENS, [data.text], null, true) }
|
||||
if (data.type == ssh.SHELL) { meta = {index: web.CODE_XTERM, args: [data.text]} }
|
||||
if (data.type == ctx.INDEX) { meta = {index: data.text.split(mdb.FS)[0], args: data.text.split(mdb.FS).slice(1) } }
|
||||
|
@ -62,7 +62,7 @@ Volcanos(chat.ONFIGURE, {
|
||||
can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) })
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码", "文档", "计划", "流程", "桌面", "后台", "官网"],
|
||||
Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码", "文档", "计划", "流程", "后台", "桌面", "官网"],
|
||||
_trans: {show: "预览", exec: "输出"},
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) {
|
||||
can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button)
|
||||
|
Loading…
x
Reference in New Issue
Block a user