Skip to content

Commit

Permalink
Change UI
Browse files Browse the repository at this point in the history
  • Loading branch information
naibo committed Jul 6, 2023
1 parent 741e3c4 commit dbab4e5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ElectronJS/config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"webserver_address":"http:https://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"}
{"webserver_address":"http:https://localhost","webserver_port":8074,"user_data_folder":"./user_data","debug":false,"mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data"}
2 changes: 1 addition & 1 deletion ElectronJS/src/taskGrid/FlowChart_CN.html
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ <h4 class="modal-title" id="myModalLabel">保存任务</h4>
<input onkeydown="inputDelete(event)" id="serviceDescription" name="serviceDescription" class="form-control"></input>
<label>导出数据格式(Excel/CSV/TXT/数据库):</label>
<select id="outputFormat" class="form-control">
<option value = "csv">CSV</option>
<option value = "xlsx">XLSX(EXCEL)</option>
<option value = "csv">CSV</option>
<option value = "txt">TXT</option>
<option value = "mysql">MySQL数据库</option>
</select>
Expand Down
1 change: 1 addition & 0 deletions ElectronJS/src/taskGrid/FlowChart_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let root = {
useLoop: false, //是否使用循环中的元素
xpath: "", //xpath
wait: 0,
waitType: 0,
},
isInLoop: false, //是否处于循环内
};
Expand Down
2 changes: 1 addition & 1 deletion ElectronJS/src/taskGrid/invokeTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ <h4 style="text-align: center;">{{"Task Invocation~任务调用" | lang}}</h4>
<input type="text" class="form-control" v-model="user_data_folder"></input>
</div>
<div class="form-group" style="margin-top: 10px" v-if="task.outputFormat=='mysql'">
<label>{{"Mysql configuration file Path:~Mysql配置文件路径:" | lang}}</label>
<label>{{"MySQL configuration file Path:~MySQL配置文件路径:" | lang}}</label>
<input type="text" class="form-control" v-model="mysql_config_path"></input>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion ElectronJS/tasks/4.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ExecuteStage/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"justMyCode": true,
// "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
// "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
"args": ["--id", "[21]", "--headless", "0", "--user_data", "1"]
"args": ["--id", "[22]", "--headless", "0", "--user_data", "1"]
}
]
}
4 changes: 3 additions & 1 deletion ExecuteStage/easyspider_executestage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,4 +1458,6 @@ def getData(self, para, loopElement, isInLoop=True, parentPath="", index=0):

for thread in threads:
thread.browser.quit()
print("Thread with task id: ", thread.id, " is closed")
# print("Thread with task id: ", thread.id, " is closed")
print("程序已运行完成,请手动关闭此窗口。")
print("The program has finished running, please manually close this window.")
18 changes: 11 additions & 7 deletions ExecuteStage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,17 @@ def end(self):
class myMySQL:
def __init__(self, config_file="mysql_config.json"):
# 读取配置文件
with open(config_file, 'r') as f:
config = json.load(f)
host = config["host"]
port = config["port"]
user = config["user"]
passwd = config["password"]
db = config["database"]
try:
with open(config_file, 'r') as f:
config = json.load(f)
host = config["host"]
port = config["port"]
user = config["user"]
passwd = config["password"]
db = config["database"]
except:
print("读取配置文件失败,请检查配置文件:"+config_file+"是否存在。")
print("Failed to read configuration file, please check if the configuration file: "+config_file+" exists.")
try:
self.conn = pymysql.connect(
host=host, port=port, user=user, passwd=passwd, db=db)
Expand Down

0 comments on commit dbab4e5

Please sign in to comment.