2.0.0 • Published 5 years ago

docker.js v2.0.0

Weekly downloads
3
License
LGPL-3.0
Repository
github
Last release
5 years ago

NodeJS Module for Handling and Displaying Docker Information

Manage docker containers in a web browser. Uses GraphViz for rendering the docker containers from the server into a visible graph on the client's web browser.

This library will used in the project Docker as a Service.

Screen Shot

Screen Shot of Docker Visualization

Server Side

Code snipped from usage on server side:

var express = require('express')
var app = express()
var server = app.listen(3000, () => {
  // listening on port 3000
})
var io = require('socket.io').listen(server)
var docker = require('docker.js')(app, io)
io.sockets.on('connection', docker.connect)

Client Side

Code snipped from usage on client side:

<!DOCTYPE HTML>
<html>
  <head>
    <script type="text/javascript" src="/jquery.js"></script>
    <script type="text/javascript" src="/viz.js"></script>
    <script type="text/javascript" src="/docker.js"></script>
    <script type="text/javascript" src="/socket.io.js"></script>
    <script type="text/javascript" src="/client.js"></script>
  </head>
  <body>
    <div id="stacks">… graphic goes here …</div>
    <a id="svgStacks></a>
    <footer>
        <div id="error">
    </footer>
  </body>
</html>

In client.js:

var socket = null;
var docker = null;

function error(msg, data) {
  $('#error').html('<h1>Error</h1><p>'+(new Date()).toLocaleString()+'</p><p>'+msg+'</p><pre>'+data+'</pre>').show()
}

function sigstack() {
  $('#error').hide()
  var dot = docker.graphics.stack()
  var svg = docker.graphics.viz(dot, error)
  $('#stacks').html(svg)
  $('a#svgStacks').attr('href', 'data:image/svg;base64,'+btoa(svg))
                  .attr('target', '_blank')
                  .attr('download', window.location.hostname+'.svg')
                  .show()
}

function init() {
  socket = io.connect()
  docker = new Docker(socket, error, sigstack)
}
$(init)
2.0.0

5 years ago

1.4.16

5 years ago

1.4.15

5 years ago

1.4.14

5 years ago

1.4.12

5 years ago

1.4.11

5 years ago

1.4.10

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.4

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.3

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago