|
|
@ -329,7 +329,8 @@ function SRCSet() { |
|
|
|
clearMyVar("checkSource_nexttime"); |
|
|
|
clearMyVar("checkSource_nexttime"); |
|
|
|
clearMyVar("failSourceList"); |
|
|
|
clearMyVar("failSourceList"); |
|
|
|
clearMyVar("executeList"); |
|
|
|
clearMyVar("executeList"); |
|
|
|
clearMyVar("批量检测_暂停检测");
|
|
|
|
clearMyVar("批量检测_暂停检测"); |
|
|
|
|
|
|
|
clearMyVar("批量检测_复检模式"); |
|
|
|
})); |
|
|
|
})); |
|
|
|
function testSource(option) { |
|
|
|
function testSource(option) { |
|
|
|
let sm = option=="yi"?"一级列表":option=="er"?"二级选集":"搜索结果" |
|
|
|
let sm = option=="yi"?"一级列表":option=="er"?"二级选集":"搜索结果" |
|
|
@ -337,9 +338,10 @@ function SRCSet() { |
|
|
|
if(getMyVar("批量检测_线程开始")=="1"){ |
|
|
|
if(getMyVar("批量检测_线程开始")=="1"){ |
|
|
|
return "toast://上一个任务还没有结束,请等待."; |
|
|
|
return "toast://上一个任务还没有结束,请等待."; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
clearMyVar("批量检测_复检模式"); |
|
|
|
putMyVar("checkSource_nexttime", "24"); |
|
|
|
putMyVar("checkSource_nexttime", "24"); |
|
|
|
putMyVar("批量检测_线程开始", "1"); |
|
|
|
putMyVar("批量检测_线程开始", "1"); |
|
|
|
let duoselect = storage0.getMyVar("failSourceList") || storage0.getMyVar('SrcJu_duoselect') || []; |
|
|
|
let duoselect = getMyVar("批量检测_复检模式")?storage0.getMyVar("failSourceList"):storage0.getMyVar('SrcJu_duoselect') || []; |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyPublic.js'); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyPublic.js'); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyData.js'); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyData.js'); |
|
|
|
let task = function (data) { |
|
|
|
let task = function (data) { |
|
|
@ -425,7 +427,6 @@ function SRCSet() { |
|
|
|
desc: "点击中止线程,暂停批量检测", |
|
|
|
desc: "点击中止线程,暂停批量检测", |
|
|
|
url: $().lazyRule(()=>{ |
|
|
|
url: $().lazyRule(()=>{ |
|
|
|
putMyVar("批量检测_暂停检测","1"); |
|
|
|
putMyVar("批量检测_暂停检测","1"); |
|
|
|
deleteItem("pausetestSource"); |
|
|
|
|
|
|
|
return "hiker://empty"; |
|
|
|
return "hiker://empty"; |
|
|
|
}), |
|
|
|
}), |
|
|
|
col_type: "text_center_1", |
|
|
|
col_type: "text_center_1", |
|
|
@ -436,47 +437,50 @@ function SRCSet() { |
|
|
|
|
|
|
|
|
|
|
|
let executeList = []; |
|
|
|
let executeList = []; |
|
|
|
let success = 0; |
|
|
|
let success = 0; |
|
|
|
let faillist = []; |
|
|
|
let faillist = storage0.getMyVar("failSourceList") || []; |
|
|
|
log("批量检测_线程开始"); |
|
|
|
log("批量检测_线程开始"); |
|
|
|
be(list, { |
|
|
|
if(list.length>0){ |
|
|
|
func: function (obj, id, error, taskResult) { |
|
|
|
be(list, { |
|
|
|
executeList.push(id); |
|
|
|
func: function (obj, id, error, taskResult) { |
|
|
|
if(taskResult.error){ |
|
|
|
executeList.push(id); |
|
|
|
addItemBefore("testSource2", taskResult.d); |
|
|
|
if(taskResult.error){ |
|
|
|
faillist.push(taskResult.data); |
|
|
|
addItemBefore("testSource2", taskResult.d); |
|
|
|
if(faillist.length==1){ |
|
|
|
faillist.push(taskResult.data); |
|
|
|
deleteItem("deletefailSource"); |
|
|
|
if(faillist.length==1){ |
|
|
|
addItemAfter("testSource2", { |
|
|
|
deleteItem("deletefailSource"); |
|
|
|
title: "批量删除失败的源", |
|
|
|
addItemAfter("testSource2", { |
|
|
|
url: $("确定将失败的源全部删除").confirm(() => { |
|
|
|
title: "批量删除失败的源", |
|
|
|
let failSource = storage0.getMyVar("failSourceList") || []; |
|
|
|
url: $("确定将失败的源全部删除").confirm(() => { |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyPublic.js'); |
|
|
|
let failSource = storage0.getMyVar("failSourceList") || []; |
|
|
|
deleteData("jk", failSource); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyPublic.js'); |
|
|
|
back(true); |
|
|
|
deleteData("jk", failSource); |
|
|
|
return 'toast://已删除失效源'+failSource.length; |
|
|
|
back(true); |
|
|
|
}), |
|
|
|
return 'toast://已删除失效源'+failSource.length; |
|
|
|
col_type : "text_center_1", |
|
|
|
}), |
|
|
|
extra: { |
|
|
|
col_type : "text_center_1", |
|
|
|
id: "deletefailSource" |
|
|
|
extra: { |
|
|
|
} |
|
|
|
id: "deletefailSource" |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
storage0.putMyVar("failSourceList", faillist); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
success++; |
|
|
|
} |
|
|
|
} |
|
|
|
storage0.putMyVar("failSourceList", faillist); |
|
|
|
updateItem("testSource", {desc: "已检测:" + executeList.length + ",正常源:" + success}); |
|
|
|
}else{ |
|
|
|
//log(id + ">>>" +error);
|
|
|
|
success++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
updateItem("testSource", {desc: "已检测:" + executeList.length + ",正常源:" + success}); |
|
|
|
|
|
|
|
//log(id + ">>>" +error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(getMyVar("批量检测_停止线程")=="1" || getMyVar("批量检测_暂停检测")=="1"){ |
|
|
|
if(getMyVar("批量检测_停止线程")=="1" || getMyVar("批量检测_暂停检测")=="1"){ |
|
|
|
return "break"; |
|
|
|
return "break"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
param: { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
param: { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
log("批量检测_线程结束"); |
|
|
|
log("批量检测_线程结束"); |
|
|
|
clearMyVar("批量检测_线程开始");
|
|
|
|
clearMyVar("批量检测_线程开始");
|
|
|
|
|
|
|
|
deleteItem("pausetestSource"); |
|
|
|
hideLoading(); |
|
|
|
hideLoading(); |
|
|
|
|
|
|
|
|
|
|
|
if(getMyVar("批量检测_停止线程")=="1"){ |
|
|
|
if(getMyVar("批量检测_停止线程")=="1"){ |
|
|
@ -487,6 +491,7 @@ function SRCSet() { |
|
|
|
addItemAfter("testSource2", { |
|
|
|
addItemAfter("testSource2", { |
|
|
|
title: "针对失败的源,进入复检模式", |
|
|
|
title: "针对失败的源,进入复检模式", |
|
|
|
url: $().lazyRule((failnum)=>{ |
|
|
|
url: $().lazyRule((failnum)=>{ |
|
|
|
|
|
|
|
putMyVar("批量检测_复检模式"); |
|
|
|
refreshPage(true); |
|
|
|
refreshPage(true); |
|
|
|
return "toast://进入复检" + failnum; |
|
|
|
return "toast://进入复检" + failnum; |
|
|
|
}, faillist.length), |
|
|
|
}, faillist.length), |
|
|
@ -535,10 +540,11 @@ function SRCSet() { |
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
|
col_type: "line_blank" |
|
|
|
col_type: "line_blank" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if(getMyVar("批量检测_复检模式")){ |
|
|
|
let failSource = storage0.getMyVar("failSourceList") || []; |
|
|
|
let failSource = storage0.getMyVar("failSourceList") || []; |
|
|
|
if(failSource.length>0){ |
|
|
|
if(failSource.length>0){ |
|
|
|
num = failSource.length; |
|
|
|
num = failSource.length; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
|