mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-09 21:49:43 -05:00
Tweaks to plugin install/removal so server does not require a restart. Initial support for downgrading plugins.
This commit is contained in:
4
db.js
4
db.js
@@ -766,6 +766,8 @@ module.exports.CreateDB = function (parent, func) {
|
||||
|
||||
obj.setPluginStatus = function(id, status, func) { id = require('mongodb').ObjectID(id); obj.pluginsfile.updateOne({ _id: id }, { $set: {status: status } }, func); };
|
||||
|
||||
obj.updatePlugin = function(id, args, func) { delete args._id; id = require('mongodb').ObjectID(id); obj.pluginsfile.updateOne({ _id: id }, { $set: args }, func); };
|
||||
|
||||
} else {
|
||||
// Database actions on the main collection (NeDB and MongoJS)
|
||||
obj.Set = function (data, func) {
|
||||
@@ -910,6 +912,8 @@ module.exports.CreateDB = function (parent, func) {
|
||||
|
||||
obj.setPluginStatus = function(id, status, func) { obj.pluginsfile.update({ _id: id }, { $set: {status: status } }, func); };
|
||||
|
||||
obj.updatePlugin = function(id, args, func) { delete args._id; obj.pluginsfile.update({ _id: id }, { $set: args }, func); };
|
||||
|
||||
}
|
||||
|
||||
func(obj); // Completed function setup
|
||||
|
||||
Reference in New Issue
Block a user