most docker client parts have been moved to docker.js; this version works
This commit is contained in:
@@ -7,12 +7,9 @@
|
|||||||
"stylus": "~0.53.0",
|
"stylus": "~0.53.0",
|
||||||
"ejs": ">= 0.0.1",
|
"ejs": ">= 0.0.1",
|
||||||
"socket.io": "~1.4.4",
|
"socket.io": "~1.4.4",
|
||||||
"pty.js": "~0.3.0",
|
|
||||||
"async": "~1.5.2",
|
|
||||||
"socketio-auth": "0.0.5",
|
"socketio-auth": "0.0.5",
|
||||||
"authentication.js": ">= 0.0.2",
|
"authentication.js": ">= 1.0.0",
|
||||||
"docker.js": ">= 0.0.0",
|
"docker.js": ">= 0.2.4"
|
||||||
"ldapauth": "git+https://github.com/DimensionSoftware/node-ldapauth.git"
|
|
||||||
},
|
},
|
||||||
"description": "@DESCRIPTION@",
|
"description": "@DESCRIPTION@",
|
||||||
"main": "@PACKAGE_NAME@.js",
|
"main": "@PACKAGE_NAME@.js",
|
||||||
|
@@ -9,9 +9,7 @@
|
|||||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
|
||||||
var socket = null;
|
var socket = null;
|
||||||
var focused = null;
|
var docker = null;
|
||||||
|
|
||||||
var docker = new Docker();
|
|
||||||
|
|
||||||
function htmlenc(html) {
|
function htmlenc(html) {
|
||||||
return $('<div/>').text(html).html();
|
return $('<div/>').text(html).html();
|
||||||
@@ -97,7 +95,6 @@ function status(text, msg) {
|
|||||||
zoom(0);
|
zoom(0);
|
||||||
$("#main").show();
|
$("#main").show();
|
||||||
$("form input:first-child").focus();
|
$("form input:first-child").focus();
|
||||||
docker.containers.contextmenu("#main");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function emit(signal, data) {
|
function emit(signal, data) {
|
||||||
@@ -206,7 +203,7 @@ function previewCreate() {
|
|||||||
});
|
});
|
||||||
$('#dosend').unbind().click(function() {
|
$('#dosend').unbind().click(function() {
|
||||||
if (Object.keys(tobecreated).length>0) {
|
if (Object.keys(tobecreated).length>0) {
|
||||||
emit("create", docker.containers.configuration(tobecreated));
|
emit("docker.container.create", docker.containers.configuration(tobecreated));
|
||||||
tobecreated = {};
|
tobecreated = {};
|
||||||
showImage();
|
showImage();
|
||||||
}
|
}
|
||||||
@@ -285,110 +282,6 @@ function zoom(incr = 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var viz = null;
|
|
||||||
var vizmore = null;
|
|
||||||
var rankdir = "LR";
|
|
||||||
function rotateviz() {
|
|
||||||
if (!viz) return;
|
|
||||||
if (rankdir == "LR")
|
|
||||||
rankdir = "TB";
|
|
||||||
else
|
|
||||||
rankdir = "LR";
|
|
||||||
showviz();
|
|
||||||
previewCreate();
|
|
||||||
}
|
|
||||||
function showviz(vizpath, more) {
|
|
||||||
if (!vizpath) {
|
|
||||||
vizpath = viz;
|
|
||||||
more = vizmore;
|
|
||||||
} else {
|
|
||||||
viz = vizpath;
|
|
||||||
vizmore = more;
|
|
||||||
}
|
|
||||||
res = "digraph {\n"+" rankdir="+rankdir+";\n"+viz+"\n}";
|
|
||||||
try {
|
|
||||||
status(more?Viz(res)+more:Viz(res));
|
|
||||||
stats();
|
|
||||||
$('#main a > ellipse + text').attr('font-size', '12');
|
|
||||||
$('#main a > ellipse + text + text')
|
|
||||||
.attr('font-weight', 'bold')
|
|
||||||
.attr('font-size', '16')
|
|
||||||
.each(function() {$(this).attr('y', parseFloat($(this).attr('y'))+1.0)});
|
|
||||||
$('#main a > ellipse + text + text + text, #main a > ellipse + text + text + text + text').attr('font-size', '10');
|
|
||||||
} catch(e) {
|
|
||||||
(res = res.split("\n")).forEach(function(v, i, a) {
|
|
||||||
a[i] = ("000"+(i+1)).slice(-3)+": "+v;
|
|
||||||
});
|
|
||||||
status("<h2>Exception Caught:</h2><p>"+e+"<p><pre>"+res.join("\n")+"</pre>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function details(name) {
|
|
||||||
if (name) focused = name;
|
|
||||||
else if (!focused) return overview();
|
|
||||||
showviz(docker.containers.subgraph(focused));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Convert number of bytes to readable text
|
|
||||||
function size(num) {
|
|
||||||
if (num>0.6*1024) {
|
|
||||||
if (num>0.6*1024*1024) {
|
|
||||||
if (num>0.6*1024*1024*1024) {
|
|
||||||
if (num>0.6*1024*1024*1024*1024) {
|
|
||||||
return Math.round(num/1024/1024/1024/1024)+"TB";
|
|
||||||
} else {
|
|
||||||
return Math.round(num/1024/1024/1024)+"GB";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Math.round(num/1024/1024)+"MB";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Math.round(num/1024)+"kB";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return num+"B";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var laststats=null;
|
|
||||||
function stats(data) {
|
|
||||||
if (data)
|
|
||||||
console.log("->rcv stats");
|
|
||||||
else
|
|
||||||
data=laststats;
|
|
||||||
if (!data) return;
|
|
||||||
var lines = data.split("\n");
|
|
||||||
var head = lines.shift();
|
|
||||||
lines.forEach(function(line) {
|
|
||||||
if (!line) return;
|
|
||||||
elements = line.split(/ +/);
|
|
||||||
$('#main text + text:contains("'+elements[0]+'") + text + text')
|
|
||||||
.html('cpu: '+elements[1]+' mem: '+elements[7]);
|
|
||||||
$('#main text + text:contains("'+elements[0]+'") + text')
|
|
||||||
.html('net: '+elements[8]+elements[9]+' '+elements[11]+elements[12]
|
|
||||||
+' block: '+elements[13]+elements[14]+' '+elements[16]+elements[17]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function images(i) {
|
|
||||||
console.log("->rcv images");
|
|
||||||
docker.images.set(i);
|
|
||||||
$('#imagedata').empty().append(docker.images.tags().map(function(i) {
|
|
||||||
var option = document.createElement('option');
|
|
||||||
option.value = i;
|
|
||||||
return option;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
function containers(c) {
|
|
||||||
console.log("->rcv containers");
|
|
||||||
docker.containers.set(c);
|
|
||||||
if (focused && docker.containers.exists(focused))
|
|
||||||
details(focused);
|
|
||||||
else
|
|
||||||
overview();
|
|
||||||
}
|
|
||||||
|
|
||||||
function showLogin() {
|
function showLogin() {
|
||||||
$("#close").hide();
|
$("#close").hide();
|
||||||
$("#console").hide();
|
$("#console").hide();
|
||||||
@@ -443,6 +336,16 @@ function showLogs() {
|
|||||||
$("#main").hide();
|
$("#main").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function images(i) {
|
||||||
|
console.log("->rcv images");
|
||||||
|
docker.images.set(i);
|
||||||
|
$('#imagedata').empty().append(docker.images.tags().map(function(i) {
|
||||||
|
var option = document.createElement('option');
|
||||||
|
option.value = i;
|
||||||
|
return option;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
function logs(data) {
|
function logs(data) {
|
||||||
console.log("->rcv logs("+data.name+")");
|
console.log("->rcv logs("+data.name+")");
|
||||||
if (data.type=='done') {
|
if (data.type=='done') {
|
||||||
@@ -568,11 +471,6 @@ function bash_data(data) {
|
|||||||
$("#screen").focus();
|
$("#screen").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function overview() {
|
|
||||||
focused = null;
|
|
||||||
showviz(docker.containers.graph());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Initial Function: Startup
|
/// Initial Function: Startup
|
||||||
/** To be called after login */
|
/** To be called after login */
|
||||||
function start() {
|
function start() {
|
||||||
@@ -582,8 +480,8 @@ function start() {
|
|||||||
$("#menu").hide();
|
$("#menu").hide();
|
||||||
try {
|
try {
|
||||||
status("Starting up ...");
|
status("Starting up ...");
|
||||||
emit("images");
|
emit("docker.images");
|
||||||
emit("containers");
|
emit("docker.containers");
|
||||||
showImage();
|
showImage();
|
||||||
} catch (m) {
|
} catch (m) {
|
||||||
error(m);
|
error(m);
|
||||||
@@ -601,8 +499,8 @@ function initForms() {
|
|||||||
var obj = this;
|
var obj = this;
|
||||||
this.getAttribute('data-name').split(' ').forEach(function(n) {
|
this.getAttribute('data-name').split(' ').forEach(function(n) {
|
||||||
res += 'data-'+n+'="'+
|
res += 'data-'+n+'="'+
|
||||||
(obj.type!='checkbox'||obj.checked
|
(obj.type!='checkbox'||obj.checked
|
||||||
?obj.value:obj.getAttribute('data-false'))
|
?obj.value:obj.getAttribute('data-false'))
|
||||||
.replace(/&/g, '&')
|
.replace(/&/g, '&')
|
||||||
.replace(/"/g, '"')
|
.replace(/"/g, '"')
|
||||||
+'"';
|
+'"';
|
||||||
@@ -629,6 +527,10 @@ function initForms() {
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
socket = io.connect();
|
socket = io.connect();
|
||||||
|
docker = new Docker(socket, '#main', error);
|
||||||
|
$("#server").html($("#username").value+'@'+window.location.hostname)
|
||||||
|
initForms();
|
||||||
|
showLogin();
|
||||||
socket
|
socket
|
||||||
.io
|
.io
|
||||||
.on("connect", connect)
|
.on("connect", connect)
|
||||||
@@ -638,15 +540,9 @@ function init() {
|
|||||||
socket
|
socket
|
||||||
.on("authenticated", authenticated)
|
.on("authenticated", authenticated)
|
||||||
.on("unauthorized", unauthorized)
|
.on("unauthorized", unauthorized)
|
||||||
.on("fail", error)
|
.on("docker.images", images)
|
||||||
.on("containers", containers)
|
.on("docker.container.logs", logs)
|
||||||
.on("images", images)
|
.on("docker.container.bash.data", bash_data);
|
||||||
.on("stats", stats)
|
|
||||||
.on("logs", logs)
|
|
||||||
.on("bash-data", bash_data);
|
|
||||||
$("#server").html($("#username").value+'@'+window.location.hostname)
|
|
||||||
initForms();
|
|
||||||
showLogin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// On Load, Call @ref start
|
/// On Load, Call @ref start
|
||||||
|
@@ -20,13 +20,12 @@ try {
|
|||||||
var express = require('express')
|
var express = require('express')
|
||||||
, routes = require(__dirname+'/routes');
|
, routes = require(__dirname+'/routes');
|
||||||
|
|
||||||
var app = module.exports = express.createServer();
|
var app = express.createServer();
|
||||||
var io = require('socket.io').listen(app);
|
var io = require('socket.io').listen(app);
|
||||||
var package = require(__dirname+'/package.json');
|
var package = require(__dirname+'/package.json');
|
||||||
var config = require(package.path.config);
|
var config = require(package.path.config);
|
||||||
var docker = require('docker.js')(app);
|
|
||||||
var authentication = require('authentication.js')(config.restrict);
|
var authentication = require('authentication.js')(config.restrict);
|
||||||
var sockets = require(__dirname+'/sockets')(app, io, docker, authentication);
|
var sockets = require(__dirname+'/sockets')(app, io, authentication);
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
process.argv.forEach(function(val, index) {
|
process.argv.forEach(function(val, index) {
|
||||||
|
@@ -1,247 +1,17 @@
|
|||||||
module.exports = function(app, io, docker, authentication) {
|
module.exports = function(app, io, authentication) {
|
||||||
|
|
||||||
var pty = require('pty.js');
|
|
||||||
var proc = require('child_process');
|
|
||||||
|
|
||||||
var module={};
|
|
||||||
var running="";
|
|
||||||
|
|
||||||
function broadcast(signal, data) {
|
var docker = require('docker.js')(app, io);
|
||||||
console.log("<= signal: "+signal);
|
|
||||||
io.sockets.emit(signal, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function exec(cmd, callback) {
|
|
||||||
if (cmd.length>40) {
|
|
||||||
console.log("== "+cmd.slice(0, 30+cmd.slice(30).indexOf(' '))+" ...");
|
|
||||||
} else {
|
|
||||||
console.log("== "+cmd);
|
|
||||||
}
|
|
||||||
proc.exec(cmd, {maxBuffer: 10*1024*1024}, callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
function fail(txt, data) {
|
|
||||||
console.log("** "+txt, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
var oldcontainer = null;
|
|
||||||
function containerinspect(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("inspect docker containers failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
running = "";
|
|
||||||
JSON.parse(stdout).forEach(function(n) {
|
|
||||||
if (n.State.Running) running+=" "+n.Name.replace(/^\//, '');
|
|
||||||
});
|
|
||||||
if (oldcontainer!=stdout) broadcast("containers", stdout);
|
|
||||||
oldcontainer = stdout;
|
|
||||||
}
|
|
||||||
|
|
||||||
function containerlist(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("list docker containers failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
var containers = stdout.trim().replace(/\n/g, " ");
|
|
||||||
exec("docker inspect "+containers, containerinspect);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatecontainers(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("update docker container failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
exec("docker ps -aq --no-trunc ", containerlist);
|
|
||||||
}
|
|
||||||
|
|
||||||
var oldimage = null;
|
|
||||||
function imageinspect(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("inspect docker images failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
if (oldimage && oldimage==stdout) return; // do not resend same images
|
|
||||||
oldimage = stdout;
|
|
||||||
broadcast("images", stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
function imagelist(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("list docker images failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
exec("docker inspect "+stdout.trim().replace(/\n/g, " "),
|
|
||||||
imageinspect);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateimages(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return fail("update docker images failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
exec("docker images -q --no-trunc", imagelist);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// New Authenticated Client
|
||||||
function connection(socket, userdata) {
|
function connection(socket, userdata) {
|
||||||
|
|
||||||
console.log("=> new connection from "+userdata.username);
|
console.log("=> new connection from "+userdata.username);
|
||||||
|
docker.connect(socket);
|
||||||
function emit(signal, data, info) {
|
|
||||||
if (typeof data == 'string' && !data.match("\n")) {
|
|
||||||
console.log("<- signal: "+signal+"("+data+")");
|
|
||||||
} else {
|
|
||||||
console.log("<- signal: "+signal);
|
|
||||||
}
|
|
||||||
if (info) console.log(info);
|
|
||||||
socket.emit(signal, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function fail(txt, data) {
|
|
||||||
console.log("** "+txt, data);
|
|
||||||
emit("fail", txt);
|
|
||||||
}
|
|
||||||
|
|
||||||
function modify(cmd, name) {
|
|
||||||
if (!name.match(/^[a-z0-9][-_:.+a-z0-9]*$/i))
|
|
||||||
return this.fail("illegal instance name");
|
|
||||||
exec("docker "+cmd+" "+name, updatecontainers);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createContainer(cmds) {
|
|
||||||
if (cmds.length>0)
|
|
||||||
exec(cmds.shift(), function(error, stdout, stderr) {
|
|
||||||
if (error || stderr)
|
|
||||||
return this.fail("create container failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
createContainer(cmds);
|
|
||||||
})
|
|
||||||
else
|
|
||||||
updatecontainers();
|
|
||||||
}
|
|
||||||
|
|
||||||
function containers() {
|
|
||||||
console.log("-> containers");
|
|
||||||
if (oldcontainer) emit("containers", oldcontainer);
|
|
||||||
else updatecontainers();
|
|
||||||
}
|
|
||||||
|
|
||||||
function images() {
|
|
||||||
console.log("-> images");
|
|
||||||
if (oldimage) emit("images", oldimage);
|
|
||||||
else updateimages();
|
|
||||||
}
|
|
||||||
|
|
||||||
function start(name) {
|
|
||||||
console.log("-> start("+name+")");
|
|
||||||
modify("start", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function stop(name) {
|
|
||||||
console.log("-> stop("+name+")");
|
|
||||||
modify("stop", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function pause(name) {
|
|
||||||
console.log("-> pause("+name+")");
|
|
||||||
modify("pause", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function unpause(name) {
|
|
||||||
console.log("-> unpause("+name+")");
|
|
||||||
modify("unpause", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function remove(name) {
|
|
||||||
console.log("-> remove("+name+")");
|
|
||||||
modify("rm", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function create(data) {
|
|
||||||
console.log("-> create");
|
|
||||||
var d = new docker.Docker();
|
|
||||||
var dc = new d.Containers();
|
|
||||||
createContainer(dc.creation(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
function logs(name) {
|
|
||||||
console.log("-> logs("+name+")");
|
|
||||||
var l = proc.spawn("docker", ["logs", "-f", name])
|
|
||||||
.on('close', function(code) {
|
|
||||||
emit('logs', {name: name, type: 'done'});
|
|
||||||
});
|
|
||||||
l.stdout.on('data', function(data) {
|
|
||||||
emit('logs', {name: name, type: 'stdout', text: data.toString()});
|
|
||||||
});
|
|
||||||
l.stderr.on('data', function(data) {
|
|
||||||
emit('logs', {name: name, type: 'stderr', text: data.toString()});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var bash_connections = {};
|
|
||||||
|
|
||||||
function new_bash(name) {
|
|
||||||
if (!name.match(/^[a-z0-9][-_:.+a-z0-9]*$/i))
|
|
||||||
return this.fail("illegal instance name");
|
|
||||||
if (bash_connections[name]) return;
|
|
||||||
bash_connections[name] = pty.spawn("docker", ["exec", "-it", name, "bash", "-i"]);
|
|
||||||
bash_connections[name].stdout.on('data', function(data) {
|
|
||||||
emit('bash-data', {name: name, type: 'stdout', text: data.toString()});
|
|
||||||
});
|
|
||||||
bash_connections[name].stderr.on('data', function(data) {
|
|
||||||
emit('bash-data', {name: name, type: 'stderr', text: data.toString()});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function bash_start(name) {
|
|
||||||
console.log("-> bash-start("+name+")");
|
|
||||||
new_bash(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function bash_input(data) {
|
|
||||||
console.log("-> bash-input("+data.name+", "+data.text+")");
|
|
||||||
new_bash(data.name);
|
|
||||||
bash_connections[data.name].stdin.resume();
|
|
||||||
bash_connections[data.name].stdin.write(data.text);
|
|
||||||
}
|
|
||||||
|
|
||||||
function bash_end(name, text) {
|
|
||||||
console.log("-> bash-end("+name+")");
|
|
||||||
if (!bash_connections[name]) return;
|
|
||||||
bash_connections[name].stdin.close();
|
|
||||||
delete bash_connections[name]; bash_connections[name] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
socket
|
|
||||||
.on("containers", containers)
|
|
||||||
.on("images", images)
|
|
||||||
.on("start", start)
|
|
||||||
.on("stop", stop)
|
|
||||||
.on("pause", pause)
|
|
||||||
.on("unpause", unpause)
|
|
||||||
.on("remove", remove)
|
|
||||||
.on("create", create)
|
|
||||||
.on('logs', logs)
|
|
||||||
.on('bash-start', bash_start)
|
|
||||||
.on('bash-input', bash_input)
|
|
||||||
.on('bash-end', bash_end);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stats(error, stdout, stderr) {
|
// Handle Connection Authentication
|
||||||
if (error || stderr)
|
|
||||||
return fail("get containers stats failed", {
|
|
||||||
error: error, stderr: stderr, stdout: stdout
|
|
||||||
});
|
|
||||||
broadcast("stats", stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle Connection
|
|
||||||
require('socketio-auth')(io, {
|
require('socketio-auth')(io, {
|
||||||
authenticate: function (socket, data, callback) {
|
authenticate: function (socket, data, callback) {
|
||||||
console.log("=> authenticate: ", data.username);
|
console.log("=> authenticate: ", data.username);
|
||||||
//get credentials sent by the client
|
|
||||||
authentication(data.username, data.password,
|
authentication(data.username, data.password,
|
||||||
function() {
|
function() {
|
||||||
console.log("####LOGIN-SUCESS####");
|
console.log("####LOGIN-SUCESS####");
|
||||||
@@ -256,16 +26,6 @@ module.exports = function(app, io, docker, authentication) {
|
|||||||
timeout: "none"
|
timeout: "none"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Regular Update of Images and Containers
|
var module = {};
|
||||||
setInterval(function() {
|
|
||||||
updateimages();
|
|
||||||
updatecontainers();
|
|
||||||
}, 10000);
|
|
||||||
|
|
||||||
// Regular Update of Stats
|
|
||||||
setInterval(function() {
|
|
||||||
if (running) exec('docker stats --no-stream'+running, stats);
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
@@ -7,9 +7,9 @@
|
|||||||
<link href="stylesheets/jquery-ui.css" rel="stylesheet" type="text/css" />
|
<link href="stylesheets/jquery-ui.css" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="javascripts/jquery.js"></script>
|
<script type="text/javascript" src="javascripts/jquery.js"></script>
|
||||||
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>
|
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>
|
||||||
<script type="text/javascript" src="javascripts/viz.js"></script>
|
<script type="text/javascript" src="/viz.js"></script>
|
||||||
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
|
||||||
<script type="text/javascript" src="/docker/docker.js"></script>
|
<script type="text/javascript" src="/docker.js"></script>
|
||||||
<script type="text/javascript" src="javascripts/servicedock.js"></script>
|
<script type="text/javascript" src="javascripts/servicedock.js"></script>
|
||||||
<title>ServiceDock: Docker as a Service</title>
|
<title>ServiceDock: Docker as a Service</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<div id="togglemenu">
|
<div id="togglemenu">
|
||||||
<span id="imagetools" style="display: none">
|
<span id="imagetools" style="display: none">
|
||||||
<img class="btn" onclick="zoom(1)" src="images/zoom.svg" />
|
<img class="btn" onclick="zoom(1)" src="images/zoom.svg" />
|
||||||
<img class="btn" onclick="rotateviz()" src="images/rotate.svg" />
|
<img class="btn" onclick="docker.rotate()" src="images/rotate.svg" />
|
||||||
</span>
|
</span>
|
||||||
<span class="btn" id="close" onclick="showImage()" style="display: none">×</span>
|
<span class="btn" id="close" onclick="showImage()" style="display: none">×</span>
|
||||||
<img class="btn" id="menuicon" onclick="togglemenu()" src="images/menu.svg" />
|
<img class="btn" id="menuicon" onclick="togglemenu()" src="images/menu.svg" />
|
||||||
|
Reference in New Issue
Block a user