Skip to content
Browse files

remove settings input, cleanup `window` and use `panel.hub.account` f…

…or the account url
  • Loading branch information...
1 parent aea7c4a commit f50d5ed647ce80075aaede4d4e56d4316d3f2511 @tblobaum committed
Showing with 32 additions and 50 deletions.
  1. +17 −26 public/bundle.js
  2. +15 −15 public/entry.js
  3. +0 −9 public/index.html
View
43 public/bundle.js
@@ -376,20 +376,11 @@ module.exports = function (opts) {
function Panel (opts) {
var self = this
- // opts = opts || {}
- // if (!opts.secret) {
- // opts.secret = prompt('Enter the hub password', 'beepboop')
- // }
- // self.secret = opts.secret || ''
var stream = shoe('/dnode')
var d = dnode()
d.on('remote', function (remote) {
- // remote.auth(self.secret, function (err, result) {
- // if (err) self.emit('error', err)
- // else {
- self.emit('remote', remote)
- // }
- // })
+ console.log(remote)
+ self.emit('remote', remote)
})
d.pipe(stream).pipe(d)
}
@@ -5121,6 +5112,14 @@ require.define("/public/entry.js",function(require,module,exports,__dirname,__fi
, deploysTemplate = ejs.compile(views['deploys.ejs'])
, processes = {}
+window.clearSpawns = function () {
+ document.getElementById('monitor-spawn').innerHTML = ''
+}
+
+window.clearStdio = function () {
+ document.getElementById('monitor-stdio').innerHTML = ''
+}
+
panel.on('remote', function (hub) {
var ports = document.getElementById('info')
ports.textContent = 'hub:' + hub.ports.control + ' // git port:' + hub.ports.git
@@ -5129,7 +5128,7 @@ panel.on('remote', function (hub) {
monitorHub()
})
-window.stopProcess = function (drone, pid) {
+function stopProcess (drone, pid) {
panel.hub.stop({
drone : drone
, drones : Object.keys(processes)
@@ -5137,7 +5136,7 @@ window.stopProcess = function (drone, pid) {
}, function () {})
}
-window.processList = function () {
+function processList () {
var em = new EventEmitter
em.on('data', function (key, procs) {
@@ -5147,14 +5146,14 @@ window.processList = function () {
em.on('end', function () {
document.getElementById('ps').innerHTML = psTemplate({
ps : processes
- , accountUrl : document.getElementById('accountUrl').value
+ , accountUrl : panel.hub.account
})
})
panel.hub.ps(em.emit.bind(em))
}
-window.monitorHub = function () {
+function monitorHub () {
var em = new EventEmitter
, stdio = document.getElementById('monitor-stdio')
, deployElement = document.getElementById('monitor-deploy')
@@ -5165,7 +5164,7 @@ window.monitorHub = function () {
deploy.status = deploy.status ||'deploy'
appendText(deploysTemplate({
deploy : deploy
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), deployElement)
})
@@ -5174,7 +5173,7 @@ window.monitorHub = function () {
proc.status = proc.status ||'spawned'
prepend(spawnsTemplate({
proc : proc
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), spawn)
enableProcess(proc)
})
@@ -5184,7 +5183,7 @@ window.monitorHub = function () {
proc.status = proc.status || sig ? sig : 'stopped'
prepend(spawnsTemplate({
proc : proc
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), spawn)
disableProcess(proc)
})
@@ -5200,14 +5199,6 @@ window.monitorHub = function () {
panel.hub.subscribe(em.emit.bind(em))
}
-window.clearSpawns = function () {
- document.getElementById('monitor-spawn').innerHTML = ''
-}
-
-window.clearStdio = function clearStdio () {
- document.getElementById('monitor-stdio').innerHTML = ''
-}
-
function enableProcess (proc) {
var row = document.getElementById('pid-' + proc.id)
, status = document.getElementById('pid-' + proc.id + '-status')
View
30 public/entry.js
@@ -7,6 +7,14 @@ var panel = require('./fleet-panel')()
, deploysTemplate = ejs.compile(views['deploys.ejs'])
, processes = {}
+window.clearSpawns = function () {
+ document.getElementById('monitor-spawn').innerHTML = ''
+}
+
+window.clearStdio = function () {
+ document.getElementById('monitor-stdio').innerHTML = ''
+}
+
panel.on('remote', function (hub) {
var ports = document.getElementById('info')
ports.textContent = 'hub:' + hub.ports.control + ' // git port:' + hub.ports.git
@@ -15,7 +23,7 @@ panel.on('remote', function (hub) {
monitorHub()
})
-window.stopProcess = function (drone, pid) {
+function stopProcess (drone, pid) {
panel.hub.stop({
drone : drone
, drones : Object.keys(processes)
@@ -23,7 +31,7 @@ window.stopProcess = function (drone, pid) {
}, function () {})
}
-window.processList = function () {
+function processList () {
var em = new EventEmitter
em.on('data', function (key, procs) {
@@ -33,14 +41,14 @@ window.processList = function () {
em.on('end', function () {
document.getElementById('ps').innerHTML = psTemplate({
ps : processes
- , accountUrl : document.getElementById('accountUrl').value
+ , accountUrl : panel.hub.account
})
})
panel.hub.ps(em.emit.bind(em))
}
-window.monitorHub = function () {
+function monitorHub () {
var em = new EventEmitter
, stdio = document.getElementById('monitor-stdio')
, deployElement = document.getElementById('monitor-deploy')
@@ -51,7 +59,7 @@ window.monitorHub = function () {
deploy.status = deploy.status ||'deploy'
appendText(deploysTemplate({
deploy : deploy
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), deployElement)
})
@@ -60,7 +68,7 @@ window.monitorHub = function () {
proc.status = proc.status ||'spawned'
prepend(spawnsTemplate({
proc : proc
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), spawn)
enableProcess(proc)
})
@@ -70,7 +78,7 @@ window.monitorHub = function () {
proc.status = proc.status || sig ? sig : 'stopped'
prepend(spawnsTemplate({
proc : proc
- , accountUrl : accountUrl.value
+ , accountUrl : panel.hub.account
}), spawn)
disableProcess(proc)
})
@@ -86,14 +94,6 @@ window.monitorHub = function () {
panel.hub.subscribe(em.emit.bind(em))
}
-window.clearSpawns = function () {
- document.getElementById('monitor-spawn').innerHTML = ''
-}
-
-window.clearStdio = function clearStdio () {
- document.getElementById('monitor-stdio').innerHTML = ''
-}
-
function enableProcess (proc) {
var row = document.getElementById('pid-' + proc.id)
, status = document.getElementById('pid-' + proc.id + '-status')
View
9 public/index.html
@@ -66,15 +66,6 @@
<hr />
</div>
- <div class='span10 offset1'>
- <h3>Settings</h3> <br />
- <form class=''>
- <label for='accountUrl'>Account Url</label>
- <input type='text' id='accountUrl' class='input-xlarge' value='https://github.com/tblobaum/'>
- </form>
- <hr />
- </div>
-
</div>
<div class='row'>
<div class='span10 offset1'>

0 comments on commit f50d5ed

Please sign in to comment.
Something went wrong with that request. Please try again.