mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 12:52:50 +03:00
Add NeDB compatibility
This commit is contained in:
parent
470ce54413
commit
aca43d8ed7
15
db.js
15
db.js
@ -895,6 +895,21 @@ module.exports.CreateDB = function (parent, func) {
|
||||
func(r);
|
||||
});
|
||||
}
|
||||
|
||||
// Add a plugin
|
||||
obj.addPlugin = function (plugin, func) { obj.pluginsfile.insert(plugin, func); };
|
||||
|
||||
// Get all plugins
|
||||
obj.getPlugins = function (func) { obj.pluginsfile.find().sort({ name: 1 }).exec(func); };
|
||||
|
||||
// Get plugin
|
||||
obj.getPlugin = function (id, func) { obj.pluginsfile.find({ _id: id }).sort({ name: 1 }).exec(func); };
|
||||
|
||||
// Delete plugin
|
||||
obj.deletePlugin = function (id, func) { obj.pluginsfile.remove({ _id: id }, func); };
|
||||
|
||||
obj.setPluginStatus = function(id, status, func) { obj.pluginsfile.update({ _id: id }, { $set: {status: status } }, func); };
|
||||
|
||||
}
|
||||
|
||||
func(obj); // Completed function setup
|
||||
|
Loading…
Reference in New Issue
Block a user