From d5e5e2747f0000b67a8dc0490b9aa09787693660 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Nov 2024 13:11:48 +0800 Subject: [PATCH] add some --- const.js | 1 + frame.js | 2 +- index.css | 10 +++++----- lib/user.js | 6 +++++- panel/header.js | 1 + plugin/input/date.js | 4 +++- plugin/table.js | 5 ++++- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/const.js b/const.js index 64e6fc00..b7ad8970 100644 --- a/const.js +++ b/const.js @@ -511,6 +511,7 @@ var icon = { data: "bi bi-database", branch: "bi bi-diagram-3", commit: "bi bi-hash", message: "bi bi-wechat", + address: "bi bi-pin-map", plugin: "bi bi-window-stack", preview: "bi bi-window-stack", show: "bi bi-window-stack", diff --git a/frame.js b/frame.js index de7567ac..0b762a2f 100644 --- a/frame.js +++ b/frame.js @@ -35,7 +35,7 @@ Volcanos(chat.ONENGINE, { names = can.base.MergeURL(names, ice.MSG_INDEX, sub.ConfIndex()), can.page.exportValue(sub, msg) can.onengine.signal(panel, chat.ONREMOTE, can.request({}, {_follow: panel._follow, _msg: msg, _cmds: cmds, names: names})) can.misc.Run(event, can, {names: names}, cmds, function(msg) { - toast && can.user.toastSuccess(msg._can, _toast), toast && toast.close && toast.close(), toast = true + msg.IsErr() || toast && can.user.toastSuccess(msg._can, _toast), toast && toast.close && toast.close(), toast = true // delete(sub._toast), delete(sub.__toast) can.onmotion.delay(can, function() { can.page.ClassList.del(can, sub._target, "_process") }, 300) can.base.isFunc(cb) && cb(msg), Volcanos.meta.pack[can.core.Keys(panel._name, cmds.join(mdb.FS))] = msg diff --git a/index.css b/index.css index 786b1c52..b7127e46 100644 --- a/index.css +++ b/index.css @@ -447,7 +447,7 @@ body>div.input.login { flex-direction:column; } body>div.input.login>div.action { border-bottom:var(--box-border); padding:0; flex-direction:row; } body>div.input.login>div.action>div.tabs { padding:var(--button-padding); } body>div.input.login>div.action>div.tabs.select { color:unset; } -body>div.input.login>div.output { text-align:center; min-height:var(--qrcode-height); min-width:var(--iframe-height); overflow:hidden; clear:both; } +body:not(.mobile)>div.input.login>div.output { text-align:center; min-height:var(--qrcode-height); min-width:var(--iframe-height); overflow:hidden; clear:both; } body>div.input.login>div.output>fieldset { box-shadow:unset; } body>div.input.login>div.output>fieldset>div.output { background-color:transparent; } body>div.input.login>div.display { padding-top:var(--button-padding); width:100%; flex-direction:column; } @@ -527,8 +527,8 @@ input[type=button].notice:hover { background-color:var(--notice-bg-color); color input[type=button].notice { border:var(--box-notice); } body:not(.mobile) table.content tr:hover { background-color:var(--tr-hover-bg-color); } table.content tr.select { background-color:var(--tr-hover-bg-color); } -table.content tr.danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } -table.content tr.notice { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } +// table.content tr.danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } +// table.content tr.notice { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } table.content tr.disable { color:var(--disable-fg-color); } table.content tr.offline { color:var(--disable-fg-color); } table.content tr.invalid { color:var(--disable-fg-color); } @@ -877,7 +877,7 @@ body.mobile fieldset.Search>div.action>div.item.filter>span { position:absolute; body.mobile fieldset.Search>div.action>div.item.filter { width:100%; position:relative; } body.mobile fieldset.River { position:fixed; top:var(--header-height); z-index:11; } body.mobile fieldset.River>div.output { font-size:1.4rem; min-width:var(--project-width); } -body.mobile:not(.cmd) fieldset.Action { margin-top:var(--header-height); } +html:not(.login) body.mobile:not(.cmd) fieldset.Action { margin-top:var(--header-height); } body.mobile fieldset.Action.cmd { margin-top:0; } body.mobile fieldset.Action { overflow:hidden; } body.mobile fieldset.Action>div.output { overflow-x:hidden; } @@ -894,7 +894,7 @@ body.mobile.landscape fieldset.Action { margin-top:0; } body.mobile.landscape>div.input.login { padding:0; } body.mobile.landscape>div.input.login>div.output { height:290px; } body.mobile.landscape>div.input.login>div.output img { max-height:280px; } -html.login body.mobile>fieldset.panel.Action>div.output { background-color:var(--panel-bg-color); } +// html.login body.mobile>fieldset.panel.Action>div.output { background-color:var(--panel-bg-color); } /* print */ body.print { -webkit-filter: grayscale(100%); } body.print { background-color:white; color:black; } diff --git a/lib/user.js b/lib/user.js index a1a8fcdb..fc8312df 100644 --- a/lib/user.js +++ b/lib/user.js @@ -276,6 +276,7 @@ Volcanos("user", { return target.value }, cancel: function(event, can, button) { + can.page.ClassList.del(can, can._fields||can._target, "_process") button == "cancel" && msg._cancel && msg._cancel(event), callback("afterInputs", button) can.onengine.signal(can, "onremove", can.request(event, {query: can.page.getquery(can, ui._target)})), can.page.Remove(can, ui._target) }, @@ -380,6 +381,7 @@ Volcanos("user", { }) var _cmd = "space login "+arg[0] ui = can.onappend.tabview(can, list, _list, can.page.Append(can, document.body, [{view: "input login float flex"}])._target) + can.user.title(can.user.info.titles) 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) }}, @@ -395,8 +397,10 @@ Volcanos("user", { } }} }) }, + // {text: [can.user.info.titles]}, ]}]), window.parent != window && window.innerHeight < 480 && can.onmotion.hidden(can, ui.output) - can.page.style(can, ui._target, {left: (can.page.width()-ui._target.offsetWidth)/2, top: can.page.height() < 640? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-ui._target.offsetHeight-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT}) + can.page.style(can, ui._target, {left: (can.page.width()-ui._target.offsetWidth)/2, + top: can.page.height() < 640? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-can.base.Min(ui._target.offsetHeight, 420)-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT}) } }) }, diff --git a/panel/header.js b/panel/header.js index f598df08..a4909973 100644 --- a/panel/header.js +++ b/panel/header.js @@ -112,6 +112,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, can.user.isMobile && (msg["theme.list"] = ["dark.css", "light.css"]) can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) })) can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() { + can.user.info.titles = msg.Option("titles")||document.title if (can.base.beginWith(location.pathname, nfs.WIKI_PORTAL, web.CHAT_CMD+web.WIKI_PORTAL, web.CHAT_CMD+web.CHAT_OAUTH_CLIENT)) { return show(msg) } if (location.pathname == nfs.PS && can.base.beginWith(msg.Option(ice.MAIN)||"", nfs.WIKI_PORTAL, web.CHAT_CMD+web.WIKI_PORTAL)) { return show(msg) } msg.Option(mdb.PLUGIN) && can.onappend.plugin(can, {space: msg.plugin[1], index: msg.Option(mdb.PLUGIN)}, function(sub) { can.onmotion.hidden(can, sub._target) }, document.body) diff --git a/plugin/input/date.js b/plugin/input/date.js index 419a3b53..cc3b3687 100644 --- a/plugin/input/date.js +++ b/plugin/input/date.js @@ -21,7 +21,9 @@ Volcanos(chat.ONFIGURE, {date: { target.value == "" && (now.setMinutes(now.getMinutes()>30? 30: 0), now.setSeconds(0)) function show(now) { can.Action(YEAR, now.getFullYear()), can.Action(MONTH, now.getMonth()+1) can.Action(HOUR, now.getHours()), can.Action(MINUTE, parseInt(now.getMinutes()/30)*30), can.Action(SECOND, 0) - can.page.Appends(can, can._table, can.date.List(can, function(event, day) { day.setHours(now.getHours()), day.setMinutes(now.getMinutes()), day.getSeconds(now.getSeconds()), _cb(day), can.close() }, now)) + can.page.Appends(can, can._table, can.date.List(can, function(event, day) { + day.setHours(can.Action(HOUR)), day.setMinutes(can.Action(MINUTE)), day.getSeconds(can.Action(SECOND)), _cb(day), can.close() + }, now)) var l = can.date.solar2lunar(now); can.page.Appends(can, can._status, [{view: "today", inner: [l.gzYear, l.Animal+"年", l.cnMonth, l.cnDay, l.lunarFestival||l.festival||l.Term, l.Astro].join(lex.SP)}]) return now } show(now), can._show = function(d) { d? _cb(show(now = new Date(now.getTime()+d*24*3600*1000))): _cb(show(now)) } diff --git a/plugin/table.js b/plugin/table.js index c44c02a9..10c1e4e4 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -352,7 +352,10 @@ Volcanos(chat.ONIMPORT, { sub.onimport._field = function(msg) { var sup = sub; can.onmotion.clear(can, sub._output) msg.Table(function(value) { value.style = html.OUTPUT can.onappend.plugin(can, value, function(sub) { can.onimport.myField(can, sub) - sub.onexport.output = function(_sub, msg) { can.onimport.myOption(sub) } + sub.onexport.output = function(_sub, msg) { + can.onimport.myOption(sub) + can.user.isMobile && sub.onimport.size(sub, window.innerHeight-ACTION_HEIGHT, window.innerWidth, false) + } var run = sub.run; sub.run = function(event, cmds, cb) { run(sub.request(event, { city_name: current[CITY_NAME], street_name: current[STREET_NAME], place_name: current[PLACE_NAME],