From 78af0b3d1c8d6449d8ab0ac935c661b02b309b04 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Oct 2024 23:45:30 +0800 Subject: [PATCH] add some --- const.js | 4 +++- frame.js | 5 ++--- index.css | 11 ++++++----- panel/action.js | 10 +++++----- panel/footer.js | 7 ++++--- plugin/state.js | 5 ++--- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/const.js b/const.js index d93bf455..64e6fc00 100644 --- a/const.js +++ b/const.js @@ -113,8 +113,10 @@ var web = { PORTAL: "portal", DESKTOP: "desktop", STUDIO: "studio", SERVICE: "service", MESSAGE: "message", - WORD: "word", + STATUS: "status", VIMER: "vimer", + WORD: "word", + PLAN: "plan", CODE_GIT_SEARCH: "web.code.git.search", CODE_GIT_STATUS: "web.code.git.status", diff --git a/frame.js b/frame.js index 439abe47..8a0866d6 100644 --- a/frame.js +++ b/frame.js @@ -303,7 +303,7 @@ Volcanos(chat.ONAPPEND, { }: {_space: "", full: !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") != "" && "查看文档", }, function(key, value) { 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||{} var name = can.core.Split(item.nick||item.index||"", " .").pop()||""; can.base.isIn(name, - "cluster", - "launchTemplate", + "cluster", "launchTemplate", tcp.SERVER, tcp.CLIENT, web.STUDIO, mdb.SEARCH, web.SERVICE, can.core.Split(can.ConfIndex(), nfs.PT).pop() ) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT)) diff --git a/index.css b/index.css index 7474e9c0..c998db69 100644 --- a/index.css +++ b/index.css @@ -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 { position:absolute; right: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].danger { color:var(--danger-bg-color) } 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; } -body.mobile 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 { width:100%; } +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.output { transition:left .5s; } 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; } div.float { background-color:var(--float-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.danger:hover { background-color:var(--danger-bg-color); color:var(--danger-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) !important; color:var(--danger-fg-color) !important; } /* z-index */ table.content.action td:last-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.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.float>legend { padding:0 10px; } 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.button { border-radius:var(--button-radius); } diff --git a/panel/action.js b/panel/action.js index 1ebd06b7..9d82c173 100644 --- a/panel/action.js +++ b/panel/action.js @@ -7,9 +7,10 @@ Volcanos(chat.ONIMPORT, { can.base.isIn(item.index, ssh.CLOUD_PROFILE) && (item.style = html.OUTPUT) if (list.length == 0) { 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) { + sub.Conf(ice.AUTO, cli.DELAY) 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.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() }) }, - _tabs: function(can, sub, meta) { - var _init = true + _tabs: function(can, sub, meta) { 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 can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) 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() }) 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) + 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)) 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 }, 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 } - if (!can.user.isTechOrRoot(can)) { return } + _menu: function(can, msg) { if (can.user.isMobile) { 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]) }) can.onmotion.hidden(can, can._header_tabs = can.page.Append(can, target, ["_tabs"])._target) }, diff --git a/panel/footer.js b/panel/footer.js index c02b551f..fbf44b1c 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -10,9 +10,10 @@ Volcanos(chat.ONIMPORT, { can.onimport._title(can, msg, target) can.onimport._storm(can, msg, target) can.core.List([ - {index: chat.TUTOR}, - {index: chat.FLOWS, value: "流程"}, - {index: chat.MESSAGE}, + // {index: chat.TUTOR}, + // {index: chat.FLOWS, value: "流程"}, + // {index: chat.MESSAGE}, + {index: web.SPIDE, value: "服务"}, {index: cli.RUNTIME}, {index: code.XTERM, args: [cli.SH]}, ], function(value) { value.type = html.BUTTON, value.name = value.index diff --git a/plugin/state.js b/plugin/state.js index de92cd64..16781af2 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -39,9 +39,8 @@ Volcanos(chat.ONIMPORT, { } var option = can.base.Obj(msg.Option("field.option")) msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash }) - var sup = item.space? can._root.Action: can - 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}, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) + var sup = item.space? can._root.Action: can; 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]) 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) if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)