Skip to content

Commit

Permalink
Save Name Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
naibo committed Jul 6, 2023
1 parent 31bcb63 commit 06304b2
Show file tree
Hide file tree
Showing 8 changed files with 409 additions and 38 deletions.
338 changes: 331 additions & 7 deletions ElectronJS/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ElectronJS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@electron-forge/maker-rpm": "^6.0.5",
"@electron-forge/maker-squirrel": "^6.0.5",
"@electron-forge/maker-zip": "^6.0.5",
"electron": "^25.0.1"
"electron": "^20.0.1"
},
"repository": "https://github.com/NaiboWang/EasySpider",
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion ElectronJS/src/taskGrid/FlowChart_CN.html
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ <h4 class="modal-title" id="myModalLabel">保存任务</h4>
<select id="outputFormat" class="form-control">
<option value = "csv">CSV</option>
<option value = "xlsx">XLSX(EXCEL)</option>
<option value = "mysql">MySQL</option>
<option value = "mysql">MySQL数据库</option>
</select>
<label>导出文件名/数据库表格名称(如果值为“Time”则名称为执行任务时的时间):</label>
<input onkeydown="inputDelete(event)" value="Time" id="saveName" class="form-control"></input>
<label>浏览器模拟类型:</label>
<select id="environment" name="environment" class="form-control">
<option value = 0>电脑端</option>
Expand Down
37 changes: 30 additions & 7 deletions ElectronJS/src/taskGrid/invokeTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,38 @@ <h4 class="modal-title" id="excelModalLabel">{{"Read from Excel~从Excel文件
<td>{{"Argument Value 2_1~参数值2_2" | lang}}</td>
<td>...</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
<label>{{"The 'Invoke Name' is shown at the main table of this page, such as 'urlList_0' is the invoke name of the open page operation.~“调用名称”在本页面的主表格中显示,例如“urlList_0”是“打开网页“操作的调用名称。" | lang}}</label>
<label>{{"You can just put part of the arguments in the Excel file, and the values of the rest of the arguments will be set to default. Example table for this task is:~您可以只在Excel文件中放入部分参数,其余参数值将被设置为默认值。一个针对此任务的表格示例为:" | lang}}</label>
<table class="table table-bordered excel">
<thead>
<tr>
<th v-for="i in Math.min(3, task.inputParameters.length)" v-if="task.inputParameters.length>0">
{{task.inputParameters[i-1]["name"]}}
</th>
</tr>
</thead>
<tbody>
<tr>
<td v-for="i in Math.min(3, task.inputParameters.length)" v-if="task.inputParameters.length>0">
{{task.inputParameters[i-1]["name"]}}
{{getLine(i,0)}}
</td>
</tr>
<tr>
<td v-for="i in Math.min(3, task.inputParameters.length)" v-if="task.inputParameters.length>0">
{{task.inputParameters[i-1]['value']}}
<tr>
<td v-for="i in Math.min(3, task.inputParameters.length)">
{{getLine(i,1)}}
</td>
<tr>
<tr>
<td v-for="i in Math.min(3, task.inputParameters.length)">
<div v-if="task.inputParameters[i-1]['name'].indexOf('url') >=0">
{{task.inputParameters[i-1]['value']}}
<div v-if="task.inputParameters[i-1]['value'].toString().split('\n').length >=2 || task.inputParameters[i-1]['name'].indexOf('url') >=0">
...
</div>
</td>
<tr>
Expand Down Expand Up @@ -276,7 +288,18 @@ <h4 style="text-align: center;">{{"Task Invocation~任务调用" | lang}}</h4>
url = "taskInfo.html?id="+getUrlParam("id")+"&lang=en&type="+getUrlParam("type")+"&wsport="+getUrlParam("wsport")+"&backEndAddressServiceWrapper=" + app.$data.backEndAddressServiceWrapper
}
window.location.href = url;
}, readFromExcel: function(){
}, getLine: function(i, index){
const value = this.task.inputParameters[i-1]["value"].toString();
const parts = value.split("\n");
if(parts.length > index){
return parts[index];
} else if(this.task.inputParameters[i-1]["name"].indexOf("url") >=0){
return parts[0];
} else {
return "";
}
},
readFromExcel: function(){
$('#excelModal').modal('show');
}, submitFile: function() {
let form_data = new FormData();
Expand Down
1 change: 1 addition & 0 deletions ElectronJS/src/taskGrid/logic_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ function saveService(type) {
"environment": environment,
"maxViewLength": parseInt($("#maxViewLength").val()),
"outputFormat": $("#outputFormat").val(),
"saveName": $("#saveName").val(),
"containJudge": containJudge,
"desc": serviceDescription,
"inputParameters": inputParameters,
Expand Down
Loading

0 comments on commit 06304b2

Please sign in to comment.