1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

File tab now reconnects to the previous remote device path.

This commit is contained in:
Ylian Saint-Hilaire 2021-10-20 14:04:10 -07:00
parent d0d85feb45
commit 1f20d45b66
6 changed files with 92 additions and 378 deletions

View file

@ -1665,6 +1665,7 @@ function getDirectoryInfo(reqpath) {
var results = null, xpath = obj.path.join(reqpath, '*');
//if (process.platform == "win32") { xpath = xpath.split('/').join('\\'); }
try { results = fs.readdirSync(xpath); } catch (e) { }
if ((results != null) && (results.length == 0) && (fs.existsSync(reqpath) == false)) { results = null; }
if (results != null) {
for (var i = 0; i < results.length; ++i) {
if ((results[i] != '.') && (results[i] != '..')) {
@ -1680,6 +1681,8 @@ function getDirectoryInfo(reqpath) {
}
}
}
} else {
response.dir = null;
}
}
return response;
@ -2554,7 +2557,7 @@ function onTunnelData(data) {
// Send the folder content to the browser
var response = getDirectoryInfo(cmd.path);
if (cmd.reqid != undefined) { response.reqid = cmd.reqid; }
response.reqid = cmd.reqid;
this.write(Buffer.from(JSON.stringify(response)));
/*