mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-23 05:42:13 +03:00
Added MeshCtrl device group hex encoding to JSON of listdevicegroups.
This commit is contained in:
parent
0d59f937e0
commit
6a21eedb08
@ -1119,6 +1119,8 @@ function serverConnect() {
|
|||||||
for (var i in data.meshes) { settings.xmeshes[data.meshes[i]._id] = data.meshes[i]; }
|
for (var i in data.meshes) { settings.xmeshes[data.meshes[i]._id] = data.meshes[i]; }
|
||||||
} else if (settings.cmd == 'listdevicegroups') {
|
} else if (settings.cmd == 'listdevicegroups') {
|
||||||
if (args.json) {
|
if (args.json) {
|
||||||
|
// If asked, add the MeshID hex encoding to the JSON.
|
||||||
|
if (args.hex) { for (var i in data.meshes) { data.meshes[i]._idhex = '0x' + Buffer.from(data.meshes[i]._id.split('/')[2].replace(/\@/g, '+').replace(/\$/g, '/'), 'base64').toString('hex').toUpperCase(); } }
|
||||||
console.log(JSON.stringify(data.meshes, ' ', 2));
|
console.log(JSON.stringify(data.meshes, ' ', 2));
|
||||||
} else {
|
} else {
|
||||||
if (args.idexists) { for (var i in data.meshes) { const u = data.meshes[i]; if ((u._id == args.idexists) || (u._id.split('/')[2] == args.idexists)) { console.log('1'); process.exit(); return; } } console.log('0'); process.exit(); return; }
|
if (args.idexists) { for (var i in data.meshes) { const u = data.meshes[i]; if ((u._id == args.idexists) || (u._id.split('/')[2] == args.idexists)) { console.log('1'); process.exit(); return; } } console.log('0'); process.exit(); return; }
|
||||||
|
Loading…
Reference in New Issue
Block a user