feat(electron): added key managment ui

This commit is contained in:
2025-08-11 11:26:09 -04:00
parent d7d7615376
commit 268e4fbeae
28 changed files with 2525 additions and 247 deletions

View File

@@ -10,16 +10,21 @@ function runPythonCommand(command, kwargs, event) {
// Determine executable name based on platform
const executableName = process.platform === 'win32' ? 'fourdst-backend.exe' : 'fourdst-backend';
// Initialize args first
let args = [command, JSON.stringify(kwargs)];
if (app.isPackaged) {
// In packaged app, backend is in resources/backend/ directory
backendPath = path.join(process.resourcesPath, 'backend', executableName);
} else {
// In development, use the meson build output
backendPath = path.join(buildDir, 'electron', 'dist', 'fourdst-backend', executableName);
// In development, use the Python bridge.py directly for faster iteration
backendPath = 'python';
// Update args to include the bridge.py path as the first argument
const bridgePath = path.join(__dirname, '..', 'bridge.py');
args.unshift(bridgePath);
}
console.log(`[MAIN_PROCESS] Spawning backend: ${backendPath}`);
const args = [command, JSON.stringify(kwargs)];
console.log(`[MAIN_PROCESS] With args: [${args.join(', ')}]`);
return new Promise((resolve) => {