Laitool v3.0.1-preview.1
This commit is contained in:
+8
-13
@@ -9,14 +9,14 @@ import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||
import icon from '../../resources/icon.ico?asset'
|
||||
import { define } from '../define/define.js'
|
||||
import { func } from './func.js'
|
||||
import { AsyncQueue } from './quene.js'
|
||||
import { DEFINE_STRING } from '../define/define_string.js'
|
||||
import { AsyncQueue } from './quene'
|
||||
import { DEFINE_STRING } from '../define/define_string'
|
||||
import { Tools } from './tools.js'
|
||||
import { ImageGenerate } from './ReverseManage/imageGenerate.js'
|
||||
import { Setting } from './setting/setting.js'
|
||||
import { has, isEmpty } from 'lodash'
|
||||
import { AutoSync } from './setting/autoSync.js'
|
||||
import { TaskManager } from './Task/taskManage.js'
|
||||
import { TaskManager } from './Service/taskManage'
|
||||
|
||||
// ipc
|
||||
import { DiscordIpc, RemoveDiscordIpc } from './IPCEvent/discordIpc.js'
|
||||
@@ -30,9 +30,6 @@ let setting = new Setting(global)
|
||||
async function InitData(gl) {
|
||||
let res = await setting.getSettingDafultData()
|
||||
gl.config = res
|
||||
gl.requestQuene = new AsyncQueue(gl, res.task_number)
|
||||
gl.fileQueue = new AsyncQueue(gl, 1)
|
||||
gl.taskManager = new TaskManager()
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -95,7 +92,7 @@ async function createWindow(hash = 'ShowMessage', data, url = null) {
|
||||
} else {
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'] + '/#/' + hash)
|
||||
mainWindow.webContents.openDevTools()
|
||||
// mainWindow.webContents.openDevTools()
|
||||
} else {
|
||||
if (hash != '') {
|
||||
mainWindow.loadURL(`file://${path.join(__dirname, '../renderer/index.html')}#/${hash}`)
|
||||
@@ -152,7 +149,10 @@ app.whenReady().then(async () => {
|
||||
await AutoSync()
|
||||
|
||||
global.newWindow = []
|
||||
mainWindow = createWindow('ShowMessage', null)
|
||||
mainWindow = await createWindow('ShowMessage', null)
|
||||
|
||||
global.requestQuene = new AsyncQueue(global, global.config.task_number)
|
||||
global.fileQueue = new AsyncQueue(global, 1)
|
||||
|
||||
//判断是不是又配置文件,没有的话,将temp中的基础配置加载
|
||||
// 判断文件夹是不是存在
|
||||
@@ -463,11 +463,6 @@ ipcMain.handle(DEFINE_STRING.REFRASH_IMAGWE_DATA, async (event, value) => {
|
||||
return res
|
||||
})
|
||||
|
||||
// 监听打开全局窗口事件
|
||||
ipcMain.on(DEFINE_STRING.SHOW_GLOABAL_MESSAGE_DIALOG, (event, value) => {
|
||||
global.newWindow[0].win.webContents.send(DEFINE_STRING.SHOW_MESSAGE_DIALOG, value)
|
||||
})
|
||||
|
||||
/**
|
||||
* 监听一个窗口,返回窗口创建成功后需要的基础数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user