node-red
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<h1>This is a test page for node 70-HTML</h1>
|
||||
|
||||
<p>There's nothing to read here.</p>
|
||||
|
||||
<ol id="colours">
|
||||
<li>Blue</li>
|
||||
<li>Red</li>
|
||||
</ol>
|
||||
|
||||
<ul id="fruits">
|
||||
<li>Apple</li>
|
||||
<li>Pear</li>
|
||||
</ul>
|
||||
|
||||
<ul id="vegetables">
|
||||
<li>Potato</li>
|
||||
<li>Parsnip</li>
|
||||
</ul>
|
||||
|
||||
<span>
|
||||
<img src="foo.png">
|
||||
</span>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
Text file
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 163 B |
@@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">
|
||||
RED.plugins.registerPlugin("node-red-library-filestore", {
|
||||
type: "node-red-library-source",
|
||||
name: "Local File-System Library",
|
||||
icon: "font-awesome/fa-hdd-o",
|
||||
defaults: {
|
||||
path: { value: ""},
|
||||
// secret: { type: "password" }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
RED.plugins.registerPlugin("node-red-library-dbstore", {
|
||||
type: "node-red-library-source",
|
||||
name: "Database Library",
|
||||
icon: "font-awesome/fa-database",
|
||||
defaults: {
|
||||
connection: { value: ""}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
module.exports = function(RED) {
|
||||
const PLUGIN_TYPE_ID = "node-red-library-filestore";
|
||||
|
||||
class FileStorePlugin {
|
||||
constructor(config) {
|
||||
this.type = PLUGIN_TYPE_ID;
|
||||
this.id = config.id;
|
||||
this.label = config.label;
|
||||
this.config = config.config;
|
||||
this.icon = config.icon;
|
||||
|
||||
console.log("FileStorePlugin",config)
|
||||
}
|
||||
async init() {
|
||||
console.log("FileStorePlugin.init")
|
||||
|
||||
}
|
||||
async getEntry(type,path) {
|
||||
console.log("FileStorePlugin.getLibraryEntry",type,path)
|
||||
return []
|
||||
}
|
||||
async saveEntry(type,path,meta,body) {
|
||||
console.log("FileStorePlugin.saveLibraryEntry",type,path)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RED.plugins.registerPlugin(PLUGIN_TYPE_ID, {
|
||||
type: "node-red-library-source",
|
||||
class: FileStorePlugin,
|
||||
defaults: {
|
||||
"path": { value: "" },
|
||||
// "secret": { type: "password" }
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": {
|
||||
"path": "Path"
|
||||
},
|
||||
"desc": {
|
||||
"path":"The local file-system path to the library"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugin": "winning"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "test-plugin",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"node-red": {
|
||||
"plugins": {
|
||||
"test": "test.js",
|
||||
"test-editor-plugin": "test-editor-plugin.html",
|
||||
"test-runtime-plugin": "test-runtime-plugin.js",
|
||||
"library-filestore": "library-filestore.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<script type="text/javascript">
|
||||
console.log("Loaded test-plugin/test-editor-plugin")
|
||||
RED.plugins.registerPlugin("my-test-editor-only-plugin", {
|
||||
type: "bar",
|
||||
onadd: function() {
|
||||
console.log("my-test-editor-only-plugin.onadd called")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
module.exports = function(RED) {
|
||||
console.log("Loaded test-plugin/test-runtime-plugin")
|
||||
|
||||
RED.plugins.registerPlugin("my-test-runtime-only-plugin", {
|
||||
type: "bar",
|
||||
onadd: function() {
|
||||
console.log("my-test-runtime-only-plugin.onadd called")
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<script type="text/javascript">
|
||||
console.log("Loaded test-plugin/test")
|
||||
// RED.plugins.registerPlugin("")
|
||||
</script>
|
||||
|
||||
<script src="resources/test-plugin/script.js">
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = function(RED) {
|
||||
console.log("Loaded test-plugin/test")
|
||||
|
||||
RED.plugins.registerPlugin("my-test-plugin", {
|
||||
type: "foo",
|
||||
onadd: function() {
|
||||
console.log("my-test-plugin.onadd called")
|
||||
RED.events.on("registry:plugin-added", function(id) {
|
||||
console.log(`my-test-plugin: plugin-added event "${id}"`)
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDMDCCAhgCCQDPGPyu5M6ZaDANBgkqhkiG9w0BAQsFADBZMQswCQYDVQQGEwJB
|
||||
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
|
||||
cyBQdHkgTHRkMRIwEAYDVQQDDAlsb2NhbGhvc3QwIBcNMTgwMzE2MDY0ODU1WhgP
|
||||
MjExODAyMjAwNjQ4NTVaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0
|
||||
YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMM
|
||||
CWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMifGelM
|
||||
k/b3HeIj98y9P5jS+Qblqpq7+gsCaL+qglMFmG0QXe6Ordkrh3xeY0uTkaFatwLM
|
||||
WMzoX60nNdaVjC9U9RlQLK/3nncCveexxRUGtI8VpxN04ivBE/ULhtJeStQFrfyt
|
||||
LWr1WWf8o8P/EWzZnh0Y1oHc0XqhOPHu9Nfd9kn5nfHNd/xbY8KXa4DkVSJ1lLFK
|
||||
3t/nSWttchF8zKgNpoQznNGqUTjT28l0sS8fyH76DyRj3Ke6xdNxX2NRUU0PnGFI
|
||||
RMsBG4Qrzo5xY7lQP7uVVgZUlxryw+NuZuC1PBXaUKJOf6CGwrTq5WB9zF1iBZCs
|
||||
wD68NvtLd0kHEgECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAfqNOg2v90r5x4lFo
|
||||
SYmPUoX24gdwHd/mfCzDJksB8n98X1eULYZqqRF2Q7LMkYu/twxfR3EKQX1HZxQY
|
||||
LpGUYX4ubJdVTy13opJs8B4NkhvRuOAP0+b7RVt4RfuxLX9tYOB98tEbf7Mj0ccq
|
||||
F4sHi+PMCh64K7rNWECHar0F51yNtNXcxJPMuHZVmj0/U7h6ZxNf+GzdTi8YKmVy
|
||||
5OHI7xol/II/v3QOi1L+BaEIUkqYODKuQouJVIzu4zX6JRfAaxwjJmliYoJm7OEY
|
||||
dFMEQUw1Ggsos+KbkGi9mCDbveYpWcZTR8nfPwmx+oJtt47DTHUC3KSdRxgtfjGs
|
||||
otmVSw==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAyJ8Z6UyT9vcd4iP3zL0/mNL5BuWqmrv6CwJov6qCUwWYbRBd
|
||||
7o6t2SuHfF5jS5ORoVq3AsxYzOhfrSc11pWML1T1GVAsr/eedwK957HFFQa0jxWn
|
||||
E3TiK8ET9QuG0l5K1AWt/K0tavVZZ/yjw/8RbNmeHRjWgdzReqE48e701932Sfmd
|
||||
8c13/FtjwpdrgORVInWUsUre3+dJa21yEXzMqA2mhDOc0apRONPbyXSxLx/IfvoP
|
||||
JGPcp7rF03FfY1FRTQ+cYUhEywEbhCvOjnFjuVA/u5VWBlSXGvLD425m4LU8FdpQ
|
||||
ok5/oIbCtOrlYH3MXWIFkKzAPrw2+0t3SQcSAQIDAQABAoIBAGmbryUrpZxU24tG
|
||||
idRiLw9Ax8yEq7lGiMqw2vlCRdZ0VJfdDMVeoE945ZpniXeoV/oLadl0P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GBAKhsmatxVD9B3jvUDd/CWhXVDSZQECrfJ+Uy1q6b5NO5yMibpIZv14Nj
|
||||
VT+b2qXoO1wL6htTRJXXNPmrB/JtrLiLg/vxVuA7CPSgot8SDA+/lbRhf1n/SKnD
|
||||
ECXrEUmq28SgBItbY4vcy5PVEHRvlzqO/LpD6Y7iGNpR7zw9Yk3b
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -0,0 +1,3 @@
|
||||
curl -H "Content-Type: application/json" --request POST --data '{"url":"/Users/nol/code/node-red/node-red/test/resources/subflow/test-subflow-mod-1.0.0.tgz","module":"test-subflow-mod"}' http://localhost:1880/nodes
|
||||
|
||||
curl --request DELETE http://localhost:1880/nodes/test-subflow-mod
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "test-subflow-mod",
|
||||
"version": "1.0.2",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"license": "ISC",
|
||||
"node-red": {
|
||||
"nodes": {
|
||||
"test-subflow": "subflow.js"
|
||||
},
|
||||
"dependencies": [
|
||||
"node-red-node-random"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"node-red-node-random": "*",
|
||||
"cowsay2": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
module.exports = function(RED) {
|
||||
RED.nodes.registerSubflow(JSON.parse(require('fs').readFileSync(require("path").join(__dirname,"subflow.json"))))
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"id": "caf258cc.4e2c48",
|
||||
"type": "subflow",
|
||||
"name": "Test Subflow",
|
||||
"info":"This is my exportable module subflow\n\nI hope this shows as help!",
|
||||
"category": "common",
|
||||
"in": [
|
||||
{
|
||||
"x": 120,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
{
|
||||
"id": "2f1d674f.a02d28"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out": [
|
||||
{
|
||||
"x": 560,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
{
|
||||
"id": "1497236e.07f12d",
|
||||
"port": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"x": 360,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
{
|
||||
"id": "f4334f5f.4905c",
|
||||
"port": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "FOO",
|
||||
"type": "cred",
|
||||
"ui": {
|
||||
"icon": "font-awesome/fa-thermometer-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BAR",
|
||||
"type": "str",
|
||||
"value": "1",
|
||||
"ui": {
|
||||
"icon": "font-awesome/fa-thermometer-2",
|
||||
"type": "select",
|
||||
"opts": {
|
||||
"opts": [
|
||||
{
|
||||
"l": {
|
||||
"en-US": "option 1"
|
||||
},
|
||||
"v": "1"
|
||||
},
|
||||
{
|
||||
"l": {
|
||||
"en-US": "option 2"
|
||||
},
|
||||
"v": "2"
|
||||
},
|
||||
{
|
||||
"l": {
|
||||
"en-US": "option 3"
|
||||
},
|
||||
"v": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "onewithaverylongname",
|
||||
"type": "str",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "BARRY",
|
||||
"type": "bool",
|
||||
"value": "true",
|
||||
"ui": {
|
||||
"icon": "font-awesome/fa-thermometer-4",
|
||||
"type": "checkbox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "WILMA",
|
||||
"type": "num",
|
||||
"value": "10",
|
||||
"ui": {
|
||||
"icon": "font-awesome/fbomb",
|
||||
"type": "spinner"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "awg",
|
||||
"type": "num",
|
||||
"value": "",
|
||||
"ui": {
|
||||
"icon": "font-awesome/fa-address-book-o",
|
||||
"type": "spinner"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "awf",
|
||||
"type": "str",
|
||||
"value": "",
|
||||
"ui": {
|
||||
"type": "select",
|
||||
"opts": {
|
||||
"opts": [
|
||||
{
|
||||
"l": {
|
||||
"en-US": "one"
|
||||
},
|
||||
"v": "1"
|
||||
},
|
||||
{
|
||||
"l": {
|
||||
"en-US": "two"
|
||||
},
|
||||
"v": "2"
|
||||
},
|
||||
{
|
||||
"l": {
|
||||
"en-US": "three"
|
||||
},
|
||||
"v": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "aawf",
|
||||
"type": "bool",
|
||||
"value": "true",
|
||||
"ui": {
|
||||
"type": "checkbox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "awgawgawg",
|
||||
"type": "str",
|
||||
"value": "",
|
||||
"ui": {
|
||||
"type": "none"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "seagseg",
|
||||
"type": "str",
|
||||
"value": "",
|
||||
"ui": {
|
||||
"type": "hide"
|
||||
}
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"type": "fly-a-plane"
|
||||
},
|
||||
"color": "#A6BBCF",
|
||||
"icon": "font-awesome/fa-space-shuttle",
|
||||
"status": {
|
||||
"x": 500,
|
||||
"y": 300,
|
||||
"wires": [
|
||||
{
|
||||
"id": "8252d1cc.54f94",
|
||||
"port": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"flow": [
|
||||
{
|
||||
"id": "2f1d674f.a02d28",
|
||||
"type": "function",
|
||||
"z": "caf258cc.4e2c48",
|
||||
"name": "",
|
||||
"func": "node.error(\"subflow error \"+msg.payload,msg);\nmsg.payload = {\n FOO: env.get(\"FOO\"),\n BAR: env.get(\"BAR\"),\n WILMA: env.get(\"WILMA\"),\n BARRY: env.get(\"BARRY\")\n}\nnode.warn(\"warning\");\n\nreturn msg;",
|
||||
"outputs": 1,
|
||||
"noerr": 0,
|
||||
"initialize": "",
|
||||
"finalize": "",
|
||||
"libs": [ {"var":"cowsay2","module":"cowsay2"}],
|
||||
"x": 240,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[
|
||||
"1497236e.07f12d"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f4334f5f.4905c",
|
||||
"type": "catch",
|
||||
"z": "caf258cc.4e2c48",
|
||||
"name": "",
|
||||
"scope": null,
|
||||
"uncaught": false,
|
||||
"x": 220,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[
|
||||
"8252d1cc.54f94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "8252d1cc.54f94",
|
||||
"type": "change",
|
||||
"z": "caf258cc.4e2c48",
|
||||
"name": "",
|
||||
"rules": [
|
||||
{
|
||||
"t": "set",
|
||||
"p": "payload",
|
||||
"pt": "msg",
|
||||
"to": "error.message",
|
||||
"tot": "msg"
|
||||
}
|
||||
],
|
||||
"action": "",
|
||||
"property": "",
|
||||
"from": "",
|
||||
"to": "",
|
||||
"reg": false,
|
||||
"x": 350,
|
||||
"y": 300,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1497236e.07f12d",
|
||||
"type": "random",
|
||||
"z": "caf258cc.4e2c48",
|
||||
"name": "",
|
||||
"low": "1",
|
||||
"high": "10",
|
||||
"inte": "true",
|
||||
"property": "random",
|
||||
"x": 420,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "876fc49e.f15268",
|
||||
"type": "subflow:caf258cc.4e2c48",
|
||||
"z": "d607ce33.4fa5a",
|
||||
"name": "",
|
||||
"x": 200,
|
||||
"y": 760,
|
||||
"wires": [
|
||||
[],
|
||||
[]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user