This commit is contained in:
root
2025-11-25 09:56:15 +03:00
commit 68c8f0e80d
23717 changed files with 3200521 additions and 0 deletions

17
mc_test/dist/main/preload.js vendored Executable file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const { contextBridge, ipcRenderer } = require('electron');
// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object
contextBridge.exposeInMainWorld('electronAPI', {
// Подключение к машине
connectToMachine: (machine) => ipcRenderer.invoke('connect-to-machine', machine),
// Управление состоянием машины
controlMachine: (machineId, action) => ipcRenderer.invoke('control-machine', { machineId, action }),
// Получение статуса машины
getMachineStatus: (machineId) => ipcRenderer.invoke('get-machine-status', machineId),
// Получение списка машин
getMachineList: () => ipcRenderer.invoke('get-machine-list'),
// Логирование
logEvent: (level, tag, message, context) => ipcRenderer.send('log-event', { level, tag, message, context }),
});