diff --git a/package.json b/package.json index 95d9f497..0207f269 100644 --- a/package.json +++ b/package.json @@ -36,20 +36,31 @@ "sample-config-advanced.json" ], "dependencies": { + "@yetzt/nedb": "^1.8.0", + "archiver": "^4.0.2", "body-parser": "^1.19.0", "cbor": "~5.2.0", "compression": "^1.7.4", "cookie-session": "^1.4.0", "express": "^4.17.0", - "express-handlebars": "^3.1.0", + "express-handlebars": "^5.3.5", "express-ws": "^4.0.0", + "image-size": "^1.0.1", "ipcheck": "^0.1.0", + "loadavg-windows": "^1.1.1", "minimist": "^1.2.5", "multiparty": "^4.2.1", - "@yetzt/nedb": "^1.8.0", "node-forge": "^1.0.0", + "node-rdpjs-2": "^0.3.5", + "node-windows": "^0.1.4", + "otplib": "^10.2.3", + "pg": "^8.7.1", + "pgtools": "^0.3.2", + "ssh2": "^1.6.0", + "web-push": "^3.4.5", "ws": "^5.2.3", - "yauzl": "^2.10.0" + "yauzl": "^2.10.0", + "yubikeyotp": "^0.2.0" }, "engines": { "node": ">=10.0.0" diff --git a/views/default.handlebars b/views/default.handlebars index 64034252..f00dbb95 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -17216,10 +17216,9 @@ } } - // Quick fix for #3362 - Request Confirmation if MeshCentral-Browser-Tab is closed. - Maybe needs an option per User or Config.JSON-Setting + // Request Confirmation if closing while a desktop, terminal session is active window.addEventListener('beforeunload', function (e) { - e.preventDefault(); - e.returnValue = ''; + if (((desktop != null) && (xxcurrentView == 11)) || ((terminal != null) && (xxcurrentView = 12))) { e.preventDefault(); e.returnValue = ''; } }); diff --git a/views/layouts/empty.handlebars b/views/layouts/empty.handlebars new file mode 100644 index 00000000..64ca8899 --- /dev/null +++ b/views/layouts/empty.handlebars @@ -0,0 +1 @@ +{{{body}}} \ No newline at end of file diff --git a/webserver.js b/webserver.js index d281de51..dfa2c59c 100644 --- a/webserver.js +++ b/webserver.js @@ -5587,7 +5587,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF } // Setup middleware - obj.app.engine('handlebars', obj.exphbs({ defaultLayout: null })); // defaultLayout: 'main' + obj.app.engine('handlebars', obj.exphbs({ defaultLayout: 'empty' })); obj.app.set('view engine', 'handlebars'); if (obj.args.trustedproxy) { // Reverse proxy should add the "X-Forwarded-*" headers