mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-27 14:43:14 -05:00
Added AV details to device export.
This commit is contained in:
parent
7b637afc68
commit
bf899b2ded
12
meshuser.js
12
meshuser.js
@ -5910,7 +5910,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
if (type == 'csv') {
|
if (type == 'csv') {
|
||||||
try {
|
try {
|
||||||
// Create the CSV file
|
// Create the CSV file
|
||||||
output = 'id,name,rname,host,icon,ip,osdesc,groupname,av,update,firewall,cpu,osbuild,biosDate,biosVendor,biosVersion,boardName,boardVendor,boardVersion,productUuid,agentOpenSSL,agentCommitDate,agentCommitHash,agentCompileTime,netIfCount,macs,addresses\r\n';
|
output = 'id,name,rname,host,icon,ip,osdesc,groupname,av,update,firewall,avdetails,cpu,osbuild,biosDate,biosVendor,biosVersion,boardName,boardVendor,boardVersion,productUuid,agentOpenSSL,agentCommitDate,agentCommitHash,agentCompileTime,netIfCount,macs,addresses\r\n';
|
||||||
for (var i = 0; i < results.length; i++) {
|
for (var i = 0; i < results.length; i++) {
|
||||||
const nodeinfo = results[i];
|
const nodeinfo = results[i];
|
||||||
|
|
||||||
@ -5920,11 +5920,15 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
output += csvClean(n._id) + ',' + csvClean(n.name) + ',' + csvClean(n.rname ? n.rname : '') + ',' + csvClean(n.host ? n.host : '') + ',' + (n.icon ? n.icon : 1) + ',' + (n.ip ? n.ip : '') + ',' + (n.osdesc ? csvClean(n.osdesc) : '') + ',' + csvClean(parent.meshes[n.meshid].name);
|
output += csvClean(n._id) + ',' + csvClean(n.name) + ',' + csvClean(n.rname ? n.rname : '') + ',' + csvClean(n.host ? n.host : '') + ',' + (n.icon ? n.icon : 1) + ',' + (n.ip ? n.ip : '') + ',' + (n.osdesc ? csvClean(n.osdesc) : '') + ',' + csvClean(parent.meshes[n.meshid].name);
|
||||||
if (typeof n.wsc == 'object') {
|
if (typeof n.wsc == 'object') {
|
||||||
output += ',' + csvClean(n.wsc.antiVirus ? n.wsc.antiVirus : '') + ',' + csvClean(n.wsc.autoUpdate ? n.wsc.autoUpdate : '') + ',' + csvClean(n.wsc.firewall ? n.wsc.firewall : '')
|
output += ',' + csvClean(n.wsc.antiVirus ? n.wsc.antiVirus : '') + ',' + csvClean(n.wsc.autoUpdate ? n.wsc.autoUpdate : '') + ',' + csvClean(n.wsc.firewall ? n.wsc.firewall : '')
|
||||||
} else {
|
} else { output += ',,,'; }
|
||||||
output += ',,,';
|
if (typeof n.av == 'object') {
|
||||||
|
var avdetails = '', firstav = true;
|
||||||
|
for (var a in n.av) { if (typeof n.av[a].product == 'string') { if (firstav) { firstav = false; } else { avdetails += '|'; } avdetails += (n.av[a].product + '/' + ((n.av[a].enabled) ? 'enabled' : 'disabled') + '/' + ((n.av[a].updated) ? 'updated' : 'notupdated')); } }
|
||||||
|
output += ',' + csvClean(avdetails);
|
||||||
}
|
}
|
||||||
|
else { output += ','; }
|
||||||
} else {
|
} else {
|
||||||
output += ',,,,,,,,,,';
|
output += ',,,,,,,,,,,';
|
||||||
}
|
}
|
||||||
|
|
||||||
// System infomation
|
// System infomation
|
||||||
|
@ -5143,11 +5143,18 @@
|
|||||||
meshserver.send({ action: 'getDeviceDetails', nodeids: chkNodeIds, type: 'csv' }); // With details
|
meshserver.send({ action: 'getDeviceDetails', nodeids: chkNodeIds, type: 'csv' }); // With details
|
||||||
} else {
|
} else {
|
||||||
// Without details
|
// Without details
|
||||||
var csv = "id, name, rname, host, icon, ip, osdesc, state, groupname, conn, pwr, av, update, firewall" + '\r\n', r = [];
|
var csv = "id, name, rname, host, icon, ip, osdesc, state, groupname, conn, pwr, av, update, firewall, avdetails" + '\r\n', r = [];
|
||||||
for (var i in chkNodeIds) {
|
for (var i in chkNodeIds) {
|
||||||
var n = getNodeFromId(chkNodeIds[i]);
|
var n = getNodeFromId(chkNodeIds[i]);
|
||||||
csv += '"' + n._id.split(',').join('') + '","' + n.name.split(',').join('') + '","' + (n.rname?(n.rname.split(',').join('')):'') + '","' + (n.host?(n.host.split(',').join('')):'') + '","' + n.icon + '","' + (n.ip?n.ip:'') + '","' + (n.osdesc?(n.osdesc.split(',').join('')):'') + '","' + n.state + '","' + meshes[n.meshid].name.split(',').join('') + '","' + (n.conn?n.conn:'') + '","' + (n.pwr?n.pwr:'') + '"';
|
csv += '"' + n._id.split(',').join('') + '","' + n.name.split(',').join('') + '","' + (n.rname?(n.rname.split(',').join('')):'') + '","' + (n.host?(n.host.split(',').join('')):'') + '","' + n.icon + '","' + (n.ip?n.ip:'') + '","' + (n.osdesc?(n.osdesc.split(',').join('')):'') + '","' + n.state + '","' + meshes[n.meshid].name.split(',').join('') + '","' + (n.conn?n.conn:'') + '","' + (n.pwr?n.pwr:'') + '"';
|
||||||
if (typeof n.wsc == 'object') { csv += ',"' + csvClean(n.wsc.antiVirus) + '","' + csvClean(n.wsc.autoUpdate) + '","' + csvClean(n.wsc.firewall) + '"'; } else { csv += ',,,'; }
|
if (typeof n.wsc == 'object') { csv += ',"' + csvClean(n.wsc.antiVirus) + '","' + csvClean(n.wsc.autoUpdate) + '","' + csvClean(n.wsc.firewall) + '"'; } else { csv += ',,,'; }
|
||||||
|
if (typeof n.av == 'object') {
|
||||||
|
var avdetails = '', firstav= true;
|
||||||
|
for (var a in n.av) { if (typeof n.av[a].product == 'string') { if (firstav) { firstav = false; } else { avdetails += '|'; } avdetails += (n.av[a].product + '/' + ((n.av[a].enabled)?'enabled':'disabled') + '/' + ((n.av[a].updated)?'updated':'notupdated')); } }
|
||||||
|
csv += ',"' + csvClean(avdetails) + '"'; }
|
||||||
|
else {
|
||||||
|
csv += ',';
|
||||||
|
}
|
||||||
csv += '\r\n';
|
csv += '\r\n';
|
||||||
}
|
}
|
||||||
saveAs(new Blob([csv], { type: 'application/octet-stream' }), "devicelist.csv");
|
saveAs(new Blob([csv], { type: 'application/octet-stream' }), "devicelist.csv");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user