more bashing
This commit is contained in:
3
nodejs/etc/servicedock.json
Normal file
3
nodejs/etc/servicedock.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"port": 8889
|
||||
}
|
@@ -8,6 +8,8 @@ EXTRA_DIST = servicedock.js package.json.in public routes sockets views
|
||||
|
||||
nodejsdir = ${pkgdatadir}/nodejs
|
||||
|
||||
sysconf_DATA = etc/@PACKAGE_NAME@.json
|
||||
|
||||
all: node_modules
|
||||
|
||||
node_modules: package.json.in
|
||||
|
@@ -17,5 +17,14 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Marc Wäckerlin",
|
||||
"license": "LGPL3"
|
||||
"license": "LGPL3",
|
||||
"path": {
|
||||
"prefix": "@PREFIX@",
|
||||
"sysconf": "@SYSCONFDIR@",
|
||||
"pkgdata": "@PKGDATADIR@",
|
||||
"localstate": "@LOCALSTATEDIR@",
|
||||
"log": "@LOCALSTATEDIR@/log/@PACKAGE_NAME@.log",
|
||||
"config": "@SYSCONFDIR@/@PACKAGE_NAME@.json",
|
||||
"nodejs": "@PKGDATADIR@/nodejs"
|
||||
}
|
||||
}
|
||||
|
@@ -828,19 +828,22 @@ function bash_data(data) {
|
||||
if (data.type=='done') {
|
||||
$("#screen").append('<span class="'+data.type+'">\nDONE</span>');
|
||||
} else {
|
||||
var done = false;
|
||||
var buff = "";
|
||||
console.log("ASCII: ", ascii(data.text));
|
||||
if (data.text.length==1) {
|
||||
switch (data.text.charCodeAt(0)) {
|
||||
for (var i=0; i<data.text.length; ++i) {
|
||||
switch (data.text.charCodeAt(i)) {
|
||||
case 7:
|
||||
$('#screen').text(function (_,txt) {
|
||||
case 8:
|
||||
if (buff.length) $("#screen").append(ansifilter(htmlenc(buff)));
|
||||
buff = "";
|
||||
$('#screen').html(function (_,txt) {
|
||||
return txt.slice(0, -1);
|
||||
});
|
||||
done = true;
|
||||
break;
|
||||
default: buff += data.text[i];
|
||||
}
|
||||
}
|
||||
if (!done) $("#screen").append(ansifilter(htmlenc(data.text)));
|
||||
if (buff.length) $("#screen").append(ansifilter(htmlenc(buff)));
|
||||
}
|
||||
$("#screen").animate({
|
||||
scrollTop: $("#screen").prop('scrollHeight')
|
||||
|
@@ -9,6 +9,8 @@ var express = require('express')
|
||||
var app = module.exports = express.createServer();
|
||||
var io = require('socket.io').listen(app);
|
||||
var sockets = require(__dirname+'/sockets')(io);
|
||||
var package = require(__dirname+'/package.json');
|
||||
var config = require(package.path.config);
|
||||
|
||||
// Configuration
|
||||
|
||||
@@ -34,7 +36,7 @@ app.configure('production', function(){
|
||||
|
||||
app.get('/', routes.index);
|
||||
|
||||
app.listen(8889, function() {
|
||||
app.listen(config.port, function() {
|
||||
console.log("Express server listening on port %d in %s mode",
|
||||
app.address().port, app.settings.env);
|
||||
});
|
||||
|
Reference in New Issue
Block a user