mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Updated dynamic palette (markdown)
parent
632de8732a
commit
0667ef2ffa
@ -9,12 +9,12 @@ To add a new node to the palette:
|
||||
The post body is a JSON structure that identifies where the node information comes from, either a local file (`filename`) or an npm module (`npm`).
|
||||
|
||||
{
|
||||
filename: "path to local node .js file",
|
||||
filename: "path to local node .js file or package.json",
|
||||
npm: "npm module name"
|
||||
}
|
||||
|
||||
2. For `filename`, we require that the files already exist somewhere under `NODE_RED_HOME/nodes/`
|
||||
This reduces security concerns over exposing arbitrary files and removes the need for the runtime to 'remember' what extra nodes have been added.
|
||||
This reduces security concerns over exposing arbitrary files and removes the need for the runtime to remember what extra nodes have been added.
|
||||
|
||||
For `npm`, we npm install the node.
|
||||
|
||||
@ -25,9 +25,8 @@ To add a new node to the palette:
|
||||
### Remove node type
|
||||
To remove a node from the palette:
|
||||
|
||||
1. a DELETE http request is sent to `{admin root}/nodes/{node-type}` to trigger the remove.
|
||||
2. The runtime registry removes the node. This will stop the current flow if it uses the node.
|
||||
3. An event is fired over the comms link telling any connected editors that a node has been removed.
|
||||
1. a DELETE http request is sent to `{admin root}/nodes` to trigger the remove. The payload matches the add node payload.
|
||||
2. The runtime registry removes the corresponding nodes. This will stop the current flow if it uses any of them.
|
||||
3. An event is fired over the comms link telling any connected editors that the nodes have been removed.
|
||||
|
||||
This poses some problems:
|
||||
* What to do with the node's files? If the runtime restarts, the node will come back. As a file may contain multiple nodes, we can't delete/npm-uninstall the node's files. Add node to an excludes list? That is currently based on filename not node-type.
|
||||
In the case of `filename` being specified, the user is expected to delete the files after the request completes. For `npm`, the system will uninstall the module.
|
Loading…
Reference in New Issue
Block a user