mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4620 from node-red/pr_4387
Add support for plugin (only) modules to the palette manager
This commit is contained in:
@@ -65,6 +65,25 @@ var api = module.exports = {
|
||||
runtime.log.audit({event: "plugins.configs.get"}, opts.req);
|
||||
return runtime.plugins.getPluginConfigs(opts.lang);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the editor content for one registered plugin
|
||||
* @param {Object} opts
|
||||
* @param {User} opts.user - the user calling the api
|
||||
* @param {User} opts.user - the user calling the api
|
||||
* @param {Object} opts.req - the request to log (optional)
|
||||
* @return {Promise<NodeInfo>} - the plugin information
|
||||
* @memberof @node-red/runtime_plugins
|
||||
*/
|
||||
getPluginConfig: async function(opts) {
|
||||
if (/[^0-9a-z=\-\*]/i.test(opts.lang)) {
|
||||
throw new Error("Invalid language: "+opts.lang)
|
||||
return;
|
||||
}
|
||||
runtime.log.audit({event: "plugins.configs.get"}, opts.req);
|
||||
return runtime.plugins.getPluginConfig(opts.module, opts.lang);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets all registered module message catalogs
|
||||
* @param {Object} opts
|
||||
|
@@ -173,7 +173,11 @@ function installModule(module,version,url) {
|
||||
if (info.pending_version) {
|
||||
events.emit("runtime-event",{id:"node/upgraded",retain:false,payload:{module:info.name,version:info.pending_version}});
|
||||
} else {
|
||||
events.emit("runtime-event",{id:"node/added",retain:false,payload:info.nodes});
|
||||
if (!info.nodes.length && info.plugins.length) {
|
||||
events.emit("runtime-event",{id:"plugin/added",retain:false,payload:info.plugins});
|
||||
} else {
|
||||
events.emit("runtime-event",{id:"node/added",retain:false,payload:info.nodes});
|
||||
}
|
||||
}
|
||||
return info;
|
||||
});
|
||||
|
@@ -7,5 +7,6 @@ module.exports = {
|
||||
getPluginsByType: registry.getPluginsByType,
|
||||
getPluginList: registry.getPluginList,
|
||||
getPluginConfigs: registry.getPluginConfigs,
|
||||
getPluginConfig: registry.getPluginConfig,
|
||||
exportPluginSettings: registry.exportPluginSettings
|
||||
}
|
Reference in New Issue
Block a user