Skip to content

Commit

Permalink
Version 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
naibo committed Dec 30, 2024
1 parent 5180f47 commit c56e871
Show file tree
Hide file tree
Showing 30 changed files with 472 additions and 313 deletions.
439 changes: 197 additions & 242 deletions .temp_to_pub/EasySpider_windows_x64/Code/easyspider_executestage.py

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions .temp_to_pub/EasySpider_windows_x64/Code/myChrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@



class MyChrome(webdriver.Chrome):
class MyChrome(webdriver.Chrome, webdriver.Remote):

def __init__(self, *args, **kwargs):
def __init__(self, mode='local_driver', *args, **kwargs):
self.iframe_env = False # 现在的环境是root还是iframe
super().__init__(*args, **kwargs) # 调用父类的 __init__
self.mode = mode
if mode == "local_driver":
webdriver.Chrome.__init__(self, *args, **kwargs)
elif mode == "remote_driver":
webdriver.Remote.__init__(self, *args, **kwargs)
# super().__init__(*args, **kwargs) # 调用父类的 __init__

# def find_element(self, by=By.ID, value=None, iframe=False):
# # 在这里改变查找元素的行为
Expand Down
2 changes: 1 addition & 1 deletion .temp_to_pub/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def compress_folder_to_7z_split(folder_path, output_file):
except:
subprocess.call(["7zz", "a", "-v95m", output_file, folder_path])

easyspider_version = "0.6.2"
easyspider_version = "0.6.3"

if __name__ == "__main__":

Expand Down
Binary file modified ElectronJS/EasySpider_en.crx
Binary file not shown.
Binary file modified ElectronJS/EasySpider_zh.crx
Binary file not shown.
5 changes: 3 additions & 2 deletions ElectronJS/change_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def update_file_version(file_path, new_version, key="当前版本/Current Versio
file.write(line)


version = "0.6.2"
version = "0.6.3"

# py html js

Expand All @@ -47,7 +47,8 @@ def update_file_version(file_path, new_version, key="当前版本/Current Versio

# index.html
file_path = "./src/index.html"
update_file_version(file_path, version, key="当前版本/Current Version: <b>v")
update_file_version(file_path, version, key="软件当前版本:<b>v")
update_file_version(file_path, version, key="Current Version: <b>v")

# package.json
file_path = "./package.json"
Expand Down
2 changes: 1 addition & 1 deletion ElectronJS/config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","debug":false,"copyright":1,"sys_version":"x64","mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data"}
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","debug":false,"lang":"en","copyright":1,"sys_arch":"x64","mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"D:\\Document\\Projects\\EasySpider\\ElectronJS\\user_data"}
1 change: 1 addition & 0 deletions ElectronJS/config1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","debug":false,"copyright":1,"sys_version":"x64","mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data","lang":"zh"}
18 changes: 14 additions & 4 deletions ElectronJS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ function createWindow() {
server_address +
"/index.html?user_data_folder=" +
config.user_data_folder +
"&copyright=" +
config.copyright,
"&copyright=" + config.copyright +
"&lang=" + config.lang,
{extraHeaders: "pragma: no-cache\n"}
);
// 隐藏菜单栏
Expand All @@ -162,9 +162,8 @@ function createWindow() {
app.quit();
}
});
//调试模式
// mainWindow.webContents.openDevTools();
// Open the DevTools.
// mainWindow.webContents.openDevTools()
}

async function findElementRecursive(driver, by, value, frames) {
Expand Down Expand Up @@ -1558,6 +1557,17 @@ app.whenReady().then(() => {
path.join(task_server.getDir(), "config.json"),
JSON.stringify(config)
);
//重新读取配置文件
config = JSON.parse(fs.readFileSync(path.join(task_server.getDir(), "config.json")));
});
ipcMain.on("change-lang", function (event, arg) {
config.lang = arg;
fs.writeFileSync(
path.join(task_server.getDir(), "config.json"),
JSON.stringify(config)
);
//重新读取配置文件
config = JSON.parse(fs.readFileSync(path.join(task_server.getDir(), "config.json")));
});
createWindow();

Expand Down
57 changes: 40 additions & 17 deletions ElectronJS/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ElectronJS/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "easy-spider",
"productName": "EasySpider",
"version": "0.6.2",
"version": "0.6.3",
"icon": "./favicon",
"description": "NoCode Visual Web Crawler",
"main": "main.js",
Expand Down Expand Up @@ -39,8 +39,8 @@
"multer": "^1.4.5-lts.1",
"node-abi": "^3.52.0",
"node-window-manager": "^2.2.4",
"selenium-webdriver": "^4.16.0",
"ws": "^8.17.1",
"selenium-webdriver": "^4.27.0",
"ws": "^8.18.0",
"xlsx": "^0.18.5"
},
"config": {
Expand All @@ -67,7 +67,7 @@
],
"packagerConfig": {
"icon": "./favicon",
"appVersion": "0.6.2",
"appVersion": "0.6.3",
"name": "EasySpider",
"executableName": "EasySpider",
"appCopyright": "Naibo Wang ([email protected])",
Expand Down
5 changes: 5 additions & 0 deletions ElectronJS/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if (!fs.existsSync(path.join(getDir(), "config.json"))) {
webserver_port: 8074,
user_data_folder: "./user_data",
debug: false,
lang: "-",
copyright: 0,
sys_arch: require("os").arch(),
mysql_config_path: "./mysql_config.json",
Expand Down Expand Up @@ -459,6 +460,10 @@ exports.start = function (port = 8074) {
"utf8"
);
config_file = JSON.parse(config_file);
let lang = config_file["lang"];
if(lang == undefined){
lang = "-";
}
res.write(JSON.stringify(config_file));
res.end();
} else if (pathName == "/setUserDataFolder") {
Expand Down
11 changes: 7 additions & 4 deletions ElectronJS/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@
<body>
<div id="app">

<div style="padding: 10px; text-align: center;vertical-align: middle;" v-if="init">
<div style="padding: 10px; text-align: center;vertical-align: middle;" v-if="lang=='-'">
<h5 style="margin-top: 20px">选择语言/Select Language</h5>

<p><a @click="changeLang('zh')" class="btn btn-outline-primary btn-lg"
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">中文</a></p>

<p><a @click="changeLang('en')" class="btn btn-outline-primary btn-lg"
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">English</a></p>
<p style="font-size: 17px">当前版本/Current Version: <b>v0.6.2</b></p>
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases"
target="_blank">Github</a>最新版本/Newest Version:<b>{{newest_version}}</b></p>
<!-- <p>如发现新版本更新,可从以下Github仓库下载最新版本使用/If a new version is found, you can download the latest version from the following Github repository:</p>-->
<!-- <p></p>-->
<div class="img-container">
Expand Down Expand Up @@ -92,6 +89,9 @@ <h4 style="margin-top: 20px">Copyright and Disclaimer</h4>
<a href="https://www.easyspider.cn/index_english.html" target="_blank"
style="text-align: center; font-size: 18px">Browse official website to watch tutorials</a>
</p>
<p style="font-size: 17px">Current Version: <b>v0.6.3</b></p>
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases"
target="_blank">Newest</a> Version: <b>{{newest_version}}</b></p>
<div class="img-container">
<!-- <h5>Producer</h5>-->
<a href="https://www.zju.edu.cn" alt="Zhejiang University" target="_blank"><img
Expand Down Expand Up @@ -191,6 +191,9 @@ <h4 style="margin-top: 20px">版权声明和注意事项</h4>
<a href="https://www.easyspider.cn?lang=zh" target="_blank"
style="text-align: center; font-size: 18px">点此访问官网查看文档/视频教程</a>
</p>
<p style="font-size: 17px">软件当前版本:<b>v0.6.3</b></p>
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases"
target="_blank">官网</a>最新版本:<b>{{newest_version}}</b></p>
<div class="img-container">
<!-- <h5>出品方</h5>-->
<a href="https://www.zju.edu.cn" alt="浙江大学" target="_blank"><img src="img/zju.png"></a>
Expand Down
9 changes: 7 additions & 2 deletions ElectronJS/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let app = Vue.createApp({
data() {
return {
init: true,
lang: 'zh',
lang: '-',
user_data_folder: getUrlParam("user_data_folder"),
copyright: 0,
step: 0,
Expand All @@ -34,6 +34,10 @@ let app = Vue.createApp({
if(this.copyright == 0){
this.step = -1;
}
this.lang = getUrlParam("lang");
if (this.lang == 'undefined' || this.lang == '') {
this.lang = '-';
}
// 发送GET请求获取GitHub的Release API响应
const request = new XMLHttpRequest();
request.open('GET', `https://api.github.com/repos/NaiboWang/EasySpider/releases/latest`);
Expand All @@ -52,8 +56,9 @@ let app = Vue.createApp({
},
methods: {
changeLang(lang = 'zh') {
this.init = false;
// this.init = false;
this.lang = lang;
window.electronAPI.changeLang(lang);
},
acceptAgreement() {
this.step = 0;
Expand Down
1 change: 1 addition & 0 deletions ElectronJS/src/js/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ contextBridge.exposeInMainWorld('electronAPI', {
startDesign: (lang="en", user_data_folder = '', mobile=false) => ipcRenderer.send('start-design', lang, user_data_folder, mobile),
startInvoke: (lang="en") => ipcRenderer.send('start-invoke', lang),
acceptAgreement: () => ipcRenderer.send('accept-agreement'),
changeLang: (lang="en") => ipcRenderer.send('change-lang', lang)
})
4 changes: 2 additions & 2 deletions ElectronJS/src/taskGrid/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ if (mobile == "true") {
}

let serviceInfo = {
"version": "0.6.2"
"version": "0.6.3"
};

function saveService(type) {
Expand Down Expand Up @@ -625,7 +625,7 @@ function saveService(type) {
"links": links,
"create_time": $("#create_time").val(),
"update_time": formatDateTime(new Date()),
"version": "0.6.2",
"version": "0.6.3",
"saveThreshold": saveThreshold,
// "cloudflare": cloudflare,
"quitWaitTime": parseInt($("#quitWaitTime").val()),
Expand Down
Loading

0 comments on commit c56e871

Please sign in to comment.