From 5adab4a366d07cce279617a0e73f9cf225fddc6b Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 20 Jan 2022 13:52:08 -0800 Subject: [PATCH 1/2] Fixed meshctrl.js, devicelist with group filter and --csv --- meshctrl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meshctrl.js b/meshctrl.js index db3debc0..01c341b1 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -2048,7 +2048,11 @@ function serverConnect() { for (var j in devicesInMesh) { var n = devicesInMesh[j]; nodecount++; - 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)); + if (settings.xmeshes) { + 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)); + } else { + 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)); + } } } if (nodecount == 0) { console.log('None'); } @@ -2069,7 +2073,6 @@ function serverConnect() { nodes.push(devicesInMesh[j]); } } - console.log(JSON.stringify(nodes, ' ', 2)); } else { // Display the list of nodes in text format From 5d6d704d2cc673e1666fb0598fe7abc6ee932e44 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 20 Jan 2022 17:56:20 -0800 Subject: [PATCH 2/2] Fix for server crash when adding device group notification, #3498 --- meshuser.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshuser.js b/meshuser.js index d52a1b4a..e8682d4f 100644 --- a/meshuser.js +++ b/meshuser.js @@ -1592,7 +1592,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (err != null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'changemeshnotify', responseid: command.responseid, result: err })); } catch (ex) { } } break; } // Change the device group notification + if (user.links == null) { user.links = {}; } if (user.links[command.meshid]) { + // The user has direct rights for this device group if (command.notify == 0) { delete user.links[command.meshid].notify; } else {