mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add mp/theme.json
This commit is contained in:
parent
01839c4e74
commit
e79536baae
@ -65,7 +65,7 @@ table.content.full { width:100%; }
|
||||
table.content thead { position:sticky; top:2px; }
|
||||
table.content tr.offline { color:var(--disable-fg-color); }
|
||||
table.content tr.offline a { color:var(--disable-fg-color); }
|
||||
table.content th { padding:5px; box-shadow: var(--box-shadow); }
|
||||
table.content th { padding:5px; box-shadow:var(--box-shadow); }
|
||||
table.content td { padding:5px; }
|
||||
table.content.detail td:first-child { width:80px; }
|
||||
table.content.action th:last-child { position:sticky; right:2px; }
|
||||
|
@ -5,7 +5,7 @@ const page = require("utils/lib/page.js")
|
||||
const user = require("utils/lib/user.js")
|
||||
|
||||
App({
|
||||
data: {}, conf: {serve: "https://2021.shylinux.com"},
|
||||
data: {}, conf: {serve: "https://2021.shylinux.com", appid: "wxf4e5104d83476ed6"},
|
||||
base: base, core: core, misc: misc, page: page, user: user,
|
||||
onLaunch: function() { console.log("app load", this.conf) },
|
||||
})
|
||||
|
@ -5,12 +5,15 @@
|
||||
"pages/insert/insert"
|
||||
],
|
||||
"window": {
|
||||
"backgroundColor": "#000",
|
||||
"backgroundTextStyle": "dark",
|
||||
"navigationBarBackgroundColor": "#000",
|
||||
"navigationBarTitleText": "终端工具链",
|
||||
"navigationBarTextStyle": "white"
|
||||
"navigationBarBackgroundColor": "@navBgColor",
|
||||
"navigationBarTextStyle": "@navTxtStyle",
|
||||
"backgroundColor": "@bgColor",
|
||||
"backgroundTextStyle": "@bgTxtStyle",
|
||||
"backgroundColorTop": "@bgColorTop",
|
||||
"backgroundColorBottom": "@bgColorBottom"
|
||||
},
|
||||
"style": "v2",
|
||||
"darkmode": true,
|
||||
"themeLocation": "theme.json",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
|
@ -1,11 +1,17 @@
|
||||
<template name="action">
|
||||
<view class="action">
|
||||
<view class="item" wx:for="{{action}}" wx:key="index">
|
||||
<view class="item button" wx:for="{{action}}" wx:key="index">
|
||||
<button size="mini" bindtap="onaction" data-name="{{item}}">{{item}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template name="debug">
|
||||
<view class="debug" wx:if="{{conf.debug == 'true'}}">
|
||||
<view wx:for="{{conf}}" wx:key="index">{{index}}: {{item}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template name="list">
|
||||
<view class="output">
|
||||
<view class="item" wx:for="{{list}}" wx:key="index">
|
||||
@ -27,11 +33,11 @@
|
||||
<textarea wx:if="{{item.type == 'textarea'}}" placeholder="{{item.name}}" value="{{item.value}}"
|
||||
bindinput="onInputs" data-index="{{index}}" data-order="{{order}}"></textarea>
|
||||
<!-- 文本 -->
|
||||
<input wx:elif="{{item.type == 'text'}}" placeholder="{{item.name}}" value="{{item.value}}" type="text"
|
||||
<input wx:elif="{{item.type == 'text'}}" placeholder="{{item.placeholder||item.name}}" value="{{item.value}}" type="text"
|
||||
bindinput="onInputs" data-index="{{index}}" data-order="{{order}}"/>
|
||||
<!-- 列表 -->
|
||||
<picker wx:elif="{{item.type == 'select'}}" range="{{item.values}}" value="{{item.index||0}}"
|
||||
bindchange="onChange" data-index="{{index}}" data-order="{{order}}">{{item.values[item.index||0]}}</picker>
|
||||
bindchange="onChange" data-index="{{index}}" data-order="{{order}}">{{item.value||item.values[item.index||0]}}</picker>
|
||||
<!-- 按钮 -->
|
||||
<button wx:elif="{{item.type == 'button'}}" size="mini"
|
||||
bindtap="onAction" data-index="{{index}}" data-order="{{order}}" data-name="{{item.name}}">{{item.value||item.name}}</button>
|
||||
@ -49,8 +55,8 @@
|
||||
</template>
|
||||
|
||||
<template name="table">
|
||||
<table wx:if="{{msg}}">
|
||||
<tr><th wx:for="{{msg.append}}" wx:key="index">{{item}}</th></tr>
|
||||
<table class="{{msg._style}}" wx:if="{{msg}}">
|
||||
<tr><th wx:for="{{msg._head}}" wx:key="index">{{item}}</th></tr>
|
||||
<tr wx:for="{{msg._index}}" wx:key="index">
|
||||
<td wx:for="{{msg.append}}" wx:for-index="i" wx:key="i">
|
||||
<view class="which" wx:for="{{msg._view[item][index]}}" wx:for-item="input" wx:for-index="i" wx:key="i">
|
||||
|
@ -1,17 +1,33 @@
|
||||
view { box-sizing: border-box; }
|
||||
page { background-color:black; color:white; }
|
||||
view.action view.item { padding:0; margin-right:10px; float:left; }
|
||||
view.output { max-width:-webkit-fill-available; overflow:auto; clear:both; }
|
||||
view.output view.item { font-size:18px; text-align:center; padding:10px; border:solid 1px green; }
|
||||
view.output view.list view.item { background-color:darkgray; margin-left:20px; }
|
||||
view.legend { font-size:18px; font-weight:bold; margin-top:20px; margin-bottom:10px; }
|
||||
view.option view.item { padding:0; border:0; margin:2px; height:32px; float:left; }
|
||||
view.option view.item.textarea { border:solid 1px green; width:calc(100% - 2px); clear:both; }
|
||||
view.option view.item.select { border:solid 1px green; }
|
||||
view.option view.item input { border:solid 1px green; height:32px; width:80px; }
|
||||
page {
|
||||
--box-border:lightblue solid 1px;
|
||||
--box-shadow:var(--body-fg-color) 2px 2px 8px;
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
page {
|
||||
--box-border:lightgreen solid 1px;
|
||||
}
|
||||
}
|
||||
page { padding:10px; }
|
||||
page, view { box-sizing: border-box; }
|
||||
view.debug { font-family:monospace; font-style:italic; padding:10px; clear:both; }
|
||||
view.action view.item { float:left; }
|
||||
view.action view.item.button { margin-right:5px; }
|
||||
view.output { width:100%; overflow:auto; clear:both; }
|
||||
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.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; min-width:80px; }
|
||||
view.option view.item input { border:var(--box-border); height:30px; min-width:80px; }
|
||||
view.option view.item button { height:32px; }
|
||||
view.output view.code { white-space:pre; padding:10px; border-left:solid 2px cyan; margin-left:10px; }
|
||||
table { display:table; }
|
||||
tr { display:table-row; text-align:center; white-space:nowrap; }
|
||||
th { display:table-cell; padding:5px; border:solid 1px red; }
|
||||
td { display:table-cell; padding:5px; border:solid 1px green; vertical-align:middle; }
|
||||
view.output view.code { white-space:pre; padding:10px; border-left:cyan solid 2px; }
|
||||
table { display:table; border-collapse:collapse; }
|
||||
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; }
|
||||
td view.which { padding:0; order:0; }
|
||||
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; }
|
||||
picker { min-width:80px; }
|
||||
|
@ -19,28 +19,25 @@ 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(value, "feature._trans"), html.INPUT)
|
||||
}
|
||||
if (input.type == html.BUTTON) {
|
||||
input.value = can.core.Value(value, "feature._trans."+(input.value||input.name))
|
||||
input.value = {"list": "查看", "back": "返回", "create": "创建"}[input.value||input.name]||input.value||input.name
|
||||
input.value = can.user.trans(can, input.value||input.name, can.core.Value(value, "feature._trans"))
|
||||
}
|
||||
input.type == html.BUTTON && input.action == ice.AUTO && can.core.Timer(100, function() {
|
||||
can.run({}, [value.id||value.index], function(msg) {
|
||||
value.msg = msg, can.page.setData(can)
|
||||
})
|
||||
can.onaction.onAction({}, can, ice.LIST, {order: index, name: ice.LIST})
|
||||
})
|
||||
})
|
||||
}), can.page.setData(can)
|
||||
}), can.page.setData(can), can.user.toast(can, "加载成功")
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: ["刷新", "扫码", "清屏"],
|
||||
"刷新": function(event, can) { can.onaction.refresh(event, can) },
|
||||
"扫码": function(event, can) { can.user.agent.scanQRCode(can) },
|
||||
"清屏": function(event, can) { can.core.List(can.ui.data.list, function(item) { delete(item.msg) }), can.page.setData(can) },
|
||||
refresh: function(event, can) { can.onaction._cmds = [], can.onaction._space = ""
|
||||
if (can.db.cmd||can.db.index) {
|
||||
can.onaction._space = can.db.pod||can.db.space
|
||||
can.onaction._serve = decodeURIComponent(can.db.serve)
|
||||
can.user.title(can.core.Keys(can.onaction._space, can.db.cmd||can.db.index))
|
||||
refresh: function(event, can) {
|
||||
if (can.db.cmd||can.db.index) { can.onaction._cmds = []
|
||||
can.run(event, [ctx.ACTION, ctx.COMMAND, can.db.cmd||can.db.index], function(msg) {
|
||||
can.onaction._cmds = [ctx.ACTION, ctx.RUN], can.onimport._init(can, msg)
|
||||
})
|
||||
@ -59,6 +56,7 @@ Volcanos(chat.ONACTION, {list: ["刷新", "扫码", "清屏"],
|
||||
onChange: function(event, can, button, data) { var order = data.order, index = data.index
|
||||
var input = can.ui.data.list[order||0].inputs[index||0]
|
||||
input.value = input.values[parseInt(event.detail.value)]
|
||||
can.onaction.onAction({}, can, ice.LIST, {order: index, name: ice.LIST})
|
||||
},
|
||||
onAction: function(event, can, button, data) { var order = data.order, name = data.name
|
||||
var field = can.ui.data.list[order||0]
|
||||
@ -68,7 +66,7 @@ Volcanos(chat.ONACTION, {list: ["刷新", "扫码", "清屏"],
|
||||
can.onaction.onAction(event, can, ice.LIST, {order: order, name: ice.LIST})
|
||||
})
|
||||
}}
|
||||
can.user.jumps(chat.PAGES_INSERT, {river: can.db.river, storm: can.db.storm, index: field.id||field.index, title: field.name})
|
||||
can.user.jumps(chat.PAGES_INSERT, {river: can.db.river, storm: can.db.storm, index: field.id||field.index, serve: can.db.serve, space: can.db.space})
|
||||
return
|
||||
}
|
||||
field._history = field._history||[]
|
||||
@ -90,20 +88,31 @@ 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) { field.msg = msg, can.page.setData(can) })
|
||||
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)
|
||||
})
|
||||
can.core.Item(msg._view, function(key, value) { can.core.List(value, function(value, index) { 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)
|
||||
}
|
||||
}) }) })
|
||||
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
|
||||
var field = can.ui.data.list[order||0]
|
||||
if (input && input.type == html.BUTTON) {
|
||||
can.request(event, field.msg.Table()[data.index])
|
||||
if (input && input.type == html.BUTTON) { can.request(event, field.msg.Table()[data.index])
|
||||
if (field.feature[input.name]) {
|
||||
can.onAction(event, can, input.name, {order: order, name: input.name})
|
||||
} else {
|
||||
can.run(event, [field.id||field.index, ctx.ACTION, input.name], function(msg) {
|
||||
// value.msg = msg, can.page.setData(can)
|
||||
})
|
||||
}
|
||||
return
|
||||
} return
|
||||
}
|
||||
can.core.List(field.inputs, function(input) {
|
||||
if (input.name == name) { input.value = value, can.page.setData(can)
|
||||
|
@ -1,4 +1,5 @@
|
||||
<import src="../../app.wxml"/>
|
||||
<template is="action" data="{{action}}"></template>
|
||||
<template is="debug" data="{{conf}}"></template>
|
||||
<template is="field" data="{{list}}"></template>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<import src="../../app.wxml"/>
|
||||
<template is="action" data="{{action}}"></template>
|
||||
<template is="debug" data="{{conf}}"></template>
|
||||
<view class="output">
|
||||
<view class="item" wx:for="{{list}}" wx:key="index">
|
||||
<!-- 文本 -->
|
||||
|
@ -2,7 +2,9 @@ const {ice, nfs, chat, html} = require("../../utils/const.js")
|
||||
const {shy, Volcanos} = require("../../utils/proto.js")
|
||||
Volcanos._page = {}
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { msg.Dump(can) },
|
||||
_init: function(can, msg) {
|
||||
msg.Dump(can), can.user.toast(can, "加载成功")
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {list: ["刷新", "扫码", "登录"],
|
||||
"刷新": function(event, can) { can.onaction.refresh(event, can) },
|
||||
@ -24,7 +26,7 @@ Volcanos("onaction", {list: ["刷新", "扫码", "登录"],
|
||||
},
|
||||
onchange: function(event, can, button, data) { var index = data.index, i = data.i
|
||||
var river = can.ui.data.list[index], storm = river.list[i]
|
||||
can.user.jumps(can.base.MergeURL(chat.PAGES_ACTION, {river: river.hash, storm: storm.hash, title: river.name+"."+storm.name}))
|
||||
can.user.jumps(can.base.MergeURL(chat.PAGES_ACTION, {river: river.hash, storm: storm.hash, serve: can.db.serve, space: can.db.space}))
|
||||
},
|
||||
_name: nfs.CHAT_RIVER,
|
||||
})
|
||||
|
@ -1,3 +1,4 @@
|
||||
<import src="../../app.wxml"/>
|
||||
<template is="action" data="{{action}}"></template>
|
||||
<template is="debug" data="{{conf}}"></template>
|
||||
<template is="list" data="{{list}}"></template>
|
||||
|
27
publish/client/mp/theme.json
Normal file
27
publish/client/mp/theme.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"light": {
|
||||
"navBgColor": "#f6f6f6",
|
||||
"navTxtStyle": "black",
|
||||
"bgColor": "#f6f6f6",
|
||||
"bgTxtStyle": "light",
|
||||
"bgColorTop": "#f6f6f6",
|
||||
"bgColorBottom": "#efefef",
|
||||
"tabBgColor": "#ffffff",
|
||||
"tabSelectedColor": "#3cc51f",
|
||||
"tabFontColor": "#000000",
|
||||
"tabBorderStyle": "black"
|
||||
},
|
||||
"dark": {
|
||||
"navBgColor": "#191919",
|
||||
"navTxtStyle": "white",
|
||||
"bgColor": "#191919",
|
||||
"bgTxtStyle": "dark",
|
||||
"bgColorTop": "#191919",
|
||||
"bgColorBottom": "#1f1f1f",
|
||||
"tabBgColor": "#191919",
|
||||
"tabSelectedColor": "#51a937",
|
||||
"tabFontColor": "#ffffff",
|
||||
"tabBorderStyle": "white"
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ var ctx = {
|
||||
}
|
||||
var mdb = {
|
||||
EQ: ice.EQ, FS: ice.FS,
|
||||
TIME: "time", ZONE: "zone", ID: "id",
|
||||
TYPE: "type", NAME: "name", TEXT: "text", ICON: "icon", ICONS: "icons",
|
||||
KEY: "key", VALUE: "value", STATUS: "status", EXPIRE: "expire", EXTRA: "extra",
|
||||
DATA: "data", VIEW: "view", ORDER: "order",
|
||||
@ -79,6 +80,7 @@ var http = {
|
||||
}
|
||||
var html = {
|
||||
SELECT: "select", INPUT: "input", TEXT: "text", FILE: "file", TEXTAREA: "textarea", BUTTON: "button",
|
||||
VALUE: "value",
|
||||
}
|
||||
module.exports = {
|
||||
kit, ice,
|
||||
|
@ -49,4 +49,10 @@ Volcanos("base", {
|
||||
isObject: function(val) { return typeof val == code.OBJECT },
|
||||
isArray: function(val) { return Array.isArray(val) },
|
||||
isFunc: function(val) { return typeof val == code.FUNCTION },
|
||||
toLast: function(list, value) { if (!list || list.length == 0) { return }
|
||||
for (var i = 0; i < list.length-1; i++) { if (list[i] == value) {
|
||||
for (i; i < list.length-1; i++) { list[i] = list[i+1] }
|
||||
list[list.length-1] = value
|
||||
} }
|
||||
},
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
const {kit, ice, mdb, nfs, code, chat, http} = require("../const.js")
|
||||
const {kit, ice, ctx, mdb, web, nfs, code, chat, http, html} = require("../const.js")
|
||||
const {Volcanos} = require("../proto.js")
|
||||
module.exports =
|
||||
Volcanos("misc", {
|
||||
@ -58,19 +58,28 @@ Volcanos("misc", {
|
||||
return args
|
||||
},
|
||||
requests: function(can, msg, cmd, data, cb) {
|
||||
wx.showLoading(), can.misc.request(can, msg, cmd, data, function(msg) { wx.hideLoading(), cb && cb(msg) })
|
||||
can.misc.request(can, msg, cmd, data, function(msg) { cb && cb(msg) })
|
||||
},
|
||||
request: function(can, msg, cmd, data, cb) { data.sessid = can.conf.sessid
|
||||
request: function(can, msg, cmd, data, cb) { data.sessid = can.conf.sessid, data.appid = data.appid||can.conf.appid
|
||||
can.core.List(msg.option, function(key) { data[key] = data[key]||[msg.Option(key)] }), data.option = data.option||msg.option
|
||||
wx.request({method: http.POST, url: (msg._serve||can.conf.serve)+cmd, data: data, success: function(res) {
|
||||
wx.request({method: http.POST, url: (msg._serve||can.db.serve||can.conf.serve)+cmd, data: data, success: function(res) {
|
||||
if (res.statusCode == 401) {
|
||||
can.user.info = {}, can.misc.localStorage(can, ice.MSG_SESSID, can.conf.sessid = "")
|
||||
return can.user.login(can, function() { can.misc.request(can, msg, cmd, data, cb) })
|
||||
}
|
||||
wx.hideLoading()
|
||||
msg.Copy(res.data), console.log("request", cmd, data.cmds||data, msg)
|
||||
can.base.toLast(msg.append, mdb.TIME), can.base.toLast(msg.append, web.LINK), can.base.toLast(msg.append, ctx.ACTION)
|
||||
if (msg.append && msg.append.indexOf(ctx.ACTION) > 0) {
|
||||
msg._style = "content action"
|
||||
} else if (msg.IsDetail()) {
|
||||
msg._style = "content detail"
|
||||
} else {
|
||||
msg._style = "content"
|
||||
}
|
||||
msg.Data = function(item, index) {
|
||||
var text = msg[item]&&msg[item][index]||""
|
||||
var data = {_type: "text", _text: text}
|
||||
var data = {_type: html.TEXT, _text: text}
|
||||
if (text.indexOf("<") != 0) { return [data] }
|
||||
var res = [], list = can.core.Split(text, " ", "<=/>")
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
@ -89,7 +98,7 @@ Volcanos("misc", {
|
||||
return res.length == 0? [data]: res
|
||||
}
|
||||
msg._index = []; for (var i = 0; i < msg.Length(); i++) { msg._index.push(i) }
|
||||
msg._view = {}, msg[ice.MSG_APPEND] && can.core.List(msg[ice.MSG_APPEND], function(k) { msg._view[k] = {}
|
||||
msg._view = {}, msg[ice.MSG_APPEND] && can.core.List(msg[ice.MSG_APPEND], function(k) { msg._view[k] = []
|
||||
for (var i in msg[k]) { msg._view[k][i] = msg.Data(k, i) }
|
||||
}), cb && cb(msg)
|
||||
}})
|
||||
|
@ -3,5 +3,6 @@ module.exports =
|
||||
Volcanos("page", {
|
||||
setData: function(can, list) {
|
||||
can.ui.setData({list: list||can.ui.data.list})
|
||||
wx.hideLoading()
|
||||
}
|
||||
})
|
||||
|
@ -19,12 +19,21 @@ Volcanos("user", {
|
||||
},
|
||||
scanQRCode: function(can, cb) {
|
||||
wx.scanCode({success: function(res) { var data = can.base.ParseJSON(res.result)
|
||||
if (data.type == web.LINK, data._origin) { can.base.Copy(data, can.misc.ParseURL(can, res.result)) }
|
||||
if (data.type == web.LINK && data._origin) { can.base.Copy(data, can.misc.ParseURL(can, res.result)) }
|
||||
if (cb && cb(data)) { return }
|
||||
if (data.cmd) { var serve = /(https?:\/\/[^/]+)([^?#])/.exec(data._origin)[1]; data.serve = serve
|
||||
delete(data.type), delete(data.name), delete(data.text), delete(data._origin)
|
||||
if (data.cmd||data.index) {
|
||||
if (data.type == web.LINK && data._origin) {
|
||||
var serve = /(https?:\/\/[^/]+)([^?#])*/.exec(data._origin)[1]; data.serve = serve, delete(data._origin)
|
||||
delete(data.type), delete(data.name), delete(data.text)
|
||||
}
|
||||
can.user.jumps(can.base.MergeURL("/pages/action/action", data))
|
||||
} else {
|
||||
if (data.type == web.LINK && data._origin) {
|
||||
var serve = /(https?:\/\/[^/]+)([^?#])*/.exec(data._origin)[1]; data.serve = serve, delete(data._origin)
|
||||
delete(data.type), delete(data.name), delete(data.text)
|
||||
can.user.jumps(can.base.MergeURL("/pages/river/river", data))
|
||||
return
|
||||
}
|
||||
can.misc.request(can, can.request(), chat.WX_LOGIN_SCAN, data)
|
||||
}
|
||||
}})
|
||||
@ -32,7 +41,7 @@ Volcanos("user", {
|
||||
}, info: {},
|
||||
jumps: function(url, cb) { wx.navigateTo({url: url, success: cb}) },
|
||||
title: function(text, cb) { text && wx.setNavigationBarTitle({title: text, success: cb}) },
|
||||
toast: function(can, content, title) { wx.showToast({title: title, content: content||""}) },
|
||||
toast: function(can, title) { wx.showToast({title: title||""}) },
|
||||
modal: function(can, content, title, cb) { wx.showModal({title: title||"", content: content||"", success: cb}) },
|
||||
login: function(can, cb) {
|
||||
can.conf.sessid = can.conf.sessid||can.misc.localStorage(can, ice.MSG_SESSID)
|
||||
@ -52,4 +61,20 @@ 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({
|
||||
"list": "查看", "back": "返回", "create": "创建",
|
||||
"start": "启动", "stop": "停止", "open": "打开",
|
||||
"trash": "清理",
|
||||
input: {
|
||||
"time": "时间", "link": "链接", "status": "状态", "action": "操作",
|
||||
"type": "类型", "name": "名称", "text": "内容", "icon": "图标",
|
||||
"repos": "仓库", "binary": "程序", "script": "脚本", "template": "仓库", "version": "版本",
|
||||
"path": "路径", "size": "大小",
|
||||
},
|
||||
value: {
|
||||
"start": "启动", "stop": "停止",
|
||||
},
|
||||
}, can.core.Keys(zone, text))||text
|
||||
},
|
||||
})
|
||||
|
@ -25,16 +25,20 @@ Volcanos._init = function() {
|
||||
}); return msg
|
||||
},
|
||||
run: function(event, cmds, cb) {
|
||||
var msg = can.request(event); msg._serve = can.onaction._serve
|
||||
can.misc.requests(can, can.request(event, {pod: can.onaction._space}), can.onaction._name||nfs.CHAT_ACTION, {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) {
|
||||
wx.showLoading()
|
||||
var msg = can.request(event); msg._serve = can.db.serve
|
||||
can.misc.requests(can, can.request(event, {pod: can.db.pod||can.db.space}), can.onaction._name||nfs.CHAT_ACTION, {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) {
|
||||
msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg)
|
||||
})
|
||||
},
|
||||
}; Volcanos._page.__proto__ = getApp(), delete(Volcanos._page)
|
||||
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
|
||||
can.core.Item(can.db, function(key, value) { can.db[key] = decodeURIComponent(value) })
|
||||
can.user.title(can.db.title||can.db.pod||can.db.space||(can.db.serve||can.conf.serve).split("://")[1])
|
||||
console.log("app show", can.ui.route, options)
|
||||
can.user.title(decodeURIComponent(options.title||""))
|
||||
can.ui.setData({conf: can.db})
|
||||
can.user.login(can, function() {
|
||||
if (can.onaction.refresh) {
|
||||
can.onaction.refresh({}, can)
|
||||
|
Loading…
x
Reference in New Issue
Block a user