mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
design
This commit is contained in:
@@ -42,8 +42,10 @@ ipcMain.on('bs-download.start', async (event, args: InitDownloadInfoInterface) =
|
||||
console.log(out);
|
||||
|
||||
if(out[0] === "[Progress]"){ event.reply('bs-download.progress', out[1]); }
|
||||
else if(out[0] === "[Password]" || out[0].includes('[Password]')){ event.reply('bs-download.ask-password'); }
|
||||
else if(out[0] === "[any]"){ event.reply('bs-download.progress', out); }
|
||||
else if(out[0] === "[Password]"){ event.reply('bs-download.ask-password'); }
|
||||
else if(out[0] === "[2FA]"){ event.reply('bs-download.ask-2fa'); }
|
||||
else if(out[0] === "[Guard]"){ event.reply('bs-download.ask-guard'); }
|
||||
else if(out[0] === "[Error]"){ event.reply('bs-download.error', out); }
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
import './bs-download-ipcs';
|
||||
import './bs-download-ipcs';
|
||||
import './window-controls-ipcs';
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { getMainWindow } from '../main';
|
||||
|
||||
ipcMain.on('window.close', () => {
|
||||
getMainWindow()?.close();
|
||||
});
|
||||
|
||||
ipcMain.on('window.maximize', () => {
|
||||
getMainWindow()?.maximize();
|
||||
});
|
||||
|
||||
ipcMain.on('window.minimize', () => {
|
||||
getMainWindow()?.minimize();
|
||||
});
|
||||
|
||||
ipcMain.on('window.reset', () => {
|
||||
console.log('aaaaaa');
|
||||
getMainWindow()?.restore();
|
||||
});
|
||||
@@ -26,6 +26,10 @@ export default class AppUpdater {
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
|
||||
export function getMainWindow(): BrowserWindow | null{
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
ipcMain.on('ipc-example', async (event, arg) => {
|
||||
const msgTemplate = (pingPong: string) => `IPC test: ${pingPong}`;
|
||||
console.log(msgTemplate(arg));
|
||||
@@ -74,6 +78,10 @@ const createWindow = async () => {
|
||||
show: false,
|
||||
width: 1024,
|
||||
height: 728,
|
||||
minWidth: 800,
|
||||
minHeight: 500,
|
||||
frame: false,
|
||||
titleBarOverlay: false,
|
||||
icon: getAssetPath('icon.png'),
|
||||
webPreferences: {
|
||||
preload: app.isPackaged
|
||||
@@ -82,6 +90,8 @@ const createWindow = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
mainWindow.loadURL(resolveHtmlPath('index.html'));
|
||||
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
export type Channels = 'bs-download.start'|'bs-download.send-input';
|
||||
export type Channels = 'bs-download.start'|'bs-download.send-input'|'window.close'|'window.maximize'|'window.minimize'|'window.reset';
|
||||
|
||||
export type ReplyChannels = 'bs-download.ask-password';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user