diff --git a/ChangeLog b/ChangeLog index 1ebc736..b65057e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-01-31 21:58 marc + + * ChangeLog, nodejs/docker/docker.js, + nodejs/public/javascripts/servicedock.js, + nodejs/public/stylesheets/servicedock.css, + nodejs/views/index.ejs: create works + 2016-01-29 15:55 marc * nodejs/docker/docker.js, diff --git a/nodejs/sockets/index.js b/nodejs/sockets/index.js index cab761d..eda8a5f 100644 --- a/nodejs/sockets/index.js +++ b/nodejs/sockets/index.js @@ -17,6 +17,10 @@ module.exports = function(io) { proc.exec(cmd, callback); } + function fail(txt, data) { + console.log("** "+txt, data); + } + var oldcontainer = null; function containerinspect(error, stdout, stderr) { if (error || stderr) @@ -96,7 +100,7 @@ module.exports = function(io) { function modify(cmd, name) { if (!name.match(/^[a-z0-9][-_:.+a-z0-9]*$/i)) - return fail("illegal instance name"); + return this.fail("illegal instance name"); exec("docker "+cmd+" "+name, updatecontainers); } @@ -104,7 +108,7 @@ module.exports = function(io) { if (cmds.length>0) exec(cmds.shift(), function(error, stdout, stderr) { if (error || stderr) - return fail("create container failed", { + return this.fail("create container failed", { error: error, stderr: stderr, stdout: stdout }); createContainer(cmds); @@ -175,7 +179,7 @@ module.exports = function(io) { function new_bash(name) { if (!name.match(/^[a-z0-9][-_:.+a-z0-9]*$/i)) - return fail("illegal instance name"); + return this.fail("illegal instance name"); if (bash_connections[name]) return; bash_connections[name] = pty.spawn("docker", ["exec", "-it", name, "bash", "-i"]);