更新 'SrcJySet.js'

master
src48597962 5 months ago
parent 6761752814
commit a2dc1909d1
  1. 32
      SrcJySet.js

@ -320,14 +320,15 @@ function SRCSet() {
if(getMyVar("批量检测_线程启动")=="1"){ if(getMyVar("批量检测_线程启动")=="1"){
return "toast://上一个任务还没有结束,请等待."; return "toast://上一个任务还没有结束,请等待.";
} }
clearMyVar("failSourceList"); //clearMyVar("failSourceList");
return $("hiker://empty#noRecordHistory##noHistory#").rule((num) => { return $("hiker://empty#noRecordHistory##noHistory##noRefresh#").rule((num) => {
addListener("onClose", $.toString(() => { addListener("onClose", $.toString(() => {
clearMyVar("failSourceList");
putMyVar("批量检测_停止线程","1"); putMyVar("批量检测_停止线程","1");
let nowtime = Date.now(); let nowtime = Date.now();
setItem('checkSourcetime', nowtime+'|'+getMyVar("checkSource_nexttime", "0")); setItem('checkSourcetime', nowtime+'|'+getMyVar("checkSource_nexttime", "0"));
clearMyVar("checkSource_nexttime"); clearMyVar("checkSource_nexttime");
clearMyVar("failSourceList");
clearMyVar("executeList");
})); }));
function testSource(option) { function testSource(option) {
let sm = option=="yi"?"一级列表":option=="er"?"二级选集":"搜索结果" let sm = option=="yi"?"一级列表":option=="er"?"二级选集":"搜索结果"
@ -414,10 +415,14 @@ function SRCSet() {
}); });
showLoading(sm + ",批量检测中..."); showLoading(sm + ",批量检测中...");
updateItem("testSource", {url: $().lazyRule(()=>{ addItemAfter("testSource", {
putMyVar("批量检测_停止线程","1"); title: sm + ",批量检测中...",
return "hiker://empty"; desc: "点击中止线程,暂停批量检测",
})}); url: $().lazyRule(()=>{
putMyVar("批量检测_暂停检测","1");
return "hiker://empty";
})
});
addItemAfter("testSource2", { addItemAfter("testSource2", {
title: "批量删除失败的源", title: "批量删除失败的源",
url: $("确定将失败的源全部删除").confirm(() => { url: $("确定将失败的源全部删除").confirm(() => {
@ -432,12 +437,12 @@ function SRCSet() {
id: "deletefailSource" id: "deletefailSource"
} }
}); });
let execute = 0; let executeList = [];
let success = 0; let success = 0;
let faillist = []; let faillist = [];
be(list, { be(list, {
func: function (obj, id, error, taskResult) { func: function (obj, id, error, taskResult) {
execute++; executeList.push(id);
if(taskResult.error){ if(taskResult.error){
addItemBefore("testSource2", taskResult.d); addItemBefore("testSource2", taskResult.d);
faillist.push(taskResult.data); faillist.push(taskResult.data);
@ -445,10 +450,10 @@ function SRCSet() {
}else{ }else{
success++; success++;
} }
updateItem("testSource", {desc: "已检测:" + execute + ",正常源:" + success}); updateItem("testSource", {desc: "已检测:" + executeList.length + ",正常源:" + success});
//log(id + ">>>" +error); //log(id + ">>>" +error);
if(getMyVar("批量检测_停止线程")=="1"){ if(getMyVar("批量检测_停止线程")=="1" || getMyVar("批量检测_暂停检测")=="1"){
return "break"; return "break";
} }
}, },
@ -469,8 +474,11 @@ function SRCSet() {
deleteItem("deletefailSource"); deleteItem("deletefailSource");
} }
clearMyVar("批量检测_线程启动"); clearMyVar("批量检测_线程启动");
if(getMyVar("批量检测_暂停检测")=="1"){
storage0.putMyVar("executeList", executeList);
}
return "toast://测试结束"; return "toast://测试结束";
}, option,sm) }, option, sm)
} }
let d = []; let d = [];
d.push({ d.push({

Loading…
Cancel
Save