mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
87c9232f65
commit
c22051ac58
@ -319,7 +319,7 @@ Volcanos(chat.ONLAYOUT, {
|
||||
var layout = can.page.insertBefore(can, [{view: [[html.LAYOUT, type]]}], target); layout.appendChild(target), can.page.style(can, target, style)
|
||||
var right = can.page.Append(can, layout, [{view: html.CONTENT, style: style}])._target; can.onmotion.cache(can, function() { return can.onexport.keys(can) }, right)
|
||||
can.ui.content = right, right._max = 0
|
||||
can.page.Appends(can, right, [{view: ["tips", "", msg.Option(nfs.FILE)]}])
|
||||
can.page.Appends(can, right, [{view: ["tips", "", msg.Option(nfs.FILE).split(nfs.PS).slice(-2).join(nfs.PS)]}])
|
||||
can.page.SelectChild(can, target, "tr.line", function(target) { can.onaction.appendLine(can, can.page.SelectOne(can, target, "td.text").innerText, right) })
|
||||
right.scrollTop = target.scrollTop = scroll, right._msg = msg, msg._content = layout._root = right._root = target._root = target._root||layout
|
||||
},
|
||||
@ -379,7 +379,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { if (!msg) { return }
|
||||
} p && include(p.include)
|
||||
p && p.prepare && can.core.ItemForm(p.prepare, function(value, index, key) { p.keyword = p.keyword||{}, p.keyword[value] = key })
|
||||
if (!content._root && can.db.history.length > 1) { content = can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._profile), content._cache_key = key }
|
||||
content._max = 0, content._msg = msg, msg.__content = content, can.page.Appends(can, content, [{view: ["tips", "", msg.Option(nfs.FILE)]}])
|
||||
content._max = 0, content._msg = msg, msg.__content = content, can.page.Appends(can, content, [{view: ["tips", "", msg.Option(nfs.FILE).split(nfs.PS).slice(-2).join(nfs.PS)]}])
|
||||
if (msg.Length() > 0) { can.onsyntax._change(can, msg), can.onaction.rerankLine(can, "tr.line:not(.delete)>td.line")
|
||||
can.page.Select(can, content, "tr.line.delete>td.line", function(target) { target.innerHTML = "" })
|
||||
} else {
|
||||
|
@ -14,6 +14,6 @@ App({
|
||||
this.conf.platform = res.platform
|
||||
this.conf.brand = res.brand
|
||||
this.conf.model = res.model
|
||||
console.log("app load", this.conf)
|
||||
console.log("app load", this.conf, res)
|
||||
},
|
||||
})
|
||||
|
@ -7,9 +7,9 @@
|
||||
</template>
|
||||
|
||||
<template name="debug">
|
||||
<view class="debug" wx:if="{{conf.debug == 'true'}}">
|
||||
<view wx:for="{{conf}}" wx:key="index">{{index}}: {{item}}</view>
|
||||
</view>
|
||||
<table class="debug" wx:if="{{conf.debug == 'true'}}">
|
||||
<tr wx:for="{{conf}}" wx:key="index"><th>{{index}}</th><td>{{item}}</td></tr>
|
||||
</table>
|
||||
</template>
|
||||
|
||||
<template name="table">
|
||||
|
@ -9,29 +9,32 @@ page {
|
||||
}
|
||||
page { padding:10px; }
|
||||
page, view { box-sizing: border-box; }
|
||||
view.debug { font-family:monospace; font-style:italic; padding:10px; clear:both; }
|
||||
view.output { width:100%; overflow:auto; clear:both; }
|
||||
view.output textarea { width:100%; text-align:left; }
|
||||
view.output { width:100%; overflow:auto; overflow-x:hidden; clear:both; }
|
||||
view.output textarea { text-align:left; padding:10px; width:100%; }
|
||||
view.output view.item { font-size:18px; text-align:center; padding:10px; border:var(--box-border); }
|
||||
view.output view.list view.item { margin-left:20px; }
|
||||
|
||||
view.legend { font-size:18px; font-weight:bold; margin:10px 0; }
|
||||
view.legend { font-size:20px; font-weight:bold; font-style:italic; margin:10px 0; }
|
||||
view.action view.item { padding:0; border:0; margin-right:5px; float:left; }
|
||||
view.option view.item { padding:0; border:0; margin-right:5px; float:left; }
|
||||
view.option view.item.textarea { border:var(--box-border); width:calc(100% - 2px); clear:both; }
|
||||
view.option view.item.select { border:var(--box-border); }
|
||||
view.option view.item picker { border:var(--box-border); height:30px; width:80px; }
|
||||
view.option view.item input { border:var(--box-border); height:30px; width:80px; }
|
||||
view.option view.item picker { border:var(--box-border); height:30px; width:60px; }
|
||||
view.option view.item input { border:var(--box-border); height:30px; width:60px; }
|
||||
view.option view.item button { height:32px; }
|
||||
view.output view.code { white-space:pre; padding:10px; border-left:cyan solid 2px; }
|
||||
view.output view.code { white-space:pre; border-left:cyan solid 1px; }
|
||||
view.status view.item { font-size:12px; font-style:italic; padding:5px; border:none; margin:0; float:left; }
|
||||
view.status view.item text.name { font-size:10px; }
|
||||
view.action.submit view.item { margin-right:0; }
|
||||
|
||||
table { display:table; border-collapse:collapse; }
|
||||
table { display:table; border-collapse:collapse; width:100%; }
|
||||
table.debug { font-family:monospace; font-style:italic; }
|
||||
table.debug th { font-weight:bold; }
|
||||
tr { display:table-row; }
|
||||
th { display:table-cell; padding:5px; border:var(--box-border); vertical-align:middle; text-align:center; }
|
||||
td { display:table-cell; padding:5px; border:var(--box-border); vertical-align:middle; min-width:60px; }
|
||||
th { display:table-cell; padding:5px; vertical-align:middle; }
|
||||
td { display:table-cell; padding:5px; vertical-align:middle; }
|
||||
td view.which { padding:0; order:0; }
|
||||
table.content th { border:var(--box-border); text-align:center; }
|
||||
table.content td { border:var(--box-border); min-width:60px; }
|
||||
table.content.action th:last-child { position:sticky; right:2px; text-align:center; min-width:60px; }
|
||||
table.content.action td:last-child { position:sticky; right:2px; text-align:center; min-width:60px; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
const {ice, ctx, mdb, code, chat, http, html} = require("../../utils/const.js")
|
||||
const {ice, ctx, mdb, web, code, chat, http, html} = require("../../utils/const.js")
|
||||
const {shy, Volcanos} = require("../../utils/proto.js")
|
||||
Volcanos._page = {}
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
@ -21,11 +21,11 @@ Volcanos(chat.ONIMPORT, {
|
||||
if (input.type == html.SELECT) {
|
||||
input.values = input.values || can.core.Split(input.value)
|
||||
}
|
||||
if (input.type == html.TEXT) {
|
||||
input.placeholder = can.user.trans(can, input.placeholder||input.name, can.core.Value(field, "feature._trans"), html.INPUT)
|
||||
if (can.base.isIn(input.type, html.TEXT, html.TEXTAREA)) {
|
||||
input.placeholder = can.user.trans(can, input.placeholder||input.name, field, html.INPUT)
|
||||
}
|
||||
if (input.type == html.BUTTON) {
|
||||
input.value = can.user.trans(can, input.value||input.name, can.core.Value(field, "feature._trans"))
|
||||
input.value = can.user.trans(can, input.value||input.name, field)
|
||||
} else {
|
||||
if (can.db.cmd||can.db.index) { input.value = input.value||can.db[input.name] }
|
||||
}
|
||||
@ -70,27 +70,21 @@ Volcanos(chat.ONACTION, {list: ["刷新", "扫码", "清屏"],
|
||||
can.onaction._refresh(event, can, order)
|
||||
},
|
||||
onAction: function(event, can, button, data) { var order = data.order, name = data.name
|
||||
var msg = can.request(event)
|
||||
var field = can.ui.data.list[order||0]
|
||||
if (field.feature[name]) {
|
||||
if (can.base.isIn(name, mdb.CREATE, mdb.INSERT)) { msg._method = http.PUT }
|
||||
var field = can.ui.data.list[order||0], msg = can.request(event)
|
||||
if (field.feature[name]) { if (can.base.isIn(name, mdb.CREATE, mdb.INSERT)) { msg._method = http.PUT }
|
||||
return can.data.insert = {field: field, name: name, list: field.feature[name], cb: function(res) {
|
||||
can.run(event, can.base.Simple([field.id||field.index, ctx.ACTION, name], res), function(msg) {
|
||||
can.onaction._refresh(event, can, order)
|
||||
})
|
||||
}}, can.user.jumps(chat.PAGES_INSERT)
|
||||
}
|
||||
field._history = field._history||[]
|
||||
} field._history = field._history||[]
|
||||
switch (name) {
|
||||
case ice.BACK: field._history.pop()
|
||||
var ls = field._history.pop()||[], i = 0
|
||||
case ice.BACK: field._history.pop(); var ls = field._history.pop()||[], i = 0
|
||||
can.core.List(field.inputs, function(input) { if (input.type != html.BUTTON) { input.value = ls[i++]||"" } })
|
||||
can.onaction._refresh(event, can, order)
|
||||
break
|
||||
can.onaction._refresh(event, can, order); break
|
||||
case ctx.RUN: break
|
||||
case ice.LIST:
|
||||
case "refresh": msg._method = http.GET
|
||||
break
|
||||
case web.REFRESH: msg._method = http.GET; break
|
||||
default: msg.Option(ctx.ACTION, name)
|
||||
}
|
||||
var cmd = can.core.List(field.inputs, function(input) { if (input.type != html.BUTTON) { return input.value } })
|
||||
@ -99,17 +93,16 @@ Volcanos(chat.ONACTION, {list: ["刷新", "扫码", "清屏"],
|
||||
for (var i = 0; i < to.length; i++) { if (to[i] != from[i]) { return false } } return true
|
||||
} eq(field._history[field._history.length-1], cmd) || field._history.push(cmd)
|
||||
can.run(event, [field.id||field.index].concat(cmd), function(msg) {
|
||||
msg._head = can.core.List(msg.append, function(item) { return can.user.trans(can, item, can.core.Value(field, "feature._trans"), html.INPUT) })
|
||||
msg._head = can.core.List(msg.append, function(item) { return can.user.trans(can, item, field, html.INPUT) })
|
||||
can.core.Item(msg._view, function(key, value) { can.core.List(value, function(value) { can.core.List(value, function(input, i) {
|
||||
if (input.type == html.BUTTON) { input.value = can.user.trans(can, input.value||input.name, can.core.Value(field, "feature._trans")) }
|
||||
if (input._type == html.TEXT) { input._text = can.user.trans(can, input._text, can.core.Value(field, "feature._trans"), html.VALUE) }
|
||||
if (input.type == html.BUTTON) { input.value = can.user.trans(can, input.value||input.name, field) }
|
||||
if (input._type == html.TEXT) { input._text = can.user.trans(can, input._text, field, html.VALUE) }
|
||||
}) }) })
|
||||
msg._status = can.core.List(can.base.Obj(msg.Option(ice.MSG_STATUS)), function(item) { return item.name = can.user.trans(can, item.name), can.user.trans(can, item, html.INPUT) })
|
||||
msg._status = can.core.List(can.base.Obj(msg.Option(ice.MSG_STATUS)), function(item) { return item })
|
||||
msg._action = can.core.List(can.base.Obj(msg.Option(ice.MSG_ACTION)), function(item) {
|
||||
if (typeof item == code.STRING) { return {type: html.BUTTON, name: item, value: can.user.trans(can, item)} }
|
||||
return item.value = can.user.trans(can, item.value||item.name), item
|
||||
})
|
||||
field.msg = msg, can.page.setData(can)
|
||||
}), field.msg = msg, can.page.setData(can)
|
||||
})
|
||||
},
|
||||
onDetail: function(event, can, button, data) { var order = data.order, name = data.name, value = data.value, input = data.input
|
||||
|
@ -26,7 +26,7 @@ var ice = {
|
||||
MSG_DEBUG: "debug",
|
||||
}
|
||||
var ctx = {
|
||||
CONTEXT: "context", COMMAND: "command", CONFIG: "config", INPUTS: "inputs", FEATURE: "feature",
|
||||
CONTEXT: "context", COMMAND: "command", CONFIG: "config", INPUTS: "inputs", FEATURE: "feature", FEATURE_TRANS: "feature._trans",
|
||||
CMDS: "cmds", INDEX: "index", ARGS: "args", STYLE: "style", DISPLAY: "display", ACTION: "action", RUN: "run",
|
||||
EXTRA_INDEX: "extra.index", EXTRA_ARGS: "extra.args",
|
||||
}
|
||||
@ -39,6 +39,7 @@ var mdb = {
|
||||
}
|
||||
var web = {
|
||||
OPEN: "open", LINK: "link", HTTP: "http", DOMAIN: "domain", URL: "url",
|
||||
DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter",
|
||||
}
|
||||
var aaa = {
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ Volcanos("user", {
|
||||
}}) })
|
||||
},
|
||||
trans: function(can, text, list, zone) { if (!text) { return text }
|
||||
return can.core.Value(list, can.core.Keys(zone, text))||can.core.Value({
|
||||
return can.core.Value(can.core.Value(list, ctx.FEATURE_TRANS), can.core.Keys(zone, text))||can.core.Value({
|
||||
"run": "执行", "list": "查看", "back": "返回",
|
||||
"create": "创建", "remove": "删除",
|
||||
"prunes": "清理",
|
||||
|
Loading…
x
Reference in New Issue
Block a user