Updated MeshCommander, Added MeshCore download page.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-23 14:32:43 -08:00
parent cdd5153b93
commit c5f6cbaef2
13 changed files with 15800 additions and 847 deletions

File diff suppressed because one or more lines are too long

1466
public/commander-de.htm Normal file

File diff suppressed because one or more lines are too long

1468
public/commander-es.htm Normal file

File diff suppressed because one or more lines are too long

1474
public/commander-fr.htm Normal file

File diff suppressed because one or more lines are too long

1464
public/commander-it.htm Normal file

File diff suppressed because one or more lines are too long

1527
public/commander-ja.htm Normal file

File diff suppressed because one or more lines are too long

1499
public/commander-ko.htm Normal file

File diff suppressed because one or more lines are too long

1456
public/commander-nl.htm Normal file

File diff suppressed because one or more lines are too long

1469
public/commander-pt.htm Normal file

File diff suppressed because one or more lines are too long

1620
public/commander-ru.htm Normal file

File diff suppressed because one or more lines are too long

1479
public/commander-zh-chs.htm Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4423,6 +4423,36 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
}
}
if (req.query.cores != null) {
// Send list of agent cores
var response = '<html><head><title>Mesh Agents Cores</title><style>table,th,td { border:1px solid black;border-collapse:collapse;padding:3px; }</style></head><body style=overflow:auto><table>';
response += '<tr style="background-color:lightgray"><th>Name</th><th>Size</th><th>Comp</th><th>Decompressed Hash SHA384</th></tr>';
for (var i in parent.defaultMeshCores) {
response += '<tr><td>' + i.split(' ').join('&nbsp;') + '</td><td style="text-align:right"><a download href="/meshagents?dlcore=' + i + '">' + parent.defaultMeshCores[i].length + (req.query.key ? ('?key=' + req.query.key) : '') + '</a></td><td style="text-align:right"><a download href="/meshagents?dlccore=' + i + (req.query.key ? ('?key=' + req.query.key) : '') + '">' + parent.defaultMeshCoresDeflate[i].length + '</a></td><td>' + Buffer.from(parent.defaultMeshCoresHash[i], 'binary').toString('hex') + '</td></tr>';
}
response += '</table><a href="' + req.originalUrl.split('?')[0] + (req.query.key ? ('?key=' + req.query.key) : '') + '">Mesh Agents</a></body></html>';
res.send(response);
return;
}
if (req.query.dlcore != null) {
// Download mesh core
var bin = parent.defaultMeshCores[req.query.dlcore];
if (bin == null) { res.sendStatus(404); return; }
setContentDispositionHeader(res, 'application/octet-stream', req.query.dlcore + '.js', null, 'meshcore.js');
res.send(bin);
return;
}
if (req.query.dlccore != null) {
// Download compressed mesh core
var bin = parent.defaultMeshCoresDeflate[req.query.dlccore];
if (bin == null) { res.sendStatus(404); return; }
setContentDispositionHeader(res, 'application/octet-stream', req.query.dlccore + '.js.deflate', null, 'meshcore.js.deflate');
res.send(bin);
return;
}
// Send a list of available mesh agents
var response = '<html><head><title>Mesh Agents</title><style>table,th,td { border:1px solid black;border-collapse:collapse;padding:3px; }</style></head><body style=overflow:auto><table>';
response += '<tr style="background-color:lightgray"><th>ID</th><th>Description</th><th>Link</th><th>Size</th><th>SHA384</th><th>MeshCmd</th></tr>';
@ -4440,6 +4470,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
response += '<td><a download href="' + originalUrl + '?meshcmd=' + agentinfo.id + (req.query.key ? ('&key=' + req.query.key) : '') + '">' + agentinfo.rname.replace('agent', 'cmd') + '</a></td></tr>';
}
response += '</table>';
response += '<a href="' + originalUrl + '?cores=1' + (req.query.key ? ('&key=' + req.query.key) : '') + '">MeshCores</a> ';
if (coreDumpsAllowed) { response += '<a href="' + originalUrl + '?dumps=1' + (req.query.key ? ('&key=' + req.query.key) : '') + '">MeshAgent Crash Dumps</a>'; }
response += '</body></html>';
res.send(response);