Commit 20748590 authored by antoor's avatar antoor

Optimization of the back-end module loading scheme

优化后端模块加载方案
parent 0d3c8bb6
......@@ -49,7 +49,6 @@
# 待做事项
* 数据高级搜索功能
* 数据库配置编辑功能
* 在线检测/下载/安装更新
* 虚拟终端复制粘贴tab补全
* 插件模块 //实时编写插件执行、UI以及各种操作API设计
* 扩展模块 //用于扩展一些高级的功能,懒人必备
......@@ -57,4 +56,4 @@
* 中文开发文档
* 英文说明+开发文档
* nodejs服务端脚本支持
* python服务端脚本支持
* python服务端脚本支持
\ No newline at end of file
......@@ -4,15 +4,6 @@ const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
// 导入模块
const Cache = require('./modules/cache');
const Update = require('./modules/update');
const Menubar = require('./modules/menubar');
const Request = require('./modules/request');
const Database = require('./modules/database');
// electron.crashReporter.start();
app
.on('window-all-closed', app.quit)
.on('ready', () => {
......@@ -22,12 +13,10 @@ app
minWidth: 1040,
minHeight: 699,
webgl: false,
title: 'AntSword',
// autoHideMenuBar: true,
// transparent: false,
// frame: false
// resizable: false
title: 'AntSword'
});
// 加载views
mainWindow.loadURL(`file:\/\/${__dirname}/views/index.html`);
// 调整部分UI
......@@ -37,7 +26,9 @@ app
antSword.modules.shellmanager.category.cell.setWidth(222);
}, 500);
`);
}
};
// 窗口事件监听
mainWindow
.on('closed', () => { mainWindow = null })
.on('resize', reloadUI)
......@@ -49,18 +40,9 @@ app
// 打开调试控制台
// mainWindow.webContents.openDevTools();
new Menubar(electron, app, mainWindow);
// 监听Request请求
new Request(electron);
// 初始化数据库
new Database(electron);
// 初始化缓存模块
new Cache(electron);
// 监听更新请求
new Update(electron);
// 初始化模块
['menubar', 'request', 'database', 'cache', 'update'].map((_) => {
new ( require(`./modules/${_}`) )(electron, app, mainWindow);
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment