mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-24 06:05:53 -05:00
Merge pull request #703 from ryanblenis/plugin-admin
Plugin Admin Links Broken
This commit is contained in:
commit
ce5da5249b
@ -412,12 +412,16 @@ module.exports.pluginHandler = function (parent) {
|
||||
} else {
|
||||
parent.db.updatePlugin(id, { status: 1, version: version_only.name }, func);
|
||||
}
|
||||
obj.plugins[plugin.shortName] = require(obj.pluginPath + '/' + plugin.shortName + '/' + plugin.shortName + '.js')[plugin.shortName](obj);
|
||||
obj.exports[plugin.shortName] = obj.plugins[plugin.shortName].exports;
|
||||
if (typeof obj.plugins[plugin.shortName].server_startup == 'function') obj.plugins[plugin.shortName].server_startup();
|
||||
var plugin_config = obj.fs.readFileSync(obj.pluginPath + '/' + plugin.shortName + '/config.json');
|
||||
plugin_config = JSON.parse(plugin_config);
|
||||
parent.db.updatePlugin(plugin._id, plugin_config);
|
||||
try {
|
||||
obj.plugins[plugin.shortName] = require(obj.pluginPath + '/' + plugin.shortName + '/' + plugin.shortName + '.js')[plugin.shortName](obj);
|
||||
obj.exports[plugin.shortName] = obj.plugins[plugin.shortName].exports;
|
||||
if (typeof obj.plugins[plugin.shortName].server_startup == 'function') obj.plugins[plugin.shortName].server_startup();
|
||||
} catch (e) { console.log('Error instantiating new plugin: ', e); }
|
||||
try {
|
||||
var plugin_config = obj.fs.readFileSync(obj.pluginPath + '/' + plugin.shortName + '/config.json');
|
||||
plugin_config = JSON.parse(plugin_config);
|
||||
parent.db.updatePlugin(plugin._id, plugin_config);
|
||||
} catch (e) { console.log('Error reading plugin config upon install'); }
|
||||
parent.updateMeshCore();
|
||||
});
|
||||
});
|
||||
|
@ -9539,7 +9539,7 @@
|
||||
installedPluginList.forEach(function(p){
|
||||
var cant_action = [];
|
||||
if (p.hasAdminPanel == true && p.status) {
|
||||
p.nameHtml = '<a onclick="return goPlugin(' + p.shortName + ', ' + p.name + ');">' + p.name + '</a>';
|
||||
p.nameHtml = '<a onclick="return goPlugin(\'' + p.shortName + '\', \'' + p.name.replace(/'/g, "\\'") + '\');">' + p.name + '</a>';
|
||||
} else {
|
||||
p.nameHtml = p.name;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user