From 050ccba968567694647f474a9940be1d886cb86d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 13:10:02 -0700 Subject: [PATCH 1/6] add description block for home server --- console/src/css/style.less | 15 ++++++++++++++- console/src/index.html | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/console/src/css/style.less b/console/src/css/style.less index df6d310406..de8a9d5d4d 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -132,19 +132,27 @@ header { height: @focus-height - @info-padding-top-bottom - @info-padding-top-bottom; padding: @info-padding-top-bottom 75px; + @title-margin-left: 255px; + h2 { color: black; font-size: 36px; - margin-left: 255px; + margin-left: @title-margin-left; margin-bottom: 0px; } .server-box { float: left; + margin-top: 5px; .title { border-bottom: 1px solid @dark-gray; margin-bottom: 20px; + + p { + color: white; + margin-top: 0px; + } } .process-status { @@ -184,6 +192,11 @@ header { width: 215px; } } + + &#right-box { + position: absolute; + margin-left: @title-margin-left; + } } } } diff --git a/console/src/index.html b/console/src/index.html index 99dcf064c9..69548dbb42 100644 --- a/console/src/index.html +++ b/console/src/index.html @@ -64,7 +64,13 @@
+

hifi://localhost

+

+ 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! +

From 1229ed9a7fa276c00f4b486cd82ed7c42032d789 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 14:47:26 -0700 Subject: [PATCH 2/6] add launch arguments to console output --- console/src/css/style.less | 9 +++++++-- console/src/index.html | 10 ++++++---- console/src/index.js | 7 ++----- console/src/main.js | 21 ++++++++++----------- console/src/modules/hf-process.js | 2 +- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/console/src/css/style.less b/console/src/css/style.less index de8a9d5d4d..dd68d4c4ab 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -16,11 +16,11 @@ html { body { height: 100%; overflow: auto; - font-family: 'Raleway', sans-serif; + font-family: 'Raleway'; background-image: url('../images/background.jpg'); margin: 0; font-size: 11px; - letter-spacing: 1px; + letter-spacing: 0.075rem; } input, textarea, select, a { @@ -48,6 +48,11 @@ header { margin: 0px 75px; color: white; + a { + color: white; + text-decoration: none; + } + p { text-align: center; } diff --git a/console/src/index.html b/console/src/index.html index 69548dbb42..20d4d460dc 100644 --- a/console/src/index.html +++ b/console/src/index.html @@ -28,10 +28,12 @@

Search

diff --git a/console/src/index.js b/console/src/index.js index 937b0ad970..a76e52f3ae 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -71,11 +71,8 @@ $(function() { } } - $('#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'); }); $('#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..d7c81ae1e1 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,22 @@ 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) { + // create a new Interface instance - Interface makes sure only one is running at a time + var args = []; + if (args.url) { + args << "--url" << args.url + } + + var pInterface = new Process('interface', interfacePath); + 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'; From e7f943db2c147d005a8f237aac9fe0a1a1ca4b8a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 14:54:15 -0700 Subject: [PATCH 3/6] fix interface launching via start-interface command --- console/src/index.js | 2 +- console/src/main.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/console/src/index.js b/console/src/index.js index a76e52f3ae..f57e5aa6c0 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -72,7 +72,7 @@ $(function() { } $('#last-visited-link').click(function() { - ipcRenderer.send('start-interface'); + ipcRenderer.send('start-interface', { url: 'hifi://testing-url' }); }); $('#manage-server #restart').click(function() { ipcRenderer.send('restart-server', { name: 'home' }); diff --git a/console/src/main.js b/console/src/main.js index d7c81ae1e1..2a92f395c8 100644 --- a/console/src/main.js +++ b/console/src/main.js @@ -156,12 +156,13 @@ app.on('ready', function() { ipcMain.on('start-interface', function(event, arg) { // create a new Interface instance - Interface makes sure only one is running at a time - var args = []; - if (args.url) { - args << "--url" << args.url + var argArray = []; + if (arg.url) { + argArray = ["--url", arg.url] + console.log(argArray); } - var pInterface = new Process('interface', interfacePath); + var pInterface = new Process('interface', interfacePath, argArray); pInterface.start(); }); From ddd51264d92795d3b33eae1981c162ab9514be23 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 15:14:25 -0700 Subject: [PATCH 4/6] hook up the go button to localhost --- console/src/css/style.less | 13 +++++++++++++ console/src/images/go-hmd.svg | 18 ++++++++++++++++++ console/src/index.html | 3 +++ console/src/index.js | 7 ++++++- console/src/main.js | 4 ++-- 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 console/src/images/go-hmd.svg diff --git a/console/src/css/style.less b/console/src/css/style.less index dd68d4c4ab..613dd89693 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -201,6 +201,19 @@ header { &#right-box { position: absolute; margin-left: @title-margin-left; + + #go-server-button { + cursor: pointer; + border: none; + margin-top: 10px; + background-color: #08A6E0; + width: 150px; + + img { + padding: 10px 0px; + width: 50px; + } + } } } } diff --git a/console/src/images/go-hmd.svg b/console/src/images/go-hmd.svg new file mode 100644 index 0000000000..4e4fc8566e --- /dev/null +++ b/console/src/images/go-hmd.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/console/src/index.html b/console/src/index.html index 20d4d460dc..990adb3285 100644 --- a/console/src/index.html +++ b/console/src/index.html @@ -73,6 +73,9 @@ to build, explore, and share. We’ve started you off with a
home full of goodies to help you learn the ropes. Enjoy!

+
diff --git a/console/src/index.js b/console/src/index.js index f57e5aa6c0..dd7af7f754 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -72,8 +72,13 @@ $(function() { } $('#last-visited-link').click(function() { - ipcRenderer.send('start-interface', { url: 'hifi://testing-url' }); + ipcRenderer.send('start-interface'); }); + + $('#go-server-button').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 2a92f395c8..062746bac6 100644 --- a/console/src/main.js +++ b/console/src/main.js @@ -155,13 +155,13 @@ app.on('ready', function() { homeServer.start(); ipcMain.on('start-interface', function(event, arg) { - // create a new Interface instance - Interface makes sure only one is running at a time + // check if we have a url parameter to include var argArray = []; if (arg.url) { argArray = ["--url", arg.url] - console.log(argArray); } + // create a new Interface instance - Interface makes sure only one is running at a time var pInterface = new Process('interface', interfacePath, argArray); pInterface.start(); }); From a30d7ee697e3e27894ff6e19ac51a9b6f1745c40 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 15:41:14 -0700 Subject: [PATCH 5/6] add disabled styling for go button --- console/src/css/style.less | 10 ++++++++-- console/src/index.js | 15 +++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/console/src/css/style.less b/console/src/css/style.less index 613dd89693..9260680fbb 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -23,7 +23,7 @@ body { letter-spacing: 0.075rem; } -input, textarea, select, a { +input, textarea, select, a, button { outline: none; } @@ -203,12 +203,18 @@ header { margin-left: @title-margin-left; #go-server-button { + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.5); cursor: pointer; border: none; margin-top: 10px; - background-color: #08A6E0; + background-color: #129EC0; width: 150px; + &.disabled { + cursor: default; + background-color: #86888F; + } + img { padding: 10px 0px; width: 50px; diff --git a/console/src/index.js b/console/src/index.js index dd7af7f754..2eba4ba1c7 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,16 +55,25 @@ $(function() { function onProcessGroupUpdate(event, arg) { var sendingGroup = arg; var stopButton = $('#manage-server #stop'); + var goButton = $('#go-server-button'); 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'); + 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'); + break; } } @@ -74,8 +81,8 @@ $(function() { $('#last-visited-link').click(function() { ipcRenderer.send('start-interface'); }); - - $('#go-server-button').click(function(){ + + $('#go-server-button:not(.disabled)').click(function(){ ipcRenderer.send('start-interface', { url: 'hifi://localhost' }); }) From 919305e75971735ff1e12ee8a9fcc22ec450243b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 22 Dec 2015 15:46:44 -0700 Subject: [PATCH 6/6] display helper text when server stopped --- console/src/css/style.less | 7 +++++++ console/src/index.html | 3 +++ console/src/index.js | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/console/src/css/style.less b/console/src/css/style.less index 9260680fbb..64c202482b 100644 --- a/console/src/css/style.less +++ b/console/src/css/style.less @@ -203,6 +203,7 @@ header { margin-left: @title-margin-left; #go-server-button { + float: left; box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.5); cursor: pointer; border: none; @@ -220,6 +221,12 @@ header { width: 50px; } } + + #server-stopped-text { + float: left; + margin: 20px 0px 0px 20px; + color: red; + } } } } diff --git a/console/src/index.html b/console/src/index.html index 990adb3285..8a54567c14 100644 --- a/console/src/index.html +++ b/console/src/index.html @@ -76,6 +76,9 @@ +
+ Server stopped
Click "Restart"
+
diff --git a/console/src/index.js b/console/src/index.js index 2eba4ba1c7..6da2986a0f 100755 --- a/console/src/index.js +++ b/console/src/index.js @@ -56,6 +56,7 @@ $(function() { 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: @@ -66,6 +67,9 @@ $(function() { // 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 @@ -74,6 +78,9 @@ $(function() { // enable the go button goButton.removeClass('disabled'); + // hide the server stopped text + serverStopped.hide(); + break; } }