1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2020-09-08 10:48:51 +08:00
parent 1a8afa2967
commit 0a3c227723
3 changed files with 9 additions and 8 deletions

View File

@ -183,7 +183,7 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
{name: "spided", help: "网页爬虫", index: "web.code.chrome.spided", args: location && location.protocol && location.protocol=="chrome-extension:"? ["1", "", "spide"]: ["1"]},
]},
"context": {name: "理念 context", action: [
{name: "context", help: "编程", index: "web.wiki.word", args: ["usr/learning/社会/管理/context.shy"]},
{name: "contexts", help: "上下文", index: "web.wiki.word", args: ["src/task.shy"]},
]},
}},
"project": {name: "研发群", storm: {
@ -222,7 +222,6 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
{name: "redis", help: "缓存", index: "web.wiki.word", args: ["usr/redis-story/src/main.shy"]},
]},
"mysql": {name: "数据 mysql", action: [
{name: "es", help: "搜索引擎", index: "web.wiki.word", args: ["usr/icebergs/misc/es/es.shy"]},
{name: "mysql", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/main.shy"]},
]},
"context": {name: "环境 context", action: [

View File

@ -13,7 +13,9 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
// 自动刷新
var refresh = msg.Option("_refresh") || can.Conf("feature")["_refresh"]
refresh && can.Timer(refresh, function() { can.run({}) })
var i = 0; refresh && can.Timer(refresh, function(timer) {
if (i > 100) { timer.stop = true} else { can.run({}) }
})
// 展示数据
can.ui = can.page.Appends(can, can._target, [

View File

@ -199,12 +199,12 @@ var Volcanos = shy("火山架", {cache: {}, index: 1, order: 1, pack: {}, libs:
}),
Timer: shy("定时器, value, [1,2,3,4], {value, length}", function(interval, cb, cbs) { interval = typeof interval == "object"? interval || []: [interval]
var timer = {stop: false}
function loop(event, i) {if (timer.stop || i >= interval.length && interval.length >= 0) {return typeof cbs == "function" && cbs(event, interval)}
return typeof cb == "function" && cb(event, interval.value||interval[i], i, interval)?
typeof cbs == "function" && cbs(event, interval):
setTimeout(function() {loop(event, i+1)}, interval.value||interval[i+1])
function loop(timer, i) {if (timer.stop || i >= interval.length && interval.length >= 0) {return typeof cbs == "function" && cbs(timer, interval)}
return typeof cb == "function" && cb(timer, interval.value||interval[i], i, interval)?
typeof cbs == "function" && cbs(timer, interval):
setTimeout(function() {loop(timer, i+1)}, interval.value||interval[i+1])
}
setTimeout(function(event) {loop(event, 0)}, interval.value||interval[0])
setTimeout(function() {loop(timer, 0)}, interval.value||interval[0])
return timer
}),
})