mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-09 03:24:13 +00:00
Communication with local-server.js
This commit is contained in:
parent
42d1f20d15
commit
2cae9de2de
@ -8,6 +8,10 @@ function getServerArguments(server, overrides) {
|
||||
return serverArguments;
|
||||
}
|
||||
|
||||
function getChannelForServer(server) {
|
||||
return `local-server-run-${server.name}`;
|
||||
}
|
||||
|
||||
async function stopAll() {
|
||||
for(var serverName in runningServers) {
|
||||
let result, error = await stop(serverName);
|
||||
@ -64,6 +68,14 @@ async function main() {
|
||||
});
|
||||
}
|
||||
|
||||
ipcMain.on('local-server-run', async function (event, server) {
|
||||
const responseChannel = getChannelForServer();
|
||||
await run(server);
|
||||
event.sender.send(responseChannel, {
|
||||
success: true
|
||||
});
|
||||
});
|
||||
|
||||
if (require.main === module) {
|
||||
process.on('SIGINT', function() {
|
||||
console.log("Caught interrupt signal");
|
||||
|
Loading…
x
Reference in New Issue
Block a user