From 8577dd764d912f5ce4bfd058e690006d7c23b8df Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Oct 2024 07:35:53 +0800 Subject: [PATCH] add some --- frame.js | 5 ++--- index.css | 34 ++++++++++++++++++---------------- lib/user.js | 7 +++++-- panel/header.css | 2 +- panel/header.js | 3 ++- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/frame.js b/frame.js index 915b1a2a..de7567ac 100644 --- a/frame.js +++ b/frame.js @@ -1183,11 +1183,10 @@ Volcanos(chat.ONMOTION, { return can.core.Timer(interval||30, function() { cb(self, last, can._delay_list.meta[key]) }) }, float: function(can) { var target = can._fields||can._target, sup = can._fields? can.sup: can - var margin = (can.getFooterHeight()||html.ACTION_HEIGHT)+(can.user.isMobile? html.ACTION_HEIGHT: 0)+html.PLUGIN_MARGIN - var height = can.base.Max(can.Conf("_height")||html.FLOAT_HEIGHT, can.page.height()-can.getHeaderHeight()-margin), width = can.base.Max(can.Conf("_width")||html.FLOAT_WIDTH, can.page.width()-can.getRiverWidth()-2*html.PLUGIN_MARGIN) + var height = can.base.Max(can.Conf("_height")||html.FLOAT_HEIGHT, can.page.height()-can.getHeaderHeight()-can.getFooterHeight()-2*html.PLUGIN_MARGIN), width = can.base.Max(can.Conf("_width")||html.FLOAT_WIDTH, can.page.width()-can.getRiverWidth()-2*html.PLUGIN_MARGIN) sup.onimport.size(sup, height, width, false), can.onappend.style(can, html.FLOAT) can.onmotion.resize(can, target, function(height, width) { sup.onimport.size(sup, height, width, false) }, can.getHeaderHeight(), can.getRiverWidth()) - var left = can.page.width()-width-html.PLUGIN_MARGIN, top = can.page.height()-height-margin + var left = can.page.width()-width-html.PLUGIN_MARGIN, top = can.page.height()-height-can.getFooterHeight()-html.PLUGIN_MARGIN can.page.style(can, target, html.LEFT, left, html.TOP, top) target.onclick = function(event) { can.page.Select(can, document.body, html.FIELDSET_FLOAT, function(_target) { diff --git a/index.css b/index.css index 7762814c..37ef1751 100644 --- a/index.css +++ b/index.css @@ -159,11 +159,11 @@ fieldset._process input { background-color:transparent !important; color:var(--disable-fg-color) !important; } -body.mobile table.content.checkbox th:first-child { padding:var(--table-padding) var(--input-padding); } -body.mobile table.content.checkbox td:first-child { padding:var(--table-padding) var(--input-padding); } -body.mobile table.content.action th:last-child { padding:var(--table-padding) var(--input-padding); } -body.mobile table.content.action td:last-child { padding:var(--table-padding) var(--input-padding); } -body.mobile table.content.detail thead { display:none; } +body.width1 table.content.checkbox th:first-child { padding:var(--table-padding) var(--input-padding); } +body.width1 table.content.checkbox td:first-child { padding:var(--table-padding) var(--input-padding); } +body.width1 table.content.action th:last-child { padding:var(--table-padding) var(--input-padding); } +body.width1 table.content.action td:last-child { padding:var(--table-padding) var(--input-padding); } +body.width1 table.content.detail thead { display:none; } table.content input { border:none; background-color:var(--th-bg-color); padding:var(--input-padding); } table.content input:not(:last-child) { margin-right:var(--input-margin); } body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.output>table.content td i { display:none; } @@ -409,11 +409,11 @@ body div.input.float tr { margin:var(--button-margin); } body div.input.float td { padding:var(--table-padding); } body div.input.float td span.must { color:red; padding:0 5px; } body div.input.float td:nth-child(2) { padding:var(--table-padding) 0; } -body.mobile div.input.float table { width:100%; } -body.mobile div.input.float tr:not(.hide) { display:flex; flex-direction:column; margin:var(--button-margin); } -body.mobile div.input.float td { padding:0 var(--button-padding); margin:var(--button-margin); } -body.mobile div.input.float td:nth-child(1) { color:gray; font-size:var(--status-font-size); padding-left:var(--button-padding); margin-bottom:0; } -body.mobile div.input.float td:nth-child(2) { display:none; } +body.width1 div.input.float table { width:100%; } +body.width1 div.input.float tr:not(.hide) { display:flex; flex-direction:column; margin:var(--button-margin); } +body.width1 div.input.float td { padding:0 var(--button-padding); margin:var(--button-margin); } +body.widht1 div.input.float td:nth-child(1) { color:gray; font-size:var(--status-font-size); padding-left:var(--button-padding); margin-bottom:0; } +body.width1 div.input.float td:nth-child(2) { display:none; } body div.input.float tr.img td:last-child>span { display:none; } body div.input.float tr.img td:last-child>div.item { width:var(--river-width); flex-wrap:wrap; } body div.input.float tr.img td:last-child>div.item>div { background-color:gray; margin:var(--input-margin); } @@ -430,7 +430,7 @@ body div.input.float td span.icons { margin-left:-20px; visibility:hidden; } body div.input.float td label { font-family:var(--code-font-family); } body div.input.float td:hover span.icon { visibility:visible; } body div.input.float td:hover span.icons { visibility:visible; } -body:not(.mobile)>div.input.float textarea { height:var(--textarea-height); width:var(--form-width) !important; } +body:not(.width1)>div.input.float textarea { height:var(--textarea-height); width:var(--form-width) !important; } body div.input.float select { width:var(--form-width) !important; } body div.input.float input.select[type=button] { width:var(--form-width) !important; } body div.input.float input:not([type=button]) { width:var(--form-width) !important; padding-left:24px; } @@ -465,10 +465,10 @@ body>div.upload div.output div.progress { background-color:var(--progress-bg-col body>div.upload div.status div.cost { float:left; } body>div.upload div.status div.show { float:right; } body>div.upload div.status div.size { text-align:center; } -body.mobile>div.input { margin:10px; width:calc(100% - 20px); left:0 !important; } -body.mobile>div.input table { width:100%; } -body.mobile>div.input td { padding:0; } -body.mobile div.input.float table input { width:100% !important; } +body.width1>div.input { margin:10px; width:calc(100% - 20px); left:0 !important; } +body.width1>div.input table { width:100%; } +body.width1>div.input td { padding:0; } +body.width1 div.input.float table input { width:100% !important; } /* display */ fieldset:not(.Action) { position:relative; } fieldset>form.option:not(.hide) { float:left; } @@ -752,6 +752,8 @@ div.item.text.line>input { width:80px; } body:not(.mobile) div.item.text.hash>input { width:320px; } div.item.text.limit>input { width:var(--button-width); } div.item.text.offend>input { width:var(--button-width); } +body:not(.width2):not(.mobile) fieldset.plugin.vimer>form.option>div.item.text.path>input { width:var(--input-width); } +body:not(.width2):not(.mobile) fieldset.plugin.vimer>form.option>div.item.text.file>input { width:var(--project-width); } body:not(.width2):not(.mobile) fieldset.plugin>form.option>div.item.text.path>input { width:var(--project-width); } body:not(.width2):not(.mobile) fieldset.plugin.feel>form.option>div.item.text.file>input { width:var(--project-width); } body:not(.width2) fieldset>div.action>div.item.text.filter>input { width:var(--input-width); height:30px; transition:all 1.2s; } @@ -1046,7 +1048,7 @@ fieldset.Action>div.output>fieldset.ssh.cloud.profile:hover { box-shadow:none; } fieldset.Action>div.output>fieldset.ssh.cloud.profile>div.output { background-color:transparent; } fieldset.Action:not(.horizon):not(.grid)>fieldset.plugin>form.option>div.item.text.path>input { width:var(--project-width); } body:not(.debug) fieldset.plugin.can._notfound { display:none; } -body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend { border-top:var(--box-notice3); border-top-left-radius:0; margin-right:var(--legend-margin); } +body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend { border-left:var(--box-notice3); border-top-left-radius:0; margin-right:var(--legend-margin); } body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend:not(:hover) { background-color:var(--output-bg-color); } body:not(.dark) fieldset.draw.trends div.output svg { background-color:#1b5b738c; } body.width6 fieldset.plugin.word>form.option>div.item.text>input { width:var(--project-width); } diff --git a/lib/user.js b/lib/user.js index 0a28fb95..8f13e6a5 100644 --- a/lib/user.js +++ b/lib/user.js @@ -357,8 +357,10 @@ Volcanos("user", { if (cmd == ice.MSG_SESSID) { if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] } check() } else if (cmd == cli.PWD) { if (check() || ui) { return } can._wss_name = can.ondaemon._list[0] = arg[0] + var hassso = false var _list = [], list = {}; _msg.Table(function(value) { if (!value.order) { return } can.user.trans(can, kit.Dict(value.name, value.help)) + if (value.type == "oauth") { hassso = true } if (value.type == cli.QRCODE) { _list.push(value.name), list[value.name] = function(target) { can.page.Modify(can, target, arg[2]) } } else if (value.type == mdb.PLUGIN) { @@ -374,8 +376,8 @@ Volcanos("user", { can.page.Append(can, ui._target, [{view: [[html.DISPLAY, html.FLEX]], list: [ {text: [can.user.trans(can, "or command login", "或命令行授权: "), html.LABEL]}, {text: ["$ "+_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}, - {text: [can.user.trans(can, "or oauth login", "或第三方授权: "), html.LABEL]}, - {view: [["sso", html.FLEX]], list: _msg.Table(function(value) { + hassso && {text: [can.user.trans(can, "or oauth login", "或第三方授权: "), html.LABEL]}, + hassso && {view: [["sso", html.FLEX]], list: _msg.Table(function(value) { return value.type == "oauth" && {view: [[html.ITEM, html.FLEX]], title: value.link, list: [ {img: can.misc.Resource(can, value.icons)}, {text: can.user.trans(can, value.name, value.help)}, ], onclick: function() { @@ -392,6 +394,7 @@ Volcanos("user", { }) }, logout: function(can) { can.user.toastConfirm(can, aaa.LOGOUT, "", function() { can.runAction({}, aaa.LOGOUT, [], function(msg) { + can.misc.Cookie(can, "user_uid", "") can.misc.CookieSessid(can, ""), can.misc.Search(can, chat.SHARE)? can.misc.Search(can, chat.SHARE, ""): can.user.reload(true) }) }) }, header: function(can) { if (!can._root) { return } var header = can._root.Header diff --git a/panel/header.css b/panel/header.css index d00642bc..19ec3692 100644 --- a/panel/header.css +++ b/panel/header.css @@ -45,6 +45,6 @@ body.width2>fieldset.Header>div.output>div.item.avatar { margin-right:var(--plug body.width2>fieldset.Header>div.output>div.item.theme { display:none; } body.width2>fieldset.Header>div.output>div.item.time { display:none; } body.width2>fieldset.Header:not(.all):not(.tabs)>div.output div.item.title:first-child img { margin-right:0; } -body.width2>fieldset.Header:not(.all):not(.tabs)>div.output div.item.title:first-child span { display:none; } +// body.width2>fieldset.Header:not(.all):not(.tabs)>div.output div.item.title:first-child span { display:none; } body.width2>fieldset.Footer:not(.all):not(.tabs)>div.output div.item.cmd { display:none; } body.width2>fieldset.Footer:not(.all):not(.tabs)>div.output div.item.title { display:none; } diff --git a/panel/header.js b/panel/header.js index d3aea1de..d90ef352 100644 --- a/panel/header.js +++ b/panel/header.js @@ -137,7 +137,8 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, can.user.jumps(can.misc.MergeURL(can, args, true)) }, avatar: function(event, can) { if (can.user.isMobile) { return can.onaction.usernick(event, can) } - var src = can.onexport.avatar(can); can.onaction.carte(can.request(event, {_style: "header avatar"}), can, [""]) }, + var src = can.onexport.avatar(can); can.onaction.carte(can.request(event, {_style: "header avatar"}), can, [""]) + }, usernick: function(event, can) { can.onaction.carte(can.request(event, {_style: "header usernick"}), can, can.onaction._menus) }, shareuser: function(event, can) { can.user.share(can, can.request(event), [ctx.ACTION, chat.SHARE, mdb.TYPE, aaa.LOGIN, mdb.NAME, can.user.title()]) }, theme: function(event, can) { can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) {