@5minds/node-red-contrib-processcube 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -499,7 +499,7 @@
499
499
  },
500
500
  "@5minds/node-red-contrib-processcube": {
501
501
  "name": "@5minds/node-red-contrib-processcube",
502
- "version": "0.0.9",
502
+ "version": "0.2.4",
503
503
  "local": true,
504
504
  "user": false,
505
505
  "nodes": {
@@ -546,6 +546,17 @@
546
546
  "user": false,
547
547
  "module": "@5minds/node-red-contrib-processcube",
548
548
  "file": "/data/node_modules/node-red-contrib-processcube/process-start.js"
549
+ },
550
+ "processcubeEngineConfig": {
551
+ "name": "processcubeEngineConfig",
552
+ "types": [
553
+ "processcube-engine-config"
554
+ ],
555
+ "enabled": true,
556
+ "local": true,
557
+ "user": false,
558
+ "module": "@5minds/node-red-contrib-processcube",
559
+ "file": "/data/node_modules/node-red-contrib-processcube/processcube-engine-config.js"
549
560
  }
550
561
  }
551
562
  }
@@ -499,7 +499,7 @@
499
499
  },
500
500
  "@5minds/node-red-contrib-processcube": {
501
501
  "name": "@5minds/node-red-contrib-processcube",
502
- "version": "0.0.8",
502
+ "version": "0.2.4",
503
503
  "local": true,
504
504
  "user": false,
505
505
  "nodes": {
@@ -7,6 +7,11 @@
7
7
  "info": "",
8
8
  "env": []
9
9
  },
10
+ {
11
+ "id": "d042a4c68f51d6ab",
12
+ "type": "processcube-engine-config",
13
+ "url": "http://engine:8000"
14
+ },
10
15
  {
11
16
  "id": "84f18cf9bf25b858",
12
17
  "type": "openApi-red",
@@ -132,7 +137,7 @@
132
137
  "type": "externaltask-input",
133
138
  "z": "a23d2e782beb66f4",
134
139
  "name": "processmodels",
135
- "engine": "",
140
+ "engine": "d042a4c68f51d6ab",
136
141
  "topic": "processmodels",
137
142
  "x": 100,
138
143
  "y": 460,
@@ -585,6 +590,7 @@
585
590
  "type": "externaltask-input",
586
591
  "z": "a23d2e782beb66f4",
587
592
  "name": "Test",
593
+ "engine": "d042a4c68f51d6ab",
588
594
  "topic": "Test",
589
595
  "x": 90,
590
596
  "y": 600,
@@ -745,6 +751,7 @@
745
751
  "type": "externaltask-input",
746
752
  "z": "a23d2e782beb66f4",
747
753
  "name": "SampleError",
754
+ "engine": "d042a4c68f51d6ab",
748
755
  "topic": "SampleError",
749
756
  "x": 110,
750
757
  "y": 840,
@@ -4,7 +4,7 @@
4
4
  color: '#00aed7',
5
5
  defaults: {
6
6
  name: {value: ""},
7
- engine: {value: "http://engine:8000"},
7
+ engine: {value: "", type: "processcube-engine-config"},
8
8
  topic: {value: ""}
9
9
  },
10
10
  inputs: 0,
@@ -19,7 +19,9 @@ module.exports = function(RED) {
19
19
  var flowContext = node.context().flow;
20
20
  var nodeContext = node.context();
21
21
 
22
- const engineUrl = config.engine || process.env.ENGINE_URL || 'http://engine:8000';
22
+ this.engine = this.server = RED.nodes.getNode(config.engine);
23
+
24
+ const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
23
25
 
24
26
  var client = nodeContext.get('client');
25
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "authors": [{
@@ -30,7 +30,8 @@
30
30
  "externaltaskInput": "externaltask-input.js",
31
31
  "externaltaskOutput": "externaltask-output.js",
32
32
  "externaltaskError": "externaltask-error.js",
33
- "processStart": "process-start.js"
33
+ "processStart": "process-start.js",
34
+ "processcubeEngineConfig": "processcube-engine-config.js"
34
35
  }
35
36
  },
36
37
  "dependencies": {
@@ -0,0 +1,18 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('processcube-engine-config',{
3
+ category: 'config',
4
+ defaults: {
5
+ url: {value:"http://engine:8000",required:true}
6
+ },
7
+ label: function() {
8
+ return this.url;
9
+ }
10
+ });
11
+ </script>
12
+
13
+ <script type="text/html" data-template-name="processcube-engine-config">
14
+ <div class="form-row">
15
+ <label for="node-config-input-url"><i class="fa fa-bookmark"></i> Url</label>
16
+ <input type="text" id="node-config-input-url">
17
+ </div>
18
+ </script>
@@ -0,0 +1,7 @@
1
+ module.exports = function(RED) {
2
+ function ProcessCubeEngineNode(n) {
3
+ RED.nodes.createNode(this,n);
4
+ this.url = n.url;
5
+ }
6
+ RED.nodes.registerType("processcube-engine-config",ProcessCubeEngineNode);
7
+ }