bugs fixed for standalone volumes; zoom added

master
Marc Wäckerlin 6 years ago
parent 1476e69650
commit cae0789ee1
  1. 22
      client/servicedock.js
  2. 2
      package.json
  3. 21
      style/style.styl
  4. 4
      views/layout.pug

@ -1,6 +1,7 @@
var socket = io.connect() var socket = io.connect()
var docker = new Docker(socket, error, sigstack, sigcontainer) var docker = new Docker(socket, error, sigstack, sigcontainer)
var parameters = docker.graphics.parameters var parameters = docker.graphics.parameters
var zoom = 1
var stack = null var stack = null
var standalone = 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() $('#error').html('<h1>Error</h1><p>'+(new Date()).toLocaleString()+'</p><p>'+e.msg+'</p><pre>'+e.data+'</pre>').show()
} }
function update() { function update() {
var data = { var data = {
'containers': docker.containers.get(), 'containers': docker.containers.get(),
@ -88,6 +88,26 @@ function init() {
.on('dragstart', (event) => { .on('dragstart', (event) => {
event.originalEvent.dataTransfer.setData("text", ""); 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 // restart on click on status
$('#status').on('click', () => { $('#status').on('click', () => {
docker.unpause() docker.unpause()

@ -10,7 +10,7 @@
"child_process": "^1.0.2", "child_process": "^1.0.2",
"cookie-parser": "*", "cookie-parser": "*",
"debug": "*", "debug": "*",
"docker.js": "^1.4.15", "docker.js": "^1.4.16",
"dockerode": "^2.5.7", "dockerode": "^2.5.7",
"express": "*", "express": "*",
"jquery": "^3.1.1", "jquery": "^3.1.1",

@ -17,6 +17,7 @@ header
background-color: blue background-color: blue
color: white color: white
line-height: 1em line-height: 1em
cursor: grabbing
h1 h1
z-index: 99 z-index: 99
font-size: 100% font-size: 100%
@ -49,18 +50,31 @@ header
&:hover &:hover
display: block display: block
a a
margin: 0.5em
display: none display: none
&[href] &[href]
display: block display: block
&:link #info
a
color: inherit color: inherit
cursor: pointer
#zoom
margin: 0.5em
display: flex
a
margin 0 0.1em
#zoomin
cursor: zoom-in
#zoomreset
cursor: pointer
#zoomout
cursor: zoom-out
#downloads, #info #downloads, #info
display: flex display: flex
#clock #clock
margin: 0.5em margin: 0.5em
#status #status
margin: 0.5em margin: 0.5em
cursor: pointer
&.wait &.wait
&::before &::before
content: "" content: ""
@ -76,9 +90,10 @@ header
&.paused &.paused
&::before &::before
content: "" content: ""
color: gray color: yellow
#orientation #orientation
margin: 0.5em margin: 0.5em
cursor: pointer
&.lr &.lr
&::before &::before
content: "" content: ""

@ -23,6 +23,10 @@ html
label(for="upload") upload data label(for="upload") upload data
input(type="file", name="upload")#upload input(type="file", name="upload")#upload
div#info div#info
div#zoom
a#zoomin 🔎+
a#zoomreset 0
a#zoomout -🔍
div#orientation div#orientation
div#clock= (new Date()).toLocaleString() div#clock= (new Date()).toLocaleString()
div#status.error div#status.error

Loading…
Cancel
Save