This commit is contained in:
NaiboWang-Alienware
2023-07-06 17:50:05 +08:00
parent bb1f25e9ca
commit 31bcb63daf
7 changed files with 27 additions and 8 deletions
+11 -1
View File
@@ -57,7 +57,17 @@ if(!fs.existsSync(path.join(getDir(), "execution_instances"))){
fs.mkdirSync(path.join(getDir(), "execution_instances"));
}
if(!fs.existsSync(path.join(getDir(), "config.json"))){
fs.writeFileSync(path.join(getDir(), "config.json"), JSON.stringify({"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":""}));
// Generate config.json
fs.writeFileSync(path.join(getDir(), "config.json"),
JSON.stringify({
"webserver_address": "http://localhost",
"webserver_port": 8074,
"user_data_folder": "./user_data",
"debug": false,
"mysql_config_path": "./mysql_config.json",
"absolute_user_data_folder": "D:\\Document\\Projects\\EasySpider\\ElectronJS\\user_data"
}
));
}
exports.getDir = getDir;
+4 -4
View File
@@ -95,7 +95,7 @@
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Start Data Mode</a>
</p>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 300px;height:45px;padding-top:5px">Go to Home Page</a>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">Go to Home Page</a>
</div>
<div v-else-if="step == 2">
@@ -117,7 +117,7 @@
class="btn btn-primary btn-lg"
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">Start Design (Mobile)</a></p>
<p>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 320px;height:45px;padding-top:5px">Go to Home Page</a>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">Go to Home Page</a>
</p>
</div>
</div>
@@ -158,7 +158,7 @@
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">使用带用户信息浏览器设计</a>
</p>
<p>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 320px;height:45px;padding-top:5px">返回首页</a>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">返回首页</a>
</p>
</div>
@@ -181,7 +181,7 @@
class="btn btn-primary btn-lg"
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">开始设计(手机模式)</a></p>
<p>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 320px;height:45px;padding-top:5px">返回首页</a>
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">返回首页</a>
</p>
</div>
+8 -2
View File
@@ -51,7 +51,8 @@
<div class="row" style="margin-top: 40px;">
<div class="col-md-7" id="taskInfo" style="margin:0 auto" v-if="show">
<div id="tipCustom" class="alert alert-success alert-dismissible fade show" style="display: none; z-index: 1000">
{{tip | lang}}</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
@@ -243,6 +244,7 @@
task: {},
show: false, //是否渲染
ID: "",
tip: "The parameter values in the Excel file have been successfully imported into the corresponding field text box~Excel文件中的参数值已成功导入到对应字段文本框中",
file:null,
user_data_folder:"",
fileUploadStatus: "Status: Waiting for upload~状态:等待上传",
@@ -304,9 +306,13 @@
let inputParameters = app.$data.task.inputParameters;
inputParameters.forEach(function (item, index) {
if(Object.keys(response).includes(item.name)){
item.value = "\r\n".join(response[item.name]);
item.value = response[item.name].join("\r\n");
}
});
$("#tipCustom").slideDown(); //提示框
setTimeout(function() {
$("#tipCustom").slideUp();
}, 3000);
},
error: function(err) {
app.$data.fileUploadStatus = "Status: Upload failed~状态:上传失败";
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
{"id":144,"name":"长安的荔枝 (豆瓣)","url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107/","create_time":"7/6/2023, 5:02:52 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"csv","containJudge":false,"desc":"https://book.douban.com/subject/36104107/","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://book.douban.com/subject/36104107/","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://book.douban.com/subject/36104107/"}],"outputParameters":[{"id":0,"name":"自定义操作","desc":"自定义操作返回的数据","type":"string","exampleValue":""}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,5],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107/","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":-1,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":9,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":-1,"index":3,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"return $x('//*[@id=\"info\"]/text()[13]')[0]","waitTime":0,"recordASField":"1"}},{"id":-1,"index":4,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"//*[@id=\"info\"]/text()[13]","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":2,"index":5,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"function getISBN(){\nlet infoElement = document.getElementById('info');\nlet infoText = infoElement.innerText;\n\nlet parts = infoText.split('ISBN:');\nif(parts.length > 1) {\n let bindingType = parts[1].split('\\n')[0].trim();\n return bindingType; // \"平装\"\n} else {\n console.log('没有找到 \"装帧:\" 后面的字符串');\n}}\nreturn getISBN()","waitTime":0,"recordASField":"1"}}]}
+1
View File
@@ -0,0 +1 @@
{"id":145,"name":"长安的荔枝 (豆瓣) - 2","url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107/","create_time":"7/6/2023, 5:08:31 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"csv","containJudge":false,"desc":"https://book.douban.com/subject/36104107/","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://book.douban.com/subject/36104107/","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://book.douban.com/subject/36104107/"}],"outputParameters":[{"id":0,"name":"自定义操作","desc":"自定义操作返回的数据","type":"string","exampleValue":""}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,5],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107/","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":-1,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":9,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":-1,"index":3,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"return $x('//*[@id=\"info\"]/text()[13]')[0]","waitTime":0,"recordASField":"1"}},{"id":-1,"index":4,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"//*[@id=\"info\"]/text()[13]","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":2,"index":5,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"function getISBN(){\nlet infoElement = document.getElementById('info');\nlet infoText = infoElement.innerText;\n\nlet parts = infoText.split('ISBN:');\nif(parts.length > 1) {\n let bindingType = parts[1].split('\\n')[0].trim();\n return bindingType; // \"平装\"\n} else {\n console.log('没有找到 \"装帧:\" 后面的字符串');\n}}\nreturn getISBN()","waitTime":0,"recordASField":"1"}}]}
+1
View File
@@ -0,0 +1 @@
{"id":146,"name":"长安的荔枝 (豆瓣) - 3","url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107","create_time":"7/6/2023, 5:44:19 PM","version":"0.3.5","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"outputFormat":"csv","containJudge":false,"desc":"https://book.douban.com/subject/36104107/","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://book.douban.com/subject/36104107","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://book.douban.com/subject/36104107"}],"outputParameters":[{"id":0,"name":"自定义参数_0","desc":"","type":"string","exampleValue":"自定义字段"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,6],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://book.douban.com/subject/36104107/","links":"https://book.douban.com/subject/36104107","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":-1,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":9,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":-1,"index":3,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"return $x('//*[@id=\"info\"]/text()[13]')[0]","waitTime":0,"recordASField":"1"}},{"id":-1,"index":4,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"//*[@id=\"info\"]/text()[13]","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}},{"id":-1,"index":5,"parentId":0,"type":0,"option":5,"title":"自定义操作","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"codeMode":0,"code":"function getISBN(){\nlet infoElement = document.getElementById('info');\nlet infoText = infoElement.innerText;\n\nlet parts = infoText.split('ISBN:');\nif(parts.length > 1) {\n let bindingType = parts[1].split('\\n')[0].trim();\n return bindingType; // \"平装\"\n} else {\n console.log('没有找到 \"装帧:\" 后面的字符串');\n}}\nreturn getISBN()","waitTime":0,"recordASField":"1"}},{"id":2,"index":6,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"自定义参数_0","desc":"","extractType":0,"relativeXPath":"//span[text()='ISBN:']/following-sibling::text()","allXPaths":[],"exampleValues":[{"num":0,"value":"自定义字段"}],"default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]}