1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00

add usr/program/

This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-12-07 22:48:04 +08:00
parent 20ef4cfbcd
commit 30744696d6
8 changed files with 19 additions and 13 deletions

View File

@ -546,6 +546,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) } function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) }
can.core.CallFunc(on, {event: event, can: can, meta: meta, cb: _cb, target: target, sub: target._can, last: last, cbs: function(cb) { can.core.CallFunc(on, {event: event, can: can, meta: meta, cb: _cb, target: target, sub: target._can, last: last, cbs: function(cb) {
target._can? show(target._can, cb): can.onappend._init(can, {type: html.INPUT, name: input, style: meta.name, mode: chat.FLOAT}, [path], function(sub) { sub.Conf(meta) target._can? show(target._can, cb): can.onappend._init(can, {type: html.INPUT, name: input, style: meta.name, mode: chat.FLOAT}, [path], function(sub) { sub.Conf(meta)
can.page.Append(can, sub._target, [{text: [can.page.unicode.remove, "", "close"], onclick: function() { sub.close() }}])
sub.run = function(event, cmds, cb) { var msg = sub.request(event) sub.run = function(event, cmds, cb) { var msg = sub.request(event)
if (meta.range) { for (var i = meta.range[0]; i < meta.range[1]; i += meta.range[2]||1) { msg.Push(mdb.VALUE, i) } cb(msg); return } if (meta.range) { for (var i = meta.range[0]; i < meta.range[1]; i += meta.range[2]||1) { msg.Push(mdb.VALUE, i) } cb(msg); return }
(meta.run||can.run)(sub.request(event, can.Option()), cmds, cb, true) (meta.run||can.run)(sub.request(event, can.Option()), cmds, cb, true)
@ -722,7 +723,8 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
index > 0 && can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(value.toLowerCase()) > -1) { return td } }) == 0) index > 0 && can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(value.toLowerCase()) > -1) { return td } }) == 0)
}) }, }) },
delayResize: function(can, target, key) { can.onmotion.delay(can, function() { can.page.Select(can, target, key, function(_target) { delayResize: function(can, target, key) { can.onmotion.delay(can, function() { can.page.Select(can, target, key, function(_target) {
can.page.style(can, target, html.WIDTH, _target.offsetWidth+10, html.LEFT, (window.innerWidth-_target.offsetWidth)/2, html.TOP, (window.innerHeight-_target.offsetHeight)/2) var width = _target.offsetWidth+2*html.PLUGIN_PADDING
can.page.style(can, target, html.WIDTH, width, html.LEFT, (window.innerWidth-width)/2, html.TOP, (window.innerHeight-_target.offsetHeight)/2)
}) }) }, }) }) },
delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) }, delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) },
delayOnce: function(can, cb, interval, list) { delayOnce: function(can, cb, interval, list) {

View File

@ -128,7 +128,7 @@ fieldset.input.date>div.status>div.today { padding:var(--input-padding); }
fieldset.input.icon img { height:var(--desktop-icon-size); width:var(--desktop-icon-size); } fieldset.input.icon img { height:var(--desktop-icon-size); width:var(--desktop-icon-size); }
/* float */ /* float */
body div.float { padding:var(--plugin-padding); box-shadow:var(--box-shadow); } body div.float { padding:var(--plugin-padding); box-shadow:var(--box-shadow); }
body>div.toast div.title { color:var(--notice-bg-color); float:left; } body>div.toast div.title { word-break:break-all; color:var(--notice-bg-color); float:left; }
body>div.toast div.delete { color:var(--notice-bg-color); float:right; cursor:pointer; } body>div.toast div.delete { color:var(--notice-bg-color); float:right; cursor:pointer; }
body>div.toast div.delete:hover { background-color:var(--hover-bg-color); } body>div.toast div.delete:hover { background-color:var(--hover-bg-color); }
body>div.toast div.duration { color:var(--disable-fg-color); float:right; } body>div.toast div.duration { color:var(--disable-fg-color); float:right; }
@ -450,6 +450,8 @@ fieldset:not(.panel):not(.full):not(.cmd) { border-radius:var(--plugin-radius);
fieldset.input div.output { background-color:var(--plugin-bg-color); } fieldset.input div.output { background-color:var(--plugin-bg-color); }
fieldset.input tr:hover { background-color:var(--tr-hover-bg-color); } fieldset.input tr:hover { background-color:var(--tr-hover-bg-color); }
fieldset.input td:hover { background-color:var(--td-hover-bg-color); } fieldset.input td:hover { background-color:var(--td-hover-bg-color); }
fieldset.input>span.close { padding:var(--input-padding); position:absolute; top:var(--input-padding); right:var(--input-padding); }
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); color:var(--float-fg-color); } div.float { background-color:var(--float-bg-color); color:var(--float-fg-color); }
div.carte div.item { background-color:var(--carte-bg-color); } div.carte div.item { background-color:var(--carte-bg-color); }
div.carte div.item:hover { background-color:var(--hover-bg-color); } div.carte div.item:hover { background-color:var(--hover-bg-color); }

View File

@ -1,7 +1,7 @@
fieldset.Footer { width:100%; } fieldset.Footer { width:100%; }
fieldset.Footer>div.output { font-style:italic; height:var(--footer-height); overflow:hidden; } fieldset.Footer>div.output { font-style:italic; height:var(--footer-height); overflow:hidden; }
fieldset.Footer>div.output div.item { padding:7px; height:var(--footer-height); float:left; } fieldset.Footer>div.output div.item { padding:7px; height:var(--footer-height); float:left; }
fieldset.Footer>div.output div.title:first-child { font-weight:bold; text-align:center; width:var(--river-width); overflow:auto; } fieldset.Footer>div.output div.title:first-child { font-weight:bold; text-align:center; width:var(--river-width); }
fieldset.Footer>div.output div.state { font-family:var(--status-font-family); float:right; line-height:18px; } fieldset.Footer>div.output div.state { font-family:var(--status-font-family); float:right; line-height:18px; }
fieldset.Footer>div.output div.state label { font-size:var(--status-font-size); } fieldset.Footer>div.output div.state label { font-size:var(--status-font-size); }
fieldset.Footer>div.output div.toast { font-family:var(--status-font-family); float:right; line-height:18px; } fieldset.Footer>div.output div.toast { font-family:var(--status-font-family); float:right; line-height:18px; }

View File

@ -112,7 +112,7 @@ Volcanos(chat.ONACTION, {list: [
can.ConfHeight(can.page.height()-can.onexport.marginTop()-can.onexport.marginBottom(can)), can.ConfWidth(can.page.width()) can.ConfHeight(can.page.height()-can.onexport.marginTop()-can.onexport.marginBottom(can)), can.ConfWidth(can.page.width())
}) }, }) },
"远程控制": function(event, can) { can.onaction.keyboard(event, can) }, "远程控制": function(event, can) { can.onaction.keyboard(event, can) },
"共享工具": function(event, can) { var meta = can.Conf(); can.onmotion.share(event, can, [], [mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input())]) }, "共享工具": function(event, can) { var meta = can.Conf(); can.onmotion.share(can.request(event, {pod: can.ConfSpace()}), can, [], [mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input())]) },
"打开链接": function(event, can) { can.user.open(can.onexport.link(can)) }, "打开链接": function(event, can) { can.user.open(can.onexport.link(can)) },
"生成链接": function(event, can) { can.onmotion.share(event, can, [], [web.LINK, can.user.copy(event, can, can.onexport.link(can))]) }, "生成链接": function(event, can) { can.onmotion.share(event, can, [], [web.LINK, can.user.copy(event, can, can.onexport.link(can))]) },
"生成脚本": function(event, can) { var args = can.Input().join(lex.SP), list = [ "生成脚本": function(event, can) { var args = can.Input().join(lex.SP), list = [

View File

@ -3,12 +3,10 @@ const core = require("utils/lib/core.js")
const misc = require("utils/lib/misc.js") const misc = require("utils/lib/misc.js")
const page = require("utils/lib/page.js") const page = require("utils/lib/page.js")
const user = require("utils/lib/user.js") const user = require("utils/lib/user.js")
const conf = require("conf.js")
App({ App({
data: {}, conf: { data: {}, conf: conf, base: base, core: core, misc: misc, page: page, user: user,
serve: "https://2021.shylinux.com", appid: "wxf4e5104d83476ed6",
module: "shylinux.com/x/volcanos", version: "v0.3.1",
}, base: base, core: core, misc: misc, page: page, user: user,
onLaunch: function() { onLaunch: function() {
const res = wx.getSystemInfoSync() const res = wx.getSystemInfoSync()
this.conf.platform = res.platform this.conf.platform = res.platform

View File

@ -0,0 +1,6 @@
module.exports = {
appid: "wxf4e5104d83476ed6",
serve: "https://2021.shylinux.com",
module: "shylinux.com/x/volcanos",
version: "v0.3.1",
}

View File

@ -6,16 +6,13 @@ Volcanos(chat.ONIMPORT, {
msg.Dump(can), can.user.toast(can, "加载成功") msg.Dump(can), can.user.toast(can, "加载成功")
}, },
}) })
Volcanos("onaction", {list: ["刷新", "扫码", "登录", "网络"], Volcanos("onaction", {list: ["刷新", "扫码", "登录"],
"刷新": function(event, can) { can.onaction.refresh(event, can) }, "刷新": function(event, can) { can.onaction.refresh(event, can) },
"扫码": function(event, can) { can.user.agent.scanQRCode(can) }, "扫码": function(event, can) { can.user.agent.scanQRCode(can) },
"登录": function(event, can) { "登录": function(event, can) {
can.user.info = {}, can.misc.localStorage(can, ice.MSG_SESSID, can.conf.sessid = "") can.user.info = {}, can.misc.localStorage(can, ice.MSG_SESSID, can.conf.sessid = "")
can.user.userinfo(can, function() { can.onaction.refresh(event, can) }) can.user.userinfo(can, function() { can.onaction.refresh(event, can) })
}, },
"网络": function(event, can) {
can.user.agent.connectWifi(can, "CMCC-UQJ7", "RZGR9FGF")
},
refresh: function(event, can) { can.run(event, [], function(msg) { can.onimport._init(can, msg) }) }, refresh: function(event, can) { can.run(event, [], function(msg) { can.onimport._init(can, msg) }) },
onaction: function(event, can, button, data) { var name = data.name; onaction: function(event, can, button, data) { var name = data.name;
(can.onaction[name]||function(event) { can.run(event, [ctx.ACTION, name]) })(event, can) (can.onaction[name]||function(event) { can.run(event, [ctx.ACTION, name]) })(event, can)

View File

@ -19,7 +19,7 @@ Volcanos._init = function() {
}); return msg }); return msg
}, },
run: function(event, cmds, cb) { wx.showLoading(); const sys = wx.getSystemInfoSync() run: function(event, cmds, cb) { wx.showLoading(); const sys = wx.getSystemInfoSync()
can.misc.request(can, can.request(event), can.base.MergeURL(can.onaction._apis||nfs.CHAT_ACTION, kit.Dict( can.misc.request(can, can.request(event, {share: can.db.share}), can.base.MergeURL(can.onaction._apis||nfs.CHAT_ACTION, kit.Dict(
ice.POD, can.db.pod||can.db.space, ice.MSG_THEME, sys.theme, ice.MSG_DEBUG, can.db.debug, ice.POD, can.db.pod||can.db.space, ice.MSG_THEME, sys.theme, ice.MSG_DEBUG, can.db.debug,
)), {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) { wx.hideLoading() )), {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) { wx.hideLoading()
msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg) msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg)
@ -28,6 +28,7 @@ Volcanos._init = function() {
}; Volcanos._page.__proto__ = getApp(), delete(Volcanos._page) }; Volcanos._page.__proto__ = getApp(), delete(Volcanos._page)
var page = {data: {action: can.onaction.list, list: []}, var page = {data: {action: can.onaction.list, list: []},
onLoad: function(options) { can.ui = this, can.db = options, can.db.serve = can.db.serve||can.conf.serve onLoad: function(options) { can.ui = this, can.db = options, can.db.serve = can.db.serve||can.conf.serve
can.core.Item(can.db, function(key, value) { can.db[key] = decodeURIComponent(value) })
can.core.Item(can.db, function(key, value) { can.db[key] = decodeURIComponent(value) }) can.core.Item(can.db, function(key, value) { can.db[key] = decodeURIComponent(value) })
can.misc.Info("app show", can.ui.route, can.db), can.user.agent.enableDebug(can) can.misc.Info("app show", can.ui.route, can.db), can.user.agent.enableDebug(can)
can.user.title(can.db.title||can.db.pod||can.db.space||(can.db.serve||can.conf.serve).split("://")[1]) can.user.title(can.db.title||can.db.pod||can.db.space||(can.db.serve||can.conf.serve).split("://")[1])