Updated express-handlebars & changed confirmation on page exit.

This commit is contained in:
Ylian Saint-Hilaire 2022-02-14 16:33:49 -08:00
parent 71b82689d5
commit 47ff8ab14e
4 changed files with 18 additions and 7 deletions

View File

@ -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"

View File

@ -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 = ''; }
});
</script>

View File

@ -0,0 +1 @@
{{{body}}}

View File

@ -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