Merge pull request #62 from birarda/console-styling

extra styling for home server, hook up last visited / go home
This commit is contained in:
Ryan Huffman 2015-12-22 15:54:12 -08:00
commit 2f45d0dff5
6 changed files with 119 additions and 27 deletions

View file

@ -16,14 +16,14 @@ 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 {
input, textarea, select, a, button {
outline: none;
}
@ -48,6 +48,11 @@ header {
margin: 0px 75px;
color: white;
a {
color: white;
text-decoration: none;
}
p {
text-align: center;
}
@ -132,19 +137,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 +197,37 @@ header {
width: 215px;
}
}
&#right-box {
position: absolute;
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;
margin-top: 10px;
background-color: #129EC0;
width: 150px;
&.disabled {
cursor: default;
background-color: #86888F;
}
img {
padding: 10px 0px;
width: 50px;
}
}
#server-stopped-text {
float: left;
margin: 20px 0px 0px 20px;
color: red;
}
}
}
}
}

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="96.3px" height="32px" viewBox="0 0 96.3 32" enable-background="new 0 0 96.3 32" xml:space="preserve">
<path fill="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.5 KiB

View file

@ -28,10 +28,12 @@
<p>Search</p>
</div>
<div id="nav-last-visited" class="nav-item">
<div class="tray-square nav-square">
<img src="images/last-visited.svg" />
</div>
<p>Last visited</p>
<a href="#" id="last-visited-link">
<div class="tray-square nav-square">
<img src="images/last-visited.svg" />
</div>
<p>Last visited</p>
</a>
</div>
</div>
<div class="tray-line"></div>
@ -64,6 +66,18 @@
</div>
<div id="right-box" class="server-box">
<div class="title">
<p id="server-url">hifi://localhost</p>
</div>
<p>
This is your domain. 4096 cubic kilometers of space for you<br>
to build, explore, and share. Weve started you off with a<br>
home full of goodies to help you learn the ropes. Enjoy!
</p>
<button id="go-server-button">
<img src="images/go-hmd.svg" />
</button>
<div id="server-stopped-text">
<span>Server stopped<br>Click "Restart"</span>
</div>
</div>
</div>

View file

@ -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' });
});

View file

@ -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();

View file

@ -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';