+ This is your domain. 4096 cubic kilometers of space for you
+ to build, explore, and share. We’ve started you off with a
+ home full of goodies to help you learn the ropes. Enjoy!
+
+
+
+ Server stopped Click "Restart"
diff --git a/console/src/index.js b/console/src/index.js
index 937b0ad970..6da2986a0f 100755
--- a/console/src/index.js
+++ b/console/src/index.js
@@ -47,8 +47,6 @@ $(function() {
processCircle.attr('class', 'circle stopping');
break;
case HFProcess.ProcessStates.STARTED:
-
-
processCircle.attr('class', 'circle started');
break;
}
@@ -57,26 +55,44 @@ $(function() {
function onProcessGroupUpdate(event, arg) {
var sendingGroup = arg;
var stopButton = $('#manage-server #stop');
+ var goButton = $('#go-server-button');
+ var serverStopped = $('#server-stopped-text');
switch (sendingGroup.state) {
case HFProcess.ProcessGroupStates.STOPPED:
case HFProcess.ProcessGroupStates.STOPPING:
// if the process group is stopping, the stop button should be disabled
toggleManageButton(stopButton, false);
+
+ // disable the go button
+ goButton.addClass('disabled');
+
+ // show the server stopped text
+ serverStopped.show();
+
break;
case HFProcess.ProcessGroupStates.STARTED:
// if the process group is going, the stop button should be active
toggleManageButton(stopButton, true);
+
+ // enable the go button
+ goButton.removeClass('disabled');
+
+ // hide the server stopped text
+ serverStopped.hide();
+
break;
}
}
- $('#process-interface .power-on').click(function() {
- ipcRenderer.send('start-process', { name: 'interface' });
- });
- $('#process-interface .power-off').click(function() {
- ipcRenderer.send('stop-process', { name: 'interface' });
+ $('#last-visited-link').click(function() {
+ ipcRenderer.send('start-interface');
});
+
+ $('#go-server-button:not(.disabled)').click(function(){
+ ipcRenderer.send('start-interface', { url: 'hifi://localhost' });
+ })
+
$('#manage-server #restart').click(function() {
ipcRenderer.send('restart-server', { name: 'home' });
});
diff --git a/console/src/main.js b/console/src/main.js
index 4dc7c82ab9..062746bac6 100644
--- a/console/src/main.js
+++ b/console/src/main.js
@@ -120,8 +120,6 @@ app.on('ready', function() {
var logPath = path.join(app.getAppPath(), 'logs');
if (interfacePath && dsPath && acPath) {
- var pInterface = new Process('interface', interfacePath);
-
var homeServer = new ProcessGroup('home', [
new Process('domain-server', dsPath),
new Process('ac-monitor', acPath, ['-n6', '--log-directory', logPath])
@@ -129,12 +127,10 @@ app.on('ready', function() {
// make sure we stop child processes on app quit
app.on('quit', function(){
- pInterface.stop();
homeServer.stop();
});
var processes = {
- interface: pInterface,
home: homeServer
};
@@ -152,19 +148,23 @@ app.on('ready', function() {
}
// handle process updates
- // pInterface.on('state-update', sendProcessUpdate);
homeServer.on('process-update', sendProcessUpdate);
homeServer.on('state-update', sendProcessGroupUpdate);
// start the home server
homeServer.start();
- // ipcMain.on('start-process', function(event, arg) {
- // pInterface.start();
- // });
- // ipcMain.on('stop-process', function(event, arg) {
- // pInterface.stop();
- // });
+ ipcMain.on('start-interface', function(event, arg) {
+ // check if we have a url parameter to include
+ var argArray = [];
+ if (arg.url) {
+ argArray = ["--url", arg.url]
+ }
+
+ // create a new Interface instance - Interface makes sure only one is running at a time
+ var pInterface = new Process('interface', interfacePath, argArray);
+ pInterface.start();
+ });
ipcMain.on('restart-server', function(event, arg) {
homeServer.restart();
diff --git a/console/src/modules/hf-process.js b/console/src/modules/hf-process.js
index 0d9c72c7d0..c8b9f8e57a 100755
--- a/console/src/modules/hf-process.js
+++ b/console/src/modules/hf-process.js
@@ -117,7 +117,7 @@ Process.prototype = extend(Process.prototype, {
console.warn("Can't start process that is not stopped.");
return;
}
- console.log("Starting " + this.command);
+ console.log("Starting " + this.command + " " + this.commandArgs.join(' '));
var logStdout = 'ignore',
logStderr = 'ignore';