bugs fixed for standalone volumes; zoom added

This commit is contained in:
Marc Wäckerlin
2018-12-04 00:29:26 +01:00
parent 1476e69650
commit cae0789ee1
4 changed files with 48 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
var socket = io.connect()
var docker = new Docker(socket, error, sigstack, sigcontainer)
var parameters = docker.graphics.parameters
var zoom = 1
var stack = null
var standalone = null
@@ -14,7 +15,6 @@ function error(e) {
$('#error').html('<h1>Error</h1><p>'+(new Date()).toLocaleString()+'</p><p>'+e.msg+'</p><pre>'+e.data+'</pre>').show()
}
function update() {
var data = {
'containers': docker.containers.get(),
@@ -88,6 +88,26 @@ function init() {
.on('dragstart', (event) => {
event.originalEvent.dataTransfer.setData("text", "");
})
// zoom in
$('#zoomin').on('click', () => {
zoom *= 1.5
if (zoom>500) zoom=500;
$('#wizard').width(100*zoom+'%')
$('#wizard svg').width('100%')
})
// zoom reset
$('#zoomreset').on('click', () => {
zoom = 1
$('#wizard').width('100%')
$('#wizard svg').width('auto')
})
// zoom out
$('#zoomout').on('click', () => {
zoom /= 1.5
if (zoom<0.1) zoom=0.1;
$('#wizard').width(100*zoom+'%')
$('#wizard svg').width('100%')
})
// restart on click on status
$('#status').on('click', () => {
docker.unpause()