Merge branch 'ee_dev' of github.com:wallace5303/electron-egg into ee_dev

This commit is contained in:
gaoshuaixing
2022-03-02 16:40:56 +08:00
7 changed files with 26 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
[![star](https://gitee.com/wallace5303/electron-egg/badge/star.svg?theme=gvp)](https://gitee.com/wallace5303/electron-egg/stargazers) [![star](https://gitee.com/wallace5303/electron-egg/badge/star.svg?theme=gvp)](https://gitee.com/wallace5303/electron-egg/stargazers)
<div align=center> <div align=center>
<img src="https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/logo.png" width="200" height="200" /> <img src="https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/logo.png" width="150" height="150" />
</div> </div>
一个入门简单、跨平台的桌面软件开发框架。 一个入门简单、跨平台的桌面软件开发框架。
@@ -20,28 +20,33 @@
## 特性 ## 特性
1. 跨平台一套代码可以打包成windows版、Mac版、Linux版 1. 跨平台一套代码可以打包成windows版、Mac版、Linux版
2. 简单高效只需学习js语言同时支持vue、react、ejs等前端技术 2. 简单高效:只需学习 js 语言同时支持vue、react、ejs等前端技术
3. 前端独立理论上支持任何前端技术编写出精美的UI效果 3. 前端独立理论上支持任何前端技术编写出精美的UI效果
4. 工程化:可以用服务端的开发思维,来编写桌面软件 4. 工程化:可以用服务端的开发思维,来编写桌面软件
5. 高性能事件驱动、非阻塞式IO 5. 高性能事件驱动、非阻塞式IO
6. 功能丰富:服务端的技术场景等 6. 功能丰富:前端、服务端的技术场景等
7. 功能demo桌面软件常见功能后续逐步集成或提供demo 7. 功能demo桌面软件常见功能后续逐步集成或提供demo
8. 更多功能请看文档 8. 更多功能请看文档
## 使用场景 ## 使用场景
### 1. 常规桌面软件 ### 1. 常规桌面软件
- demo - windows平台
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/home.png) ![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/home.png)
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/socket.png)
- macOS平台
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/mac-socket.png)
- linux平台 (ubuntu)
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/ubuntu-db.png)
### 2. vue、react、angular、web 转换成桌面软件 ### 2. vue、react、angular、web 转换成桌面软件
- vue-ant-design本地 - vue-ant-design本地
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/vue-antd.png) ![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/vue-antd.png)
- Youtube远程网站 - Youtubeweb项目地址
![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/youtub.png) ![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/youtub.png)
@@ -53,9 +58,11 @@
## 开始使用 ## 开始使用
1. [安装文档](https://www.yuque.com/u34495/mivcfg/qo4uqg) - [安装文档](https://www.yuque.com/u34495/mivcfg/qo4uqg)
## 项目案例
- [查看](https://www.yuque.com/u34495/mivcfg/ep4otg)
## 交流 ## 交流
1. qq群735532437 1. qq群735532437

View File

@@ -14,7 +14,7 @@ module.exports = {
* 安装 * 安装
*/ */
install (eeApp) { install (eeApp) {
console.log('[preload] load AutoUpdater module'); eeApp.logger.info('[preload] load AutoUpdater module');
const status = { const status = {
error: -1, error: -1,
@@ -27,13 +27,13 @@ module.exports = {
const updateConfig = eeApp.config.autoUpdate; const updateConfig = eeApp.config.autoUpdate;
const mainWindow = eeApp.electron.mainWindow; const mainWindow = eeApp.electron.mainWindow;
const version = app.getVersion(); const version = app.getVersion();
console.log('[preload:autoUpdater] current version: ', version); eeApp.logger.info('[preload:autoUpdater] current version: ', version);
// 设置下载服务器地址 // 设置下载服务器地址
let server = updateConfig.options.url; let server = updateConfig.options.url;
let lastChar = server.substring(server.length - 1); let lastChar = server.substring(server.length - 1);
server = lastChar === '/' ? server : server + "/"; server = lastChar === '/' ? server : server + "/";
console.log('[preload:autoUpdater] server: ', server); eeApp.logger.info('[preload:autoUpdater] server: ', server);
updateConfig.options.url = server; updateConfig.options.url = server;
// 是否后台自动下载 // 是否后台自动下载
@@ -82,6 +82,7 @@ module.exports = {
totalSize: totalSize, totalSize: totalSize,
transferredSize: transferredSize transferredSize: transferredSize
} }
eeApp.logger.info('[preload:download-progress] progress: ', text);
sendStatusToWindow(mainWindow, info); sendStatusToWindow(mainWindow, info);
}) })
autoUpdater.on('update-downloaded', (info) => { autoUpdater.on('update-downloaded', (info) => {
@@ -110,7 +111,6 @@ module.exports = {
autoUpdater.downloadUpdate(); autoUpdater.downloadUpdate();
}, },
} }
/** /**
@@ -118,7 +118,6 @@ module.exports = {
*/ */
function sendStatusToWindow(mainWindow, content = {}) { function sendStatusToWindow(mainWindow, content = {}) {
const textJson = JSON.stringify(content); const textJson = JSON.stringify(content);
eLogger.info(textJson);
const channel = 'app.updater'; const channel = 'app.updater';
mainWindow.webContents.send(channel, textJson); mainWindow.webContents.send(channel, textJson);
} }

View File

@@ -11,7 +11,7 @@ module.exports = {
* 安装 * 安装
*/ */
install (eeApp) { install (eeApp) {
console.log('[preload] load awaken module'); eeApp.logger.info('[preload] load awaken module');
const protocolInfo = eeApp.config.awakeProtocol; const protocolInfo = eeApp.config.awakeProtocol;
const PROTOCOL = protocolInfo.protocol; const PROTOCOL = protocolInfo.protocol;
@@ -49,7 +49,7 @@ module.exports = {
urlPath: pathname, urlPath: pathname,
urlParams: search && search.slice(1) urlParams: search && search.slice(1)
} }
console.log('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo); eeApp.logger.info('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo);
} }
} }
} }

View File

@@ -10,7 +10,7 @@ module.exports = {
* 安装 * 安装
*/ */
install (eeApp) { install (eeApp) {
console.log('[preload] load security module'); eeApp.logger.info('[preload] load security module');
const runWithDebug = process.argv.find(function(e){ const runWithDebug = process.argv.find(function(e){
let isHasDebug = e.includes("--inspect") || e.includes("--inspect-brk") || e.includes("--remote-debugging-port"); let isHasDebug = e.includes("--inspect") || e.includes("--inspect-brk") || e.includes("--remote-debugging-port");
return isHasDebug; return isHasDebug;
@@ -18,7 +18,7 @@ module.exports = {
// 不允许远程调试 // 不允许远程调试
if (runWithDebug) { if (runWithDebug) {
console.log('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug); eeApp.logger.error('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
eeApp.appQuit(); eeApp.appQuit();
} }
} }

View File

@@ -13,7 +13,7 @@ module.exports = {
* 安装 * 安装
*/ */
install (eeApp) { install (eeApp) {
console.log('[preload] load tray module'); eeApp.logger.info('[preload] load tray module');
const trayConfig = eeApp.config.tray; const trayConfig = eeApp.config.tray;
const mainWindow = eeApp.electron.mainWindow; const mainWindow = eeApp.electron.mainWindow;

View File

@@ -15,7 +15,7 @@ const awaken = require('../library/awaken');
module.exports = async (app) => { module.exports = async (app) => {
//已实现的功能模块,可选择性使用和修改 //已实现的功能模块,可选择性使用和修改
tray.install(app); tray.install(app);
security.install(app); security.install(app);
@@ -33,7 +33,7 @@ function loadUpdate (app) {
const config = app.config.autoUpdate; const config = app.config.autoUpdate;
if ( (is.windows() && config.windows) || (is.macOS() && config.macOS) || (is.linux() && config.linux) ) { if ( (is.windows() && config.windows) || (is.macOS() && config.macOS) || (is.linux() && config.linux) ) {
const autoUpdater = require('../library/autoUpdater'); const autoUpdater = require('../library/autoUpdater');
autoUpdater.install(); autoUpdater.install(app);
// 是否检查更新 // 是否检查更新
if (config.force) { if (config.force) {

View File

@@ -1,6 +1,6 @@
{ {
"name": "ee", "name": "ee",
"version": "2.0.0", "version": "2.0.1",
"description": "A fast, desktop software development framework", "description": "A fast, desktop software development framework",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {