diff --git a/console/src/index.js b/console/src/index.js index 160a340dc3..ffb8b8d1d4 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -13,6 +13,7 @@ $(function() { var serverState = arg.home.state; var serverCircles = $('#ds-status .circle, #ac-status .circle'); + switch (serverState) { case HFProcess.ProcessStates.STOPPED: serverCircles.attr('class', 'circle stopped'); diff --git a/console/src/main.js b/console/src/main.js index a33dbd00b7..935ed474dd 100644 --- a/console/src/main.js +++ b/console/src/main.js @@ -149,9 +149,7 @@ app.on('ready', function() { sendProcessUpdate(); }); ipcMain.on('restart-server', function(event, arg) { - homeServer.stop(); - sendProcessUpdate(); - homeServer.start(); + homeServer.restart(); sendProcessUpdate(); }); ipcMain.on('stop-server', function(event, arg) { diff --git a/console/src/modules/hf-process.js b/console/src/modules/hf-process.js index 7a1a5d8646..37621bf940 100755 --- a/console/src/modules/hf-process.js +++ b/console/src/modules/hf-process.js @@ -59,14 +59,17 @@ ProcessGroup.prototype = extend(ProcessGroup.prototype, { this.state = ProcessGroupStates.STOPPING; }, restart: function() { - // set our restart flag so the group will restart once stopped - this.restarting = true; + if (this.state == ProcessGroupStates.STOPPED) { + // start the group, we were already stopped + console.log("STARTING THE GROUP, ALREADY STOPPED"); + this.start(); + } else { + // set our restart flag so the group will restart once stopped + this.restarting = true; - // call stop, that will put them in the stopping state - this.stop(); - - // update our state - this.state = ProcessGroupStates.STOPPING; + // call stop, that will put them in the stopping state + this.stop(); + } }, // Event handlers