-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0eb25c0
commit c172bed
Showing
16 changed files
with
2,767 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="css/ratchet.css"> | ||
<style type="text/css"> | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div class="app"></div> | ||
<script src="configure.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var ipc = require('ipc') | ||
var mustache = require('mustache') | ||
var fs = require('fs') | ||
|
||
var template = fs.readFileSync('./configure.mustache').toString() | ||
var container = document.querySelector('.app') | ||
|
||
ipc.on('status', function(data) { | ||
data = data.map(function(d) { | ||
if (d.uptime) { | ||
d.classes = "btn-positive" | ||
d.message = "Running" | ||
return d | ||
} | ||
if (d.state === 'dead') { | ||
d.classes = "btn-negative" | ||
d.message = "Dead" | ||
return d | ||
} | ||
|
||
d.message = "Not Running" | ||
return d | ||
}) | ||
var output = mustache.render(template, {items: data}) | ||
container.innerHTML = output | ||
|
||
addEvents() | ||
}) | ||
|
||
ipc.send('update-me') | ||
|
||
function addEvents() { | ||
var startAll = document.querySelector('.start-all') | ||
var stopAll = document.querySelector('.stop-all') | ||
var restartAll = document.querySelector('.restart-all') | ||
var buttons = [startAll, stopAll, restartAll] | ||
|
||
buttons.forEach(function (button) { | ||
button.addEventListener('mousedown', function(e) { | ||
var action = e.target.attributes['data-action'].value | ||
ipc.send('task', {task: action}) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ul class="table-view"> | ||
{{#items}} | ||
<li class="table-view-cell">{{name}} <button class="btn {{classes}}">{{message}}</button></li> | ||
{{/items}} | ||
</ul> | ||
<div class="content-padded"> | ||
<button data-action="startAll" class="start-all btn btn-positive btn-block">Start All</button> | ||
<button data-action="restartAll" class="restart-all btn btn-primary btn-block">Restart All</button> | ||
<button data-action="stopAll" class="stop-all btn btn-negative btn-block">Stop All</button> | ||
</div> |
Oops, something went wrong.