2025-12-11 09:49:02 +08:00
|
|
|
const { contextBridge } = require('electron');
|
2025-08-15 10:12:38 +08:00
|
|
|
|
2025-12-09 12:59:04 +08:00
|
|
|
contextBridge.exposeInMainWorld('electronAPI', {
|
2025-12-11 09:49:02 +08:00
|
|
|
generateReportPdf: (payload) => {
|
|
|
|
|
try {
|
|
|
|
|
return window?.electron?.ipcRenderer?.invoke('generate-report-pdf', payload)
|
|
|
|
|
} catch {}
|
|
|
|
|
},
|
2025-12-10 15:35:50 +08:00
|
|
|
getBackendUrl: () => process.env.BACKEND_URL || 'http://localhost:5000',
|
2025-12-11 09:49:02 +08:00
|
|
|
getSocketTransports: () => {
|
|
|
|
|
const allowPolling = process.env.ALLOW_POLLING === '1'
|
|
|
|
|
return allowPolling ? ['websocket', 'polling'] : ['websocket']
|
|
|
|
|
}
|
2025-12-09 12:59:04 +08:00
|
|
|
});
|
2025-12-11 09:49:02 +08:00
|
|
|
|