1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-09-19 21:36:02 +08:00
parent add0dfc832
commit 9706ddbc29
7 changed files with 13 additions and 12 deletions

View File

@ -230,7 +230,7 @@ var chat = {
PLUGIN_TABLE_JS: "/plugin/table.js", PLUGIN_TABLE_JS: "/plugin/table.js",
PLUGIN_STATE_JS: "/plugin/state.js", PLUGIN_STATE_JS: "/plugin/state.js",
FRAME_JS: "/volcanos/frame.js", FRAME_JS: "/volcanos/frame.js",
ICONS_CSS: "/require/modules/bootstrap-icons/font/bootstrap-icons.min.css", // https://icons.getbootstrap.com/ // ICONS_CSS: "/require/modules/bootstrap-icons/font/bootstrap-icons.min.css", // https://icons.getbootstrap.com/
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap", ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport", ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport",

View File

@ -137,10 +137,10 @@ body>div.input div.action { width:100%; }
body>div.input div.action>div.item { margin:5px; float:right; } body>div.input div.action>div.item { margin:5px; float:right; }
body>div.input div.action>div.item>input[type=button] { width:110px; } body>div.input div.action>div.item>input[type=button] { width:110px; }
body>div.input.login>div.output { text-align:center; } body>div.input.login>div.output { text-align:center; }
body>div.input.login>div.output div.sso { cursor:pointer; } body>div.input.login>div.output div.sso { display:flex; justify-content:center; cursor:pointer; }
body>div.input.login>div.output div.sso:hover { background-color:var(--hover-bg-color); } body>div.input.login>div.output div.sso:hover { background-color:var(--hover-bg-color); }
body>div.input.login>div.output div.sso>img { height:32px; } body>div.input.login>div.output div.sso>img { height:32px; }
body>div.input.login>div.output div.sso>span { height:32px; display:inline-block; vertical-align:middle; } body>div.input.login>div.output div.sso>span { line-height:32px; }
body>div.input.simple td:first-child { display:none; } body>div.input.simple td:first-child { display:none; }
body>div.upload div.action input[type=file] { width:320px; } body>div.upload div.action input[type=file] { width:320px; }
body>div.upload div.output { border:var(--box-notice); } body>div.upload div.output { border:var(--box-notice); }

View File

@ -1,9 +1,8 @@
Volcanos("base", { Volcanos("base", {
Int: function(val, def) { return parseInt(val)||def||0 }, Int: function(val, def) { return parseInt(val)||def||0 },
Min: function(val, min, max) { Min: function(val, min, max) { return val < min? min: val > max? max: val },
return val > max? max: val < min? min: val Max: function(val, max) { return val > max? max: val },
},
Max: function(val, max) { return val < max? val: max },
Obj: function(val, def) { Obj: function(val, def) {
try { try {
if (typeof val == code.STRING) { if (val == "") { return def } val = JSON.parse(val) } if (typeof val == code.STRING) { if (val == "") { return def } val = JSON.parse(val) }
@ -22,8 +21,10 @@ Volcanos("base", {
for (var k in to) { if (k != skip && !call(to[k], from[k])) { return false } } return true for (var k in to) { if (k != skip && !call(to[k], from[k])) { return false } } return true
} return to === from } return to === from
}, },
Ext: function(path) { return path.split(nfs.PS).pop().split(nfs.PT).pop().toLowerCase() }, Ext: function(path) { return path.split(nfs.PS).pop().split(nfs.PT).pop().toLowerCase() },
Dir: function(path) { return path.endsWith(nfs.PS)? path: path.slice(0, path.lastIndexOf(nfs.PS)+1) }, Dir: function(path) { return path.endsWith(nfs.PS)? path: path.slice(0, path.lastIndexOf(nfs.PS)+1) },
Path: function(path) { var res = "", arg = arguments; for (var i = 0; i < arg.length; i++) { if (!arg[i]) { continue } Path: function(path) { var res = "", arg = arguments; for (var i = 0; i < arg.length; i++) { if (!arg[i]) { continue }
res += (arg[i][0]==nfs.PS || res=="" || res[res.length-1]==nfs.PS? "": nfs.PS) + arg[i].trim() res += (arg[i][0]==nfs.PS || res=="" || res[res.length-1]==nfs.PS? "": nfs.PS) + arg[i].trim()
} return res }, } return res },

View File

@ -19,7 +19,7 @@ Volcanos("page", {
if (!can.base.isFunc(cb)) { var value = cb; cb = function(item) { return item.name && (can.base.isUndefined(value)? item.value: (item.value = value))||"" } } if (!can.base.isFunc(cb)) { var value = cb; cb = function(item) { return item.name && (can.base.isUndefined(value)? item.value: (item.value = value))||"" } }
if (key.indexOf(nfs.PT) > -1) { return [""] } if (key.indexOf(nfs.PT) > -1) { return [""] }
key && can.base.isString(cb) && can.page.Select(can, target, "div.item."+key+">span.value", cb) key && can.base.isString(cb) && can.page.Select(can, target, "div.item."+key+">span.value", cb)
return can.page.Select(can, target, key? "select[name="+key+"],"+"input.select[type=button][name="+key+"],"+"input[name="+key+"],"+"textarea[name="+key+"]": ".args", cb) return can.page.Select(can, target, key? "select[name="+key+"],"+"input.select[type=button][name="+key+"],"+"input[type=text][name="+key+"],"+"textarea[name="+key+"]": ".args", cb)
}, },
SelectInput: function(can, target, name, cb) { return can.page.Select(can, target, "input[name="+name+"]", cb)[0] }, SelectInput: function(can, target, name, cb) { return can.page.Select(can, target, "input[name="+name+"]", cb)[0] },
SelectChild: function(can, target, key, cb) { return can.core.List(can.page.Select(can, target, key||"*", function(node) { if (node.parentNode == target) { return node } }), cb) }, SelectChild: function(can, target, key, cb) { return can.core.List(can.page.Select(can, target, key||"*", function(node) { if (node.parentNode == target) { return node } }), cb) },

View File

@ -35,7 +35,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
ontoast: function(can, msg) { can.core.CallFunc(can.onimport.ntip, {can: can, msg: msg}) }, ontoast: function(can, msg) { can.core.CallFunc(can.onimport.ntip, {can: can, msg: msg}) },
onremote: function(can, msg) { can.core.CallFunc(can.onimport.ncmd, {can: can, msg: msg}) }, onremote: function(can, msg) { can.core.CallFunc(can.onimport.ncmd, {can: can, msg: msg}) },
onlayout: function(can, layout) { can.onmotion.toggle(can, can._target, !layout || layout == html.TABS) }, onlayout: function(can, layout) { can.onmotion.toggle(can, can._target, !layout || layout == html.TABS) },
onunload: function(can) { can._wss.close() }, onunload: function(can) { can._wss && can._wss.close() },
onaction_cmd: function(can) { can.onappend.style(can, html.HIDE) }, onaction_cmd: function(can) { can.onappend.style(can, html.HIDE) },
oncommand_focus: function(can) { can.page.Select(can, can._output, ["div.cmd", html.INPUT], function(target) { can.onmotion.focus(can, target) }) }, oncommand_focus: function(can) { can.page.Select(can, can._output, ["div.cmd", html.INPUT], function(target) { can.onmotion.focus(can, target) }) },
ondebugs: function(can, msg) { can.runAction(msg, msg.Option(ctx.ACTION), [msg.Option(ctx.INDEX)], function(_msg) { ondebugs: function(can, msg) { can.runAction(msg, msg.Option(ctx.ACTION), [msg.Option(ctx.INDEX)], function(_msg) {

View File

@ -61,7 +61,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) }) msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) }) lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
} }
can.run(can.request({}, {_method: web.GET}), [], function(msg) { lang(msg) can.run(can.request({}, {_method: web.GET}), [], function(msg) { lang(msg), can.page.requireModules(can, [msg.Option("icons")])
can.require(can.core.List(msg["theme.list"], function(item) { return "src/template/web.chat.header/theme/"+item })) can.require(can.core.List(msg["theme.list"], function(item) { return "src/template/web.chat.header/theme/"+item }))
can.onaction._menus[1] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, ".css") })) can.onaction._menus[1] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, ".css") }))
can.onaction._menus[2] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, ".js") })) can.onaction._menus[2] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, ".js") }))

View File

@ -12,7 +12,7 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
meta.iceberg = Config.iceberg||meta.iceberg, meta.volcano = Config.volcano||meta.volcano meta.iceberg = Config.iceberg||meta.iceberg, meta.volcano = Config.volcano||meta.volcano
meta.libs = (Config.libs||chat.libs).concat(Config.list), panels = Config.panels||chat.panel_list, delete(Config.panels) meta.libs = (Config.libs||chat.libs).concat(Config.list), panels = Config.panels||chat.panel_list, delete(Config.panels)
libs = [], panels.forEach(function(p) { p && (libs = libs.concat(p.list = p.list||["/panel/"+p.name+nfs._JS, "/panel/"+p.name+nfs._CSS])) }), libs = libs.concat(Config.plugins||chat.plugin_list) libs = [], panels.forEach(function(p) { p && (libs = libs.concat(p.list = p.list||["/panel/"+p.name+nfs._JS, "/panel/"+p.name+nfs._CSS])) }), libs = libs.concat(Config.plugins||chat.plugin_list)
cb = can||function(can) { can.require([can.frame, chat.ICONS_CSS], function() { cb = can||function(can) { can.require([can.frame], function() {
can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target) can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target)
}, function(can, key, sub) { can[key] = sub }) } }, function(can, key, sub) { can[key] = sub }) }
can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width