1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
root 2024-10-17 23:45:30 +08:00
parent d7c0a536ea
commit 78af0b3d1c
6 changed files with 22 additions and 20 deletions

View File

@ -113,8 +113,10 @@ var web = {
PORTAL: "portal", DESKTOP: "desktop", PORTAL: "portal", DESKTOP: "desktop",
STUDIO: "studio", SERVICE: "service", STUDIO: "studio", SERVICE: "service",
MESSAGE: "message", MESSAGE: "message",
WORD: "word", STATUS: "status",
VIMER: "vimer", VIMER: "vimer",
WORD: "word",
PLAN: "plan",
CODE_GIT_SEARCH: "web.code.git.search", CODE_GIT_SEARCH: "web.code.git.search",
CODE_GIT_STATUS: "web.code.git.status", CODE_GIT_STATUS: "web.code.git.status",

View File

@ -303,7 +303,7 @@ Volcanos(chat.ONAPPEND, {
}: {_space: "", }: {_space: "",
full: !can.isCmdMode() && "切换全屏", full: !can.isCmdMode() && "切换全屏",
open: !can.isCmdMode() && "打开链接", open: !can.isCmdMode() && "打开链接",
chat: can.user.isTechOrRoot(can) && can.ConfIndex() != chat.MESSAGE && "发送聊天", // chat: can.user.isTechOrRoot(can) && can.ConfIndex() != chat.MESSAGE && "发送聊天",
// help: can.page.ClassList.has(can, can._fields||can._target, html.PLUGIN) && can.Conf("_help") && can.Conf("_help") != "" && "查看文档", // help: can.page.ClassList.has(can, can._fields||can._target, html.PLUGIN) && can.Conf("_help") && can.Conf("_help") != "" && "查看文档",
}, function(key, value) { }, function(key, value) {
return (value || value === "") && {view: [[html.ITEM, html.BUTTON, key, mdb.ICONS, "state"]], list: [{icon: icon[key]}], return (value || value === "") && {view: [[html.ITEM, html.BUTTON, key, mdb.ICONS, "state"]], list: [{icon: icon[key]}],
@ -435,8 +435,7 @@ Volcanos(chat.ONAPPEND, {
field: function(can, type, item, target) { type = type||html.STORY, item = item||{} field: function(can, type, item, target) { type = type||html.STORY, item = item||{}
var name = can.core.Split(item.nick||item.index||"", " .").pop()||""; can.base.isIn(name, var name = can.core.Split(item.nick||item.index||"", " .").pop()||""; can.base.isIn(name,
"cluster", "cluster", "launchTemplate",
"launchTemplate",
tcp.SERVER, tcp.CLIENT, web.STUDIO, mdb.SEARCH, web.SERVICE, tcp.SERVER, tcp.CLIENT, web.STUDIO, mdb.SEARCH, web.SERVICE,
can.core.Split(can.ConfIndex(), nfs.PT).pop() can.core.Split(can.ConfIndex(), nfs.PT).pop()
) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT)) ) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT))

View File

@ -204,13 +204,13 @@ div.item.card div.status span { margin-right:5px; }
div.item.card div.action { max-width:100%; display:flex; align-items:center; } div.item.card div.action { max-width:100%; display:flex; align-items:center; }
div.item.card div.action { position:absolute; right:0; } div.item.card div.action { position:absolute; right:0; }
div.item.card div.title div.action { top:0; } div.item.card div.title div.action { top:0; }
body:not(.mobile) div.item.card div.action { z-index:1; } body:not(.width1) div.item.card div.action { z-index:1; }
div.item.card div.action input[type=button] { background-color:transparent; border:none; color:var(--notice-bg-color); margin-left:5px; } div.item.card div.action input[type=button] { background-color:transparent; border:none; color:var(--notice-bg-color); margin-left:5px; }
div.item.card div.action input[type=button].danger { color:var(--danger-bg-color) } div.item.card div.action input[type=button].danger { color:var(--danger-bg-color) }
div.item.card div.action input[type=button]:last-child { margin-right:5px; } div.item.card div.action input[type=button]:last-child { margin-right:5px; }
div.item.card div.output { padding:10px 0; display:flex; transition:left .2s; } div.item.card div.output { padding:10px 0; display:flex; transition:left .2s; }
body.mobile div.item.card div.output { width:100%; } body.width1 div.item.card div.output { width:100%; }
body.mobile div.item.card div.output { background-color:var(--output-bg-color); } body.width1 div.item.card div.output { background-color:var(--output-bg-color); }
div.item.card.select div.title { font-weight:bold; } div.item.card.select div.title { font-weight:bold; }
div.item.card.select div.output { transition:left .5s; } div.item.card.select div.output { transition:left .5s; }
div.item img[src*=".ico"] { padding:3px; } div.item img[src*=".ico"] { padding:3px; }
@ -599,8 +599,8 @@ fieldset.input>span.close { line-height:16px; padding:var(--input-padding); posi
fieldset.input>span.close:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; } fieldset.input>span.close:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; }
div.float { background-color:var(--float-bg-color); } div.float { background-color:var(--float-bg-color); }
div.carte div.item:hover { background-color:var(--hover-bg-color); } div.carte div.item:hover { background-color:var(--hover-bg-color); }
div.carte div.item.notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } div.carte div.item.notice:hover { background-color:var(--notice-bg-color) !important; color:var(--notice-fg-color) !important; }
div.carte div.item.danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } div.carte div.item.danger:hover { background-color:var(--danger-bg-color) !important; color:var(--danger-fg-color) !important; }
/* z-index */ /* z-index */
table.content.action td:last-child { z-index:1; } table.content.action td:last-child { z-index:1; }
table.content.checkbox td:first-child { z-index:1; } table.content.checkbox td:first-child { z-index:1; }
@ -626,6 +626,7 @@ body.light fieldset.plugin>legend { box-shadow:var(--legend-box-shadow); margin-
body.light fieldset.story>legend { box-shadow:var(--legend-box-shadow); margin-right:var(--legend-margin); } body.light fieldset.story>legend { box-shadow:var(--legend-box-shadow); margin-right:var(--legend-margin); }
body.light fieldset.vimer fieldset.story>legend { margin-right:var(--input-margin); padding:0 var(--input-padding); } body.light fieldset.vimer fieldset.story>legend { margin-right:var(--input-margin); padding:0 var(--input-padding); }
fieldset.story>legend { border-top-left-radius:var(--plugin-radius); } fieldset.story>legend { border-top-left-radius:var(--plugin-radius); }
fieldset.story.float>legend { padding:0 10px; }
fieldset>form.option div.item:not(.icon) { box-shadow:var(--input-box-shadow); } fieldset>form.option div.item:not(.icon) { box-shadow:var(--input-box-shadow); }
fieldset>form.option div.item.select { border-radius:var(--button-radius); } fieldset>form.option div.item.select { border-radius:var(--button-radius); }
fieldset>form.option div.item.button { border-radius:var(--button-radius); } fieldset>form.option div.item.button { border-radius:var(--button-radius); }

View File

@ -7,9 +7,10 @@ Volcanos(chat.ONIMPORT, {
can.base.isIn(item.index, ssh.CLOUD_PROFILE) && (item.style = html.OUTPUT) can.base.isIn(item.index, ssh.CLOUD_PROFILE) && (item.style = html.OUTPUT)
if (list.length == 0) { if (list.length == 0) {
can.user.info.nodetype == web.SERVER && item._command == web.DREAM && (list = [river, storm, item._command]) can.user.info.nodetype == web.SERVER && item._command == web.DREAM && (list = [river, storm, item._command])
can.user.info.nodetype == web.WORKER && item._command == web.WORD && (list = [river, storm, item._command]) can.user.info.nodetype == web.WORKER && item._command == web.VIMER && (list = [river, storm, item._command])
} }
can.onappend.plugin(can, item, function(sub, meta, skip) { can.onappend.plugin(can, item, function(sub, meta, skip) {
sub.Conf(ice.AUTO, cli.DELAY)
if (msg.detail && can.base.isIn(meta.index, "can._notfound")) { sub.Conf(ctx.INDEX, msg.detail[index+3]) } if (msg.detail && can.base.isIn(meta.index, "can._notfound")) { sub.Conf(ctx.INDEX, msg.detail[index+3]) }
sub.run = function(event, cmds, cb) { return can.run(can.request(event, {pod: meta.pod||meta.space}), (can.base.beginWith(meta.index, "can.")? [meta.index]: [river, storm, meta.id||meta.index]).concat(cmds), cb) } sub.run = function(event, cmds, cb) { return can.run(can.request(event, {pod: meta.pod||meta.space}), (can.base.beginWith(meta.index, "can.")? [meta.index]: [river, storm, meta.id||meta.index]).concat(cmds), cb) }
sub.onexport.output = function() { msg.Length() > 1 && can.onexport.isauto(can) && can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, ""), can.onaction.layout(can, list[3]) } sub.onexport.output = function() { msg.Length() > 1 && can.onexport.isauto(can) && can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, ""), can.onaction.layout(can, list[3]) }
@ -18,8 +19,7 @@ Volcanos(chat.ONIMPORT, {
}) })
}, function() { can.onaction.layout(can, list[3]), _select._tabs.click() }) }, function() { can.onaction.layout(can, list[3]), _select._tabs.click() })
}, },
_tabs: function(can, sub, meta) { _tabs: function(can, sub, meta) { var _init = true
var _init = true
var tabs = [{view: [[html.TABS, meta.name], "", can.user.trans(can, meta.name, meta.help)], title: meta.help, onclick: function(event) { can._current = sub var tabs = [{view: [[html.TABS, meta.name], "", can.user.trans(can, meta.name, meta.help)], title: meta.help, onclick: function(event) { can._current = sub
can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target)
can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs) can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs)
@ -27,13 +27,13 @@ Volcanos(chat.ONIMPORT, {
// can.onmotion.delay(can, function() { sub._header_tabs.scrollIntoViewIfNeeded() }) // can.onmotion.delay(can, function() { sub._header_tabs.scrollIntoViewIfNeeded() })
var layout = can.onexport.layout(can); layout == FREE || (can._output.scrollTop = sub._target.offsetTop-10) var layout = can.onexport.layout(can); layout == FREE || (can._output.scrollTop = sub._target.offsetTop-10)
can.isCmdMode() || can.misc.SearchHash(can, can.Conf(chat.RIVER), can.Conf(chat.STORM), sub.ConfIndex(), layout) can.isCmdMode() || can.misc.SearchHash(can, can.Conf(chat.RIVER), can.Conf(chat.STORM), sub.ConfIndex(), layout)
sub.Conf(ice.AUTO) == cli.DELAY && sub._output.innerHTML == "" && sub.Update(can.request(event, {_toast: "load"}))
sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can))
can.onengine.signal(can, "onindex", can.request(_init? {target: event.target, type: "click", isTrusted: true}: event, {index: sub.ConfIndex()})), _init = false can.onengine.signal(can, "onindex", can.request(_init? {target: event.target, type: "click", isTrusted: true}: event, {index: sub.ConfIndex()})), _init = false
// can.onengine.signal(can, "onevent", can.request(_init? {target: event.target, type: "click", isTrusted: true}: event)), _init = false // can.onengine.signal(can, "onevent", can.request(_init? {target: event.target, type: "click", isTrusted: true}: event)), _init = false
}, oncontextmenu: sub._legend.onclick}]; sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target }, oncontextmenu: sub._legend.onclick}]; sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target
}, },
_menu: function(can, msg) { if (can.user.isMobile) { return } _menu: function(can, msg) { if (can.user.isMobile) { return } if (!can.user.isTechOrRoot(can)) { return }
if (!can.user.isTechOrRoot(can)) { return }
var target = can.setHeaderMenu(can.base.Obj(can.Conf(chat.MENUS)||msg.Option(chat.MENUS), can.onaction._menus), function(event, button, list) { list && can.core.CallFunc([can.onaction, list[0]], [can, button]) }) var target = can.setHeaderMenu(can.base.Obj(can.Conf(chat.MENUS)||msg.Option(chat.MENUS), can.onaction._menus), function(event, button, list) { list && can.core.CallFunc([can.onaction, list[0]], [can, button]) })
can.onmotion.hidden(can, can._header_tabs = can.page.Append(can, target, ["_tabs"])._target) can.onmotion.hidden(can, can._header_tabs = can.page.Append(can, target, ["_tabs"])._target)
}, },

View File

@ -10,9 +10,10 @@ Volcanos(chat.ONIMPORT, {
can.onimport._title(can, msg, target) can.onimport._title(can, msg, target)
can.onimport._storm(can, msg, target) can.onimport._storm(can, msg, target)
can.core.List([ can.core.List([
{index: chat.TUTOR}, // {index: chat.TUTOR},
{index: chat.FLOWS, value: "流程"}, // {index: chat.FLOWS, value: "流程"},
{index: chat.MESSAGE}, // {index: chat.MESSAGE},
{index: web.SPIDE, value: "服务"},
{index: cli.RUNTIME}, {index: cli.RUNTIME},
{index: code.XTERM, args: [cli.SH]}, {index: code.XTERM, args: [cli.SH]},
], function(value) { value.type = html.BUTTON, value.name = value.index ], function(value) { value.type = html.BUTTON, value.name = value.index

View File

@ -39,9 +39,8 @@ Volcanos(chat.ONIMPORT, {
} }
var option = can.base.Obj(msg.Option("field.option")) var option = can.base.Obj(msg.Option("field.option"))
msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash }) msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash })
var sup = item.space? can._root.Action: can var sup = item.space? can._root.Action: can; height = item._height||height, width = item._width||width
height = item._height||height, width = item._width||width can.onappend._plugin(sup, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width, icons: item._icon}, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
can.onappend._plugin(sup, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)||item.index; sup.run(can.request(event, {pod: item.space}, option), (msg[ice.FIELD_PREFIX]? msg[ice.FIELD_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) } sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)||item.index; sup.run(can.request(event, {pod: item.space}, option), (msg[ice.FIELD_PREFIX]? msg[ice.FIELD_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) }
can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, !can.user.isMobile), cb && cb(sub) can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, !can.user.isMobile), cb && cb(sub)
if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300) if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)