diff --git a/app.js b/app.js index ead1656985b88f5f6fbdc40c04cdf3ac832d6845..09947913dddcb60afd5afab9b559f230d50b00f6 100644 --- a/app.js +++ b/app.js @@ -10,6 +10,7 @@ const fs = require('fs'); const express = require('express'); +var compression = require('compression'); const path = require('path'); const favicon = require('serve-favicon'); const logger = require('morgan'); @@ -68,6 +69,9 @@ app.use(function(req, res, next) { next(); }); +// enable compression +app.use(compression()); + app.engine('mustache', mustacheExpress()); app.set('views', path.join(dirname, 'templates')); app.set('view engine', 'mustache'); diff --git a/package-lock.json b/package-lock.json index b30415947ed1bd614dff3a35fe79819bfdc6198f..8c4574aa7e3edf6238867e4001c7aa725e17876a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1793,6 +1793,55 @@ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, + "compressible": { + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", + "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", + "requires": { + "mime-db": ">= 1.40.0 < 2" + }, + "dependencies": { + "mime-db": { + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" + } + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", diff --git a/package.json b/package.json index 2b381144775f850173baf4d4312d8e4850aca459..20fcf9e4d56a60d3ec77fb2ff1fe156cdd92fa2a 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,16 @@ "private": true, "scripts": { "start": "PORT=3001 node ./bin/www", - "build-atlasmaker": "webpack --config webpack.atlasmaker.config.js && cp view/atlasmaker/dist/atlasmaker.js public/lib/atlasmaker.js", - "build-atlasmaker-tools": "webpack --config webpack.atlasmaker-tools.config.js && cp -r view/atlasmaker/dist/atlasmaker-tools public/lib/", - "build-brainbox": "webpack --config webpack.brainbox.config.js && cp view/brainbox/dist/brainbox.js public/lib/brainbox.js", - "build-pages": "webpack --config webpack.pages.config.js && cp view/brainbox/dist/*-page.js public/js/", + "build-atlasmaker": "webpack --mode production --config webpack.atlasmaker.config.js && cp view/atlasmaker/dist/atlasmaker.js public/lib/atlasmaker.js", + "build-atlasmaker-tools": "webpack --mode production --config webpack.atlasmaker-tools.config.js && cp -r view/atlasmaker/dist/atlasmaker-tools public/lib/", + "build-brainbox": "webpack --mode production --config webpack.brainbox.config.js && cp view/brainbox/dist/brainbox.js public/lib/brainbox.js", + "build-pages": "webpack --mode production --config webpack.pages.config.js && cp view/brainbox/dist/*-page.js public/js/", "build": "npm run build-atlasmaker && npm run build-atlasmaker-tools && npm run build-brainbox && npm run build-pages", + "dev-atlasmaker": "webpack --mode development --config webpack.atlasmaker.config.js && cp view/atlasmaker/dist/atlasmaker.js public/lib/atlasmaker.js", + "dev-atlasmaker-tools": "webpack --mode development --config webpack.atlasmaker-tools.config.js && cp -r view/atlasmaker/dist/atlasmaker-tools public/lib/", + "dev-brainbox": "webpack --mode development --config webpack.brainbox.config.js && cp view/brainbox/dist/brainbox.js public/lib/brainbox.js", + "dev-pages": "webpack --mode development --config webpack.pages.config.js && cp view/brainbox/dist/*-page.js public/js/", + "dev": "npm run dev-atlasmaker && npm run dev-atlasmaker-tools && npm run dev-brainbox && npm run dev-pages", "mocha-test": "mocha ./test/runner.js test/unit/*.js test/integration/*.js", "lint": "eslint .", "test": "docker exec brainbox_web_1 /bin/bash -c 'cd /brainbox && npm run mocha-test'" @@ -16,6 +21,7 @@ "dependencies": { "async": "^2.0.1", "body-parser": "~1.18.2", + "compression": "^1.7.4", "cookie-parser": "~1.4.3", "crypto": "1.0.1", "dateformat": "^3.0.3", diff --git a/templates/mri.mustache b/templates/mri.mustache index 919809679573aa982b6080c86469932741eb9988..bf0d481989cce860483d9dffbd4674ed18f8b9af 100644 --- a/templates/mri.mustache +++ b/templates/mri.mustache @@ -3,10 +3,14 @@ - + {{title}} - + {{! }} + + @@ -30,7 +34,7 @@
- + brainbox logo @@ -81,8 +85,8 @@
- - + add annotation + remove annotation
Text Annotations
@@ -100,8 +104,8 @@
- - + add text annotation + remove text annotation
@@ -131,7 +135,7 @@

- + naat logo groupe de neuroanatomie appliquée et théorique diff --git a/view/atlasmaker/src/html/toolsFull.html b/view/atlasmaker/src/html/toolsFull.html index aa4e95c941fdc49041d4d50726663297905ffdca..13a10c4e0241086316d39116f2873b65d74bf160 100644 --- a/view/atlasmaker/src/html/toolsFull.html +++ b/view/atlasmaker/src/html/toolsFull.html @@ -1,7 +1,7 @@

- + menu
@@ -10,10 +10,10 @@
-
+
close
-
-
+
left
+
right
@@ -48,30 +48,30 @@
Axi
-
-
-
-
-
-
-
+
fullscreen
+
3d render
+
+
chat
+
upload
+
download
+
precise cursor
-
-
-
-
-
-
+
show
+
paint
+
erase
+
ruler
+
adjust
+
eyedropper
-
-
-
+
fill
+
undo
+
save
@@ -112,7 +112,7 @@
- + close