Fixed meshctrl.js, devicelist with group filter and --csv

Ylian Saint-Hilaire committed Jan 20, 2022 at 13:52 UTC 5adab4a366d07cce279617a0e73f9cf225fddc6b
1 file changed +5 -2
meshctrl.js
+5 -2
@@ -2048,7 +2048,11 @@ function serverConnect() {
2048 for (var j in devicesInMesh) {
2049 var n = devicesInMesh[j];
2050 nodecount++;
2051 - console.log('\"' + settings.xmeshes[i]._id.split('/')[2] + '\",\"' + settings.xmeshes[i].name.split('\"').join('') + '\",\"' + n._id.split('/')[2] + '\",\"' + n.name.split('\"').join('') + '\",' + (n.icon ? n.icon : 0) + ',' + (n.conn ? n.conn : 0) + ',' + (n.pwr ? n.pwr : 0));
2051 + if (settings.xmeshes) {
2052 + console.log('\"' + settings.xmeshes[i]._id.split('/')[2] + '\",\"' + settings.xmeshes[i].name.split('\"').join('') + '\",\"' + n._id.split('/')[2] + '\",\"' + n.name.split('\"').join('') + '\",' + (n.icon ? n.icon : 0) + ',' + (n.conn ? n.conn : 0) + ',' + (n.pwr ? n.pwr : 0));
2053 + } else {
2054 + console.log('\"' + n._id.split('/')[2] + '\",\"' + n.name.split('\"').join('') + '\",' + (n.icon ? n.icon : 0) + ',' + (n.conn ? n.conn : 0) + ',' + (n.pwr ? n.pwr : 0));
2055 + }
2056 }
2057 }
2058 if (nodecount == 0) { console.log('None'); }
@@ -2069,7 +2073,6 @@ function serverConnect() {
2073 nodes.push(devicesInMesh[j]);
2074 }
2075 }
2072 -
2076 console.log(JSON.stringify(nodes, ' ', 2));
2077 } else {
2078 // Display the list of nodes in text format