diff --git a/views/default.handlebars b/views/default.handlebars
index 1729c0b3..c956d07f 100644
--- a/views/default.handlebars
+++ b/views/default.handlebars
@@ -11117,7 +11117,8 @@
// Display list of devices in this device group
count = 0;
nodes.sort(deviceSort);
- var y = '
' + "Devices" + ' | |
';
+ var dllist = (currentMesh.mtype == 1)?'
':'';
+ var y = '' + "Devices" + ' | ' + dllist + ' |
';
for (var i in nodes) {
var node = nodes[i], gray = ((node.conn > 0)?'':' gray');
if (currentMesh._id != node.meshid) continue;
@@ -11147,6 +11148,22 @@
try { window.history.replaceState({}, document.title, window.location.pathname + urlviewmode); } catch (ex) { }
}
}
+
+ // Save the list of devices in a device group in the MeshCommander format
+ function meshDownloadDeviceList() {
+ if (xxdialogMode) return;
+ var r = { webappversion: "0.9.0", computers: [ ] };
+ for (var i in nodes) {
+ var node = nodes[i];
+ if ((currentMesh._id != node.meshid) || (node.intelamt == null)) continue;
+ var c = { name: node.name, host: node.host, user: node.intelamt.user, pass: '', tls: (node.intelamt.tls == 1)?1:0, ver: node.intelamt.ver, pstate: node.intelamt.state }
+ if (node.intelamt.state == 2) { c.pmode = 1; } // TODO
+ if (node.intelamt.realm) { c.digestrealm = node.intelamt.realm; }
+ if (node.intelamt.hash) { c.tlscerthash = node.intelamt.hash; }
+ r.computers.push(c);
+ }
+ saveAs(stringToUtf8BlobNoHeader(JSON.stringify(r, null, 2)), currentMesh.name + ".json");
+ }
function p20editMeshAmt() {
if (xxdialogMode) return;
@@ -15645,6 +15662,11 @@
return new Blob([bytes2], { type: 'application/octet-stream' }) // application/json;charset=utf-8
}
+ // Convert a string into a UTF8 blob
+ function stringToUtf8BlobNoHeader(str) {
+ return new Blob([new TextEncoder().encode(str)], { type: 'application/octet-stream' }) // application/json;charset=utf-8
+ }
+
function getLang() { if (navigator.languages != undefined) { return navigator.languages[0]; } return navigator.language; }
function getNodeAmtVersion(node) { if ((node == null) || (node.intelamt == null) || (typeof node.intelamt.ver != 'string')) return 0; var verSplit = node.intelamt.ver.split('.'); if (verSplit.length < 2) return 0; return parseInt(verSplit[0]) + (parseInt(verSplit[1]) / 100); }
function getstore(name, val) { try { if (typeof (localStorage) === 'undefined') return val; var v = localStorage.getItem(name); if ((v == null) || (v == null)) return val; return v; } catch (e) { return val; } }