mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Split SMBIOS information into seperate collection.
This commit is contained in:
parent
0865403772
commit
5d1423cbaf
36 changed files with 41 additions and 11 deletions
|
@ -362,7 +362,13 @@ function CreateMeshCentralServer(config, args) {
|
|||
if ((json == null) || (typeof json.length != 'number') || (json.length < 1)) { console.log('Invalid JSON format: ' + obj.args.dbimport + '.'); }
|
||||
for (i in json) { if ((json[i].type == "mesh") && (json[i].links != null)) { for (var j in json[i].links) { var esc = obj.common.escapeFieldName(j); if (esc !== j) { json[i].links[esc] = json[i].links[j]; delete json[i].links[j]; } } } } // Escape MongoDB invalid field chars
|
||||
//for (i in json) { if ((json[i].type == "node") && (json[i].host != null)) { json[i].rname = json[i].host; delete json[i].host; } } // DEBUG: Change host to rname
|
||||
obj.db.RemoveAll(function () { obj.db.InsertMany(json, function (err) { if (err != null) { console.log(err); } else { console.log('Imported ' + json.length + ' objects(s) from ' + obj.args.dbimport + '.'); } process.exit(); }); });
|
||||
setTimeout(function () { // If the Mongo database is being created for the first time, there is a race condition here. This will get around it.
|
||||
obj.db.RemoveAll(function () {
|
||||
obj.db.InsertMany(json, function (err) {
|
||||
if (err != null) { console.log(err); } else { console.log('Imported ' + json.length + ' objects(s) from ' + obj.args.dbimport + '.'); } process.exit();
|
||||
});
|
||||
});
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue