@gregoriusrippenstein/node-red-contrib-introspection 0.5.3 → 0.5.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.
- package/examples/seeker-sink.json +368 -190
- package/nodes/05-seeker.html +14 -0
- package/package.json +5 -5
- package/plugins/{screenshot.html → sidebar.html} +91 -12
- package/plugins/orphans.html +0 -45
|
@@ -1,4 +1,225 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"id": "7b2b4035188017d2",
|
|
4
|
+
"type": "group",
|
|
5
|
+
"z": "139a816449acd89f",
|
|
6
|
+
"name": "don't execute this flow it contains a loop",
|
|
7
|
+
"style": {
|
|
8
|
+
"label": true
|
|
9
|
+
},
|
|
10
|
+
"nodes": [
|
|
11
|
+
"7a12d1bd632f72da",
|
|
12
|
+
"489b7ede750a407d",
|
|
13
|
+
"a2e7e963d4fa1c2b",
|
|
14
|
+
"82bcb32e163a6456",
|
|
15
|
+
"37a6ae8572a3c549",
|
|
16
|
+
"f1e2d5fedcf8f5b2",
|
|
17
|
+
"a40bc0a91661f47a",
|
|
18
|
+
"6a085dbc390852c3",
|
|
19
|
+
"a8e0e319494b8ee3",
|
|
20
|
+
"6106ae78b76189cb"
|
|
21
|
+
],
|
|
22
|
+
"x": 136,
|
|
23
|
+
"y": 673,
|
|
24
|
+
"w": 1186,
|
|
25
|
+
"h": 413
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "7a12d1bd632f72da",
|
|
29
|
+
"type": "Seeker",
|
|
30
|
+
"z": "139a816449acd89f",
|
|
31
|
+
"g": "7b2b4035188017d2",
|
|
32
|
+
"name": "",
|
|
33
|
+
"x": 212,
|
|
34
|
+
"y": 750,
|
|
35
|
+
"wires": [
|
|
36
|
+
[
|
|
37
|
+
"a2e7e963d4fa1c2b"
|
|
38
|
+
]
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "489b7ede750a407d",
|
|
43
|
+
"type": "Sink",
|
|
44
|
+
"z": "139a816449acd89f",
|
|
45
|
+
"g": "7b2b4035188017d2",
|
|
46
|
+
"name": "",
|
|
47
|
+
"x": 1246,
|
|
48
|
+
"y": 899,
|
|
49
|
+
"wires": []
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "a2e7e963d4fa1c2b",
|
|
53
|
+
"type": "split",
|
|
54
|
+
"z": "139a816449acd89f",
|
|
55
|
+
"g": "7b2b4035188017d2",
|
|
56
|
+
"name": "",
|
|
57
|
+
"splt": "\\n",
|
|
58
|
+
"spltType": "str",
|
|
59
|
+
"arraySplt": 1,
|
|
60
|
+
"arraySpltType": "len",
|
|
61
|
+
"stream": false,
|
|
62
|
+
"addname": "",
|
|
63
|
+
"x": 504,
|
|
64
|
+
"y": 746,
|
|
65
|
+
"wires": [
|
|
66
|
+
[
|
|
67
|
+
"f1e2d5fedcf8f5b2",
|
|
68
|
+
"6106ae78b76189cb"
|
|
69
|
+
]
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "82bcb32e163a6456",
|
|
74
|
+
"type": "join",
|
|
75
|
+
"z": "139a816449acd89f",
|
|
76
|
+
"g": "7b2b4035188017d2",
|
|
77
|
+
"name": "",
|
|
78
|
+
"mode": "auto",
|
|
79
|
+
"build": "object",
|
|
80
|
+
"property": "payload",
|
|
81
|
+
"propertyType": "msg",
|
|
82
|
+
"key": "topic",
|
|
83
|
+
"joiner": "\\n",
|
|
84
|
+
"joinerType": "str",
|
|
85
|
+
"accumulate": "false",
|
|
86
|
+
"timeout": "",
|
|
87
|
+
"count": "",
|
|
88
|
+
"reduceRight": false,
|
|
89
|
+
"x": 849,
|
|
90
|
+
"y": 919,
|
|
91
|
+
"wires": [
|
|
92
|
+
[
|
|
93
|
+
"489b7ede750a407d"
|
|
94
|
+
]
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "37a6ae8572a3c549",
|
|
99
|
+
"type": "sort",
|
|
100
|
+
"z": "139a816449acd89f",
|
|
101
|
+
"g": "7b2b4035188017d2",
|
|
102
|
+
"name": "",
|
|
103
|
+
"order": "ascending",
|
|
104
|
+
"as_num": false,
|
|
105
|
+
"target": "payload",
|
|
106
|
+
"targetType": "msg",
|
|
107
|
+
"msgKey": "payload",
|
|
108
|
+
"msgKeyType": "elem",
|
|
109
|
+
"seqKey": "payload",
|
|
110
|
+
"seqKeyType": "msg",
|
|
111
|
+
"x": 541,
|
|
112
|
+
"y": 836,
|
|
113
|
+
"wires": [
|
|
114
|
+
[
|
|
115
|
+
"f1e2d5fedcf8f5b2",
|
|
116
|
+
"a40bc0a91661f47a"
|
|
117
|
+
]
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "f1e2d5fedcf8f5b2",
|
|
122
|
+
"type": "batch",
|
|
123
|
+
"z": "139a816449acd89f",
|
|
124
|
+
"g": "7b2b4035188017d2",
|
|
125
|
+
"name": "",
|
|
126
|
+
"mode": "count",
|
|
127
|
+
"count": 10,
|
|
128
|
+
"overlap": 0,
|
|
129
|
+
"interval": 10,
|
|
130
|
+
"allowEmptySequence": false,
|
|
131
|
+
"topics": [
|
|
132
|
+
{
|
|
133
|
+
"topic": ""
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"x": 698,
|
|
137
|
+
"y": 800,
|
|
138
|
+
"wires": [
|
|
139
|
+
[
|
|
140
|
+
"37a6ae8572a3c549"
|
|
141
|
+
]
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "a40bc0a91661f47a",
|
|
146
|
+
"type": "csv",
|
|
147
|
+
"z": "139a816449acd89f",
|
|
148
|
+
"g": "7b2b4035188017d2",
|
|
149
|
+
"name": "",
|
|
150
|
+
"sep": ",",
|
|
151
|
+
"hdrin": "",
|
|
152
|
+
"hdrout": "none",
|
|
153
|
+
"multi": "one",
|
|
154
|
+
"ret": "\\n",
|
|
155
|
+
"temp": "",
|
|
156
|
+
"skip": "0",
|
|
157
|
+
"strings": true,
|
|
158
|
+
"include_empty_strings": "",
|
|
159
|
+
"include_null_values": "",
|
|
160
|
+
"x": 633,
|
|
161
|
+
"y": 912,
|
|
162
|
+
"wires": [
|
|
163
|
+
[
|
|
164
|
+
"82bcb32e163a6456"
|
|
165
|
+
]
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "6a085dbc390852c3",
|
|
170
|
+
"type": "csv",
|
|
171
|
+
"z": "139a816449acd89f",
|
|
172
|
+
"g": "7b2b4035188017d2",
|
|
173
|
+
"name": "",
|
|
174
|
+
"sep": ",",
|
|
175
|
+
"hdrin": "",
|
|
176
|
+
"hdrout": "none",
|
|
177
|
+
"multi": "one",
|
|
178
|
+
"ret": "\\n",
|
|
179
|
+
"temp": "",
|
|
180
|
+
"skip": "0",
|
|
181
|
+
"strings": true,
|
|
182
|
+
"include_empty_strings": "",
|
|
183
|
+
"include_null_values": "",
|
|
184
|
+
"x": 693,
|
|
185
|
+
"y": 1008,
|
|
186
|
+
"wires": [
|
|
187
|
+
[
|
|
188
|
+
"82bcb32e163a6456"
|
|
189
|
+
]
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "a8e0e319494b8ee3",
|
|
194
|
+
"type": "link in",
|
|
195
|
+
"z": "139a816449acd89f",
|
|
196
|
+
"g": "7b2b4035188017d2",
|
|
197
|
+
"name": "link in 1",
|
|
198
|
+
"links": [
|
|
199
|
+
"6106ae78b76189cb"
|
|
200
|
+
],
|
|
201
|
+
"x": 487,
|
|
202
|
+
"y": 1045,
|
|
203
|
+
"wires": [
|
|
204
|
+
[
|
|
205
|
+
"6a085dbc390852c3"
|
|
206
|
+
]
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "6106ae78b76189cb",
|
|
211
|
+
"type": "link out",
|
|
212
|
+
"z": "139a816449acd89f",
|
|
213
|
+
"g": "7b2b4035188017d2",
|
|
214
|
+
"name": "link out 92",
|
|
215
|
+
"mode": "link",
|
|
216
|
+
"links": [
|
|
217
|
+
"a8e0e319494b8ee3"
|
|
218
|
+
],
|
|
219
|
+
"x": 753,
|
|
220
|
+
"y": 714,
|
|
221
|
+
"wires": []
|
|
222
|
+
},
|
|
2
223
|
{
|
|
3
224
|
"id": "644d61288c671091",
|
|
4
225
|
"type": "group",
|
|
@@ -20,8 +241,8 @@
|
|
|
20
241
|
"afaa8ef8c8aa0746",
|
|
21
242
|
"b2264dd04c98a2cc"
|
|
22
243
|
],
|
|
23
|
-
"x":
|
|
24
|
-
"y":
|
|
244
|
+
"x": 136,
|
|
245
|
+
"y": 91,
|
|
25
246
|
"w": 1208,
|
|
26
247
|
"h": 541
|
|
27
248
|
},
|
|
@@ -31,8 +252,8 @@
|
|
|
31
252
|
"z": "139a816449acd89f",
|
|
32
253
|
"g": "644d61288c671091",
|
|
33
254
|
"name": "",
|
|
34
|
-
"x":
|
|
35
|
-
"y":
|
|
255
|
+
"x": 212,
|
|
256
|
+
"y": 251,
|
|
36
257
|
"wires": [
|
|
37
258
|
[
|
|
38
259
|
"2330ef30ca42509f",
|
|
@@ -46,8 +267,8 @@
|
|
|
46
267
|
"z": "139a816449acd89f",
|
|
47
268
|
"g": "644d61288c671091",
|
|
48
269
|
"name": "",
|
|
49
|
-
"x":
|
|
50
|
-
"y":
|
|
270
|
+
"x": 1268,
|
|
271
|
+
"y": 384,
|
|
51
272
|
"wires": []
|
|
52
273
|
},
|
|
53
274
|
{
|
|
@@ -68,8 +289,8 @@
|
|
|
68
289
|
"checkall": "true",
|
|
69
290
|
"repair": false,
|
|
70
291
|
"outputs": 1,
|
|
71
|
-
"x":
|
|
72
|
-
"y":
|
|
292
|
+
"x": 426,
|
|
293
|
+
"y": 132,
|
|
73
294
|
"wires": [
|
|
74
295
|
[
|
|
75
296
|
"73729a40176391b6",
|
|
@@ -97,8 +318,8 @@
|
|
|
97
318
|
"from": "",
|
|
98
319
|
"to": "",
|
|
99
320
|
"reg": false,
|
|
100
|
-
"x":
|
|
101
|
-
"y":
|
|
321
|
+
"x": 527,
|
|
322
|
+
"y": 188,
|
|
102
323
|
"wires": [
|
|
103
324
|
[
|
|
104
325
|
"2330ef30ca42509f",
|
|
@@ -118,8 +339,8 @@
|
|
|
118
339
|
"syntax": "mustache",
|
|
119
340
|
"template": "This is the payload: {{payload}} !",
|
|
120
341
|
"output": "str",
|
|
121
|
-
"x":
|
|
122
|
-
"y":
|
|
342
|
+
"x": 630,
|
|
343
|
+
"y": 249,
|
|
123
344
|
"wires": [
|
|
124
345
|
[
|
|
125
346
|
"b559bb547b6a7efc",
|
|
@@ -145,8 +366,8 @@
|
|
|
145
366
|
"drop": false,
|
|
146
367
|
"allowrate": false,
|
|
147
368
|
"outputs": 1,
|
|
148
|
-
"x":
|
|
149
|
-
"y":
|
|
369
|
+
"x": 734,
|
|
370
|
+
"y": 301,
|
|
150
371
|
"wires": [
|
|
151
372
|
[
|
|
152
373
|
"7ba5ec934b306519"
|
|
@@ -171,8 +392,8 @@
|
|
|
171
392
|
"bytopic": "all",
|
|
172
393
|
"topic": "topic",
|
|
173
394
|
"outputs": 1,
|
|
174
|
-
"x":
|
|
175
|
-
"y":
|
|
395
|
+
"x": 806,
|
|
396
|
+
"y": 351,
|
|
176
397
|
"wires": [
|
|
177
398
|
[
|
|
178
399
|
"e8adf1e30363b84c"
|
|
@@ -192,8 +413,8 @@
|
|
|
192
413
|
"winHide": false,
|
|
193
414
|
"oldrc": false,
|
|
194
415
|
"name": "",
|
|
195
|
-
"x":
|
|
196
|
-
"y":
|
|
416
|
+
"x": 555,
|
|
417
|
+
"y": 418,
|
|
197
418
|
"wires": [
|
|
198
419
|
[
|
|
199
420
|
"e8adf1e30363b84c",
|
|
@@ -220,8 +441,8 @@
|
|
|
220
441
|
"septopics": true,
|
|
221
442
|
"property": "payload",
|
|
222
443
|
"topi": "topic",
|
|
223
|
-
"x":
|
|
224
|
-
"y":
|
|
444
|
+
"x": 650,
|
|
445
|
+
"y": 483,
|
|
225
446
|
"wires": [
|
|
226
447
|
[
|
|
227
448
|
"b2264dd04c98a2cc"
|
|
@@ -230,16 +451,13 @@
|
|
|
230
451
|
},
|
|
231
452
|
{
|
|
232
453
|
"id": "afaa8ef8c8aa0746",
|
|
233
|
-
"type": "
|
|
454
|
+
"type": "function",
|
|
234
455
|
"z": "139a816449acd89f",
|
|
235
456
|
"g": "644d61288c671091",
|
|
236
457
|
"name": "",
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"property": "payload",
|
|
241
|
-
"x": 748,
|
|
242
|
-
"y": 551,
|
|
458
|
+
"outputs": 1,
|
|
459
|
+
"x": 754,
|
|
460
|
+
"y": 514,
|
|
243
461
|
"wires": [
|
|
244
462
|
[
|
|
245
463
|
"49b6268a2ba413cf",
|
|
@@ -250,18 +468,13 @@
|
|
|
250
468
|
},
|
|
251
469
|
{
|
|
252
470
|
"id": "b2264dd04c98a2cc",
|
|
253
|
-
"type": "
|
|
471
|
+
"type": "function",
|
|
254
472
|
"z": "139a816449acd89f",
|
|
255
473
|
"g": "644d61288c671091",
|
|
256
474
|
"name": "",
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"round": "",
|
|
261
|
-
"mult": "single",
|
|
262
|
-
"reduce": false,
|
|
263
|
-
"x": 855,
|
|
264
|
-
"y": 593,
|
|
475
|
+
"outputs": 1,
|
|
476
|
+
"x": 865,
|
|
477
|
+
"y": 591,
|
|
265
478
|
"wires": [
|
|
266
479
|
[
|
|
267
480
|
"afaa8ef8c8aa0746",
|
|
@@ -270,224 +483,189 @@
|
|
|
270
483
|
]
|
|
271
484
|
},
|
|
272
485
|
{
|
|
273
|
-
"id": "
|
|
486
|
+
"id": "1f6f6592356849fd",
|
|
274
487
|
"type": "group",
|
|
275
488
|
"z": "139a816449acd89f",
|
|
276
|
-
"name": "
|
|
489
|
+
"name": "the special case of the link-call node",
|
|
277
490
|
"style": {
|
|
278
491
|
"label": true
|
|
279
492
|
},
|
|
280
493
|
"nodes": [
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"
|
|
285
|
-
"
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"
|
|
290
|
-
"
|
|
494
|
+
"c0cbed3bf1c2bb62",
|
|
495
|
+
"027ee35fdd4245eb",
|
|
496
|
+
"9797d34ff57eb027",
|
|
497
|
+
"7501d78d7b3ab70a",
|
|
498
|
+
"a9cd472850d17541",
|
|
499
|
+
"51175e409c29f55e",
|
|
500
|
+
"0c60e87d67835ccd",
|
|
501
|
+
"75e7a58fb39dc7d5",
|
|
502
|
+
"9327e0f2f332bbdb",
|
|
503
|
+
"f49f34f8c6c7aa42"
|
|
291
504
|
],
|
|
292
|
-
"x":
|
|
293
|
-
"y":
|
|
294
|
-
"w":
|
|
295
|
-
"h":
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"id": "7a12d1bd632f72da",
|
|
299
|
-
"type": "Seeker",
|
|
300
|
-
"z": "139a816449acd89f",
|
|
301
|
-
"g": "7b2b4035188017d2",
|
|
302
|
-
"name": "",
|
|
303
|
-
"x": 212,
|
|
304
|
-
"y": 750,
|
|
305
|
-
"wires": [
|
|
306
|
-
[
|
|
307
|
-
"a2e7e963d4fa1c2b"
|
|
308
|
-
]
|
|
309
|
-
]
|
|
505
|
+
"x": 293,
|
|
506
|
+
"y": 1169,
|
|
507
|
+
"w": 1035,
|
|
508
|
+
"h": 372
|
|
310
509
|
},
|
|
311
510
|
{
|
|
312
|
-
"id": "
|
|
313
|
-
"type": "
|
|
511
|
+
"id": "c0cbed3bf1c2bb62",
|
|
512
|
+
"type": "link out",
|
|
314
513
|
"z": "139a816449acd89f",
|
|
315
|
-
"g": "
|
|
316
|
-
"name": "",
|
|
317
|
-
"
|
|
318
|
-
"
|
|
514
|
+
"g": "1f6f6592356849fd",
|
|
515
|
+
"name": "link out 116",
|
|
516
|
+
"mode": "return",
|
|
517
|
+
"links": [],
|
|
518
|
+
"x": 1023,
|
|
519
|
+
"y": 1398,
|
|
319
520
|
"wires": []
|
|
320
521
|
},
|
|
321
522
|
{
|
|
322
|
-
"id": "
|
|
323
|
-
"type": "
|
|
523
|
+
"id": "027ee35fdd4245eb",
|
|
524
|
+
"type": "link in",
|
|
324
525
|
"z": "139a816449acd89f",
|
|
325
|
-
"g": "
|
|
326
|
-
"name": "",
|
|
327
|
-
"
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"arraySpltType": "len",
|
|
331
|
-
"stream": false,
|
|
332
|
-
"addname": "",
|
|
333
|
-
"x": 504,
|
|
334
|
-
"y": 746,
|
|
526
|
+
"g": "1f6f6592356849fd",
|
|
527
|
+
"name": "call with return",
|
|
528
|
+
"links": [],
|
|
529
|
+
"x": 665,
|
|
530
|
+
"y": 1236,
|
|
335
531
|
"wires": [
|
|
336
532
|
[
|
|
337
|
-
"
|
|
338
|
-
"6106ae78b76189cb"
|
|
533
|
+
"7501d78d7b3ab70a"
|
|
339
534
|
]
|
|
340
535
|
]
|
|
341
536
|
},
|
|
342
537
|
{
|
|
343
|
-
"id": "
|
|
344
|
-
"type": "
|
|
538
|
+
"id": "9797d34ff57eb027",
|
|
539
|
+
"type": "link call",
|
|
345
540
|
"z": "139a816449acd89f",
|
|
346
|
-
"g": "
|
|
541
|
+
"g": "1f6f6592356849fd",
|
|
347
542
|
"name": "",
|
|
348
|
-
"
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
"
|
|
352
|
-
"
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"accumulate": "false",
|
|
356
|
-
"timeout": "",
|
|
357
|
-
"count": "",
|
|
358
|
-
"reduceRight": false,
|
|
359
|
-
"x": 849,
|
|
360
|
-
"y": 919,
|
|
543
|
+
"links": [
|
|
544
|
+
"027ee35fdd4245eb"
|
|
545
|
+
],
|
|
546
|
+
"linkType": "static",
|
|
547
|
+
"timeout": "30",
|
|
548
|
+
"x": 809,
|
|
549
|
+
"y": 1500,
|
|
361
550
|
"wires": [
|
|
362
551
|
[
|
|
363
|
-
"
|
|
552
|
+
"0c60e87d67835ccd"
|
|
364
553
|
]
|
|
365
554
|
]
|
|
366
555
|
},
|
|
367
556
|
{
|
|
368
|
-
"id": "
|
|
369
|
-
"type": "
|
|
557
|
+
"id": "7501d78d7b3ab70a",
|
|
558
|
+
"type": "function",
|
|
370
559
|
"z": "139a816449acd89f",
|
|
371
|
-
"g": "
|
|
372
|
-
"name": "",
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
376
|
-
"
|
|
377
|
-
"
|
|
378
|
-
"
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
"x": 541,
|
|
382
|
-
"y": 836,
|
|
560
|
+
"g": "1f6f6592356849fd",
|
|
561
|
+
"name": "function 31",
|
|
562
|
+
"func": "\nreturn msg;",
|
|
563
|
+
"outputs": 1,
|
|
564
|
+
"noerr": 0,
|
|
565
|
+
"initialize": "",
|
|
566
|
+
"finalize": "",
|
|
567
|
+
"libs": [],
|
|
568
|
+
"x": 837,
|
|
569
|
+
"y": 1210,
|
|
383
570
|
"wires": [
|
|
384
571
|
[
|
|
385
|
-
"
|
|
386
|
-
"a40bc0a91661f47a"
|
|
572
|
+
"a9cd472850d17541"
|
|
387
573
|
]
|
|
388
574
|
]
|
|
389
575
|
},
|
|
390
576
|
{
|
|
391
|
-
"id": "
|
|
392
|
-
"type": "
|
|
577
|
+
"id": "a9cd472850d17541",
|
|
578
|
+
"type": "function",
|
|
393
579
|
"z": "139a816449acd89f",
|
|
394
|
-
"g": "
|
|
395
|
-
"name": "",
|
|
396
|
-
"
|
|
397
|
-
"
|
|
398
|
-
"
|
|
399
|
-
"
|
|
400
|
-
"
|
|
401
|
-
"
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
],
|
|
406
|
-
"x": 698,
|
|
407
|
-
"y": 800,
|
|
580
|
+
"g": "1f6f6592356849fd",
|
|
581
|
+
"name": "function 32",
|
|
582
|
+
"func": "\nreturn msg;",
|
|
583
|
+
"outputs": 1,
|
|
584
|
+
"noerr": 0,
|
|
585
|
+
"initialize": "",
|
|
586
|
+
"finalize": "",
|
|
587
|
+
"libs": [],
|
|
588
|
+
"x": 877,
|
|
589
|
+
"y": 1292,
|
|
408
590
|
"wires": [
|
|
409
591
|
[
|
|
410
|
-
"
|
|
592
|
+
"c0cbed3bf1c2bb62",
|
|
593
|
+
"f49f34f8c6c7aa42"
|
|
411
594
|
]
|
|
412
595
|
]
|
|
413
596
|
},
|
|
414
597
|
{
|
|
415
|
-
"id": "
|
|
416
|
-
"type": "
|
|
598
|
+
"id": "51175e409c29f55e",
|
|
599
|
+
"type": "function",
|
|
417
600
|
"z": "139a816449acd89f",
|
|
418
|
-
"g": "
|
|
419
|
-
"name": "",
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
"
|
|
423
|
-
"
|
|
424
|
-
"
|
|
425
|
-
"
|
|
426
|
-
"
|
|
427
|
-
"
|
|
428
|
-
"include_empty_strings": "",
|
|
429
|
-
"include_null_values": "",
|
|
430
|
-
"x": 633,
|
|
431
|
-
"y": 912,
|
|
601
|
+
"g": "1f6f6592356849fd",
|
|
602
|
+
"name": "function 33",
|
|
603
|
+
"func": "\nreturn msg;",
|
|
604
|
+
"outputs": 1,
|
|
605
|
+
"noerr": 0,
|
|
606
|
+
"initialize": "",
|
|
607
|
+
"finalize": "",
|
|
608
|
+
"libs": [],
|
|
609
|
+
"x": 582,
|
|
610
|
+
"y": 1381,
|
|
432
611
|
"wires": [
|
|
433
612
|
[
|
|
434
|
-
"
|
|
613
|
+
"9797d34ff57eb027"
|
|
435
614
|
]
|
|
436
615
|
]
|
|
437
616
|
},
|
|
438
617
|
{
|
|
439
|
-
"id": "
|
|
440
|
-
"type": "
|
|
618
|
+
"id": "0c60e87d67835ccd",
|
|
619
|
+
"type": "function",
|
|
441
620
|
"z": "139a816449acd89f",
|
|
442
|
-
"g": "
|
|
443
|
-
"name": "",
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"
|
|
447
|
-
"
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
"
|
|
451
|
-
"
|
|
452
|
-
"include_empty_strings": "",
|
|
453
|
-
"include_null_values": "",
|
|
454
|
-
"x": 693,
|
|
455
|
-
"y": 1008,
|
|
621
|
+
"g": "1f6f6592356849fd",
|
|
622
|
+
"name": "function 34",
|
|
623
|
+
"func": "\nreturn msg;",
|
|
624
|
+
"outputs": 1,
|
|
625
|
+
"noerr": 0,
|
|
626
|
+
"initialize": "",
|
|
627
|
+
"finalize": "",
|
|
628
|
+
"libs": [],
|
|
629
|
+
"x": 1060,
|
|
630
|
+
"y": 1458,
|
|
456
631
|
"wires": [
|
|
457
632
|
[
|
|
458
|
-
"
|
|
633
|
+
"75e7a58fb39dc7d5"
|
|
459
634
|
]
|
|
460
635
|
]
|
|
461
636
|
},
|
|
462
637
|
{
|
|
463
|
-
"id": "
|
|
464
|
-
"type": "
|
|
638
|
+
"id": "75e7a58fb39dc7d5",
|
|
639
|
+
"type": "Sink",
|
|
465
640
|
"z": "139a816449acd89f",
|
|
466
|
-
"g": "
|
|
467
|
-
"name": "
|
|
468
|
-
"
|
|
469
|
-
|
|
470
|
-
]
|
|
471
|
-
|
|
472
|
-
|
|
641
|
+
"g": "1f6f6592356849fd",
|
|
642
|
+
"name": "",
|
|
643
|
+
"x": 1252,
|
|
644
|
+
"y": 1486,
|
|
645
|
+
"wires": []
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"id": "9327e0f2f332bbdb",
|
|
649
|
+
"type": "Seeker",
|
|
650
|
+
"z": "139a816449acd89f",
|
|
651
|
+
"g": "1f6f6592356849fd",
|
|
652
|
+
"name": "",
|
|
653
|
+
"x": 369,
|
|
654
|
+
"y": 1313,
|
|
473
655
|
"wires": [
|
|
474
656
|
[
|
|
475
|
-
"
|
|
657
|
+
"51175e409c29f55e"
|
|
476
658
|
]
|
|
477
659
|
]
|
|
478
660
|
},
|
|
479
661
|
{
|
|
480
|
-
"id": "
|
|
481
|
-
"type": "
|
|
662
|
+
"id": "f49f34f8c6c7aa42",
|
|
663
|
+
"type": "Sink",
|
|
482
664
|
"z": "139a816449acd89f",
|
|
483
|
-
"g": "
|
|
484
|
-
"name": "
|
|
485
|
-
"
|
|
486
|
-
"
|
|
487
|
-
"a8e0e319494b8ee3"
|
|
488
|
-
],
|
|
489
|
-
"x": 753,
|
|
490
|
-
"y": 714,
|
|
665
|
+
"g": "1f6f6592356849fd",
|
|
666
|
+
"name": "",
|
|
667
|
+
"x": 1182,
|
|
668
|
+
"y": 1283,
|
|
491
669
|
"wires": []
|
|
492
670
|
}
|
|
493
671
|
]
|
package/nodes/05-seeker.html
CHANGED
|
@@ -122,6 +122,20 @@
|
|
|
122
122
|
|
|
123
123
|
switch( node.type ) {
|
|
124
124
|
|
|
125
|
+
case "link call":
|
|
126
|
+
RED.nodes.getNodeLinks(node).forEach( function(l) {
|
|
127
|
+
traverse( l.target, [...nodeIds, node.id] );
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
node.links.forEach( function(lnkNdeId) {
|
|
131
|
+
var dNode = RED.nodes.node(lnkNdeId);
|
|
132
|
+
if ( !dNode ) { return }
|
|
133
|
+
|
|
134
|
+
traverse( dNode, [...nodeIds, node.id] );
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
break;
|
|
138
|
+
|
|
125
139
|
case "link out":
|
|
126
140
|
node.links.forEach( function(lnkNdeId) {
|
|
127
141
|
var dNode = RED.nodes.node(lnkNdeId);
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gregoriusrippenstein/node-red-contrib-introspection",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"got": "
|
|
5
|
+
"got": ">=13.0.0"
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
"keywords": [
|
|
9
9
|
"node-red",
|
|
10
10
|
"introspection",
|
|
11
11
|
"selfreflection",
|
|
12
|
-
"node-red-editor"
|
|
12
|
+
"node-red-editor",
|
|
13
|
+
"screenshot"
|
|
13
14
|
],
|
|
14
15
|
|
|
15
16
|
"homepage": "https://github.com/gorenje/node-red-contrib-introspection#readme",
|
|
@@ -22,8 +23,7 @@
|
|
|
22
23
|
"node-red": {
|
|
23
24
|
"version": ">=2.0.0",
|
|
24
25
|
"plugins": {
|
|
25
|
-
"screenshot": "plugins/
|
|
26
|
-
"orphans": "plugins/orphans.html"
|
|
26
|
+
"screenshot": "plugins/sidebar.html"
|
|
27
27
|
},
|
|
28
28
|
"nodes": {
|
|
29
29
|
"seeker": "nodes/05-seeker.js",
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
(function() {
|
|
3
3
|
var globalRefToSvgData;
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function setupTreelist(){var e=collectOrphans();if(0==e.length){RED.notify("No Orphans Found",{type:"warning",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){t.node&&t.node.z==RED.workspaces.active()&&(RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var n;t.node&&(n=t.node.id,setTimeout(()=>{var e=RED.nodes.node(n);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e)),n==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var n=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),n.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),n.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectOrphans(){const t=new Set;var n=[],i=(RED.nodes.eachLink(e=>{t.add(e.source),t.add(e.target)}),RED.nodes.eachNode(e=>{t.has(e)||n.push(e)}),[]),r={};return n.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var n=t.label,n=("function"==typeof n?n.call(e):n)||"",o=e.type;if(0===o.indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:o,selected:!1,checkbox:!1},i.push(r[e.id])}),i}
|
|
6
|
+
|
|
7
|
+
function nr_intro_generate_svg_3_1(r){return e=>{try{handleSvgObject($($("svg[width=8000]")[0]),e)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_0(r){return e=>{try{handleSvgObject($($("svg")[0]),e)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function handleSvgObject(o,e){var t=o.clone();t.find("foreignObject").remove(),t.find("svg.__screenshot").remove();function a(t,e){for(var n=0;n<t.length;n++){var s=t.item(n),i=e[n];["stroke-width","fill-opacity","stroke-opacity","opacity","stroke-dasharray"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))}),["fill","stroke"].forEach(function(t){var e,n,r=(e=$(i).attr(t)||$(i).css(t))&&null!==e&&"none"!=e?(n=e.match(/^#(.)(.)(.)$/))?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:(n=e.match(/^#......$/))?e:null===(n=e.match(/^rgb\(([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?(r=e.match(/^rgba\(([0-9]+),\s+([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?{clr:"#"+("0"+parseInt(r[1],10).toString(16)).slice(-2)+("0"+parseInt(r[2],10).toString(16)).slice(-2)+("0"+parseInt(r[3],10).toString(16)).slice(-2),opa:r[4]}:(console.log("Screenshot node: returned unknown color: "+e),e):"#"+("0"+parseInt(n[1],10).toString(16)).slice(-2)+("0"+parseInt(n[2],10).toString(16)).slice(-2)+("0"+parseInt(n[3],10).toString(16)).slice(-2):"none";"object"==typeof r?(s.setAttribute(t+"-opacity",r.opa),s.setAttribute(t,r.clr)):s.setAttribute(t,r)}),$(i).hasClass("hide")&&("g"==s.tagName&&s.setAttribute("opacity","0"),s.setAttribute("visibility","hidden"))}}var n='<?xml version="1.0" standalone="no"?>\r\n<svg '+('width="'+o.attr("width")+'" height="'+o.attr("height")+'"')+' pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" class="__screenshot" xmlns:xlink="http://www.w3.org/1999/xlink">\r\n',t=t.html(),l=(new DOMParser).parseFromString(n+t+"\r\n</svg>","image/svg+xml"),r=e=>(["g","rect","line","path","circle","image","text"].forEach(t=>{$(e.getElementsByTagName(t)).each((t,e)=>{e.setAttribute("class",""),e.setAttribute("id","")})}),e),s=(["g","rect","line","path","circle","image"].forEach(function(t){a(l.getElementsByTagName(t),o.find(t))}),["text"].forEach(function(t){a(l.getElementsByTagName(t),o.find(t));for(var e=l.getElementsByTagName(t),n=o.find(t),r=0;r<e.length;r++){var s=e.item(r),i=n[r];["font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","text-anchor","dominant-baseline"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))})}}),l.getElementsByTagName("image")),g={},i=(n,r,s)=>{var i=n.getAttribute("xlink:href"),o=i.substr(-4,4).toLowerCase(),a={".jpg":"jpeg",jpeg:"jpeg",".png":"png",".svg":"svg+xml"};if(g[i])return n.setAttribute("xlink:href","data:image/"+a[o]+";base64,"+g[i]),s(r-1);switch(o){case".jpg":case"jpeg":case".png":var l=new XMLHttpRequest;l.open("GET",i,!0),l.responseType="arraybuffer";l.onload=function(t){var e=l.response;e&&(e=(t=>{for(var e="",n=new Uint8Array(t),r=n.byteLength,s=0;s<r;s++)e+=String.fromCharCode(n[s]);return window.btoa(e)})(e),g[i]=e,n.setAttribute("xlink:href","data:image/"+a[o]+";base64,"+e)),s(r-1)},l.send(null);break;case".svg":$.get(i,function(t){var e=new XMLSerializer,e=btoa(e.serializeToString(t));g[i]=e,n.setAttribute("xlink:href","data:image/svg+xml;base64,"+e),s(r-1)})}},c=t=>{t<0?e((new XMLSerializer).serializeToString(r(l))):i(s.item(t),t,c)};0<s.length?i(s.item(s.length-1),s.length-1,c):e((new XMLSerializer).serializeToString(r(l)))}function generatorFunctionForVersion(t){var n,e=t.settings.version.split("."),r=e[0],e=e[1];if("3"==r){if("0"==e)return nr_intro_generate_svg_3_0(t);if("1"==e)return nr_intro_generate_svg_3_1(t)}return n=t,t=>{var e="Node-RED version ("+n.settings.version+") not supported";n.notify(e,{type:"error"}),t&&t('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+e+"</text></svg>")}}function addPanZoom(){var t=d3.select("#node-input-screenshot-svgcontainer svg"),e=(t.html("<g>"+t.html()+"</g>"),t.select("g")),n=d3.behavior.zoom().scaleExtent([.2,100]).on("zoom",function(t){e.attr({transform:"translate("+n.translate()+") scale("+n.scale()+")"})});t.call(n)}
|
|
6
8
|
|
|
7
9
|
// Add your plugin as a new tabsheet in the right sidebar AFTER the flow editor is completely started
|
|
8
10
|
var initialiseConfigNodeOnce = () => {
|
|
@@ -14,14 +16,36 @@
|
|
|
14
16
|
// Add a "Your sidebar" tabsheet to the right sidebar panel, in which this sidebar panel can be displayed
|
|
15
17
|
// --> more details: https://nodered.org/docs/api/ui/sidebar/
|
|
16
18
|
RED.sidebar.addTab({
|
|
17
|
-
id: "
|
|
18
|
-
label: "
|
|
19
|
-
name: "
|
|
19
|
+
id: "Introspection",
|
|
20
|
+
label: "Introspection", // short name for the tab
|
|
21
|
+
name: "Introspection", // long name for the menu
|
|
20
22
|
content: content,
|
|
21
23
|
enableOnEdit: true,
|
|
22
24
|
iconClass: "fa fa-camera" // your fontawesome icon
|
|
23
25
|
});
|
|
24
26
|
|
|
27
|
+
var tabs = RED.tabs.create({
|
|
28
|
+
id: 'func-introspection-tabs',
|
|
29
|
+
onchange: function(tab) {
|
|
30
|
+
$('#func-introspection-tabs-content').children().hide();
|
|
31
|
+
$('#' + tab.id).show();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Add first tab, screenshot
|
|
36
|
+
tabs.addTab({
|
|
37
|
+
id: 'func-introspection-tab-screenshot',
|
|
38
|
+
iconClass: 'fa fa-photo',
|
|
39
|
+
label: 'Screenshot'
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Add tab, orphans
|
|
43
|
+
tabs.addTab({
|
|
44
|
+
id: 'func-introspection-tab-orphans',
|
|
45
|
+
iconClass: 'fa fa-life-ring',
|
|
46
|
+
label: 'Orphans'
|
|
47
|
+
});
|
|
48
|
+
|
|
25
49
|
$('#node-screenshot-capture-btn').on("click", function (e) {
|
|
26
50
|
if ( e ) { e.preventDefault() }
|
|
27
51
|
|
|
@@ -30,6 +54,9 @@
|
|
|
30
54
|
generatorFunctionForVersion(RED)( (svgdata) => {
|
|
31
55
|
$('#node-input-screenshot-svgcontainer').html(svgdata);
|
|
32
56
|
globalRefToSvgData = svgdata;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
addPanZoom()
|
|
59
|
+
},150)
|
|
33
60
|
});
|
|
34
61
|
})
|
|
35
62
|
|
|
@@ -52,23 +79,75 @@
|
|
|
52
79
|
RED.notify("SVG copied to clipboard", { type: "success" });
|
|
53
80
|
}
|
|
54
81
|
});
|
|
82
|
+
|
|
83
|
+
// When the user has entered new data in the sidebar, then store it into the config node
|
|
84
|
+
$("#node-input-orphan-find-btn").on("click", function(e) {
|
|
85
|
+
if ( e ) { e.preventDefault() }
|
|
86
|
+
setupTreelist();
|
|
87
|
+
})
|
|
55
88
|
};
|
|
56
89
|
RED.events.on('runtime-state', initialiseConfigNodeOnce);
|
|
57
90
|
})();
|
|
58
91
|
</script>
|
|
59
92
|
|
|
93
|
+
<style>
|
|
94
|
+
.col-100 .red-ui-typedInput-container {
|
|
95
|
+
width: 70% !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.col-100.no-label .red-ui-typedInput-container {
|
|
99
|
+
width: 100% !important;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
102
|
+
|
|
60
103
|
<!-- The html for the right sidebar plugin screen -->
|
|
61
104
|
<script type="text/x-red" data-template-name="Screenshot">
|
|
62
|
-
<div class="form-row" style="margin-left: 10px; margin-top: 30px;">
|
|
63
|
-
<button type="button" id="node-screenshot-capture-btn" class="red-ui-button red-ui-button-large"><i class="fa fa-camera"></i> Capture</button>
|
|
64
|
-
</div>
|
|
65
105
|
|
|
66
|
-
<div class="form-row
|
|
67
|
-
<
|
|
106
|
+
<div class="form-row func-introspection-tabs-row">
|
|
107
|
+
<ul style="min-width: 600px; margin-bottom: 20px;" id="func-introspection-tabs"></ul>
|
|
68
108
|
</div>
|
|
69
109
|
|
|
70
|
-
<div
|
|
71
|
-
<
|
|
72
|
-
|
|
110
|
+
<div id="func-introspection-tabs-content" style="min-height: calc(100% - 95px);">
|
|
111
|
+
<div id="func-introspection-tab-screenshot" style="display:none; min-height: calc(100%);">
|
|
112
|
+
<div class="form-row">
|
|
113
|
+
<div class="col-100">
|
|
114
|
+
|
|
115
|
+
<div class="form-row" style="margin-left: 10px; margin-top: 30px;">
|
|
116
|
+
<button type="button" id="node-screenshot-capture-btn"
|
|
117
|
+
class="red-ui-button red-ui-button-large"><i class="fa fa-camera"></i> Capture</button>
|
|
118
|
+
|
|
119
|
+
<button type="button" id="node-screenshot-download-svg" style="margin-left: 30px;"
|
|
120
|
+
class="red-ui-button red-ui-button-large"><i class="fa fa-download"></i> Download</button>
|
|
121
|
+
<button type="button" id="node-screenshot-copy-to-clipboard-svg"
|
|
122
|
+
class="red-ui-button red-ui-button-large"><i class="fa fa-clipboard"></i> Copy to Clipboard</button>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div class="form-row" style="min-height: 300px; height: 450px; overflow: hidden; margin-left: 10px; margin-right: 15px; border: 1px rgb(196, 196, 196) solid; border-radius: 5px;">
|
|
126
|
+
<div id="node-input-screenshot-svgcontainer"></div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div id="func-introspection-tab-orphans" style="display:none; min-height: calc(100%);">
|
|
133
|
+
<div class="form-row">
|
|
134
|
+
<div class="col-100">
|
|
135
|
+
<div class="form-row node-input-target-row" style="margin-left: 10px; margin-top: 30px">
|
|
136
|
+
<button id="node-input-orphan-find-btn"
|
|
137
|
+
class="red-ui-button"><i class="fa fa-rotate-right"></i> Refresh</button>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="form-row node-input-target-row node-input-target-list-row"
|
|
141
|
+
style="margin-left: 10px; position: relative; min-height: 200px; height: 450px; margin-right: 15px; ">
|
|
142
|
+
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
143
|
+
<input type="text" id="node-input-orphan-target-filter" style="display: none;">
|
|
144
|
+
</div>
|
|
145
|
+
<div id="node-input-orphan-target-container-div"></div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
73
150
|
</div>
|
|
151
|
+
|
|
152
|
+
|
|
74
153
|
</script>
|
package/plugins/orphans.html
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script type="text/javascript">
|
|
2
|
-
(function() {
|
|
3
|
-
function setupTreelist(){var e=collectOrphans();if(0==e.length){RED.notify("No Orphans Found",{type:"warning",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){t.node&&t.node.z==RED.workspaces.active()&&(RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var n;t.node&&(n=t.node.id,setTimeout(()=>{var e=RED.nodes.node(n);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e)),n==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var n=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),n.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),n.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectOrphans(){const t=new Set;var n=[],i=(RED.nodes.eachLink(e=>{t.add(e.source),t.add(e.target)}),RED.nodes.eachNode(e=>{t.has(e)||n.push(e)}),[]),r={};return n.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var n=t.label,n=("function"==typeof n?n.call(e):n)||"",o=e.type;if(0===o.indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:o,selected:!1,checkbox:!1},i.push(r[e.id])}),i}
|
|
4
|
-
|
|
5
|
-
var initialiseSidebarOrphanNodeOnce = () => {
|
|
6
|
-
RED.events.off('runtime-state', initialiseSidebarOrphanNodeOnce);
|
|
7
|
-
|
|
8
|
-
// The html content of the sidebar has been specified below as a data-template, from where it can be loaded:
|
|
9
|
-
var content = $($('script[type="text/x-red"][data-template-name="Orphans"]').i18n().html());
|
|
10
|
-
|
|
11
|
-
// Add a "Your sidebar" tabsheet to the right sidebar panel, in which this sidebar panel can be displayed
|
|
12
|
-
// --> more details: https://nodered.org/docs/api/ui/sidebar/
|
|
13
|
-
RED.sidebar.addTab({
|
|
14
|
-
id: "Orphans",
|
|
15
|
-
label: "Orphans", // short name for the tab
|
|
16
|
-
name: "Orphan Nodes", // long name for the menu
|
|
17
|
-
content: content,
|
|
18
|
-
enableOnEdit: true,
|
|
19
|
-
iconClass: "fa fa-life-ring" // your fontawesome icon
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// When the user has entered new data in the sidebar, then store it into the config node
|
|
23
|
-
$("#node-input-orphan-find-btn").on("click", function(e) {
|
|
24
|
-
if ( e ) { e.preventDefault() }
|
|
25
|
-
setupTreelist();
|
|
26
|
-
})
|
|
27
|
-
};
|
|
28
|
-
RED.events.on('runtime-state', initialiseSidebarOrphanNodeOnce);
|
|
29
|
-
})();
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<!-- The html for the right sidebar plugin screen -->
|
|
33
|
-
<script type="text/x-red" data-template-name="Orphans">
|
|
34
|
-
<div class="form-row node-input-target-row" style="margin-left: 10px; margin-top: 30px">
|
|
35
|
-
<button id="node-input-orphan-find-btn"
|
|
36
|
-
class="red-ui-button">Find Orphans</button>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="form-row node-input-target-row node-input-target-list-row" style="margin-left: 10px; position: relative; min-height: 200px; margin-right: 15px; height: calc(100% - 150px);">
|
|
40
|
-
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
41
|
-
<input type="text" id="node-input-orphan-target-filter" style="display: none;">
|
|
42
|
-
</div>
|
|
43
|
-
<div id="node-input-orphan-target-container-div"></div>
|
|
44
|
-
</div>
|
|
45
|
-
</script>
|