diff --git a/package.json b/package.json
index c1aca61b..1bfac990 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
- "version": "0.4.0-c",
+ "version": "0.4.0-e",
"keywords": [
"Remote Management",
"Intel AMT",
diff --git a/views/default-min.handlebars b/views/default-min.handlebars
index 80820e33..0b28dc45 100644
--- a/views/default-min.handlebars
+++ b/views/default-min.handlebars
@@ -1 +1 @@
-
{{{title}}}
My Devices My Account My Events My Files My Users My Server
General Desktop Terminal Files Events Intel® AMT Console
Server disconnected , click to reconnect .
My Devices No device groups.
My Account Device Groups ( New )
My Events Show Last 60 Last 120 Last 250 Last 500 Last 1000
My Files These files are shared publicly, click "link" to get public url.
✓
✗
My Server Server Statistics
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Show Last 60 Last 120 Last 250 Last 500 Last 1000
General -
Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000
File Selection
Local file upload Server file selection Agent Remote Desktop Scaling
100% 87.5% 75% 62.5% 50% 37.5% 25% 12.5% Frame rate
Fast Medium Slow Very slow Intel® AMT Hardware KVM Image Encoding
RLE8, Fastest RLE16, Recommended RAW8, Slow RAW16, Very Slow
\ No newline at end of file
+ {{{title}}}
My Devices My Account My Events My Files My Users My Server
General Desktop Terminal Files Events Intel® AMT Console
Server disconnected , click to reconnect .
My Devices No device groups.
My Account Device Groups ( New )
My Events Show Last 60 Last 120 Last 250 Last 500 Last 1000
My Files These files are shared publicly, click "link" to get public url.
✓
✗
My Server Server Statistics
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Intel® AMT Redirection port or KVM feature is disabled, click here to enable it.
Remote computer is not powered on, click here to issue a power command.
Show Last 60 Last 120 Last 250 Last 500 Last 1000
General -
Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000
File Selection
Local file upload Server file selection Agent Remote Desktop Scaling
100% 87.5% 75% 62.5% 50% 37.5% 25% 12.5% Frame rate
Fast Medium Slow Very slow Intel® AMT Hardware KVM Image Encoding
RLE8, Fastest RLE16, Recommended RAW8, Slow RAW16, Very Slow
\ No newline at end of file
diff --git a/views/default.handlebars b/views/default.handlebars
index 719a0636..26615de6 100644
--- a/views/default.handlebars
+++ b/views/default.handlebars
@@ -5817,7 +5817,7 @@
// Check if these are files we can upload, remove all folders.
var files = [];
- for (var i in e.dataTransfer.files) { if ((e.dataTransfer.files[i].type != null) && (e.dataTransfer.files[i].size != null) && (e.dataTransfer.files[i].type != '') && (e.dataTransfer.files[i].size != 0)) { files.push(e.dataTransfer.files[i]); } }
+ for (var i in e.dataTransfer.files) { if ((e.dataTransfer.files[i].size != null) && (e.dataTransfer.files[i].size != 0)) { files.push(e.dataTransfer.files[i]); } }
if (files.length == 0) return;
p13doUploadFiles(files);
@@ -7238,10 +7238,9 @@
var right = (f.t == 1 || f.t == 4)?p5getQuotabar(f):'', title = '';
h = "";
} else {
- var link = shortname;
- var publiclink = '';
- if (publicfolder) { publiclink = ' (Link )'; }
- if (f.s > 0) { link = "" + shortname + " " + publiclink; }
+ var link = shortname, publiclink = '';
+ if (publicfolder) { publiclink = ' (Link )'; }
+ if (f.s > 0) { link = "" + shortname + " " + publiclink; }
h = "";
}
@@ -7290,7 +7289,7 @@
return ' 1 ? 's' : '') + ". " + (Math.floor(f.maxbytes / 1024 / 1024)) + 'k maxinum">' + getNiceSize(tq) + ' ';
}
- function p5showPublicLink(u) { setDialogMode(2, "Public Link", 1, null, ' '); }
+ function p5showPublicLink(u) { setDialogMode(2, "Public Link", 1, null, ' '); return false; }
var sortorder;
function p5sort_filename(a, b) { if (a.ln > b.ln) return (1 * sortorder); if (a.ln < b.ln) return (-1 * sortorder); return 0; }
@@ -7328,7 +7327,7 @@
function setupBackPointers(x) { if (x.f != null) { var fs = 0, fc = 0; for (var i in x.f) { setupBackPointers(x.f[i]); x.f[i].parent = x; if (x.f[i].s) { fs += x.f[i].s; } if (x.f[i].c) { fc += x.f[i].c; } if (x.f[i].t == 3) { fc++; } } x.s = fs; x.c = fc; } return x; }
function getFileSizeStr(size) { if (size == 1) return "1 byte"; return "" + size + " bytes"; }
function p5folderup(x) { if (x == null) { filetreelocation.pop(); } else { while (filetreelocation.length > x) { filetreelocation.pop(); } } updateFiles(); return false; }
- function p5folderset(x) { filetreelocation.push(decodeURIComponent(x)); updateFiles(); }
+ function p5folderset(x) { filetreelocation.push(decodeURIComponent(x)); updateFiles(); return false; }
function p5createfolder() { setDialogMode(2, "New Folder", 3, p5createfolderEx, ' '); focusTextBox('p5renameinput'); p5fileNameCheck(); }
function p5createfolderEx() { meshserver.send({ action: 'fileoperation', fileop: 'createfolder', path: filetreelocation, newfolder: Q('p5renameinput').value}); }
function p5deletefile() { var cc = getFileSelCount(), rec = (getFileSelDirCount() > 0) ? " Recursive delete " : " "; setDialogMode(2, "Delete", 3, p5deletefileEx, (cc > 1) ? ('Delete ' + cc + ' selected items?' + rec) : ('Delete selected item?' + rec)); }
@@ -7358,13 +7357,13 @@
// Check if these are files we can upload, remove all folders.
if (e.dataTransfer == null) return;
var files = [];
- for (var i in e.dataTransfer.files) { if ((e.dataTransfer.files[i].type != null) && (e.dataTransfer.files[i].size != null) && (e.dataTransfer.files[i].type != '') && (e.dataTransfer.files[i].size != 0)) { files.push(e.dataTransfer.files[i]); } }
+ for (var i in e.dataTransfer.files) { if ((e.dataTransfer.files[i].size != null) && (e.dataTransfer.files[i].size != 0)) { files.push(e.dataTransfer.files[i]); } }
if (files.length == 0) return;
// For Chrome & Firefox
var error = 0;
p5uploadFile(); // Display the the dialog box
- try { Q('p5uploadinput').files = files; } catch (ex) { error = 1; } // Set the files in the dialog box
+ try { Q('p5uploadinput').files = e.dataTransfer.files; } catch (ex) { error = 1; } // Set the files in the dialog box
if (error == 0) { p5uploadFileEx(); } // Press the submit button
setDialogMode(0); // Close the dialog box
diff --git a/webserver.js b/webserver.js
index b266ee43..d1e1d619 100644
--- a/webserver.js
+++ b/webserver.js
@@ -1830,7 +1830,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
function handleUploadFile(req, res) {
const domain = checkUserIpAddress(req, res);
if (domain == null) { res.sendStatus(404); return; }
- if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }
+ if ((!req.session) || (req.session == null) || (!req.session.userid) || (domain.userQuota == -1)) { res.sendStatus(401); return; }
const user = obj.users[req.session.userid];
if ((user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights
@@ -1879,7 +1879,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// See if we need to create the folder
var domainx = 'domain';
- if (domain.id.length > 0) { domainx = 'domain-' + usersplit[1]; }
+ if (domain.id.length > 0) { domainx = 'domain-' + domain.id; }
try { obj.fs.mkdirSync(obj.parent.filespath); } catch (e) { }
try { obj.fs.mkdirSync(obj.parent.path.join(obj.parent.filespath, domainx)); } catch (e) { }
try { obj.fs.mkdirSync(xfile.fullpath); } catch (e) { }
@@ -3131,19 +3131,19 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Indicates to ExpressJS that the public folder should be used to serve static files.
obj.app.use(url, obj.express.static(obj.parent.webPublicPath));
- // Handle 404 error
- if (obj.args.nice404 !== false) {
- obj.app.use(function (req, res, next) {
- parent.debug('web', '404 Error ' + req.url);
- var domain = getDomain(req);
- res.status(404).render(obj.path.join(obj.parent.webViewsPath, isMobileBrowser(req) ? 'error404-mobile' : 'error404'), { title: domain.title, title2: domain.title2 });
- });
- }
-
// Start regular disconnection list flush every 2 minutes.
obj.wsagentsDisconnectionsTimer = setInterval(function () { obj.wsagentsDisconnections = {}; }, 120000);
}
+ // Handle 404 error
+ if (obj.args.nice404 !== false) {
+ obj.app.use(function (req, res, next) {
+ parent.debug('web', '404 Error ' + req.url);
+ var domain = getDomain(req);
+ res.status(404).render(obj.path.join(obj.parent.webViewsPath, isMobileBrowser(req) ? 'error404-mobile' : 'error404'), { title: domain.title, title2: domain.title2 });
+ });
+ }
+
// Start server on a free port
CheckListenPort(obj.args.port, StartWebServer);
}