mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
995 Commits
2.1.4
...
fix-link-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24178beafc | ||
|
|
6044871438 | ||
|
|
e612bb6a38 | ||
|
|
81ea67d6da | ||
|
|
06e35baeaa | ||
|
|
c9d72d7a1d | ||
|
|
62e9572070 | ||
|
|
fea68c8acc | ||
|
|
929f0e90ac | ||
|
|
81331e68d2 | ||
|
|
4fda59a585 | ||
|
|
ede3ac4282 | ||
|
|
16f8b78b39 | ||
|
|
892d21fb77 | ||
|
|
adfc5b3e98 | ||
|
|
f3d7016ab2 | ||
|
|
8382665bbb | ||
|
|
e799cfc16a | ||
|
|
055d0081e1 | ||
|
|
1824108d09 | ||
|
|
149e8ce9b0 | ||
|
|
f4661eec75 | ||
|
|
0f7a1a42e4 | ||
|
|
5bda221f9d | ||
|
|
fd42becbdc | ||
|
|
7dca148349 | ||
|
|
ffff8aeb91 | ||
|
|
ae92ea9476 | ||
|
|
c7017ee84b | ||
|
|
0346294c59 | ||
|
|
8d240ca797 | ||
|
|
7dbbafec1b | ||
|
|
c49330f9d1 | ||
|
|
10324d8260 | ||
|
|
8f27dae7ea | ||
|
|
7c306a8430 | ||
|
|
74794fea09 | ||
|
|
1efd1a52a7 | ||
|
|
4d202a7a37 | ||
|
|
e0d71abdc6 | ||
|
|
550eb6ee2f | ||
|
|
f737162697 | ||
|
|
ce57ba80eb | ||
|
|
b3ce0c0079 | ||
|
|
4adc6b269c | ||
|
|
920b0178ec | ||
|
|
7870830367 | ||
|
|
4c1d7ad2d2 | ||
|
|
661b07c856 | ||
|
|
5670bd8265 | ||
|
|
156c3984a7 | ||
|
|
f91af2153a | ||
|
|
805f8a5ee7 | ||
|
|
113d42ef35 | ||
|
|
c18018f017 | ||
|
|
e804addf0a | ||
|
|
4bb2b91ee6 | ||
|
|
5bb66ed7d4 | ||
|
|
95a7980ada | ||
|
|
281e9d1357 | ||
|
|
14e74afb07 | ||
|
|
742f05f59d | ||
|
|
79db4f8aa1 | ||
|
|
c4e216f839 | ||
|
|
2a49e7c8ef | ||
|
|
02af01d2ca | ||
|
|
ee4af4c7bf | ||
|
|
3d565e74a5 | ||
|
|
3cb84222f8 | ||
|
|
1b013bb73b | ||
|
|
fd54e625d5 | ||
|
|
77f6412d3b | ||
|
|
c81cd5450f | ||
|
|
0b663abe50 | ||
|
|
14c362d4ba | ||
|
|
fce43b4e1d | ||
|
|
1d547500e8 | ||
|
|
94690fad7a | ||
|
|
d693af9615 | ||
|
|
8b398f49c0 | ||
|
|
902ce68164 | ||
|
|
cd0474ce7b | ||
|
|
946def022f | ||
|
|
c62a101635 | ||
|
|
69a575097d | ||
|
|
b40551a8fa | ||
|
|
5b27bcd781 | ||
|
|
75725a38df | ||
|
|
24b055b1b8 | ||
|
|
32999ffa84 | ||
|
|
f06c53f1f1 | ||
|
|
a9eec28360 | ||
|
|
5cda972872 | ||
|
|
087946876b | ||
|
|
318f0f1b7e | ||
|
|
f4d7b71984 | ||
|
|
6d1a12af4b | ||
|
|
a40e5dbcd4 | ||
|
|
7c79ca7878 | ||
|
|
93c1600980 | ||
|
|
c3d1e6181f | ||
|
|
87e7f3a61c | ||
|
|
e724f216bf | ||
|
|
e6b379358a | ||
|
|
b0abba15a6 | ||
|
|
81b4874a7c | ||
|
|
f11b9c1e18 | ||
|
|
e15ecc00ce | ||
|
|
3e4c45ac6a | ||
|
|
4115c13a65 | ||
|
|
f872e2ab80 | ||
|
|
a81b1aa0cb | ||
|
|
efc0f1ab91 | ||
|
|
ce31edc803 | ||
|
|
199caccbc3 | ||
|
|
f060309002 | ||
|
|
fc3d86e6ff | ||
|
|
9fd4989142 | ||
|
|
7507a7b459 | ||
|
|
d657817211 | ||
|
|
954649007c | ||
|
|
b0d9903fe2 | ||
|
|
6375f3c445 | ||
|
|
2328f418be | ||
|
|
22b6564847 | ||
|
|
25c8bfefe2 | ||
|
|
30f4524821 | ||
|
|
9e4c3a7200 | ||
|
|
5b7e84c1b0 | ||
|
|
e6097e4968 | ||
|
|
0f2829097b | ||
|
|
e2a9f940e2 | ||
|
|
3eb2b2ac5d | ||
|
|
ce7b0a3b5e | ||
|
|
7bd7c99dd4 | ||
|
|
b0d12c4125 | ||
|
|
745607b5bc | ||
|
|
cc5a770b16 | ||
|
|
fbde0091de | ||
|
|
a533943a40 | ||
|
|
e11f17672c | ||
|
|
c038c99f9d | ||
|
|
5f159c1fbd | ||
|
|
6a19d8246c | ||
|
|
d6bb3a558f | ||
|
|
cd8ca8981b | ||
|
|
a5d7f7acce | ||
|
|
a032c2e326 | ||
|
|
9d770ed436 | ||
|
|
ae753940f3 | ||
|
|
d0d22c333c | ||
|
|
266ba17ebb | ||
|
|
0d0d5bafb0 | ||
|
|
58b951e134 | ||
|
|
30956b5441 | ||
|
|
9540cfe749 | ||
|
|
31b17faa2a | ||
|
|
5c6b8e9e50 | ||
|
|
5a36e8fb11 | ||
|
|
7d4c857a43 | ||
|
|
598bcf675f | ||
|
|
5365786386 | ||
|
|
c9b0a7c2dd | ||
|
|
371d8042d6 | ||
|
|
be343cb21e | ||
|
|
e9eabd6881 | ||
|
|
abccdc7f21 | ||
|
|
4ae914f729 | ||
|
|
86ac955b79 | ||
|
|
9734691cac | ||
|
|
d94f3a477d | ||
|
|
d53cd209f7 | ||
|
|
65cacb39d2 | ||
|
|
b008a6a2aa | ||
|
|
5c29feec63 | ||
|
|
d8e350d603 | ||
|
|
14a3366850 | ||
|
|
5ea0c6fca1 | ||
|
|
f454c29b8c | ||
|
|
fe5132be1d | ||
|
|
b50ba3e0e4 | ||
|
|
4fb40f9077 | ||
|
|
dc7fef6395 | ||
|
|
da65bf7292 | ||
|
|
17d9c2577e | ||
|
|
bc7852c1cc | ||
|
|
51d8792f62 | ||
|
|
bfdbeb0964 | ||
|
|
ede82ad0d5 | ||
|
|
f50dcb9e40 | ||
|
|
676c5e5df5 | ||
|
|
d52be76c8a | ||
|
|
c6a517c88c | ||
|
|
96eb8719b8 | ||
|
|
bcd31610f6 | ||
|
|
a4d66622a5 | ||
|
|
af4f07cb26 | ||
|
|
f7120b32f5 | ||
|
|
273404e24d | ||
|
|
1b53b5b927 | ||
|
|
7c5413e568 | ||
|
|
39b2fe45a5 | ||
|
|
8d3c5d09f6 | ||
|
|
5944fdb5dc | ||
|
|
e120bad779 | ||
|
|
d546a4a15b | ||
|
|
660a2e0ed6 | ||
|
|
1b94cc3ac0 | ||
|
|
4698d5d2fc | ||
|
|
92bc9d81c5 | ||
|
|
952cfaec14 | ||
|
|
637c44aa59 | ||
|
|
6e5fc29dca | ||
|
|
8bd02d0c36 | ||
|
|
c6cfbb8755 | ||
|
|
75d3444391 | ||
|
|
c648e1e8d6 | ||
|
|
e2f42fddb5 | ||
|
|
f93fe684c0 | ||
|
|
ee378ea0c4 | ||
|
|
613d34e6e6 | ||
|
|
4c784af55d | ||
|
|
b28595c814 | ||
|
|
fca7beec01 | ||
|
|
f813f03a46 | ||
|
|
6ff2232df3 | ||
|
|
e3b1f058cd | ||
|
|
542e9cacc2 | ||
|
|
0a0a7ca39b | ||
|
|
cee287da99 | ||
|
|
c8e4df94f9 | ||
|
|
c86e4f52a0 | ||
|
|
44216310ca | ||
|
|
5c69599e78 | ||
|
|
e4098d3991 | ||
|
|
55a94d659b | ||
|
|
7a048d5b32 | ||
|
|
e14dd06a94 | ||
|
|
62332a2b56 | ||
|
|
639030924f | ||
|
|
241b47fe19 | ||
|
|
69beecf334 | ||
|
|
e308e02f9d | ||
|
|
87258e485a | ||
|
|
0682c346ea | ||
|
|
5ae566952b | ||
|
|
18f9ab0cda | ||
|
|
bd4a5ac844 | ||
|
|
257b1f89f3 | ||
|
|
962672564e | ||
|
|
7216c6d62a | ||
|
|
21d3261eec | ||
|
|
03f758720c | ||
|
|
eaa85ae8d5 | ||
|
|
8cb212d897 | ||
|
|
a38d3981df | ||
|
|
af08c077d2 | ||
|
|
84e2489585 | ||
|
|
744375bd5d | ||
|
|
6c1f63bfbb | ||
|
|
7d0267c924 | ||
|
|
daa9cb65e5 | ||
|
|
7072265225 | ||
|
|
8daade0021 | ||
|
|
b4d30b462f | ||
|
|
18acd67b4f | ||
|
|
78ed53f4fb | ||
|
|
d95314c754 | ||
|
|
277cc19ec3 | ||
|
|
67f4553213 | ||
|
|
b2bb656d30 | ||
|
|
ca20f41d0e | ||
|
|
13e8aeae4e | ||
|
|
02308f9e2f | ||
|
|
0fdcbb4611 | ||
|
|
829ccc3466 | ||
|
|
9ac83cf62e | ||
|
|
f760354e82 | ||
|
|
e91e35d508 | ||
|
|
db7e196bf8 | ||
|
|
f5fe4f99f1 | ||
|
|
e2bff36395 | ||
|
|
0a5d7c2100 | ||
|
|
4d42f8ec58 | ||
|
|
81e7b052da | ||
|
|
be44b7e2c7 | ||
|
|
d8a781632c | ||
|
|
3726d6fe3b | ||
|
|
6090a5b274 | ||
|
|
d4fdf6be67 | ||
|
|
1b6cbe5c23 | ||
|
|
1d130a7857 | ||
|
|
f041159aa7 | ||
|
|
f438cbf633 | ||
|
|
51684d18cf | ||
|
|
c13d2ac044 | ||
|
|
6dd1adda2e | ||
|
|
5d0d7391e7 | ||
|
|
d37da58e87 | ||
|
|
1839c1972e | ||
|
|
b7bdcc4e57 | ||
|
|
b59a3b15f3 | ||
|
|
7580f7491a | ||
|
|
f33848e16b | ||
|
|
9b4d3ad6bf | ||
|
|
7b06d4273a | ||
|
|
95f7ea9fc0 | ||
|
|
12b64d1906 | ||
|
|
52db4b3321 | ||
|
|
388c1b4ce4 | ||
|
|
b134cdb90d | ||
|
|
c120dffbf0 | ||
|
|
3578f1b254 | ||
|
|
a7e3548f22 | ||
|
|
272e5380c2 | ||
|
|
b60fd36c6e | ||
|
|
5301798654 | ||
|
|
f7e6d7d143 | ||
|
|
b9649aed32 | ||
|
|
4467c0df31 | ||
|
|
7af3acde9e | ||
|
|
68c1e49f62 | ||
|
|
1e57190b8c | ||
|
|
1b8a4577d5 | ||
|
|
51baed4932 | ||
|
|
2f1f587c50 | ||
|
|
ab1e38dde8 | ||
|
|
dd0d1e700e | ||
|
|
51ebb2579f | ||
|
|
d1d3b805f6 | ||
|
|
a6e247326b | ||
|
|
823b7e2989 | ||
|
|
5f40dc37a2 | ||
|
|
5e5c05f0c6 | ||
|
|
ab1340d213 | ||
|
|
6b6004ee70 | ||
|
|
3cef2bb7e0 | ||
|
|
cc5a0a436c | ||
|
|
495a81768d | ||
|
|
125b37e98f | ||
|
|
f8ad75329d | ||
|
|
cb2efb14f7 | ||
|
|
78327716a4 | ||
|
|
cd71b3daf3 | ||
|
|
5393fa81b9 | ||
|
|
d1efd2137a | ||
|
|
fce8c3a8a0 | ||
|
|
4bd71da056 | ||
|
|
d2e84925f7 | ||
|
|
d81523370e | ||
|
|
6939546f22 | ||
|
|
2ea10206fa | ||
|
|
8aa922c55f | ||
|
|
d66def5530 | ||
|
|
42ecf54df6 | ||
|
|
10835968fb | ||
|
|
1f5588b803 | ||
|
|
202102ebf7 | ||
|
|
9729c89f5d | ||
|
|
71714733ad | ||
|
|
3fbbfce17c | ||
|
|
ad0a08ea0e | ||
|
|
3a2fa4073a | ||
|
|
6c2297c365 | ||
|
|
5e592427e9 | ||
|
|
643541eebd | ||
|
|
13885493ac | ||
|
|
75c9353cbd | ||
|
|
01d9affe61 | ||
|
|
3ad95bec3c | ||
|
|
418b3ee7d6 | ||
|
|
0000f2a34d | ||
|
|
fc5a5f1b73 | ||
|
|
226ab406b2 | ||
|
|
9eaf5d82b6 | ||
|
|
e3d6d242ac | ||
|
|
53184715bc | ||
|
|
1844633ff1 | ||
|
|
7d7682b34e | ||
|
|
83655a749c | ||
|
|
b9444e8197 | ||
|
|
5ff70b2a36 | ||
|
|
4ed559af95 | ||
|
|
ce529a9b9f | ||
|
|
31e472145c | ||
|
|
1664428429 | ||
|
|
1780cb9b91 | ||
|
|
ad32677263 | ||
|
|
0eba4bdd61 | ||
|
|
28238eb5a7 | ||
|
|
cce4f6f7f7 | ||
|
|
6bea3dabbb | ||
|
|
ea46947054 | ||
|
|
22879f8c23 | ||
|
|
77c4423059 | ||
|
|
62a2a4a9f5 | ||
|
|
59690328e2 | ||
|
|
e50ecd613f | ||
|
|
d873a6138a | ||
|
|
8093ae8570 | ||
|
|
98ebb02763 | ||
|
|
ba22b07dce | ||
|
|
d1312703c5 | ||
|
|
8d99a42307 | ||
|
|
3ab93ecdd4 | ||
|
|
6c0d6c5425 | ||
|
|
326f346936 | ||
|
|
8762d0e164 | ||
|
|
2b91edeb74 | ||
|
|
6c49d1aa3f | ||
|
|
f07f086d62 | ||
|
|
c28862f8c7 | ||
|
|
9cfaf567be | ||
|
|
53f453bf34 | ||
|
|
a16032a8ed | ||
|
|
8cec0d8fcd | ||
|
|
6f6f67829b | ||
|
|
94471b6d07 | ||
|
|
7eed9c0584 | ||
|
|
3e717862a4 | ||
|
|
30d88bbe7e | ||
|
|
551e73adef | ||
|
|
99d32c4758 | ||
|
|
9e52c15829 | ||
|
|
71a272f0a6 | ||
|
|
64061c3440 | ||
|
|
1b4f2b9c53 | ||
|
|
d83516584d | ||
|
|
3e34d0badb | ||
|
|
b2e8474df3 | ||
|
|
73ff7e2de4 | ||
|
|
b5d8d34718 | ||
|
|
ac44d22cee | ||
|
|
6e8fa12172 | ||
|
|
deb9c4ecc0 | ||
|
|
d4e6136b09 | ||
|
|
68331fc40c | ||
|
|
3046798ec5 | ||
|
|
c4332658ba | ||
|
|
50e3da0849 | ||
|
|
62cd3b2061 | ||
|
|
7e6dfa7b92 | ||
|
|
7fbebbf361 | ||
|
|
121372802f | ||
|
|
7924907384 | ||
|
|
51d429f9ae | ||
|
|
267aebb9cb | ||
|
|
3f9ebb588e | ||
|
|
f424f07e54 | ||
|
|
e5a21a3261 | ||
|
|
6f0de7c80e | ||
|
|
3ace7eeafd | ||
|
|
eb9f15e4e4 | ||
|
|
bc80569fe9 | ||
|
|
a147458120 | ||
|
|
6182e22d18 | ||
|
|
dda84c5cd5 | ||
|
|
6c15fb6978 | ||
|
|
b17b68c44b | ||
|
|
afdb15dc58 | ||
|
|
98b4b0dce0 | ||
|
|
70f26e0bea | ||
|
|
b6ad396a6c | ||
|
|
e44bb57b0e | ||
|
|
5c10b16b65 | ||
|
|
7ec1d42808 | ||
|
|
03e9e89558 | ||
|
|
3057035dec | ||
|
|
4af72cc7ba | ||
|
|
f6aee81651 | ||
|
|
a22f569ca0 | ||
|
|
8043f5d865 | ||
|
|
2ef50ab71f | ||
|
|
192a4f5e7f | ||
|
|
1af56a7f00 | ||
|
|
d2fab7fddd | ||
|
|
1818b0281d | ||
|
|
09973ba8cf | ||
|
|
dd3174c40f | ||
|
|
f0293b8f52 | ||
|
|
d549a9ad92 | ||
|
|
0385c72a8f | ||
|
|
e223b20cbd | ||
|
|
a0f7e92e40 | ||
|
|
c87ff3ca26 | ||
|
|
82672a825d | ||
|
|
98d524e82d | ||
|
|
3d3090a8f2 | ||
|
|
5561e89201 | ||
|
|
9ed96de237 | ||
|
|
0f2420576a | ||
|
|
d1b74675d9 | ||
|
|
abb81a0bac | ||
|
|
05eb055b8c | ||
|
|
e8ddd6d16d | ||
|
|
8706998c8c | ||
|
|
06e0869767 | ||
|
|
7841fc6d3e | ||
|
|
1f7311deeb | ||
|
|
07a9e69e7b | ||
|
|
9bc8adc715 | ||
|
|
7845ebffc5 | ||
|
|
b985de6df2 | ||
|
|
11f6491889 | ||
|
|
b2ec040a8d | ||
|
|
424a53da4e | ||
|
|
963c289af7 | ||
|
|
c5af71e0a2 | ||
|
|
329008bf6d | ||
|
|
531dbc5f83 | ||
|
|
851a925956 | ||
|
|
5d4e01eea6 | ||
|
|
7484dc5b4c | ||
|
|
e04f5cb277 | ||
|
|
c513cff843 | ||
|
|
a4603a4396 | ||
|
|
bc5eafce66 | ||
|
|
5fb811eb4c | ||
|
|
84a3884ffc | ||
|
|
50ae29a08c | ||
|
|
bf8bfa582a | ||
|
|
492d1ef30e | ||
|
|
bd19c203e1 | ||
|
|
1141f9de86 | ||
|
|
7955a17a17 | ||
|
|
58085e39d1 | ||
|
|
bbc32c4cd0 | ||
|
|
3841039728 | ||
|
|
f04d954882 | ||
|
|
39602ff5f2 | ||
|
|
55ecc7a92c | ||
|
|
1148960d43 | ||
|
|
415107fbf0 | ||
|
|
437cc20198 | ||
|
|
32f78a99fd | ||
|
|
65c7855afd | ||
|
|
7f68e341da | ||
|
|
a2f750ed1a | ||
|
|
b74a42cdf5 | ||
|
|
95b35be541 | ||
|
|
ea747a3d58 | ||
|
|
9b644e3c47 | ||
|
|
3f776397d1 | ||
|
|
1ec75035ba | ||
|
|
97b7b7b968 | ||
|
|
135427dcc8 | ||
|
|
a2de514c05 | ||
|
|
f1bada7fd8 | ||
|
|
ea5d25c794 | ||
|
|
193e420eb3 | ||
|
|
8a972ee543 | ||
|
|
b51eb7326f | ||
|
|
be3b5b7fe2 | ||
|
|
3a7a606f6a | ||
|
|
294fc6b62f | ||
|
|
662a44fccf | ||
|
|
b0a5d4fb6f | ||
|
|
4fb8292618 | ||
|
|
539e5899e3 | ||
|
|
bee9e20827 | ||
|
|
12f527a120 | ||
|
|
bd626899df | ||
|
|
54d036715f | ||
|
|
54c87f81a6 | ||
|
|
5de078dc61 | ||
|
|
ff57de0753 | ||
|
|
9565aee3c5 | ||
|
|
f63da0c58b | ||
|
|
205dbc1a25 | ||
|
|
12c309fd50 | ||
|
|
f04e3d5338 | ||
|
|
dc03d0b300 | ||
|
|
3e16cc4912 | ||
|
|
fcdf252f03 | ||
|
|
b23fea9cb5 | ||
|
|
e714ff35c4 | ||
|
|
4054d0eca7 | ||
|
|
367f9b6232 | ||
|
|
194eb4e266 | ||
|
|
f717eb7388 | ||
|
|
e8f20285af | ||
|
|
0fec9c7c55 | ||
|
|
f8d0ed7ca6 | ||
|
|
020eaef5ba | ||
|
|
973b31521e | ||
|
|
59e513f130 | ||
|
|
62e730b621 | ||
|
|
f4bb62adbc | ||
|
|
48a528a4b8 | ||
|
|
5aba66ea78 | ||
|
|
c5efdf5ae3 | ||
|
|
15958cd4a3 | ||
|
|
edcdc6c97c | ||
|
|
143b807e9b | ||
|
|
861379c227 | ||
|
|
2fb9f62d0b | ||
|
|
84e02fc144 | ||
|
|
57ac90f837 | ||
|
|
10a45ece76 | ||
|
|
c88a177cb2 | ||
|
|
a63dfc4650 | ||
|
|
8924ac2783 | ||
|
|
4fffa2d0ba | ||
|
|
856d2ab266 | ||
|
|
750d2c76f5 | ||
|
|
47157049c0 | ||
|
|
22000f10df | ||
|
|
d802ce1484 | ||
|
|
4b10b9ffc3 | ||
|
|
552408f488 | ||
|
|
4884938036 | ||
|
|
cdcc8cc59a | ||
|
|
f7bd600715 | ||
|
|
0014fec63f | ||
|
|
812efde342 | ||
|
|
889f0e1569 | ||
|
|
3a26c5cd65 | ||
|
|
12a25c37aa | ||
|
|
4706e20a1d | ||
|
|
14c23051ee | ||
|
|
330ddfa3ad | ||
|
|
a1e9a14ef3 | ||
|
|
958f57085f | ||
|
|
646a786b75 | ||
|
|
c8516bc5f4 | ||
|
|
58e87b3ddf | ||
|
|
ea0abb70a2 | ||
|
|
908f9562f6 | ||
|
|
8131d9a640 | ||
|
|
e092f41074 | ||
|
|
79a90dc476 | ||
|
|
25962dbf39 | ||
|
|
8df53e441d | ||
|
|
6f89efa40b | ||
|
|
d6a1b4e71f | ||
|
|
a2c0e53f87 | ||
|
|
013af7619e | ||
|
|
aa302ecc32 | ||
|
|
99b049fe2d | ||
|
|
dbdd1b8671 | ||
|
|
8ba6a7436e | ||
|
|
6e35a9f682 | ||
|
|
78f456911a | ||
|
|
8f5d3dc49c | ||
|
|
97678577fb | ||
|
|
ce67737cc9 | ||
|
|
b9919b0a9c | ||
|
|
226f45d8d5 | ||
|
|
accbf6ecfc | ||
|
|
0aa80d82d9 | ||
|
|
ace5f81a17 | ||
|
|
21a0b33645 | ||
|
|
8b991e11a2 | ||
|
|
8f013776df | ||
|
|
c30aedd309 | ||
|
|
39f303fcd6 | ||
|
|
76c0e140cf | ||
|
|
ccb3c991a6 | ||
|
|
a7932da207 | ||
|
|
5fda20c330 | ||
|
|
1be6e4565f | ||
|
|
e606d0b1de | ||
|
|
b4bcb7ace2 | ||
|
|
a63fee1223 | ||
|
|
ae76ff0aaf | ||
|
|
bba819ba84 | ||
|
|
d0d0da6cb7 | ||
|
|
475113838a | ||
|
|
b8435efc97 | ||
|
|
780e41d6a6 | ||
|
|
6d0b55f753 | ||
|
|
c9fa5c7284 | ||
|
|
e97f4c4054 | ||
|
|
96d15b7505 | ||
|
|
2f77596034 | ||
|
|
5619c105aa | ||
|
|
9a6ee023b3 | ||
|
|
77e2e44abc | ||
|
|
32bddfdd47 | ||
|
|
c9aa654ef0 | ||
|
|
5e501857aa | ||
|
|
6b00aba039 | ||
|
|
14fa9cfa4b | ||
|
|
5633c5224e | ||
|
|
03763a1423 | ||
|
|
cf6df1556c | ||
|
|
cdc8a42393 | ||
|
|
a2fd705153 | ||
|
|
3388f699a0 | ||
|
|
5e197713ff | ||
|
|
50718495da | ||
|
|
b7b604aed4 | ||
|
|
a1f5cabbba | ||
|
|
c2aae6ddf6 | ||
|
|
8a40622815 | ||
|
|
cb88409102 | ||
|
|
b918b75414 | ||
|
|
37f0e36c98 | ||
|
|
c8dc2327a3 | ||
|
|
f660973168 | ||
|
|
cf2e7744f3 | ||
|
|
855d799b21 | ||
|
|
97dd1d0f4f | ||
|
|
5b5553b9a3 | ||
|
|
702545e0b2 | ||
|
|
fa2787eb5d | ||
|
|
0f37b326a0 | ||
|
|
7f9f551cfe | ||
|
|
ecf1847dd2 | ||
|
|
40a9dce869 | ||
|
|
a6696733fa | ||
|
|
d9bd736159 | ||
|
|
4f5f5d31a3 | ||
|
|
fad1325427 | ||
|
|
8b6678a453 | ||
|
|
c7f48a83c0 | ||
|
|
af0f02d63e | ||
|
|
497d63e67e | ||
|
|
4d048af384 | ||
|
|
3649f10600 | ||
|
|
49e69a54bd | ||
|
|
a0acc89fcb | ||
|
|
64d1a82920 | ||
|
|
2396e28479 | ||
|
|
db1ad0df63 | ||
|
|
c5de18caae | ||
|
|
e57774e121 | ||
|
|
b7ee46d400 | ||
|
|
6007132640 | ||
|
|
31b3a4c342 | ||
|
|
73ff852648 | ||
|
|
6d50eb5737 | ||
|
|
3c0b74005b | ||
|
|
93ff667df1 | ||
|
|
a8579fa68a | ||
|
|
10f77fdf1a | ||
|
|
99d824a999 | ||
|
|
97d2b5df15 | ||
|
|
84a9cf7adf | ||
|
|
a49927f173 | ||
|
|
6a5c50ff77 | ||
|
|
c948573c2d | ||
|
|
5233bc501c | ||
|
|
ad96c6f838 | ||
|
|
0e92f68b4a | ||
|
|
ac97e8c613 | ||
|
|
95fe717ca7 | ||
|
|
10b18de3e0 | ||
|
|
08295eb807 | ||
|
|
fce4f0c116 | ||
|
|
cf1424976f | ||
|
|
94e8fce40a | ||
|
|
ea671bf395 | ||
|
|
fdb868516f | ||
|
|
c75bebfc90 | ||
|
|
3e102ef760 | ||
|
|
c07eddbd97 | ||
|
|
e85b925f40 | ||
|
|
27761ba6f2 | ||
|
|
b665698e78 | ||
|
|
97ebe33d68 | ||
|
|
249f7e45fb | ||
|
|
c0612e6193 | ||
|
|
79a789c557 | ||
|
|
450888f542 | ||
|
|
380a08242a | ||
|
|
e653a933f1 | ||
|
|
bda5dffa34 | ||
|
|
29df7e84a1 | ||
|
|
19cf43a10e | ||
|
|
0398ef3b90 | ||
|
|
8c19daf949 | ||
|
|
e4f0688a02 | ||
|
|
25f4fbf2bb | ||
|
|
0533c08438 | ||
|
|
5f0ea85f47 | ||
|
|
6c7c1202ed | ||
|
|
669aa769c2 | ||
|
|
fcf2994015 | ||
|
|
bee21ddc9e | ||
|
|
263e68e677 | ||
|
|
2b958f5724 | ||
|
|
95f7177ef4 | ||
|
|
006324b78e | ||
|
|
efd8c1229d | ||
|
|
0f1aea3e0d | ||
|
|
6a41cbebc9 | ||
|
|
fba95e6a42 | ||
|
|
bffb91f196 | ||
|
|
4573b65639 | ||
|
|
3d8505385a | ||
|
|
95d3a8cc22 | ||
|
|
99c053f86b | ||
|
|
f2dde705ef | ||
|
|
be11fda814 | ||
|
|
0261105c52 | ||
|
|
264047dc0c | ||
|
|
4d84926ed2 | ||
|
|
da3211fee6 | ||
|
|
1388b03cf2 | ||
|
|
9f98b4b082 | ||
|
|
b3f1401ab4 | ||
|
|
e5e3832809 | ||
|
|
2eff7da171 | ||
|
|
e9622bcfe8 | ||
|
|
63ebadc526 | ||
|
|
fe47b07229 | ||
|
|
dc73997be3 | ||
|
|
62315fd478 | ||
|
|
fb81121bd3 | ||
|
|
5293563a6a | ||
|
|
2e1e61dabe | ||
|
|
280d63fde7 | ||
|
|
c6104195f6 | ||
|
|
e55cbb3e3d | ||
|
|
56b85e4194 | ||
|
|
6431c43d0e | ||
|
|
a62107fbd1 | ||
|
|
7959d18248 | ||
|
|
2f66915a9f | ||
|
|
a508177e21 | ||
|
|
5a9d858604 | ||
|
|
514da83961 | ||
|
|
b7bae18849 | ||
|
|
fbde247c72 | ||
|
|
3a69af9034 | ||
|
|
5c87a6cb76 | ||
|
|
9c6bb434e8 | ||
|
|
d1bd303dfa | ||
|
|
3813c32454 | ||
|
|
3b00a692ee | ||
|
|
3304ebe9d3 | ||
|
|
513120cbfe | ||
|
|
b06049d5a3 | ||
|
|
0f50355deb | ||
|
|
bd6e35fea2 | ||
|
|
a4fd63cd44 | ||
|
|
fdc4219b68 | ||
|
|
5b428bb8e6 | ||
|
|
c948ff88a5 | ||
|
|
9b9a0d7060 | ||
|
|
16578e3677 | ||
|
|
be7f84bc67 | ||
|
|
033d26f2cb | ||
|
|
4c0826b1c4 | ||
|
|
c4cc204c94 | ||
|
|
3747db18b1 | ||
|
|
4173625fca | ||
|
|
0e7863a6fb | ||
|
|
207ba00ad2 | ||
|
|
87c89586a5 | ||
|
|
1cea1ced82 | ||
|
|
08732bac0f | ||
|
|
283e8d3c08 | ||
|
|
42a7165596 | ||
|
|
aa3f5001d5 | ||
|
|
56580c4005 | ||
|
|
ba304c9651 | ||
|
|
703c5adba7 | ||
|
|
8b85f6e0a6 | ||
|
|
c136d22382 | ||
|
|
42358419ad | ||
|
|
ab2ced5c37 | ||
|
|
faf31be0dc | ||
|
|
ff4c67d068 | ||
|
|
10b133db02 | ||
|
|
f0bf607b43 | ||
|
|
8948ca5323 | ||
|
|
9c3be51fe9 | ||
|
|
2da9161f29 | ||
|
|
983dad5b53 | ||
|
|
8b23d341b4 | ||
|
|
0ad60013aa | ||
|
|
289815e128 | ||
|
|
f7ee83f1b9 | ||
|
|
f67aafa8d3 | ||
|
|
4e5ddd57bf | ||
|
|
e0d4ecf835 | ||
|
|
81a461115b | ||
|
|
d679b02658 | ||
|
|
5effcdb024 | ||
|
|
211a5eb2bb | ||
|
|
c4465ba58d | ||
|
|
7903c53876 | ||
|
|
dbefe6a560 | ||
|
|
8b1f412255 | ||
|
|
a2e0074061 | ||
|
|
5fc920087b | ||
|
|
085233ab9b | ||
|
|
6657b2629f | ||
|
|
310a279aaf | ||
|
|
58f3a76da7 | ||
|
|
a2c9458b1b | ||
|
|
75bcd9e8d5 | ||
|
|
977e7ef395 | ||
|
|
eb1b8b577f | ||
|
|
28f91685ce | ||
|
|
81a4fe59d9 | ||
|
|
e7189ab81f | ||
|
|
346db89e66 | ||
|
|
f786c7f144 | ||
|
|
51f45293b8 | ||
|
|
943b103001 | ||
|
|
f055d42277 | ||
|
|
fb7a2a8d5d | ||
|
|
1e5ed2a2e3 | ||
|
|
e1467dfe23 | ||
|
|
c480f96d30 | ||
|
|
cf613aafb2 | ||
|
|
20dbf7c5f4 | ||
|
|
47c912c25b | ||
|
|
48fb1a8127 | ||
|
|
6c1b55db16 | ||
|
|
df70c8a800 | ||
|
|
82ae2e7118 | ||
|
|
0cf9b5f3df | ||
|
|
036a825892 | ||
|
|
8b43b31c64 | ||
|
|
3abef972a7 | ||
|
|
30b00741b5 | ||
|
|
f86e743cce | ||
|
|
cb96fb735e | ||
|
|
459a52d31d | ||
|
|
44ef9a13d6 | ||
|
|
0bb3652a63 | ||
|
|
6a82d683a9 | ||
|
|
fad708e8de | ||
|
|
c6a38b8355 | ||
|
|
ee84eb666b | ||
|
|
6d2793cac6 | ||
|
|
86d518fc2e | ||
|
|
25dba1a6d5 | ||
|
|
af949c62c2 | ||
|
|
ea20342d76 | ||
|
|
7732d52583 | ||
|
|
c801bc5e6b | ||
|
|
ea43729063 | ||
|
|
e26bae8027 | ||
|
|
555f155cad | ||
|
|
f8c47f59bc | ||
|
|
f3997128b9 | ||
|
|
154a4e23dd | ||
|
|
52e4e0e569 | ||
|
|
30f2b96c68 | ||
|
|
58c94b7773 | ||
|
|
83203d5f5d | ||
|
|
f77d161643 | ||
|
|
6580b139c0 | ||
|
|
2743c7c6ac | ||
|
|
062f76214e | ||
|
|
ce98ed98a2 | ||
|
|
dce9d93f6c | ||
|
|
f7e35a6cbe | ||
|
|
931335220f | ||
|
|
3ce35a8a4b | ||
|
|
9ac4e5cf6a | ||
|
|
bd77d7eec3 | ||
|
|
b5e48aa509 | ||
|
|
b14c42b6a4 | ||
|
|
ba794ba58c | ||
|
|
b00282590d | ||
|
|
44616c6872 | ||
|
|
aaa2b4c3db | ||
|
|
8974d8e4df | ||
|
|
699063cbb0 | ||
|
|
e76000b713 | ||
|
|
332b372e31 | ||
|
|
cb3fcb7bfa | ||
|
|
bef641609e | ||
|
|
24b52f09df | ||
|
|
942b17b807 | ||
|
|
cf19d7f3ad | ||
|
|
ebd62a4112 | ||
|
|
9af7357ca4 | ||
|
|
0dbc35c252 | ||
|
|
c9f03f1ac5 | ||
|
|
02bd292b8c | ||
|
|
e5f1029d0c | ||
|
|
cae247160f | ||
|
|
6692b1992c | ||
|
|
0937837b7f | ||
|
|
828888490a | ||
|
|
91cb6ba73b | ||
|
|
4ee4d32b2e | ||
|
|
8df630a2f5 | ||
|
|
2cad42870e | ||
|
|
43651135f3 | ||
|
|
6ae42eb787 | ||
|
|
ecaf866613 | ||
|
|
5ea3329b36 | ||
|
|
7bb7149f4c | ||
|
|
5856d043ca | ||
|
|
7cd3e49f04 | ||
|
|
720a163273 | ||
|
|
a9b12e5172 |
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -5,6 +5,9 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate:
|
generate:
|
||||||
name: 'Update node-red-docker image'
|
name: 'Update node-red-docker image'
|
||||||
@@ -26,7 +29,7 @@ jobs:
|
|||||||
path: 'node-red.github.io'
|
path: 'node-red.github.io'
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '16'
|
||||||
- run: node ./node-red/.github/scripts/update-node-red-docker.js
|
- run: node ./node-red/.github/scripts/update-node-red-docker.js
|
||||||
- name: Create Docker Pull Request
|
- name: Create Docker Pull Request
|
||||||
uses: peter-evans/create-pull-request@v2
|
uses: peter-evans/create-pull-request@v2
|
||||||
|
|||||||
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
@@ -6,16 +6,22 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, dev ]
|
branches: [ master, dev ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
checks: write # for coverallsapp/github-action to create new checks
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12, 14, 16]
|
node-version: [14, 16]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
|||||||
3297
CHANGELOG.md
3297
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,9 @@ If you want to raise a pull-request with a new feature, or a refactoring
|
|||||||
of existing code, it may well get rejected if you haven't discussed it on
|
of existing code, it may well get rejected if you haven't discussed it on
|
||||||
the [forum](https://discourse.nodered.org) first.
|
the [forum](https://discourse.nodered.org) first.
|
||||||
|
|
||||||
All contributors need to sign the JS Foundation's Contributor License Agreement.
|
All contributors need to sign the OpenJS Foundation's Contributor License Agreement.
|
||||||
It is an online process and quick to do. You can read the details of the agreement
|
It is an online process and quick to do. If you raise a pull-request without
|
||||||
here: https://cla.js.foundation/node-red/node-red.
|
having signed the CLA, you will be prompted to do so automatically.
|
||||||
|
|
||||||
If you raise a pull-request without having signed the CLA, you will be prompted
|
|
||||||
to do so automatically.
|
|
||||||
|
|
||||||
|
|
||||||
### Code Branches
|
### Code Branches
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ module.exports = function(grunt) {
|
|||||||
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
|
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/user.js",
|
"packages/node_modules/@node-red/editor-client/src/js/user.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/comms.js",
|
"packages/node_modules/@node-red/editor-client/src/js/comms.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/runtime.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/text/bidi.js",
|
"packages/node_modules/@node-red/editor-client/src/js/text/bidi.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
|
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
|
||||||
@@ -165,6 +166,7 @@ module.exports = function(grunt) {
|
|||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/autoComplete.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/autoComplete.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/actions.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/actions.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/diagnostics.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/diff.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/diff.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
|
||||||
@@ -191,6 +193,7 @@ module.exports = function(grunt) {
|
|||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/search.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/search.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/actionList.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/actionList.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js",
|
||||||
"packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js",
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -56,13 +56,13 @@ This project adheres to the [Contributor Covenant 1.4](http://contributor-covena
|
|||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
Node-RED is a project of the [OpenJS Foundation](https://openjsf.org).
|
Node-RED is a project of the [OpenJS Foundation](http://openjsf.org).
|
||||||
|
|
||||||
It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-technology/).
|
It is maintained by:
|
||||||
|
|
||||||
* Nick O'Leary [@knolleary](http://twitter.com/knolleary)
|
|
||||||
* Dave Conway-Jones [@ceejay](http://twitter.com/ceejay)
|
|
||||||
|
|
||||||
|
* Nick O'Leary [@knolleary](http://twitter.com/knolleary)
|
||||||
|
* Dave Conway-Jones [@ceejay](http://twitter.com/ceejay)
|
||||||
|
* And many others...
|
||||||
|
|
||||||
|
|
||||||
## Copyright and license
|
## Copyright and license
|
||||||
|
|||||||
85
package.json
85
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "2.1.4",
|
"version": "3.0.2",
|
||||||
"description": "Low-code programming for event-driven applications",
|
"description": "Low-code programming for event-driven applications",
|
||||||
"homepage": "http://nodered.org",
|
"homepage": "http://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -26,76 +26,77 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": "8.6.0",
|
"acorn": "8.7.1",
|
||||||
"acorn-walk": "8.2.0",
|
"acorn-walk": "8.2.0",
|
||||||
"ajv": "8.8.2",
|
"ajv": "8.11.0",
|
||||||
"async-mutex": "0.3.2",
|
"async-mutex": "0.3.2",
|
||||||
"basic-auth": "2.0.1",
|
"basic-auth": "2.0.1",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.19.0",
|
"body-parser": "1.20.0",
|
||||||
"cheerio": "1.0.0-rc.10",
|
"cheerio": "1.0.0-rc.10",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"content-type": "1.0.4",
|
"content-type": "1.0.4",
|
||||||
"cookie": "0.4.1",
|
"cookie": "0.5.0",
|
||||||
"cookie-parser": "1.4.6",
|
"cookie-parser": "1.4.6",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"cronosjs": "1.7.1",
|
"cronosjs": "1.7.1",
|
||||||
"denque": "2.0.1",
|
"denque": "2.1.0",
|
||||||
"express": "4.17.1",
|
"express": "4.18.1",
|
||||||
"express-session": "1.17.2",
|
"express-session": "1.17.3",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"fs-extra": "10.0.0",
|
"fs-extra": "10.1.0",
|
||||||
"fs.notify": "0.0.4",
|
"got": "11.8.5",
|
||||||
"got": "11.8.3",
|
|
||||||
"hash-sum": "2.0.0",
|
"hash-sum": "2.0.0",
|
||||||
"hpagent": "0.1.2",
|
"hpagent": "1.0.0",
|
||||||
"https-proxy-agent": "5.0.0",
|
"https-proxy-agent": "5.0.1",
|
||||||
"i18next": "21.5.4",
|
"i18next": "21.8.16",
|
||||||
"iconv-lite": "0.6.3",
|
"iconv-lite": "0.6.3",
|
||||||
"is-utf8": "0.2.1",
|
"is-utf8": "0.2.1",
|
||||||
"js-yaml": "3.14.1",
|
"js-yaml": "4.1.0",
|
||||||
"json-stringify-safe": "5.0.1",
|
"json-stringify-safe": "5.0.1",
|
||||||
"jsonata": "1.8.5",
|
"jsonata": "1.8.6",
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "^4.5.0",
|
||||||
"media-typer": "1.1.0",
|
"media-typer": "1.1.0",
|
||||||
"memorystore": "1.6.6",
|
"memorystore": "1.6.7",
|
||||||
"mime": "2.5.2",
|
"mime": "3.0.0",
|
||||||
|
"moment": "2.29.4",
|
||||||
"moment-timezone": "0.5.34",
|
"moment-timezone": "0.5.34",
|
||||||
"mqtt": "4.2.8",
|
"mqtt": "4.3.7",
|
||||||
"multer": "1.4.3",
|
"multer": "1.4.5-lts.1",
|
||||||
"mustache": "4.2.0",
|
"mustache": "4.2.0",
|
||||||
"node-red-admin": "^2.2.1",
|
"node-red-admin": "^3.0.0",
|
||||||
|
"node-watch": "0.7.3",
|
||||||
"nopt": "5.0.0",
|
"nopt": "5.0.0",
|
||||||
"oauth2orize": "1.11.1",
|
"oauth2orize": "1.11.1",
|
||||||
"on-headers": "1.0.2",
|
"on-headers": "1.0.2",
|
||||||
"passport": "0.5.0",
|
"passport": "0.6.0",
|
||||||
"passport-http-bearer": "1.0.1",
|
"passport-http-bearer": "1.0.1",
|
||||||
"passport-oauth2-client-password": "0.1.2",
|
"passport-oauth2-client-password": "0.1.2",
|
||||||
"raw-body": "2.4.2",
|
"raw-body": "2.5.1",
|
||||||
"semver": "7.3.5",
|
"semver": "7.3.7",
|
||||||
"tar": "6.1.11",
|
"tar": "6.1.11",
|
||||||
"tough-cookie": "4.0.0",
|
"tough-cookie": "4.0.0",
|
||||||
"uglify-js": "3.14.4",
|
"uglify-js": "3.16.3",
|
||||||
"uuid": "8.3.2",
|
"uuid": "8.3.2",
|
||||||
"ws": "7.5.1",
|
"ws": "7.5.6",
|
||||||
"xml2js": "0.4.23"
|
"xml2js": "0.4.23"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"bcrypt": "5.0.1"
|
"bcrypt": "5.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dompurify": "2.3.3",
|
"dompurify": "2.3.10",
|
||||||
"grunt": "1.4.1",
|
"grunt": "1.5.3",
|
||||||
"grunt-chmod": "~1.1.1",
|
"grunt-chmod": "~1.1.1",
|
||||||
"grunt-cli": "~1.4.3",
|
"grunt-cli": "~1.4.3",
|
||||||
"grunt-concurrent": "3.0.0",
|
"grunt-concurrent": "3.0.0",
|
||||||
"grunt-contrib-clean": "~2.0.0",
|
"grunt-contrib-clean": "2.0.1",
|
||||||
"grunt-contrib-compress": "2.0.0",
|
"grunt-contrib-compress": "2.0.0",
|
||||||
"grunt-contrib-concat": "~1.0.1",
|
"grunt-contrib-concat": "2.1.0",
|
||||||
"grunt-contrib-copy": "~1.0.0",
|
"grunt-contrib-copy": "1.0.0",
|
||||||
"grunt-contrib-jshint": "3.1.1",
|
"grunt-contrib-jshint": "3.2.0",
|
||||||
"grunt-contrib-uglify": "5.0.1",
|
"grunt-contrib-uglify": "5.2.2",
|
||||||
"grunt-contrib-watch": "~1.1.0",
|
"grunt-contrib-watch": "1.1.0",
|
||||||
"grunt-jsdoc": "2.4.1",
|
"grunt-jsdoc": "2.4.1",
|
||||||
"grunt-jsdoc-to-markdown": "6.0.0",
|
"grunt-jsdoc-to-markdown": "6.0.0",
|
||||||
"grunt-jsonlint": "2.1.3",
|
"grunt-jsonlint": "2.1.3",
|
||||||
@@ -104,22 +105,22 @@
|
|||||||
"grunt-sass": "~3.1.0",
|
"grunt-sass": "~3.1.0",
|
||||||
"grunt-simple-mocha": "~0.4.1",
|
"grunt-simple-mocha": "~0.4.1",
|
||||||
"grunt-simple-nyc": "^3.0.1",
|
"grunt-simple-nyc": "^3.0.1",
|
||||||
"i18next-http-backend": "1.3.1",
|
"i18next-http-backend": "1.4.1",
|
||||||
"jquery-i18next": "1.2.1",
|
"jquery-i18next": "1.2.1",
|
||||||
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
|
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
|
||||||
"marked": "3.0.7",
|
"marked": "4.0.18",
|
||||||
"minami": "1.2.3",
|
"minami": "1.2.3",
|
||||||
"mocha": "9.1.3",
|
"mocha": "9.2.2",
|
||||||
"node-red-node-test-helper": "^0.2.7",
|
"node-red-node-test-helper": "^0.3.0",
|
||||||
"nodemon": "2.0.15",
|
"nodemon": "2.0.19",
|
||||||
"proxy": "^1.0.2",
|
"proxy": "^1.0.2",
|
||||||
"sass": "1.44.0",
|
"sass": "1.54.2",
|
||||||
"should": "13.2.3",
|
"should": "13.2.3",
|
||||||
"sinon": "11.1.2",
|
"sinon": "11.1.2",
|
||||||
"stoppable": "^1.1.0",
|
"stoppable": "^1.1.0",
|
||||||
"supertest": "6.1.6"
|
"supertest": "6.2.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright JS Foundation and other contributors, http://js.foundation
|
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
|
|||||||
23
packages/node_modules/@node-red/editor-api/lib/admin/diagnostics.js
vendored
Normal file
23
packages/node_modules/@node-red/editor-api/lib/admin/diagnostics.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
let runtimeAPI;
|
||||||
|
let settings;
|
||||||
|
const apiUtil = require("../util");
|
||||||
|
module.exports = {
|
||||||
|
init: function(_settings, _runtimeAPI) {
|
||||||
|
settings = _settings;
|
||||||
|
runtimeAPI = _runtimeAPI;
|
||||||
|
},
|
||||||
|
getReport: function(req, res) {
|
||||||
|
const diagnosticsOpts = settings.diagnostics || {};
|
||||||
|
const opts = {
|
||||||
|
user: req.user,
|
||||||
|
scope: diagnosticsOpts.level || "basic"
|
||||||
|
}
|
||||||
|
if(diagnosticsOpts.enabled === false || diagnosticsOpts.enabled === "false") {
|
||||||
|
apiUtil.rejectHandler(req, res, {message: "diagnostics are disabled", status: 403, code: "diagnostics.disabled" })
|
||||||
|
} else {
|
||||||
|
runtimeAPI.diagnostics.get(opts)
|
||||||
|
.then(function(result) { res.json(result); })
|
||||||
|
.catch(err => apiUtil.rejectHandler(req, res, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,5 +68,28 @@ module.exports = {
|
|||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
apiUtils.rejectHandler(req,res,err);
|
apiUtils.rejectHandler(req,res,err);
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getState: function(req,res) {
|
||||||
|
const opts = {
|
||||||
|
user: req.user,
|
||||||
|
req: apiUtils.getRequestLogObject(req)
|
||||||
|
}
|
||||||
|
runtimeAPI.flows.getState(opts).then(function(result) {
|
||||||
|
res.json(result);
|
||||||
|
}).catch(function(err) {
|
||||||
|
apiUtils.rejectHandler(req,res,err);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
postState: function(req,res) {
|
||||||
|
const opts = {
|
||||||
|
user: req.user,
|
||||||
|
state: req.body.state || "",
|
||||||
|
req: apiUtils.getRequestLogObject(req)
|
||||||
|
}
|
||||||
|
runtimeAPI.flows.setState(opts).then(function(result) {
|
||||||
|
res.json(result);
|
||||||
|
}).catch(function(err) {
|
||||||
|
apiUtils.rejectHandler(req,res,err);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ var context = require("./context");
|
|||||||
var auth = require("../auth");
|
var auth = require("../auth");
|
||||||
var info = require("./settings");
|
var info = require("./settings");
|
||||||
var plugins = require("./plugins");
|
var plugins = require("./plugins");
|
||||||
|
var diagnostics = require("./diagnostics");
|
||||||
|
|
||||||
var apiUtil = require("../util");
|
var apiUtil = require("../util");
|
||||||
|
|
||||||
@@ -34,6 +35,7 @@ module.exports = {
|
|||||||
context.init(runtimeAPI);
|
context.init(runtimeAPI);
|
||||||
info.init(settings,runtimeAPI);
|
info.init(settings,runtimeAPI);
|
||||||
plugins.init(runtimeAPI);
|
plugins.init(runtimeAPI);
|
||||||
|
diagnostics.init(settings, runtimeAPI);
|
||||||
|
|
||||||
var needsPermission = auth.needsPermission;
|
var needsPermission = auth.needsPermission;
|
||||||
|
|
||||||
@@ -52,6 +54,12 @@ module.exports = {
|
|||||||
adminApp.get("/flows",needsPermission("flows.read"),flows.get,apiUtil.errorHandler);
|
adminApp.get("/flows",needsPermission("flows.read"),flows.get,apiUtil.errorHandler);
|
||||||
adminApp.post("/flows",needsPermission("flows.write"),flows.post,apiUtil.errorHandler);
|
adminApp.post("/flows",needsPermission("flows.write"),flows.post,apiUtil.errorHandler);
|
||||||
|
|
||||||
|
// Flows/state
|
||||||
|
adminApp.get("/flows/state", needsPermission("flows.read"), flows.getState, apiUtil.errorHandler);
|
||||||
|
if (settings.runtimeState && settings.runtimeState.enabled === true) {
|
||||||
|
adminApp.post("/flows/state", needsPermission("flows.write"), flows.postState, apiUtil.errorHandler);
|
||||||
|
}
|
||||||
|
|
||||||
// Flow
|
// Flow
|
||||||
adminApp.get("/flow/:id",needsPermission("flows.read"),flow.get,apiUtil.errorHandler);
|
adminApp.get("/flow/:id",needsPermission("flows.read"),flow.get,apiUtil.errorHandler);
|
||||||
adminApp.post("/flow",needsPermission("flows.write"),flow.post,apiUtil.errorHandler);
|
adminApp.post("/flow",needsPermission("flows.write"),flow.post,apiUtil.errorHandler);
|
||||||
@@ -95,6 +103,8 @@ module.exports = {
|
|||||||
adminApp.get("/plugins", needsPermission("plugins.read"), plugins.getAll, apiUtil.errorHandler);
|
adminApp.get("/plugins", needsPermission("plugins.read"), plugins.getAll, apiUtil.errorHandler);
|
||||||
adminApp.get("/plugins/messages", needsPermission("plugins.read"), plugins.getCatalogs, apiUtil.errorHandler);
|
adminApp.get("/plugins/messages", needsPermission("plugins.read"), plugins.getCatalogs, apiUtil.errorHandler);
|
||||||
|
|
||||||
|
adminApp.get("/diagnostics", needsPermission("diagnostics.read"), diagnostics.getReport, apiUtil.errorHandler);
|
||||||
|
|
||||||
return adminApp;
|
return adminApp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,9 +106,15 @@ async function login(req,res) {
|
|||||||
urlPrefix += "/";
|
urlPrefix += "/";
|
||||||
}
|
}
|
||||||
response = {
|
response = {
|
||||||
"type":"strategy",
|
"type":"strategy"
|
||||||
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
|
||||||
}
|
}
|
||||||
|
if (mergedAdminAuth.strategy.autoLogin) {
|
||||||
|
response.autoLogin = true
|
||||||
|
response.loginRedirect = urlPrefix + "auth/strategy"
|
||||||
|
}
|
||||||
|
response.prompts = [
|
||||||
|
{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}
|
||||||
|
]
|
||||||
if (mergedAdminAuth.strategy.icon) {
|
if (mergedAdminAuth.strategy.icon) {
|
||||||
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
|
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
|
||||||
}
|
}
|
||||||
@@ -185,7 +191,7 @@ function genericStrategy(adminApp,strategy) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
options.verify.apply(null,args);
|
options.verify.apply(this,args);
|
||||||
} else {
|
} else {
|
||||||
var profile = arguments[arguments.length - 2];
|
var profile = arguments[arguments.length - 2];
|
||||||
return completeVerify(profile,originalDone);
|
return completeVerify(profile,originalDone);
|
||||||
|
|||||||
@@ -92,10 +92,16 @@ var passwordTokenExchange = function(client, username, password, scope, done) {
|
|||||||
loginAttempts = loginAttempts.filter(function(logEntry) {
|
loginAttempts = loginAttempts.filter(function(logEntry) {
|
||||||
return logEntry.user !== username;
|
return logEntry.user !== username;
|
||||||
});
|
});
|
||||||
Tokens.create(username,client.id,scope).then(function(tokens) {
|
// Check if the user contains a user defined token and use it
|
||||||
log.audit({event: "auth.login",user,username:username,client:client.id,scope:scope});
|
// instead of generating a new token
|
||||||
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
|
if(user.token){
|
||||||
});
|
done(null,user.token,null,null);
|
||||||
|
} else {
|
||||||
|
Tokens.create(username,client.id,scope).then(function(tokens) {
|
||||||
|
log.audit({event: "auth.login",user,username:username,client:client.id,scope:scope});
|
||||||
|
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.audit({event: "auth.login.fail.permissions",username:username,client:client.id,scope:scope});
|
log.audit({event: "auth.login.fail.permissions",username:username,client:client.id,scope:scope});
|
||||||
done(null,false);
|
done(null,false);
|
||||||
@@ -146,7 +152,7 @@ function authenticateUserToken(req) {
|
|||||||
} else {
|
} else {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
});
|
}).catch(reject);
|
||||||
} else {
|
} else {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
@@ -163,6 +169,9 @@ TokensStrategy.prototype.authenticate = function(req) {
|
|||||||
authenticateUserToken(req).then(user => {
|
authenticateUserToken(req).then(user => {
|
||||||
this.success(user,{scope:user.permissions});
|
this.success(user,{scope:user.permissions});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
if (err) {
|
||||||
|
log.trace("token authentication failure: "+err.stack?err.stack:err)
|
||||||
|
}
|
||||||
this.fail(401);
|
this.fail(401);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req.body.active) {
|
if (req.body.active) {
|
||||||
|
opts.clearContext = req.body.hasOwnProperty('clearContext')?req.body.clearContext:true
|
||||||
runtimeAPI.projects.setActiveProject(opts).then(function() {
|
runtimeAPI.projects.setActiveProject(opts).then(function() {
|
||||||
listProjects(req,res);
|
listProjects(req,res);
|
||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
|
|||||||
@@ -101,7 +101,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
themeSettings = null;
|
themeSettings = null;
|
||||||
theme = settings.editorTheme || {};
|
theme = settings.editorTheme || {};
|
||||||
themeContext.asset.vendorMonaco = ((theme.codeEditor || {}).lib === "monaco") ? "vendor/monaco/monaco-bootstrap.js" : "";
|
themeContext.asset.vendorMonaco = "vendor/monaco/monaco-bootstrap.js"
|
||||||
|
if (theme.codeEditor && theme.codeEditor.lib === 'ace') {
|
||||||
|
themeContext.asset.vendorMonaco = ''
|
||||||
|
}
|
||||||
activeTheme = theme.theme;
|
activeTheme = theme.theme;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -263,9 +266,69 @@ module.exports = {
|
|||||||
theme.page = theme.page || {_:{}}
|
theme.page = theme.page || {_:{}}
|
||||||
theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
|
theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
|
||||||
}
|
}
|
||||||
if(theme.codeEditor) {
|
// check and load page settings from theme
|
||||||
theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
|
if (themePlugin.page) {
|
||||||
|
if (themePlugin.page.favicon && !theme.page.favicon) {
|
||||||
|
const result = serveFilesFromTheme(
|
||||||
|
[themePlugin.page.favicon],
|
||||||
|
themeApp,
|
||||||
|
"/",
|
||||||
|
themePlugin.path
|
||||||
|
)
|
||||||
|
if(result && result.length > 0) {
|
||||||
|
// update themeContext page favicon
|
||||||
|
themeContext.page.favicon = result[0]
|
||||||
|
theme.page = theme.page || {_:{}}
|
||||||
|
theme.page._.favicon = result[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (themePlugin.page.tabicon && themePlugin.page.tabicon.icon && !theme.page.tabicon) {
|
||||||
|
const result = serveFilesFromTheme(
|
||||||
|
[themePlugin.page.tabicon.icon],
|
||||||
|
themeApp,
|
||||||
|
"/page/",
|
||||||
|
themePlugin.path
|
||||||
|
)
|
||||||
|
if(result && result.length > 0) {
|
||||||
|
// update themeContext page tabicon
|
||||||
|
themeContext.page.tabicon.icon = result[0]
|
||||||
|
themeContext.page.tabicon.colour = themeContext.page.tabicon.colour || themeContext.page.tabicon.colour
|
||||||
|
theme.page = theme.page || {_:{}}
|
||||||
|
theme.page._.tabicon = theme.page._.tabicon || {}
|
||||||
|
theme.page._.tabicon.icon = themeContext.page.tabicon.icon
|
||||||
|
theme.page._.tabicon.colour = themeContext.page.tabicon.colour
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if the plugin has a title AND the users settings.js does NOT
|
||||||
|
if (themePlugin.page.title && !theme.page.title) {
|
||||||
|
themeContext.page.title = themePlugin.page.title || themeContext.page.title
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// check and load header settings from theme
|
||||||
|
if (themePlugin.header) {
|
||||||
|
if (themePlugin.header.image && !theme.header.image) {
|
||||||
|
const result = serveFilesFromTheme(
|
||||||
|
[themePlugin.header.image],
|
||||||
|
themeApp,
|
||||||
|
"/header/",
|
||||||
|
themePlugin.path
|
||||||
|
)
|
||||||
|
if(result && result.length > 0) {
|
||||||
|
// update themeContext header image
|
||||||
|
themeContext.header.image = result[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if the plugin has a title AND the users settings.js does NOT have a title
|
||||||
|
if (themePlugin.header.title && !theme.header.title) {
|
||||||
|
themeContext.header.title = themePlugin.header.title || themeContext.header.title
|
||||||
|
}
|
||||||
|
// if the plugin has a header url AND the users settings.js does NOT
|
||||||
|
if (themePlugin.header.url && !theme.header.url) {
|
||||||
|
themeContext.header.url = themePlugin.header.url || themeContext.header.url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theme.codeEditor = theme.codeEditor || {}
|
||||||
|
theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
|
||||||
}
|
}
|
||||||
activeThemeInitialised = true;
|
activeThemeInitialised = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ function init(settings,_server,storage,runtimeAPI) {
|
|||||||
auth.getToken,
|
auth.getToken,
|
||||||
auth.errorHandler
|
auth.errorHandler
|
||||||
);
|
);
|
||||||
|
} else if (settings.adminAuth.tokens) {
|
||||||
|
adminApp.use(passport.initialize());
|
||||||
}
|
}
|
||||||
adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler);
|
adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-api",
|
"name": "@node-red/editor-api",
|
||||||
"version": "2.1.4",
|
"version": "3.0.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,23 +16,23 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/util": "2.1.4",
|
"@node-red/util": "3.0.2",
|
||||||
"@node-red/editor-client": "2.1.4",
|
"@node-red/editor-client": "3.0.2",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.19.0",
|
"body-parser": "1.20.0",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"express-session": "1.17.2",
|
"express-session": "1.17.3",
|
||||||
"express": "4.17.1",
|
"express": "4.18.1",
|
||||||
"memorystore": "1.6.6",
|
"memorystore": "1.6.7",
|
||||||
"mime": "2.5.2",
|
"mime": "3.0.0",
|
||||||
"multer": "1.4.3",
|
"multer": "1.4.5-lts.1",
|
||||||
"mustache": "4.2.0",
|
"mustache": "4.2.0",
|
||||||
"oauth2orize": "1.11.1",
|
"oauth2orize": "1.11.1",
|
||||||
"passport-http-bearer": "1.0.1",
|
"passport-http-bearer": "1.0.1",
|
||||||
"passport-oauth2-client-password": "0.1.2",
|
"passport-oauth2-client-password": "0.1.2",
|
||||||
"passport": "0.5.0",
|
"passport": "0.6.0",
|
||||||
"ws": "7.5.1"
|
"ws": "7.5.6"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"bcrypt": "5.0.1"
|
"bcrypt": "5.0.1"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright JS Foundation and other contributors, http://js.foundation
|
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
|
|||||||
269
packages/node_modules/@node-red/editor-client/locales/de/editor.json
vendored
Executable file → Normal file
269
packages/node_modules/@node-red/editor-client/locales/de/editor.json
vendored
Executable file → Normal file
@@ -44,7 +44,8 @@
|
|||||||
"loadNodes": "Lade Nodes __count__",
|
"loadNodes": "Lade Nodes __count__",
|
||||||
"loadFlows": "Lade Flows",
|
"loadFlows": "Lade Flows",
|
||||||
"importFlows": "Füge Flows dem Arbeitsbereich hinzu",
|
"importFlows": "Füge Flows dem Arbeitsbereich hinzu",
|
||||||
"importError": "<p>Fehler beim Laden von Flows.</p><p>__message__</p>"
|
"importError": "<p>Fehler beim Laden von Flows.</p><p>__message__</p>",
|
||||||
|
"loadingProject": "Lade Projekt"
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"defaultName": "Flow __number__",
|
"defaultName": "Flow __number__",
|
||||||
@@ -53,7 +54,16 @@
|
|||||||
"delete": "Sind Sie sicher, dass '__label__' gelöscht werden soll?",
|
"delete": "Sind Sie sicher, dass '__label__' gelöscht werden soll?",
|
||||||
"dropFlowHere": "Hier kann der Flow eingefügt werden",
|
"dropFlowHere": "Hier kann der Flow eingefügt werden",
|
||||||
"addFlow": "Flow hinzufügen",
|
"addFlow": "Flow hinzufügen",
|
||||||
|
"addFlowToRight": "Flow zum Arbeitsbereich rechts hinzufügen",
|
||||||
|
"hideFlow": "Flow ausblenden",
|
||||||
|
"hideOtherFlows": "Andere Flows ausblenden",
|
||||||
|
"showAllFlows": "Alle Flows anzeigen",
|
||||||
|
"hideAllFlows": "Alle Flows ausblenden",
|
||||||
|
"hiddenFlows": "Liste __count__ ausgeblendeten Flow auf",
|
||||||
|
"hiddenFlows_plural": "Liste __count__ ausgeblendete Flows auf",
|
||||||
|
"showLastHiddenFlow": "Letzten ausgeblendeten Flow anzeigen",
|
||||||
"listFlows": "Flows auflisten",
|
"listFlows": "Flows auflisten",
|
||||||
|
"listSubflows": "Subflows auflisten",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"enabled": "Aktiviert",
|
"enabled": "Aktiviert",
|
||||||
"disabled": "Deaktiviert",
|
"disabled": "Deaktiviert",
|
||||||
@@ -65,6 +75,8 @@
|
|||||||
"view": {
|
"view": {
|
||||||
"view": "Ansicht",
|
"view": "Ansicht",
|
||||||
"grid": "Raster",
|
"grid": "Raster",
|
||||||
|
"storeZoom": "Zoomstufe beim Laden wiederherstellen",
|
||||||
|
"storePosition": "Scrollposition beim Laden wiederherstellen",
|
||||||
"showGrid": "Raster anzeigen",
|
"showGrid": "Raster anzeigen",
|
||||||
"snapGrid": "Am Raster ausrichten",
|
"snapGrid": "Am Raster ausrichten",
|
||||||
"gridSize": "Rastergröße",
|
"gridSize": "Rastergröße",
|
||||||
@@ -82,6 +94,7 @@
|
|||||||
"palette": {
|
"palette": {
|
||||||
"show": "Palette anzeigen"
|
"show": "Palette anzeigen"
|
||||||
},
|
},
|
||||||
|
"edit": "Bearbeiten",
|
||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"userSettings": "Einstellungen",
|
"userSettings": "Einstellungen",
|
||||||
"nodes": "Nodes",
|
"nodes": "Nodes",
|
||||||
@@ -92,7 +105,7 @@
|
|||||||
"search": "Flows durchsuchen",
|
"search": "Flows durchsuchen",
|
||||||
"searchInput": "Flows durchsuchen",
|
"searchInput": "Flows durchsuchen",
|
||||||
"subflows": "Subflow",
|
"subflows": "Subflow",
|
||||||
"createSubflow": "Erstellen",
|
"createSubflow": "Hinzufügen",
|
||||||
"selectionToSubflow": "Auswahl in Subflow umwandeln",
|
"selectionToSubflow": "Auswahl in Subflow umwandeln",
|
||||||
"flows": "Flow",
|
"flows": "Flow",
|
||||||
"add": "Hinzufügen",
|
"add": "Hinzufügen",
|
||||||
@@ -104,24 +117,43 @@
|
|||||||
"editPalette": "Palette verwalten",
|
"editPalette": "Palette verwalten",
|
||||||
"other": "Sonstige",
|
"other": "Sonstige",
|
||||||
"showTips": "Tipps anzeigen",
|
"showTips": "Tipps anzeigen",
|
||||||
|
"showWelcomeTours": "Geführte Touren für neue Versionen anzeigen",
|
||||||
"help": "Node-RED-Website",
|
"help": "Node-RED-Website",
|
||||||
"projects": "Projekt",
|
"projects": "Projekte",
|
||||||
"projects-new": "Neu",
|
"projects-new": "Neu",
|
||||||
"projects-open": "Öffnen",
|
"projects-open": "Öffnen",
|
||||||
"projects-settings": "Einstellungen",
|
"projects-settings": "Einstellungen",
|
||||||
"showNodeLabelDefault": "Zeige Namen von neu hinzugefügten Nodes",
|
"showNodeLabelDefault": "Zeige Namen von neu hinzugefügten Nodes",
|
||||||
"groups": "Gruppe",
|
"codeEditor": "Code-Editor",
|
||||||
|
"groups": "Gruppen",
|
||||||
"groupSelection": "Auswahl gruppieren",
|
"groupSelection": "Auswahl gruppieren",
|
||||||
"ungroupSelection": "Gruppe auflösen",
|
"ungroupSelection": "Gruppe auflösen",
|
||||||
"groupMergeSelection": "Auswahl der Gruppe hinzufügen",
|
"groupMergeSelection": "Auswahl der Gruppe hinzufügen",
|
||||||
"groupRemoveSelection": "Auswahl aus der Gruppe entfernen"
|
"groupRemoveSelection": "Auswahl aus der Gruppe entfernen",
|
||||||
|
"arrange": "Anordnen",
|
||||||
|
"alignLeft": "Links ausrichten",
|
||||||
|
"alignCenter": "Zentrieren",
|
||||||
|
"alignRight": "Rechts ausrichten",
|
||||||
|
"alignTop": "Oben ausrichten",
|
||||||
|
"alignMiddle": "Mittig ausrichten",
|
||||||
|
"alignBottom": "Unten ausrichten",
|
||||||
|
"distributeHorizontally": "Horizontal verteilen",
|
||||||
|
"distributeVertically": "Vertikal verteilen",
|
||||||
|
"moveToBack": "Nach hinten verschieben",
|
||||||
|
"moveToFront": "Nach vorne verschieben",
|
||||||
|
"moveBackwards": "Rückwärts verschieben",
|
||||||
|
"moveForwards": "Vorwärts verschieben"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"toggle-navigator": "Navigator ein-/ausblenden",
|
"toggle-navigator": "Navigator ein-/ausblenden",
|
||||||
"zoom-out": "Verkleinern",
|
"zoom-out": "Verkleinern",
|
||||||
"zoom-reset": "Vergrößerung rücksetzen",
|
"zoom-reset": "Vergrößerung rücksetzen",
|
||||||
"zoom-in": "Vergrößern"
|
"zoom-in": "Vergrößern",
|
||||||
|
"search-flows": "Flows durchsuchen",
|
||||||
|
"search-prev": "Vorherige",
|
||||||
|
"search-next": "Nächste",
|
||||||
|
"search-counter": "\"__term__\" __result__ von __count__"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"loggedInAs": "Angemeldet als __name__",
|
"loggedInAs": "Angemeldet als __name__",
|
||||||
@@ -131,48 +163,52 @@
|
|||||||
"loginFailed": "Anmeldung fehlgeschlagen",
|
"loginFailed": "Anmeldung fehlgeschlagen",
|
||||||
"notAuthorized": "Nicht berechtigt",
|
"notAuthorized": "Nicht berechtigt",
|
||||||
"errors": {
|
"errors": {
|
||||||
"settings": "Sie müssen angemeldet sein, um auf die Einstellungen zuzugreifen zu können",
|
"settings": "Sie müssen angemeldet sein, um auf die Einstellungen zugreifen zu können",
|
||||||
"deploy": "Sie müssen angemeldet sein, um Änderungen übernehmen (deploy) zu können",
|
"deploy": "Sie müssen angemeldet sein, um Änderungen übernehmen (deploy) zu können",
|
||||||
"notAuthorized": "Sie müssen angemeldet sein, um diese Aktion ausführen zu können"
|
"notAuthorized": "Sie müssen angemeldet sein, um diese Aktion ausführen zu können"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"warning": "<strong>Warnung:</strong> __message__",
|
"state": {
|
||||||
|
"flowsStopped": "Flows gestoppt",
|
||||||
|
"flowsStarted": "Flows gestartet"
|
||||||
|
},
|
||||||
|
"warning": "<strong>Warnung</strong>: __message__",
|
||||||
"warnings": {
|
"warnings": {
|
||||||
"undeployedChanges": "Node hat nicht übernommene (deploy) Änderungen",
|
"undeployedChanges": "Node hat nicht übernommene (deploy) Änderungen",
|
||||||
"nodeActionDisabled": "Node-Aktionen deaktiviert",
|
"nodeActionDisabled": "Node-Aktionen deaktiviert",
|
||||||
"nodeActionDisabledSubflow": "Node-Aktionen deaktiviert im Subflow",
|
"nodeActionDisabledSubflow": "Node-Aktionen innerhalb des Subflows deaktiviert",
|
||||||
"missing-types": "<p>Flows gestoppt aufgrund fehlender Node-Typen</p>",
|
"missing-types": "<p>Flows gestoppt aufgrund fehlender Node-Typen</p>",
|
||||||
"missing-modules": "<p>Flows angehalten aufgrund fehlender Module</p>",
|
"missing-modules": "<p>Flows angehalten aufgrund fehlender Module</p>",
|
||||||
"safe-mode": "<p>Flows sind im abgesicherten Modus gestoppt.</p><p>Flows können bearbeitet und übernommen (deploy) werden, um sie neu zu starten.</p>",
|
"safe-mode": "<p>Flows sind im abgesicherten Modus gestoppt.</p><p>Flows können bearbeitet und übernommen (deploy) werden, um sie neu zu starten.</p>",
|
||||||
"restartRequired": "Node-RED muss neu gestartet werden, damit die Module nach Upgrade aktiviert werden",
|
"restartRequired": "Node-RED muss neu gestartet werden, damit die Module nach Upgrade aktiviert werden",
|
||||||
"credentials_load_failed": "<p>Flows gestoppt, da die Berechtigungen nicht entschlüsselt werden konnten.</p><p>Die Datei mit dem Flow-Berechtigungen ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p>",
|
"credentials_load_failed": "<p>Flows gestoppt, da die Credentials nicht entschlüsselt werden konnten.</p><p>Die Datei mit den Flow-Credentials ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p>",
|
||||||
"credentials_load_failed_reset": "<p>Die Berechtigungen konnten nicht entschlüsselt werden.</p><p>Die Datei mit den Flow-Berechtigungen ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p><p>Die Datei mit den Flow-Berechtigungen wird bei der nächsten Übernahme (deploy) zurückgesetzt. Alle vorhandenen Flow-Berechtigungen werden gelöscht.</p>",
|
"credentials_load_failed_reset": "<p>Die Credentials konnten nicht entschlüsselt werden.</p><p>Die Datei mit den Flow-Credentials ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p><p>Die Datei mit den Flow-Credentials wird bei der nächsten Übernahme (deploy) zurückgesetzt. Alle vorhandenen Flow-Credentials werden gelöscht.</p>",
|
||||||
"missing_flow_file": "<p>Die Flow-Datei des Projekts wurde nicht gefunden.</p><p>Das Projekt ist nicht mit einer Flow-Datei konfiguriert.</p>",
|
"missing_flow_file": "<p>Die Flow-Datei des Projekts wurde nicht gefunden.</p><p>Das Projekt ist nicht mit einer Flow-Datei konfiguriert.</p>",
|
||||||
"missing_package_file": "<p>Die Paket-Datei des Projekts wurde nicht gefunden.</p><p>In dem Projekt fehlt die 'package.json'-Datei.</p>",
|
"missing_package_file": "<p>Die Paket-Datei des Projekts wurde nicht gefunden.</p><p>In dem Projekt fehlt die 'package.json'-Datei.</p>",
|
||||||
"project_empty": "<p>Das Projekt ist leer.</p><p>Soll ein Standardsatz an Projektdateien erstellen werden?<br/>Andernfalls müssen die Dateien manuell außerhalb des Editors dem Projekt hinzugefügt werden.</p>",
|
"project_empty": "<p>Das Projekt ist leer.</p><p>Soll ein Standardsatz an Projektdateien erstellen werden?<br/>Andernfalls müssen die Dateien manuell außerhalb des Editors dem Projekt hinzugefügt werden.</p>",
|
||||||
"project_not_found": "<p>Das Projekt '__project__' wurde nicht gefunden.</p>",
|
"project_not_found": "<p>Das Projekt '__project__' wurde nicht gefunden.</p>",
|
||||||
"git_merge_conflict": "<p>Der automatische Merge der Änderungen ist fehlgeschlagen.</p><p>Die Merge-Konflikte müssen behoben und die Ergebnisse ins Repository übertragen werden (commit).</p>"
|
"git_merge_conflict": "<p>Der automatische Merge der Änderungen ist fehlgeschlagen.</p><p>Die Merge-Konflikte müssen behoben und die Ergebnisse ins Repository übertragen werden (commit).</p>"
|
||||||
},
|
},
|
||||||
"error": "<strong>Fehler:</strong> __message__",
|
"error": "<strong>Fehler</strong>: __message__",
|
||||||
"errors": {
|
"errors": {
|
||||||
"lostConnection": "Verbindung zum Server verloren. Verbindung wird erneut hergestellt ...",
|
"lostConnection": "Verbindung zum Server verloren. Verbindung wird erneut hergestellt ...",
|
||||||
"lostConnectionReconnect": "Verbindung zum Server verloren. Verbindung wird in __time__ s versucht wieder herzustellen.",
|
"lostConnectionReconnect": "Verbindung zum Server verloren. Wiederherstellung der Verbindung in __time__s.",
|
||||||
"lostConnectionTry": "Jetzt testen",
|
"lostConnectionTry": "Jetzt versuchen",
|
||||||
"cannotAddSubflowToItself": "Subflow kann nicht zu sich selbst hinzugefügt werden",
|
"cannotAddSubflowToItself": "Subflow kann nicht zu sich selbst hinzugefügt werden",
|
||||||
"cannotAddCircularReference": "Subflow kann nicht hinzugefügt werden, da ein zirkulärer Bezug erkannt wurde",
|
"cannotAddCircularReference": "Subflow kann nicht hinzugefügt werden, da ein zirkulärer Bezug erkannt wurde",
|
||||||
"unsupportedVersion": "<p>Nicht unterstützte Version von Node.js erkannt.</p><p>Es muss ein Upgrade auf das neueste LTS-Release von Node.js durchgeführt werden.</p>",
|
"unsupportedVersion": "<p>Nicht unterstützte Version von Node.js erkannt.</p><p>Es muss ein Upgrade auf das neueste LTS-Release von Node.js durchgeführt werden.</p>",
|
||||||
"failedToAppendNode": "<p>Fehler beim Laden von '__module__'.</p><p>__error__</p>"
|
"failedToAppendNode": "<p>Fehler beim Laden von '__module__'.</p><p>__error__</p>"
|
||||||
},
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"change-branch": "Wechsel in den Branch '__project__'",
|
"change-branch": "Wechsel in den lokalen Branch '__project__'",
|
||||||
"merge-abort": "Merge abgebrochen",
|
"merge-abort": "Git-Merge abgebrochen",
|
||||||
"loaded": "Projekt '__project__' geladen",
|
"loaded": "Projekt '__project__' geladen",
|
||||||
"updated": "Projekt '__project__' aktualisiert",
|
"updated": "Projekt '__project__' aktualisiert",
|
||||||
"pull": "Projekt '__project__' erneut geladen",
|
"pull": "Projekt '__project__' erneut geladen",
|
||||||
"revert": "Änderungen im Projekt '__project__' rückgängig gemacht",
|
"revert": "Änderungen im Projekt '__project__' rückgängig gemacht",
|
||||||
"merge-complete": "Merge abgeschlossen",
|
"merge-complete": "Git-Merge abgeschlossen",
|
||||||
"setupCredentials": "Berechtigungen einrichten",
|
"setupCredentials": "Credentials einrichten",
|
||||||
"setupProjectFiles": "Projektdateien einrichten",
|
"setupProjectFiles": "Projektdateien einrichten",
|
||||||
"no": "Nein, Danke",
|
"no": "Nein, Danke",
|
||||||
"createDefault": "Standardprojektdateien erstellen",
|
"createDefault": "Standardprojektdateien erstellen",
|
||||||
@@ -180,12 +216,13 @@
|
|||||||
},
|
},
|
||||||
"label": {
|
"label": {
|
||||||
"manage-project-dep": "Projektabhängigkeiten verwalten",
|
"manage-project-dep": "Projektabhängigkeiten verwalten",
|
||||||
"setup-cred": "Berechtigungen einrichten",
|
"setup-cred": "Credentials einrichten",
|
||||||
"setup-project": "Projektdateien einrichten",
|
"setup-project": "Projektdateien einrichten",
|
||||||
"create-default-package": "Standardpaketdatei erstellen",
|
"create-default-package": "Standardpaketdatei erstellen",
|
||||||
"no-thanks": "Nein, Danke",
|
"no-thanks": "Nein, Danke",
|
||||||
"create-default-project": "Standardprojektdateien erstellen",
|
"create-default-project": "Standardprojektdateien erstellen",
|
||||||
"show-merge-conflicts": "Merge-Konflikte anzeigen"
|
"show-merge-conflicts": "Merge-Konflikte anzeigen",
|
||||||
|
"unknownNodesButton": "Nach unbekannten Nodes suchen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -203,17 +240,17 @@
|
|||||||
"subflow_plural": "__count__ Subflows",
|
"subflow_plural": "__count__ Subflows",
|
||||||
"replacedNodes": "__count__ Node ersetzt",
|
"replacedNodes": "__count__ Node ersetzt",
|
||||||
"replacedNodes_plural": "__count__ Nodes ersetzt",
|
"replacedNodes_plural": "__count__ Nodes ersetzt",
|
||||||
"pasteNodes": "Flow-JSON hier einfügen oder",
|
"pasteNodes": "Flow-JSON einfügen oder",
|
||||||
"selectFile": "Datei für Import auswählen",
|
"selectFile": "Datei für Import auswählen",
|
||||||
"importNodes": "Import",
|
"importNodes": "Import",
|
||||||
"exportNodes": "Export",
|
"exportNodes": "Export",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"importUnrecognised": "Importierter Typ nicht erkannt:",
|
"importUnrecognised": "Nicht erkannten Typ importiert:",
|
||||||
"importUnrecognised_plural": "Importierte Typen nicht erkannt:",
|
"importUnrecognised_plural": "Nicht erkannte Typen importiert:",
|
||||||
"importDuplicate": "Importiertes doppeltes Node:",
|
"importDuplicate": "Doppelten Node importiert:",
|
||||||
"importDuplicate_plural": "Importierte doppelte Nodes:",
|
"importDuplicate_plural": "Doppelte Nodes importiert:",
|
||||||
"nodesExported": "Nodes in der Zwischenablage abgelegt",
|
"nodesExported": "Nodes in die Zwischenablage exportiert",
|
||||||
"nodesImported": "Eingefügt:",
|
"nodesImported": "Importiert:",
|
||||||
"nodeCopied": "__count__ Node kopiert",
|
"nodeCopied": "__count__ Node kopiert",
|
||||||
"nodeCopied_plural": "__count__ Nodes kopiert",
|
"nodeCopied_plural": "__count__ Nodes kopiert",
|
||||||
"groupCopied": "__count__ Gruppe kopiert",
|
"groupCopied": "__count__ Gruppe kopiert",
|
||||||
@@ -229,11 +266,11 @@
|
|||||||
"all": "Alle Flows",
|
"all": "Alle Flows",
|
||||||
"compact": "Kompakt",
|
"compact": "Kompakt",
|
||||||
"formatted": "Formatiert",
|
"formatted": "Formatiert",
|
||||||
"copy": "In Zwischenablage exportieren",
|
"copy": "In Zwischenablage kopieren",
|
||||||
"export": "In Bibliothek exportieren",
|
"export": "In Bibliothek exportieren",
|
||||||
"exportAs": "Exportiere als",
|
"exportAs": "Exportiere als",
|
||||||
"overwrite": "Ersetzen",
|
"overwrite": "Ersetzen",
|
||||||
"exists": "<p>'__file__' existiert bereits.</p><p>Soll sie ersetzt werden?</p>"
|
"exists": "<p><b>\"__file__\"</b> existiert bereits.</p><p>Soll sie ersetzt werden?</p>"
|
||||||
},
|
},
|
||||||
"import": {
|
"import": {
|
||||||
"import": "Importiere in",
|
"import": "Importiere in",
|
||||||
@@ -263,13 +300,19 @@
|
|||||||
"modifiedFlowsDesc": "Übernimmt nur Flows, die geänderte Nodes enthalten",
|
"modifiedFlowsDesc": "Übernimmt nur Flows, die geänderte Nodes enthalten",
|
||||||
"modifiedNodes": "Geänderte Nodes",
|
"modifiedNodes": "Geänderte Nodes",
|
||||||
"modifiedNodesDesc": "Übernimmt nur Nodes, die sich geändert haben",
|
"modifiedNodesDesc": "Übernimmt nur Nodes, die sich geändert haben",
|
||||||
|
"startFlows": "Start",
|
||||||
|
"startFlowsDesc": "Flows starten",
|
||||||
|
"stopFlows": "Stop",
|
||||||
|
"stopFlowsDesc": "Flows stoppen",
|
||||||
"restartFlows": "Flows neustarten",
|
"restartFlows": "Flows neustarten",
|
||||||
"restartFlowsDesc": "Startet die aktuell übernommenen Flows (ohne vorheriges Deploy)",
|
"restartFlowsDesc": "Startet die aktuell übernommenen Flows (ohne vorheriges Deploy)",
|
||||||
"successfulDeploy": "Erfolgreich übernommen (deploy)",
|
"successfulDeploy": "Erfolgreich übernommen (deploy)",
|
||||||
"successfulRestart": "Flows erfolgreich neugestartet",
|
"successfulRestart": "Flows erfolgreich neugestartet",
|
||||||
"deployFailed": "Übernahme (deploy) fehlgeschlagen: __message__",
|
"deployFailed": "Übernahme (deploy) fehlgeschlagen: __message__",
|
||||||
"unusedConfigNodes": "Einige Konfigurations-Nodes werden nicht verwendet.",
|
"unusedConfigNodes": "Einige Konfigurations-Nodes werden nicht verwendet.",
|
||||||
"unusedConfigNodesLink": "Hier klicken, um sie anzuschauen.",
|
"unusedConfigNodesButton": "Suche nach unbenutzten Konfigurations-Nodes",
|
||||||
|
"unknownNodesButton": "Suche nach unbekannten Nodes",
|
||||||
|
"invalidNodesButton": "Suche nach ungültigen Nodes",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "Keine Antwort vom Server"
|
"noResponse": "Keine Antwort vom Server"
|
||||||
},
|
},
|
||||||
@@ -342,7 +385,7 @@
|
|||||||
"confirmDelete": "Sind Sie sicher mit dem Löschen dieses Subflows?",
|
"confirmDelete": "Sind Sie sicher mit dem Löschen dieses Subflows?",
|
||||||
"info": "Beschreibung",
|
"info": "Beschreibung",
|
||||||
"category": "Kategorie",
|
"category": "Kategorie",
|
||||||
"module": "Module",
|
"module": "Modul",
|
||||||
"license": "Lizenz",
|
"license": "Lizenz",
|
||||||
"licenseNone": "Keine",
|
"licenseNone": "Keine",
|
||||||
"licenseOther": "Andere",
|
"licenseOther": "Andere",
|
||||||
@@ -352,10 +395,10 @@
|
|||||||
"keys": "Schlüsselwörter",
|
"keys": "Schlüsselwörter",
|
||||||
"keysPlaceholder": "Komma-getrennte Schlüsselwörter",
|
"keysPlaceholder": "Komma-getrennte Schlüsselwörter",
|
||||||
"author": "Author",
|
"author": "Author",
|
||||||
"authorPlaceholder": "Dein Name <email@beispiel.de>",
|
"authorPlaceholder": "Ihr Name <email@example.com>",
|
||||||
"desc": "Beschreibung",
|
"desc": "Beschreibung",
|
||||||
"env": {
|
"env": {
|
||||||
"restore": "Stelle auf Subflow-Standard zurück",
|
"restore": "Subflow-Standard wiederherstellen",
|
||||||
"remove": "Entferne Umgebungsvariable"
|
"remove": "Entferne Umgebungsvariable"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
@@ -364,9 +407,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"editGroup": "Editiere Gruppe: __name__",
|
"editGroup": "Bearbeite Gruppe: __name__",
|
||||||
"errors": {
|
"errors": {
|
||||||
"cannotCreateDiffGroups": "Kann keine Gruppe erzeugen mit Nodes von verschiedenen Gruppen",
|
"cannotCreateDiffGroups": "Kann keine Gruppe mit Nodes von anderen Gruppen erstellen",
|
||||||
"cannotAddSubflowPorts": "Kann keine Subflow-Anschlüsse zu einer Gruppe hinzufügen"
|
"cannotAddSubflowPorts": "Kann keine Subflow-Anschlüsse zu einer Gruppe hinzufügen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -380,7 +423,7 @@
|
|||||||
"addNewConfig": "Neuen Konfigurations-Node '__type__' hinzufügen",
|
"addNewConfig": "Neuen Konfigurations-Node '__type__' hinzufügen",
|
||||||
"editNode": "Node '__type__' bearbeiten",
|
"editNode": "Node '__type__' bearbeiten",
|
||||||
"editConfig": "Konfigurations-Node '__type__' bearbeiten",
|
"editConfig": "Konfigurations-Node '__type__' bearbeiten",
|
||||||
"addNewType": "Neuen Typ '__type__' hinzufügen",
|
"addNewType": "Neuen Typ '__type__' hinzufügen ...",
|
||||||
"nodeProperties": "Node-Eigenschaften",
|
"nodeProperties": "Node-Eigenschaften",
|
||||||
"label": "Name",
|
"label": "Name",
|
||||||
"color": "Farbe",
|
"color": "Farbe",
|
||||||
@@ -400,10 +443,10 @@
|
|||||||
"icon": "Icon",
|
"icon": "Icon",
|
||||||
"inputType": "Eingangstyp",
|
"inputType": "Eingangstyp",
|
||||||
"selectType": "Wähle Typen ...",
|
"selectType": "Wähle Typen ...",
|
||||||
"loadCredentials": "Lade Node-Berechtigungen",
|
"loadCredentials": "Lade Node-Credentials",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"input": "Eingang",
|
"input": "Eingang",
|
||||||
"select": "Wähle",
|
"select": "Auswahl",
|
||||||
"checkbox": "Checkbox",
|
"checkbox": "Checkbox",
|
||||||
"spinner": "Spinner",
|
"spinner": "Spinner",
|
||||||
"none": "Kein",
|
"none": "Kein",
|
||||||
@@ -416,7 +459,7 @@
|
|||||||
"json": "JSON",
|
"json": "JSON",
|
||||||
"bin": "buffer",
|
"bin": "buffer",
|
||||||
"env": "Umgebungsvariable",
|
"env": "Umgebungsvariable",
|
||||||
"cred": "Berechtigung"
|
"cred": "Credentials"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"input": "Eingang",
|
"input": "Eingang",
|
||||||
@@ -436,7 +479,7 @@
|
|||||||
"errors": {
|
"errors": {
|
||||||
"scopeChange": "Wenn Sie den Geltungsbereich (scope) ändern, wird er für Nodes in anderen Flows nicht verfügbar sein",
|
"scopeChange": "Wenn Sie den Geltungsbereich (scope) ändern, wird er für Nodes in anderen Flows nicht verfügbar sein",
|
||||||
"invalidProperties": "Ungültige Eigenschaften:",
|
"invalidProperties": "Ungültige Eigenschaften:",
|
||||||
"credentialLoadFailed": "Laden der Node-Berechtigungen fehlgeschlagen"
|
"credentialLoadFailed": "Laden der Node-Credentials fehlgeschlagen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"keyboard": {
|
"keyboard": {
|
||||||
@@ -446,23 +489,27 @@
|
|||||||
"shortcut": "Tastenkürzel",
|
"shortcut": "Tastenkürzel",
|
||||||
"scope": "Geltungsbereich",
|
"scope": "Geltungsbereich",
|
||||||
"unassigned": "Nicht zugeordnet",
|
"unassigned": "Nicht zugeordnet",
|
||||||
"global": "global",
|
"global": "Global",
|
||||||
"workspace": "Arbeitsbereich",
|
"workspace": "Arbeitsbereich",
|
||||||
"selectAll": "Alle Nodes auswählen",
|
"selectAll": "Alles auswählen",
|
||||||
|
"selectNone": "Alles abwählen",
|
||||||
"selectAllConnected": "Alle verbundenen Nodes auswählen",
|
"selectAllConnected": "Alle verbundenen Nodes auswählen",
|
||||||
"addRemoveNode": "Node aus Auswahl hinzufügen/entfernen",
|
"addRemoveNode": "Node aus Auswahl hinzufügen/entfernen",
|
||||||
"editSelected": "Ausgewählten Node bearbeiten",
|
"editSelected": "Ausgewählten Node bearbeiten",
|
||||||
"deleteSelected": "Ausgewählte Nodes oder Links löschen",
|
"deleteSelected": "Ausgewählte Nodes oder Links löschen",
|
||||||
"importNode": "Node importieren",
|
"importNode": "Nodes importieren",
|
||||||
"exportNode": "Node exportieren",
|
"exportNode": "Nodes exportieren",
|
||||||
"nudgeNode": "Ausgewählte Nodes verschieben (1px)",
|
"nudgeNode": "Ausgewählte Nodes verschieben (1px)",
|
||||||
"moveNode": "Ausgewählte Nodes verschieben (20px)",
|
"moveNode": "Ausgewählte Nodes verschieben (20px)",
|
||||||
"toggleSidebar": "Seitenleiste ein-/ausblenden",
|
"toggleSidebar": "Seitenleiste ein-/ausblenden",
|
||||||
"togglePalette": "Palette ein-/ausblenden",
|
"togglePalette": "Palette ein-/ausblenden",
|
||||||
"copyNode": "Ausgewählte Nodes kopieren",
|
"copyNode": "Ausgewählte Nodes kopieren",
|
||||||
"cutNode": "Ausgewählte Nodes ausschneiden",
|
"cutNode": "Ausgewählte Nodes ausschneiden",
|
||||||
"pasteNode": "Node einfügen",
|
"pasteNode": "Nodes einfügen",
|
||||||
|
"copyGroupStyle": "Gruppenstil kopieren",
|
||||||
|
"pasteGroupStyle": "Gruppenstil einfügen",
|
||||||
"undoChange": "Letzte Änderung rückgängig machen",
|
"undoChange": "Letzte Änderung rückgängig machen",
|
||||||
|
"redoChange": "Letzte Änderung wiederholen",
|
||||||
"searchBox": "Suchfeld öffnen",
|
"searchBox": "Suchfeld öffnen",
|
||||||
"managePalette": "Palette verwalten",
|
"managePalette": "Palette verwalten",
|
||||||
"actionList": "Aktionsliste"
|
"actionList": "Aktionsliste"
|
||||||
@@ -488,7 +535,7 @@
|
|||||||
"palette": {
|
"palette": {
|
||||||
"noInfo": "Keine Informationen verfügbar",
|
"noInfo": "Keine Informationen verfügbar",
|
||||||
"filter": "Nodes filtern",
|
"filter": "Nodes filtern",
|
||||||
"search": "Modules durchsuchen",
|
"search": "Module durchsuchen",
|
||||||
"addCategory": "Neu hinzufügen ...",
|
"addCategory": "Neu hinzufügen ...",
|
||||||
"label": {
|
"label": {
|
||||||
"subflows": "Subflows",
|
"subflows": "Subflows",
|
||||||
@@ -517,7 +564,8 @@
|
|||||||
"nodeEnabled_plural": "Nodes aktiviert:",
|
"nodeEnabled_plural": "Nodes aktiviert:",
|
||||||
"nodeDisabled": "Node deaktiviert:",
|
"nodeDisabled": "Node deaktiviert:",
|
||||||
"nodeDisabled_plural": "Nodes deaktiviert:",
|
"nodeDisabled_plural": "Nodes deaktiviert:",
|
||||||
"nodeUpgraded": "Upgrade von Node-Modul __module__ auf Version __version__ durchgeführt"
|
"nodeUpgraded": "Upgrade von Node-Modul __module__ auf Version __version__ durchgeführt",
|
||||||
|
"unknownNodeRegistered": "Fehler beim Laden des Nodes: <ul><li>__type__<br>__error__</li></ul>"
|
||||||
},
|
},
|
||||||
"editor": {
|
"editor": {
|
||||||
"title": "Palette verwalten",
|
"title": "Palette verwalten",
|
||||||
@@ -633,15 +681,8 @@
|
|||||||
"outline": "Entwurf",
|
"outline": "Entwurf",
|
||||||
"empty": "leer",
|
"empty": "leer",
|
||||||
"globalConfig": "Globale Konfigurations-Nodes",
|
"globalConfig": "Globale Konfigurations-Nodes",
|
||||||
"triggerAction": "Auslösen",
|
"triggerAction": "Aktion auslösen",
|
||||||
"find": "Suche im Arbeitsbereich",
|
"find": "Suche im Arbeitsbereich"
|
||||||
"search": {
|
|
||||||
"configNodes": "Konfigurations-Nodes",
|
|
||||||
"unusedConfigNodes": "Unbenutzte Konfigurations-Nodes",
|
|
||||||
"invalidNodes": "Ungültige Nodes",
|
|
||||||
"uknownNodes": "Unbekannte Nodes",
|
|
||||||
"unusedSubflows": "Unbenutzte Subflows"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "Hilfe",
|
"name": "Hilfe",
|
||||||
@@ -651,7 +692,8 @@
|
|||||||
"showHelp": "Hilfe zeigen",
|
"showHelp": "Hilfe zeigen",
|
||||||
"showInOutline": "Zeige im Editor",
|
"showInOutline": "Zeige im Editor",
|
||||||
"showTopics": "Zeige Hilfethemen",
|
"showTopics": "Zeige Hilfethemen",
|
||||||
"noHelp": "Kein Hilfethema ausgewählt"
|
"noHelp": "Kein Hilfethema ausgewählt",
|
||||||
|
"changeLog": "Änderungsprotokoll"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"name": "Konfigurations-Node",
|
"name": "Konfigurations-Node",
|
||||||
@@ -705,7 +747,7 @@
|
|||||||
"addToProject": "Zu Projekt hinzufügen",
|
"addToProject": "Zu Projekt hinzufügen",
|
||||||
"files": "Dateien",
|
"files": "Dateien",
|
||||||
"flow": "Flow",
|
"flow": "Flow",
|
||||||
"credentials": "Berechtigungen",
|
"credentials": "Credentials",
|
||||||
"package": "Paket",
|
"package": "Paket",
|
||||||
"packageCreate": "Datei wird erstellt beim Speichern der Änderungen",
|
"packageCreate": "Datei wird erstellt beim Speichern der Änderungen",
|
||||||
"fileNotExist": "Datei existiert nicht",
|
"fileNotExist": "Datei existiert nicht",
|
||||||
@@ -718,7 +760,7 @@
|
|||||||
"changeTheEncryptionKey": "Schlüssel ändern",
|
"changeTheEncryptionKey": "Schlüssel ändern",
|
||||||
"currentKey": "Aktueller Schlüssel",
|
"currentKey": "Aktueller Schlüssel",
|
||||||
"newKey": "Neuer Schlüssel",
|
"newKey": "Neuer Schlüssel",
|
||||||
"credentialsAlert": "Dadurch werden alle vorhandenen Berechtigungen gelöscht",
|
"credentialsAlert": "Dadurch werden alle vorhandenen Credentials gelöscht",
|
||||||
"versionControl": "Versionsverwaltung (Git)",
|
"versionControl": "Versionsverwaltung (Git)",
|
||||||
"branches": "Branches",
|
"branches": "Branches",
|
||||||
"noBranches": "Keine Branches",
|
"noBranches": "Keine Branches",
|
||||||
@@ -743,7 +785,7 @@
|
|||||||
"userName": "Benutzername",
|
"userName": "Benutzername",
|
||||||
"email": "E-Mail",
|
"email": "E-Mail",
|
||||||
"workflow": "Arbeitsablauf",
|
"workflow": "Arbeitsablauf",
|
||||||
"workfowTip": "Wähle deinen bevorzugten Git-Arbeitsablauf",
|
"workfowTip": "Wählen Sie Ihren bevorzugten Git-Arbeitsablauf (Workflow)",
|
||||||
"workflowManual": "Manuell",
|
"workflowManual": "Manuell",
|
||||||
"workflowManualTip": "Alle Änderungen müssen manuell übertragen werden (commit) über die Seitenleiste 'Projekthistorie'",
|
"workflowManualTip": "Alle Änderungen müssen manuell übertragen werden (commit) über die Seitenleiste 'Projekthistorie'",
|
||||||
"workflowAuto": "Automatisch",
|
"workflowAuto": "Automatisch",
|
||||||
@@ -854,7 +896,7 @@
|
|||||||
"date": "timestamp",
|
"date": "timestamp",
|
||||||
"jsonata": "JSONata",
|
"jsonata": "JSONata",
|
||||||
"env": "Umgebungsvariable",
|
"env": "Umgebungsvariable",
|
||||||
"cred": "Berechtigung"
|
"cred": "Credentials"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"editableList": {
|
"editableList": {
|
||||||
@@ -862,8 +904,20 @@
|
|||||||
"addTitle": "Element hinzufügen"
|
"addTitle": "Element hinzufügen"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"history": "Suchhistorie",
|
||||||
|
"clear": "Leeren",
|
||||||
"empty": "Keine Übereinstimmungen gefunden",
|
"empty": "Keine Übereinstimmungen gefunden",
|
||||||
"addNode": "Node hinzufügen ..."
|
"addNode": "Node hinzufügen ...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "Konfigurations-Nodes",
|
||||||
|
"unusedConfigNodes": "Unbenutzte Konfigurations-Nodes",
|
||||||
|
"invalidNodes": "Ungültige Nodes",
|
||||||
|
"uknownNodes": "Unbekannte Nodes",
|
||||||
|
"unusedSubflows": "Unbenutzte Subflows",
|
||||||
|
"hiddenFlows": "Versteckte Flows",
|
||||||
|
"modifiedNodes": "Geänderte Nodes",
|
||||||
|
"thisFlow": "Aktueller Flow"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "Funktionen",
|
"functions": "Funktionen",
|
||||||
@@ -884,6 +938,9 @@
|
|||||||
"eval": "Fehler beim Auswerten des Ausdrucks\n__message__"
|
"eval": "Fehler beim Auswerten des Ausdrucks\n__message__"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"monaco": {
|
||||||
|
"setTheme": "Thema auswählen"
|
||||||
|
},
|
||||||
"jsEditor": {
|
"jsEditor": {
|
||||||
"title": "JavaScript-Editor"
|
"title": "JavaScript-Editor"
|
||||||
},
|
},
|
||||||
@@ -893,8 +950,10 @@
|
|||||||
"jsonEditor": {
|
"jsonEditor": {
|
||||||
"title": "JSON-Editor",
|
"title": "JSON-Editor",
|
||||||
"format": "JSON formatieren",
|
"format": "JSON formatieren",
|
||||||
"rawMode": "JSON-Editor",
|
"rawMode": "Bearbeite JSON",
|
||||||
"uiMode": "Visueller Editor",
|
"uiMode": "Visueller Editor",
|
||||||
|
"rawMode-readonly": "JSON",
|
||||||
|
"uiMode-readonly": "Visuell",
|
||||||
"insertAbove": "Oberhalb einfügen",
|
"insertAbove": "Oberhalb einfügen",
|
||||||
"insertBelow": "Unterhalb einfügen",
|
"insertBelow": "Unterhalb einfügen",
|
||||||
"addItem": "Element hinzufügen",
|
"addItem": "Element hinzufügen",
|
||||||
@@ -965,7 +1024,7 @@
|
|||||||
"clone": "Projekt klonen",
|
"clone": "Projekt klonen",
|
||||||
"desc0": "Wenn Sie bereits über ein Git-Repository verfügen, das ein Projekt enthält, können Sie es klonen, um damit zu arbeiten.",
|
"desc0": "Wenn Sie bereits über ein Git-Repository verfügen, das ein Projekt enthält, können Sie es klonen, um damit zu arbeiten.",
|
||||||
"already-exists": "Das Projekt ist bereits vorhanden",
|
"already-exists": "Das Projekt ist bereits vorhanden",
|
||||||
"must-contain": "Darf nur A-Z 0-9 _ enthalten",
|
"must-contain": "Darf nur A-Z 0-9 _ - enthalten",
|
||||||
"project-name": "Projektname",
|
"project-name": "Projektname",
|
||||||
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
|
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
|
||||||
"git-url": "Git-Repository-URL",
|
"git-url": "Git-Repository-URL",
|
||||||
@@ -977,7 +1036,7 @@
|
|||||||
"passphrase": "Passphrase",
|
"passphrase": "Passphrase",
|
||||||
"ssh-key-desc": "Bevor Sie ein Repository über SSH lokal klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zugreifen zu können",
|
"ssh-key-desc": "Bevor Sie ein Repository über SSH lokal klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zugreifen zu können",
|
||||||
"ssh-key-add": "SSH-Schlüssel hinzufügen",
|
"ssh-key-add": "SSH-Schlüssel hinzufügen",
|
||||||
"credential-key": "Schlüssel für Berechtigungen",
|
"credential-key": "Schlüssel für Credentials",
|
||||||
"cant-get-ssh-key": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden",
|
"cant-get-ssh-key": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden",
|
||||||
"already-exists2": "bereits vorhanden",
|
"already-exists2": "bereits vorhanden",
|
||||||
"git-error": "Git-Fehler",
|
"git-error": "Git-Fehler",
|
||||||
@@ -989,27 +1048,27 @@
|
|||||||
"create": "Erstellen Sie Ihre Projektdateien",
|
"create": "Erstellen Sie Ihre Projektdateien",
|
||||||
"desc0": "Ein Projekt enthält Ihre Flow-Dateien, eine README-Datei und die 'package.json'-Datei.",
|
"desc0": "Ein Projekt enthält Ihre Flow-Dateien, eine README-Datei und die 'package.json'-Datei.",
|
||||||
"desc1": "Es kann alle anderen Dateien enthalten, die im Git-Repository verwaltet werden sollen.",
|
"desc1": "Es kann alle anderen Dateien enthalten, die im Git-Repository verwaltet werden sollen.",
|
||||||
"desc2": "Ihre vorhandenen Flow- und Berechtigungs-Dateien werden in das Projekt kopiert.",
|
"desc2": "Ihre vorhandenen Flow- und Credential-Dateien werden in das Projekt kopiert.",
|
||||||
"flow-file": "Flow-Datei",
|
"flow-file": "Flow-Datei",
|
||||||
"credentials-file": "Datei mit Berechtigungen"
|
"credentials-file": "Datei mit Credentials"
|
||||||
},
|
},
|
||||||
"encryption-config": {
|
"encryption-config": {
|
||||||
"setup": "Einrichtung der Verschlüsselung Ihrer Datei mit den Berechtigungen",
|
"setup": "Einrichtung der Verschlüsselung Ihrer Datei mit den Credentials",
|
||||||
"desc0": "Die Datei mit den Flow-Berechtigungen kann verschlüsselt werden, um ihren Inhalt zu schützen.",
|
"desc0": "Die Datei mit den Flow-Credentials kann verschlüsselt werden, um ihren Inhalt zu schützen.",
|
||||||
"desc1": "Wenn Sie diese Berechtigungen in einem öffentlichen Repository speichern möchten, müssen Sie sie mit einen geheimen Schlüsselausdruck verschlüsseln.",
|
"desc1": "Wenn Sie diese Credentials in einem öffentlichen Repository speichern möchten, müssen Sie sie mit einen geheimen Schlüsselausdruck verschlüsseln.",
|
||||||
"desc2": "Die Datei mit den Flow-Berechtigungen ist derzeit nicht verschlüsselt.",
|
"desc2": "Die Datei mit den Flow-Credentials ist derzeit nicht verschlüsselt.",
|
||||||
"desc3": "D.h. ihr Inhalt (z.B. Passwörter und Zugriffs-Tokens) kann von jedem mit Zugriff auf die Datei gelesen werden.",
|
"desc3": "D.h. ihr Inhalt (z.B. Passwörter und Zugriffs-Tokens) kann von jedem mit Zugriff auf die Datei gelesen werden.",
|
||||||
"desc4": "Wenn Sie diese Berechtigungen in einen öffentlichen Repository speichern möchten, müssen Sie diese verschlüsseln, indem Sie einen geheimen Schlüsselausdruck eingeben.",
|
"desc4": "Wenn Sie diese Credentials in einen öffentlichen Repository speichern möchten, müssen Sie diese verschlüsseln, indem Sie einen geheimen Schlüsselausdruck eingeben.",
|
||||||
"desc5": "Ihre Datei mit den Flow-Berechtigungen wird derzeit mit dem Eintrag 'credentialSecret' Ihrer Einstellungsdatei als Schlüssel verschlüsselt.",
|
"desc5": "Ihre Datei mit den Flow-Credentials wird derzeit mit dem Eintrag 'credentialSecret' Ihrer Einstellungsdatei als Schlüssel verschlüsselt.",
|
||||||
"desc6": "Die Datei mit den Flow-Berechtigungen wird derzeit mit einem vom System generierten Schlüssel verschlüsselt. Sie sollten einen neuen geheimen Schlüssel für dieses Projekt vorgeben.",
|
"desc6": "Die Datei mit den Flow-Credentials wird derzeit mit einem vom System generierten Schlüssel verschlüsselt. Sie sollten einen neuen geheimen Schlüssel für dieses Projekt vorgeben.",
|
||||||
"desc7": "Der Schlüssel wird separat von den Projektdateien gespeichert. Sie müssen den Schlüssel angeben, damit dieses Projekt auch in einem anderen Node-RED-System verwendet werden kann.",
|
"desc7": "Der Schlüssel wird separat von den Projektdateien gespeichert. Sie müssen den Schlüssel angeben, damit dieses Projekt auch in einem anderen Node-RED-System verwendet werden kann.",
|
||||||
"credentials": "Berechtigung",
|
"credentials": "Credentials",
|
||||||
"enable": "Verschlüsselung aktivieren",
|
"enable": "Verschlüsselung aktivieren",
|
||||||
"disable": "Verschlüsselung deaktivieren",
|
"disable": "Verschlüsselung deaktivieren",
|
||||||
"disabled": "deaktiviert",
|
"disabled": "deaktiviert",
|
||||||
"copy": "Vorhandenen Schlüssel ersetzen",
|
"copy": "Vorhandenen Schlüssel ersetzen",
|
||||||
"use-custom": "Eigenen Schlüssel verwenden",
|
"use-custom": "Eigenen Schlüssel verwenden",
|
||||||
"desc8": "Die Datei mit den Berechtigungen wird nicht verschlüsselt, und ihr Inhalt kann leicht gelesen werden",
|
"desc8": "Die Datei mit den Credentials wird nicht verschlüsselt und ihr Inhalt kann leicht gelesen werden",
|
||||||
"create-project-files": "Projektdateien erstellen",
|
"create-project-files": "Projektdateien erstellen",
|
||||||
"create-project": "Projekt erstellen",
|
"create-project": "Projekt erstellen",
|
||||||
"already-exists": "bereits vorhanden",
|
"already-exists": "bereits vorhanden",
|
||||||
@@ -1023,7 +1082,7 @@
|
|||||||
"desc2": "Im Tab 'Commit-Historie' in der Seitenleiste werden alle Dateien angezeigt, die sich in Ihrem Projekt geändert haben, und um sie ins lokale Repository zu übertragen (commit). Es zeigt Ihnen eine vollständige Historie Ihrer Commits an und ermöglicht es Ihnen, Ihre Commits in ein (remote) Server-Repository zu schieben (push)."
|
"desc2": "Im Tab 'Commit-Historie' in der Seitenleiste werden alle Dateien angezeigt, die sich in Ihrem Projekt geändert haben, und um sie ins lokale Repository zu übertragen (commit). Es zeigt Ihnen eine vollständige Historie Ihrer Commits an und ermöglicht es Ihnen, Ihre Commits in ein (remote) Server-Repository zu schieben (push)."
|
||||||
},
|
},
|
||||||
"create": {
|
"create": {
|
||||||
"projects": "Projekt",
|
"projects": "Projekte",
|
||||||
"already-exists": "Das Projekt ist bereits vorhanden",
|
"already-exists": "Das Projekt ist bereits vorhanden",
|
||||||
"must-contain": "Darf nur A-Z 0-9 _ enthalten",
|
"must-contain": "Darf nur A-Z 0-9 _ enthalten",
|
||||||
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
|
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
|
||||||
@@ -1034,12 +1093,12 @@
|
|||||||
"desc": "Beschreibung",
|
"desc": "Beschreibung",
|
||||||
"opt": "Optional",
|
"opt": "Optional",
|
||||||
"flow-file": "Flow-Datei",
|
"flow-file": "Flow-Datei",
|
||||||
"credentials": "Berechtigungen",
|
"credentials": "Credentials",
|
||||||
"enable-encryption": "Verschlüsselung aktivieren",
|
"enable-encryption": "Verschlüsselung aktivieren",
|
||||||
"disable-encryption": "Verschlüsselung deaktivieren",
|
"disable-encryption": "Verschlüsselung deaktivieren",
|
||||||
"encryption-key": "Schlüssel",
|
"encryption-key": "Schlüssel",
|
||||||
"desc0": "Eine Floskel, mit der Sie Ihre Berechtigungen schützen",
|
"desc0": "Eine Ausdruck, mit der Sie Ihre Credentials schützen",
|
||||||
"desc1": "Die Datei mit den Berechtigungen wird nicht verschlüsselt, und ihr Inhalt kann leicht gelesen werden",
|
"desc1": "Die Datei mit den Credentials wird nicht verschlüsselt und ihr Inhalt kann leicht gelesen werden",
|
||||||
"git-url": "Git-Repository-URL",
|
"git-url": "Git-Repository-URL",
|
||||||
"protocols": "https://, ssh:// oder file://",
|
"protocols": "https://, ssh:// oder file://",
|
||||||
"auth-failed": "Authentifizierung fehlgeschlagen",
|
"auth-failed": "Authentifizierung fehlgeschlagen",
|
||||||
@@ -1049,14 +1108,15 @@
|
|||||||
"passphrase": "Passphrase",
|
"passphrase": "Passphrase",
|
||||||
"desc2": "Bevor Sie ein Repository über SSH klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zu zugreifen",
|
"desc2": "Bevor Sie ein Repository über SSH klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zu zugreifen",
|
||||||
"add-ssh-key": "Einen SSH-Schlüssel hinzufügen",
|
"add-ssh-key": "Einen SSH-Schlüssel hinzufügen",
|
||||||
"credentials-encryption-key": "Schlüssel für Berechtigungen",
|
"credentials-encryption-key": "Schlüssel für Credentials",
|
||||||
"already-exists-2": "bereits vorhanden",
|
"already-exists-2": "bereits vorhanden",
|
||||||
"git-error": "Git-Fehler",
|
"git-error": "Git-Fehler",
|
||||||
"con-failed": "Verbindung fehlgeschlagen",
|
"con-failed": "Verbindung fehlgeschlagen",
|
||||||
"not-git": "Kein Git-Repository",
|
"not-git": "Kein Git-Repository",
|
||||||
"no-resource": "Repository nicht gefunden",
|
"no-resource": "Repository nicht gefunden",
|
||||||
"cant-get-ssh-key-path": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden.",
|
"cant-get-ssh-key-path": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden.",
|
||||||
"unexpected_error": "unerwarteter_Fehler"
|
"unexpected_error": "unerwarteter_Fehler",
|
||||||
|
"clearContext": "Kontextdaten löschen beim Projektwechsel"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"confirm": "Sind Sie sicher, dass dieses Projekt gelöscht werden soll?"
|
"confirm": "Sind Sie sicher, dass dieses Projekt gelöscht werden soll?"
|
||||||
@@ -1103,13 +1163,44 @@
|
|||||||
"preview": "Vorschau",
|
"preview": "Vorschau",
|
||||||
"defaultValue": "Standardwert"
|
"defaultValue": "Standardwert"
|
||||||
},
|
},
|
||||||
|
"tourGuide": {
|
||||||
|
"takeATour": "Tour starten",
|
||||||
|
"start": "Start",
|
||||||
|
"next": "Nächste",
|
||||||
|
"welcomeTours": "Welcome Tours"
|
||||||
|
},
|
||||||
|
"diagnostics": {
|
||||||
|
"title": "System-Informationen"
|
||||||
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"de": "German",
|
"de": "Deutsch",
|
||||||
"en-US": "English",
|
"en-US": "Englisch",
|
||||||
"ja": "Japanese",
|
"ja": "Japanisch",
|
||||||
"ko": "Korean",
|
"ko": "Koreanisch",
|
||||||
"ru": "Russian",
|
"ru": "Russisch",
|
||||||
"zh-CN": "Chinese(Simplified)",
|
"zh-CN": "Chinesisch (Vereinfacht)",
|
||||||
"zh-TW": "Chinese(Traditional)"
|
"zh-TW": "Chinesisch (Traditionell)"
|
||||||
|
},
|
||||||
|
"validator": {
|
||||||
|
"errors": {
|
||||||
|
"invalid-json": "Ungültige JSON-Daten: __error__",
|
||||||
|
"invalid-json-prop": "__prop__: ungültige JSON-Daten: __error__",
|
||||||
|
"invalid-prop": "Ungültiger Eigenschaftsausdruck",
|
||||||
|
"invalid-prop-prop": "__prop__: ungültiger Eigenschaftsausdruck",
|
||||||
|
"invalid-num": "Ungültige Nummer",
|
||||||
|
"invalid-num-prop": "__prop__: ungültige Nummer",
|
||||||
|
"invalid-regexp": "Ungültiges Eingabemuster",
|
||||||
|
"invalid-regex-prop": "__prop__: ungültiges Eingabemuster",
|
||||||
|
"missing-required-prop": "__prop__: Eigenschaftswert fehlt",
|
||||||
|
"invalid-config": "__prop__: ungültige Konfigurations-Node",
|
||||||
|
"missing-config": "__prop__: Konfigurations-Node fehlt",
|
||||||
|
"validation-error": "__prop__: Validierungsfehler: __node__, __id__: __error__"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contextMenu": {
|
||||||
|
"insert": "Einfügen",
|
||||||
|
"node": "Node",
|
||||||
|
"junction": "Kreuzung",
|
||||||
|
"linkNodes": "Verknüpfe Nodes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
packages/node_modules/@node-red/editor-client/locales/de/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/de/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/de/jsonata.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/de/jsonata.json
vendored
Executable file → Normal file
177
packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
vendored
Executable file → Normal file
177
packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
vendored
Executable file → Normal file
@@ -3,7 +3,7 @@
|
|||||||
"label": {
|
"label": {
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"ok": "Ok",
|
"ok": "Ok",
|
||||||
"done":"Done",
|
"done": "Done",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
"listSubflows": "List subflows",
|
"listSubflows": "List subflows",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"enabled": "Enabled",
|
"enabled": "Enabled",
|
||||||
"disabled":"Disabled",
|
"disabled": "Disabled",
|
||||||
"info": "Description",
|
"info": "Description",
|
||||||
"selectNodes": "Click nodes to select"
|
"selectNodes": "Click nodes to select"
|
||||||
},
|
},
|
||||||
@@ -75,6 +75,8 @@
|
|||||||
"view": {
|
"view": {
|
||||||
"view": "View",
|
"view": "View",
|
||||||
"grid": "Grid",
|
"grid": "Grid",
|
||||||
|
"storeZoom": "Restore zoom level on load",
|
||||||
|
"storePosition": "Restore scroll position on load",
|
||||||
"showGrid": "Show grid",
|
"showGrid": "Show grid",
|
||||||
"snapGrid": "Snap to grid",
|
"snapGrid": "Snap to grid",
|
||||||
"gridSize": "Grid size",
|
"gridSize": "Grid size",
|
||||||
@@ -112,7 +114,7 @@
|
|||||||
"keyboardShortcuts": "Keyboard shortcuts",
|
"keyboardShortcuts": "Keyboard shortcuts",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"editPalette":"Manage palette",
|
"editPalette": "Manage palette",
|
||||||
"other": "Other",
|
"other": "Other",
|
||||||
"showTips": "Show tips",
|
"showTips": "Show tips",
|
||||||
"showWelcomeTours": "Show guided tours for new versions",
|
"showWelcomeTours": "Show guided tours for new versions",
|
||||||
@@ -128,26 +130,30 @@
|
|||||||
"ungroupSelection": "Ungroup selection",
|
"ungroupSelection": "Ungroup selection",
|
||||||
"groupMergeSelection": "Merge selection",
|
"groupMergeSelection": "Merge selection",
|
||||||
"groupRemoveSelection": "Remove from group",
|
"groupRemoveSelection": "Remove from group",
|
||||||
"arrange":"Arrange",
|
"arrange": "Arrange",
|
||||||
"alignLeft":"Align to left",
|
"alignLeft": "Align to left",
|
||||||
"alignCenter":"Align to center",
|
"alignCenter": "Align to center",
|
||||||
"alignRight":"Align to right",
|
"alignRight": "Align to right",
|
||||||
"alignTop":"Align to top",
|
"alignTop": "Align to top",
|
||||||
"alignMiddle":"Align to middle",
|
"alignMiddle": "Align to middle",
|
||||||
"alignBottom":"Align to bottom",
|
"alignBottom": "Align to bottom",
|
||||||
"distributeHorizontally":"Distribute horizontally",
|
"distributeHorizontally": "Distribute horizontally",
|
||||||
"distributeVertically":"Distribute vertically",
|
"distributeVertically": "Distribute vertically",
|
||||||
"moveToBack":"Move to back",
|
"moveToBack": "Move to back",
|
||||||
"moveToFront":"Move to front",
|
"moveToFront": "Move to front",
|
||||||
"moveBackwards":"Move backwards",
|
"moveBackwards": "Move backwards",
|
||||||
"moveForwards":"Move forwards"
|
"moveForwards": "Move forwards"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"toggle-navigator": "Toggle navigator",
|
"toggle-navigator": "Toggle navigator",
|
||||||
"zoom-out": "Zoom out",
|
"zoom-out": "Zoom out",
|
||||||
"zoom-reset": "Reset zoom",
|
"zoom-reset": "Reset zoom",
|
||||||
"zoom-in": "Zoom in"
|
"zoom-in": "Zoom in",
|
||||||
|
"search-flows": "Search flows",
|
||||||
|
"search-prev": "Previous",
|
||||||
|
"search-next": "Next",
|
||||||
|
"search-counter": "\"__term__\" __result__ of __count__"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"loggedInAs": "Logged in as __name__",
|
"loggedInAs": "Logged in as __name__",
|
||||||
@@ -163,6 +169,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
|
"state": {
|
||||||
|
"flowsStopped": "Flows stopped",
|
||||||
|
"flowsStarted": "Flows started"
|
||||||
|
},
|
||||||
"warning": "<strong>Warning</strong>: __message__",
|
"warning": "<strong>Warning</strong>: __message__",
|
||||||
"warnings": {
|
"warnings": {
|
||||||
"undeployedChanges": "node has undeployed changes",
|
"undeployedChanges": "node has undeployed changes",
|
||||||
@@ -170,10 +180,10 @@
|
|||||||
"nodeActionDisabledSubflow": "node actions disabled within subflow",
|
"nodeActionDisabledSubflow": "node actions disabled within subflow",
|
||||||
"missing-types": "<p>Flows stopped due to missing node types.</p>",
|
"missing-types": "<p>Flows stopped due to missing node types.</p>",
|
||||||
"missing-modules": "<p>Flows stopped due to missing modules.</p>",
|
"missing-modules": "<p>Flows stopped due to missing modules.</p>",
|
||||||
"safe-mode":"<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
|
"safe-mode": "<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
|
||||||
"restartRequired": "Node-RED must be restarted to enable upgraded modules",
|
"restartRequired": "Node-RED must be restarted to enable upgraded modules",
|
||||||
"credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>",
|
"credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>",
|
||||||
"credentials_load_failed_reset":"<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
|
"credentials_load_failed_reset": "<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
|
||||||
"missing_flow_file": "<p>Project flow file not found.</p><p>The project is not configured with a flow file.</p>",
|
"missing_flow_file": "<p>Project flow file not found.</p><p>The project is not configured with a flow file.</p>",
|
||||||
"missing_package_file": "<p>Project package file not found.</p><p>The project is missing a package.json file.</p>",
|
"missing_package_file": "<p>Project package file not found.</p><p>The project is missing a package.json file.</p>",
|
||||||
"project_empty": "<p>The project is empty.</p><p>Do you want to create a default set of project files?<br/>Otherwise, you will have to manually add files to the project outside of the editor.</p>",
|
"project_empty": "<p>The project is empty.</p><p>Do you want to create a default set of project files?<br/>Otherwise, you will have to manually add files to the project outside of the editor.</p>",
|
||||||
@@ -211,7 +221,8 @@
|
|||||||
"create-default-package": "Create default package file",
|
"create-default-package": "Create default package file",
|
||||||
"no-thanks": "No thanks",
|
"no-thanks": "No thanks",
|
||||||
"create-default-project": "Create default project files",
|
"create-default-project": "Create default project files",
|
||||||
"show-merge-conflicts": "Show merge conflicts"
|
"show-merge-conflicts": "Show merge conflicts",
|
||||||
|
"unknownNodesButton": "Search for unknown nodes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -250,11 +261,11 @@
|
|||||||
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
|
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
|
||||||
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
|
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
|
||||||
"export": {
|
"export": {
|
||||||
"selected":"selected nodes",
|
"selected": "selected nodes",
|
||||||
"current":"current flow",
|
"current": "current flow",
|
||||||
"all":"all flows",
|
"all": "all flows",
|
||||||
"compact":"compact",
|
"compact": "compact",
|
||||||
"formatted":"formatted",
|
"formatted": "formatted",
|
||||||
"copy": "Copy to clipboard",
|
"copy": "Copy to clipboard",
|
||||||
"export": "Export to library",
|
"export": "Export to library",
|
||||||
"exportAs": "Export as",
|
"exportAs": "Export as",
|
||||||
@@ -289,13 +300,19 @@
|
|||||||
"modifiedFlowsDesc": "Only deploys flows that contain changed nodes",
|
"modifiedFlowsDesc": "Only deploys flows that contain changed nodes",
|
||||||
"modifiedNodes": "Modified Nodes",
|
"modifiedNodes": "Modified Nodes",
|
||||||
"modifiedNodesDesc": "Only deploys nodes that have changed",
|
"modifiedNodesDesc": "Only deploys nodes that have changed",
|
||||||
|
"startFlows": "Start",
|
||||||
|
"startFlowsDesc": "Start Flows",
|
||||||
|
"stopFlows": "Stop",
|
||||||
|
"stopFlowsDesc": "Stop Flows",
|
||||||
"restartFlows": "Restart Flows",
|
"restartFlows": "Restart Flows",
|
||||||
"restartFlowsDesc": "Restarts the current deployed flows",
|
"restartFlowsDesc": "Restarts the current deployed flows",
|
||||||
"successfulDeploy": "Successfully deployed",
|
"successfulDeploy": "Successfully deployed",
|
||||||
"successfulRestart": "Successfully restarted flows",
|
"successfulRestart": "Successfully restarted flows",
|
||||||
"deployFailed": "Deploy failed: __message__",
|
"deployFailed": "Deploy failed: __message__",
|
||||||
"unusedConfigNodes":"You have some unused configuration nodes.",
|
"unusedConfigNodes": "You have some unused configuration nodes.",
|
||||||
"unusedConfigNodesLink":"Click here to see them",
|
"unusedConfigNodesButton": "Search unused config nodes",
|
||||||
|
"unknownNodesButton": "Search for unknown nodes",
|
||||||
|
"invalidNodesButton": "Search for invalid nodes",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "no response from server"
|
"noResponse": "no response from server"
|
||||||
},
|
},
|
||||||
@@ -342,8 +359,8 @@
|
|||||||
},
|
},
|
||||||
"nodeCount": "__count__ node",
|
"nodeCount": "__count__ node",
|
||||||
"nodeCount_plural": "__count__ nodes",
|
"nodeCount_plural": "__count__ nodes",
|
||||||
"local":"Local changes",
|
"local": "Local changes",
|
||||||
"remote":"Remote changes",
|
"remote": "Remote changes",
|
||||||
"reviewChanges": "Review Changes",
|
"reviewChanges": "Review Changes",
|
||||||
"noBinaryFileShowed": "Cannot show binary file contents",
|
"noBinaryFileShowed": "Cannot show binary file contents",
|
||||||
"viewCommitDiff": "View Commit Changes",
|
"viewCommitDiff": "View Commit Changes",
|
||||||
@@ -427,7 +444,7 @@
|
|||||||
"inputType": "Input type",
|
"inputType": "Input type",
|
||||||
"selectType": "select types...",
|
"selectType": "select types...",
|
||||||
"loadCredentials": "Loading node credentials",
|
"loadCredentials": "Loading node credentials",
|
||||||
"inputs" : {
|
"inputs": {
|
||||||
"input": "input",
|
"input": "input",
|
||||||
"select": "select",
|
"select": "select",
|
||||||
"checkbox": "checkbox",
|
"checkbox": "checkbox",
|
||||||
@@ -495,7 +512,8 @@
|
|||||||
"redoChange": "Redo",
|
"redoChange": "Redo",
|
||||||
"searchBox": "Open search box",
|
"searchBox": "Open search box",
|
||||||
"managePalette": "Manage palette",
|
"managePalette": "Manage palette",
|
||||||
"actionList":"Action list"
|
"actionList": "Action list",
|
||||||
|
"splitWireWithLinks": "Split selection with Link nodes"
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"library": "Library",
|
"library": "Library",
|
||||||
@@ -607,19 +625,19 @@
|
|||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"install": {
|
"install": {
|
||||||
"body":"<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>",
|
"body": "<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>",
|
||||||
"title": "Install nodes"
|
"title": "Install nodes"
|
||||||
},
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
"body":"<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>",
|
"body": "<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>",
|
||||||
"title": "Remove nodes"
|
"title": "Remove nodes"
|
||||||
},
|
},
|
||||||
"update": {
|
"update": {
|
||||||
"body":"<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>",
|
"body": "<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>",
|
||||||
"title": "Update nodes"
|
"title": "Update nodes"
|
||||||
},
|
},
|
||||||
"cannotUpdate": {
|
"cannotUpdate": {
|
||||||
"body":"An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
|
"body": "An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
|
||||||
},
|
},
|
||||||
"button": {
|
"button": {
|
||||||
"review": "Open node information",
|
"review": "Open node information",
|
||||||
@@ -653,27 +671,21 @@
|
|||||||
"showMore": "show more",
|
"showMore": "show more",
|
||||||
"showLess": "show less",
|
"showLess": "show less",
|
||||||
"flow": "Flow",
|
"flow": "Flow",
|
||||||
"selection":"Selection",
|
"selection": "Selection",
|
||||||
"nodes":"__count__ nodes",
|
"nodes": "__count__ nodes",
|
||||||
"flowDesc": "Flow Description",
|
"flowDesc": "Flow Description",
|
||||||
"subflowDesc": "Subflow Description",
|
"subflowDesc": "Subflow Description",
|
||||||
"nodeHelp": "Node Help",
|
"nodeHelp": "Node Help",
|
||||||
"none":"None",
|
"none": "None",
|
||||||
"arrayItems": "__count__ items",
|
"arrayItems": "__count__ items",
|
||||||
"showTips":"You can open the tips from the settings panel",
|
"showTips": "You can open the tips from the settings panel",
|
||||||
"outline": "Outline",
|
"outline": "Outline",
|
||||||
"empty": "empty",
|
"empty": "empty",
|
||||||
"globalConfig": "Global Configuration Nodes",
|
"globalConfig": "Global Configuration Nodes",
|
||||||
"triggerAction": "Trigger action",
|
"triggerAction": "Trigger action",
|
||||||
"find": "Find in workspace",
|
"showFlow": "Show",
|
||||||
"search": {
|
"hideFlow": "Hide",
|
||||||
"configNodes": "Configuration nodes",
|
"find": "Find in workspace"
|
||||||
"unusedConfigNodes": "Unused configuration nodes",
|
|
||||||
"invalidNodes": "Invalid nodes",
|
|
||||||
"uknownNodes": "Unknown nodes",
|
|
||||||
"unusedSubflows": "Unused subflows",
|
|
||||||
"hiddenFlows": "Hidden flows"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "Help",
|
"name": "Help",
|
||||||
@@ -683,7 +695,8 @@
|
|||||||
"showHelp": "Show help",
|
"showHelp": "Show help",
|
||||||
"showInOutline": "Show in outline",
|
"showInOutline": "Show in outline",
|
||||||
"showTopics": "Show topics",
|
"showTopics": "Show topics",
|
||||||
"noHelp": "No help topic selected"
|
"noHelp": "No help topic selected",
|
||||||
|
"changeLog": "Change Log"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"name": "Configuration nodes",
|
"name": "Configuration nodes",
|
||||||
@@ -699,8 +712,8 @@
|
|||||||
"filtered": "__count__ hidden"
|
"filtered": "__count__ hidden"
|
||||||
},
|
},
|
||||||
"context": {
|
"context": {
|
||||||
"name":"Context Data",
|
"name": "Context Data",
|
||||||
"label":"context",
|
"label": "context",
|
||||||
"none": "none selected",
|
"none": "none selected",
|
||||||
"refresh": "refresh to load",
|
"refresh": "refresh to load",
|
||||||
"empty": "empty",
|
"empty": "empty",
|
||||||
@@ -738,9 +751,9 @@
|
|||||||
"files": "Files",
|
"files": "Files",
|
||||||
"flow": "Flow",
|
"flow": "Flow",
|
||||||
"credentials": "Credentials",
|
"credentials": "Credentials",
|
||||||
"package":"Package",
|
"package": "Package",
|
||||||
"packageCreate":"File will be created when changes are saved",
|
"packageCreate": "File will be created when changes are saved",
|
||||||
"fileNotExist":"File does not exist",
|
"fileNotExist": "File does not exist",
|
||||||
"selectFile": "Select File",
|
"selectFile": "Select File",
|
||||||
"invalidEncryptionKey": "Invalid encryption key",
|
"invalidEncryptionKey": "Invalid encryption key",
|
||||||
"encryptionEnabled": "Encryption enabled",
|
"encryptionEnabled": "Encryption enabled",
|
||||||
@@ -894,8 +907,20 @@
|
|||||||
"addTitle": "add an item"
|
"addTitle": "add an item"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"history": "Search history",
|
||||||
|
"clear": "clear all",
|
||||||
"empty": "No matches found",
|
"empty": "No matches found",
|
||||||
"addNode": "add a node..."
|
"addNode": "add a node...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "Configuration nodes",
|
||||||
|
"unusedConfigNodes": "Unused configuration nodes",
|
||||||
|
"invalidNodes": "Invalid nodes",
|
||||||
|
"uknownNodes": "Unknown nodes",
|
||||||
|
"unusedSubflows": "Unused subflows",
|
||||||
|
"hiddenFlows": "Hidden flows",
|
||||||
|
"modifiedNodes": "Modified nodes and flows",
|
||||||
|
"thisFlow": "Current flow"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "Functions",
|
"functions": "Functions",
|
||||||
@@ -913,6 +938,9 @@
|
|||||||
"invalid-expr": "Invalid JSONata expression:\n __message__",
|
"invalid-expr": "Invalid JSONata expression:\n __message__",
|
||||||
"invalid-msg": "Invalid example JSON message:\n __message__",
|
"invalid-msg": "Invalid example JSON message:\n __message__",
|
||||||
"context-unsupported": "Cannot test context functions\n $flowContext or $globalContext",
|
"context-unsupported": "Cannot test context functions\n $flowContext or $globalContext",
|
||||||
|
"env-unsupported": "Cannot test $env function",
|
||||||
|
"moment-unsupported": "Cannot test $moment function",
|
||||||
|
"clone-unsupported": "Cannot test $clone function",
|
||||||
"eval": "Error evaluating expression:\n __message__"
|
"eval": "Error evaluating expression:\n __message__"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -930,6 +958,8 @@
|
|||||||
"format": "format JSON",
|
"format": "format JSON",
|
||||||
"rawMode": "Edit JSON",
|
"rawMode": "Edit JSON",
|
||||||
"uiMode": "Visual editor",
|
"uiMode": "Visual editor",
|
||||||
|
"rawMode-readonly": "JSON",
|
||||||
|
"uiMode-readonly": "Visual",
|
||||||
"insertAbove": "Insert above",
|
"insertAbove": "Insert above",
|
||||||
"insertBelow": "Insert below",
|
"insertBelow": "Insert below",
|
||||||
"addItem": "Add item",
|
"addItem": "Add item",
|
||||||
@@ -962,7 +992,7 @@
|
|||||||
"title": "Buffer editor",
|
"title": "Buffer editor",
|
||||||
"modeString": "Handle as UTF-8 String",
|
"modeString": "Handle as UTF-8 String",
|
||||||
"modeArray": "Handle as JSON array",
|
"modeArray": "Handle as JSON array",
|
||||||
"modeDesc":"<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
|
"modeDesc": "<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
|
||||||
},
|
},
|
||||||
"projects": {
|
"projects": {
|
||||||
"config-git": "Configure Git client",
|
"config-git": "Configure Git client",
|
||||||
@@ -1091,7 +1121,8 @@
|
|||||||
"not-git": "Not a git repository",
|
"not-git": "Not a git repository",
|
||||||
"no-resource": "Repository not found",
|
"no-resource": "Repository not found",
|
||||||
"cant-get-ssh-key-path": "Error! Can't get selected SSH key path.",
|
"cant-get-ssh-key-path": "Error! Can't get selected SSH key path.",
|
||||||
"unexpected_error": "unexpected_error"
|
"unexpected_error": "unexpected_error",
|
||||||
|
"clearContext": "Clear context when switching projects"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"confirm": "Are you sure you want to delete this project?"
|
"confirm": "Are you sure you want to delete this project?"
|
||||||
@@ -1123,7 +1154,7 @@
|
|||||||
"no-empty": "Cannot create default file set on a non-empty project",
|
"no-empty": "Cannot create default file set on a non-empty project",
|
||||||
"git-error": "git error"
|
"git-error": "git error"
|
||||||
},
|
},
|
||||||
"errors" : {
|
"errors": {
|
||||||
"no-username-email": "Your Git client is not configured with a username/email.",
|
"no-username-email": "Your Git client is not configured with a username/email.",
|
||||||
"unexpected": "An unexpected error occurred",
|
"unexpected": "An unexpected error occurred",
|
||||||
"code": "code"
|
"code": "code"
|
||||||
@@ -1141,9 +1172,13 @@
|
|||||||
"tourGuide": {
|
"tourGuide": {
|
||||||
"takeATour": "Take a tour",
|
"takeATour": "Take a tour",
|
||||||
"start": "Start",
|
"start": "Start",
|
||||||
"next": "Next"
|
"next": "Next",
|
||||||
|
"welcomeTours": "Welcome Tours"
|
||||||
},
|
},
|
||||||
"languages" : {
|
"diagnostics": {
|
||||||
|
"title": "System Info"
|
||||||
|
},
|
||||||
|
"languages": {
|
||||||
"de": "German",
|
"de": "German",
|
||||||
"en-US": "English",
|
"en-US": "English",
|
||||||
"ja": "Japanese",
|
"ja": "Japanese",
|
||||||
@@ -1151,5 +1186,27 @@
|
|||||||
"ru": "Russian",
|
"ru": "Russian",
|
||||||
"zh-CN": "Chinese(Simplified)",
|
"zh-CN": "Chinese(Simplified)",
|
||||||
"zh-TW": "Chinese(Traditional)"
|
"zh-TW": "Chinese(Traditional)"
|
||||||
|
},
|
||||||
|
"validator": {
|
||||||
|
"errors": {
|
||||||
|
"invalid-json": "Invalid JSON data: __error__",
|
||||||
|
"invalid-json-prop": "__prop__: invalid JSON data: __error__",
|
||||||
|
"invalid-prop": "Invalid property expression",
|
||||||
|
"invalid-prop-prop": "__prop__: invalid property expression",
|
||||||
|
"invalid-num": "Invalid number",
|
||||||
|
"invalid-num-prop": "__prop__: invalid number",
|
||||||
|
"invalid-regexp": "Invalid input pattern",
|
||||||
|
"invalid-regex-prop": "__prop__: invalid input pattern",
|
||||||
|
"missing-required-prop": "__prop__: property value missing",
|
||||||
|
"invalid-config": "__prop__: invalid configuration node",
|
||||||
|
"missing-config": "__prop__: missing configuration node",
|
||||||
|
"validation-error": "__prop__: validation error: __node__, __id__: __error__"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contextMenu": {
|
||||||
|
"insert": "Insert",
|
||||||
|
"node": "Node",
|
||||||
|
"junction": "Junction",
|
||||||
|
"linkNodes": "Link Nodes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
38
packages/node_modules/@node-red/editor-client/locales/en-US/infotips.json
vendored
Executable file → Normal file
38
packages/node_modules/@node-red/editor-client/locales/en-US/infotips.json
vendored
Executable file → Normal file
@@ -1,23 +1,23 @@
|
|||||||
{
|
{
|
||||||
"info": {
|
"info": {
|
||||||
"tip0" : "You can remove the selected nodes or links with {{core:delete-selection}}",
|
"tip0": "You can remove the selected nodes or links with {{core:delete-selection}}",
|
||||||
"tip1" : "Search for nodes using {{core:search}}",
|
"tip1": "Search for nodes using {{core:search}}",
|
||||||
"tip2" : "{{core:toggle-sidebar}} will toggle the view of this sidebar",
|
"tip2": "{{core:toggle-sidebar}} will toggle the view of this sidebar",
|
||||||
"tip3" : "You can manage your palette of nodes with {{core:manage-palette}}",
|
"tip3": "You can manage your palette of nodes with {{core:manage-palette}}",
|
||||||
"tip4" : "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}",
|
"tip4": "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}",
|
||||||
"tip5" : "Enable or disable these tips from the option in the settings",
|
"tip5": "Enable or disable these tips from the option in the settings",
|
||||||
"tip6" : "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
|
"tip6": "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
|
||||||
"tip7" : "Dragging a node onto a wire will splice it into the link",
|
"tip7": "Dragging a node onto a wire will splice it into the link",
|
||||||
"tip8" : "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
|
"tip8": "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
|
||||||
"tip9" : "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
|
"tip9": "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
|
||||||
"tip10" : "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
|
"tip10": "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
|
||||||
"tip11" : "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
|
"tip11": "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
|
||||||
"tip12" : "[ctrl] [click] in the workspace to open the quick-add dialog",
|
"tip12": "[ctrl] [click] in the workspace to open the quick-add dialog",
|
||||||
"tip13" : "Hold down [ctrl] when you [click] on a node port to enable quick-wiring",
|
"tip13": "Hold down [ctrl] when you [click] on a node port to enable quick-wiring",
|
||||||
"tip14" : "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
|
"tip14": "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
|
||||||
"tip15" : "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
|
"tip15": "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
|
||||||
"tip16" : "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
|
"tip16": "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
|
||||||
"tip17" : "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
|
"tip17": "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
|
||||||
"tip18" : "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
|
"tip18": "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
80
packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json
vendored
Executable file → Normal file
80
packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json
vendored
Executable file → Normal file
@@ -52,52 +52,52 @@
|
|||||||
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
|
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
|
||||||
},
|
},
|
||||||
"$now": {
|
"$now": {
|
||||||
"args":"$[picture [, timezone]]",
|
"args": "$[picture [, timezone]]",
|
||||||
"desc":"Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
|
"desc": "Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
|
||||||
},
|
},
|
||||||
"$base64encode": {
|
"$base64encode": {
|
||||||
"args":"string",
|
"args": "string",
|
||||||
"desc":"Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
|
"desc": "Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
|
||||||
},
|
},
|
||||||
"$base64decode": {
|
"$base64decode": {
|
||||||
"args":"string",
|
"args": "string",
|
||||||
"desc":"Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
|
"desc": "Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
|
||||||
},
|
},
|
||||||
"$number": {
|
"$number": {
|
||||||
"args": "arg",
|
"args": "arg",
|
||||||
"desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown."
|
"desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown."
|
||||||
},
|
},
|
||||||
"$abs": {
|
"$abs": {
|
||||||
"args":"number",
|
"args": "number",
|
||||||
"desc":"Returns the absolute value of the `number` parameter."
|
"desc": "Returns the absolute value of the `number` parameter."
|
||||||
},
|
},
|
||||||
"$floor": {
|
"$floor": {
|
||||||
"args":"number",
|
"args": "number",
|
||||||
"desc":"Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
|
"desc": "Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
|
||||||
},
|
},
|
||||||
"$ceil": {
|
"$ceil": {
|
||||||
"args":"number",
|
"args": "number",
|
||||||
"desc":"Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
|
"desc": "Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
|
||||||
},
|
},
|
||||||
"$round": {
|
"$round": {
|
||||||
"args":"number [, precision]",
|
"args": "number [, precision]",
|
||||||
"desc":"Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
|
"desc": "Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
|
||||||
},
|
},
|
||||||
"$power": {
|
"$power": {
|
||||||
"args":"base, exponent",
|
"args": "base, exponent",
|
||||||
"desc":"Returns the value of `base` raised to the power of `exponent`."
|
"desc": "Returns the value of `base` raised to the power of `exponent`."
|
||||||
},
|
},
|
||||||
"$sqrt": {
|
"$sqrt": {
|
||||||
"args":"number",
|
"args": "number",
|
||||||
"desc":"Returns the square root of the value of the `number` parameter."
|
"desc": "Returns the square root of the value of the `number` parameter."
|
||||||
},
|
},
|
||||||
"$random": {
|
"$random": {
|
||||||
"args":"",
|
"args": "",
|
||||||
"desc":"Returns a pseudo random number greater than or equal to zero and less than one."
|
"desc": "Returns a pseudo random number greater than or equal to zero and less than one."
|
||||||
},
|
},
|
||||||
"$millis": {
|
"$millis": {
|
||||||
"args":"",
|
"args": "",
|
||||||
"desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
|
"desc": "Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
|
||||||
},
|
},
|
||||||
"$sum": {
|
"$sum": {
|
||||||
"args": "array",
|
"args": "array",
|
||||||
@@ -136,20 +136,20 @@
|
|||||||
"desc": "Appends two arrays"
|
"desc": "Appends two arrays"
|
||||||
},
|
},
|
||||||
"$sort": {
|
"$sort": {
|
||||||
"args":"array [, function]",
|
"args": "array [, function]",
|
||||||
"desc":"Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
|
"desc": "Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
|
||||||
},
|
},
|
||||||
"$reverse": {
|
"$reverse": {
|
||||||
"args":"array",
|
"args": "array",
|
||||||
"desc":"Returns an array containing all the values from the `array` parameter, but in reverse order."
|
"desc": "Returns an array containing all the values from the `array` parameter, but in reverse order."
|
||||||
},
|
},
|
||||||
"$shuffle": {
|
"$shuffle": {
|
||||||
"args":"array",
|
"args": "array",
|
||||||
"desc":"Returns an array containing all the values from the `array` parameter, but shuffled into random order."
|
"desc": "Returns an array containing all the values from the `array` parameter, but shuffled into random order."
|
||||||
},
|
},
|
||||||
"$zip": {
|
"$zip": {
|
||||||
"args":"array, ...",
|
"args": "array, ...",
|
||||||
"desc":"Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
|
"desc": "Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
|
||||||
},
|
},
|
||||||
"$keys": {
|
"$keys": {
|
||||||
"args": "object",
|
"args": "object",
|
||||||
@@ -168,24 +168,24 @@
|
|||||||
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
|
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
|
||||||
},
|
},
|
||||||
"$sift": {
|
"$sift": {
|
||||||
"args":"object, function",
|
"args": "object, function",
|
||||||
"desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
|
"desc": "Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
|
||||||
},
|
},
|
||||||
"$each": {
|
"$each": {
|
||||||
"args":"object, function",
|
"args": "object, function",
|
||||||
"desc":"Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
|
"desc": "Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
|
||||||
},
|
},
|
||||||
"$map": {
|
"$map": {
|
||||||
"args":"array, function",
|
"args": "array, function",
|
||||||
"desc":"Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
"desc": "Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
||||||
},
|
},
|
||||||
"$filter": {
|
"$filter": {
|
||||||
"args":"array, function",
|
"args": "array, function",
|
||||||
"desc":"Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
"desc": "Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
||||||
},
|
},
|
||||||
"$reduce": {
|
"$reduce": {
|
||||||
"args":"array, function [, init]",
|
"args": "array, function [, init]",
|
||||||
"desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
|
"desc": "Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
|
||||||
},
|
},
|
||||||
"$flowContext": {
|
"$flowContext": {
|
||||||
"args": "string[, string]",
|
"args": "string[, string]",
|
||||||
|
|||||||
@@ -59,6 +59,8 @@
|
|||||||
"hideOtherFlows": "他のフローを非表示",
|
"hideOtherFlows": "他のフローを非表示",
|
||||||
"showAllFlows": "全てのフローを表示",
|
"showAllFlows": "全てのフローを表示",
|
||||||
"hideAllFlows": "全てのフローを非表示",
|
"hideAllFlows": "全てのフローを非表示",
|
||||||
|
"hiddenFlows": "__count__ 個の非表示のフロー一覧",
|
||||||
|
"hiddenFlows_plural": "__count__ 個の非表示のフロー一覧",
|
||||||
"showLastHiddenFlow": "最後に非表示にしたフローを表示",
|
"showLastHiddenFlow": "最後に非表示にしたフローを表示",
|
||||||
"listFlows": "フロー一覧",
|
"listFlows": "フロー一覧",
|
||||||
"listSubflows": "サブフロー一覧",
|
"listSubflows": "サブフロー一覧",
|
||||||
@@ -73,6 +75,8 @@
|
|||||||
"view": {
|
"view": {
|
||||||
"view": "表示",
|
"view": "表示",
|
||||||
"grid": "グリッド",
|
"grid": "グリッド",
|
||||||
|
"storeZoom": "読み込み時に拡大/縮小のレベルを復元",
|
||||||
|
"storePosition": "読み込み時にスクロール位置を復元",
|
||||||
"showGrid": "グリッドを表示",
|
"showGrid": "グリッドを表示",
|
||||||
"snapGrid": "ノードの配置を補助",
|
"snapGrid": "ノードの配置を補助",
|
||||||
"gridSize": "グリッドの大きさ",
|
"gridSize": "グリッドの大きさ",
|
||||||
@@ -145,7 +149,11 @@
|
|||||||
"toggle-navigator": "ナビゲータの表示/非表示を切替",
|
"toggle-navigator": "ナビゲータの表示/非表示を切替",
|
||||||
"zoom-out": "縮小",
|
"zoom-out": "縮小",
|
||||||
"zoom-reset": "拡大/縮小を初期化",
|
"zoom-reset": "拡大/縮小を初期化",
|
||||||
"zoom-in": "拡大"
|
"zoom-in": "拡大",
|
||||||
|
"search-flows": "フローを検索",
|
||||||
|
"search-prev": "前へ",
|
||||||
|
"search-next": "次へ",
|
||||||
|
"search-counter": "\"__term__\" __count__ 件中の __result__ 件目"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"loggedInAs": "__name__ としてログインしました",
|
"loggedInAs": "__name__ としてログインしました",
|
||||||
@@ -161,6 +169,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
|
"state": {
|
||||||
|
"flowsStopped": "フローを停止しました",
|
||||||
|
"flowsStarted": "フローを開始しました"
|
||||||
|
},
|
||||||
"warning": "<strong>警告</strong>: __message__",
|
"warning": "<strong>警告</strong>: __message__",
|
||||||
"warnings": {
|
"warnings": {
|
||||||
"undeployedChanges": "ノードの変更をデプロイしていません",
|
"undeployedChanges": "ノードの変更をデプロイしていません",
|
||||||
@@ -209,7 +221,8 @@
|
|||||||
"create-default-package": "デフォルトパッケージファイルの作成",
|
"create-default-package": "デフォルトパッケージファイルの作成",
|
||||||
"no-thanks": "不要",
|
"no-thanks": "不要",
|
||||||
"create-default-project": "デフォルトプロジェクトファイルの作成",
|
"create-default-project": "デフォルトプロジェクトファイルの作成",
|
||||||
"show-merge-conflicts": "マージ競合を表示"
|
"show-merge-conflicts": "マージ競合を表示",
|
||||||
|
"unknownNodesButton": "不明なノードを検索する"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -287,13 +300,19 @@
|
|||||||
"modifiedFlowsDesc": "変更したノードを含むフローのみデプロイ",
|
"modifiedFlowsDesc": "変更したノードを含むフローのみデプロイ",
|
||||||
"modifiedNodes": "変更したノード",
|
"modifiedNodes": "変更したノード",
|
||||||
"modifiedNodesDesc": "変更したノードのみデプロイ",
|
"modifiedNodesDesc": "変更したノードのみデプロイ",
|
||||||
|
"startFlows": "開始",
|
||||||
|
"startFlowsDesc": "フローを開始",
|
||||||
|
"stopFlows": "停止",
|
||||||
|
"stopFlowsDesc": "フローを停止",
|
||||||
"restartFlows": "フローを再起動",
|
"restartFlows": "フローを再起動",
|
||||||
"restartFlowsDesc": "デプロイされた現在のフローを再起動",
|
"restartFlowsDesc": "デプロイされた現在のフローを再起動",
|
||||||
"successfulDeploy": "デプロイが成功しました",
|
"successfulDeploy": "デプロイが成功しました",
|
||||||
"successfulRestart": "フローの再起動が成功しました",
|
"successfulRestart": "フローの再起動が成功しました",
|
||||||
"deployFailed": "デプロイが失敗しました: __message__",
|
"deployFailed": "デプロイが失敗しました: __message__",
|
||||||
"unusedConfigNodes": "使われていない設定ノードがあります。",
|
"unusedConfigNodes": "使われていない設定ノードがあります。",
|
||||||
"unusedConfigNodesLink": "設定を参照する",
|
"unusedConfigNodesButton": "未使用の構成ノードを検索",
|
||||||
|
"unknownNodesButton": "不明なノードを検索する",
|
||||||
|
"invalidNodesButton": "無効なノードを検索する",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "サーバの応答がありません"
|
"noResponse": "サーバの応答がありません"
|
||||||
},
|
},
|
||||||
@@ -493,7 +512,8 @@
|
|||||||
"redoChange": "変更操作をやり直し",
|
"redoChange": "変更操作をやり直し",
|
||||||
"searchBox": "ノードを検索",
|
"searchBox": "ノードを検索",
|
||||||
"managePalette": "パレットの管理",
|
"managePalette": "パレットの管理",
|
||||||
"actionList": "動作一覧"
|
"actionList": "動作一覧",
|
||||||
|
"splitWireWithLinks": "選択したワイヤーをlinkノードで分離"
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"library": "ライブラリ",
|
"library": "ライブラリ",
|
||||||
@@ -663,14 +683,9 @@
|
|||||||
"empty": "空",
|
"empty": "空",
|
||||||
"globalConfig": "グローバル設定ノード",
|
"globalConfig": "グローバル設定ノード",
|
||||||
"triggerAction": "アクションを実行",
|
"triggerAction": "アクションを実行",
|
||||||
"find": "ワークスペース内を検索",
|
"showFlow": "表示",
|
||||||
"search": {
|
"hideFlow": "非表示",
|
||||||
"configNodes": "設定ノード",
|
"find": "ワークスペース内を検索"
|
||||||
"unusedConfigNodes": "未使用の設定ノード",
|
|
||||||
"invalidNodes": "不正なノード",
|
|
||||||
"uknownNodes": "未知のノード",
|
|
||||||
"unusedSubflows": "未使用のサブフロー"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "ヘルプ",
|
"name": "ヘルプ",
|
||||||
@@ -680,7 +695,8 @@
|
|||||||
"showHelp": "ヘルプを表示",
|
"showHelp": "ヘルプを表示",
|
||||||
"showInOutline": "アウトラインに表示",
|
"showInOutline": "アウトラインに表示",
|
||||||
"showTopics": "トピックを表示",
|
"showTopics": "トピックを表示",
|
||||||
"noHelp": "ヘルプのトピックが未選択"
|
"noHelp": "ヘルプのトピックが未選択",
|
||||||
|
"changeLog": "更新履歴"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"name": "設定ノードを表示",
|
"name": "設定ノードを表示",
|
||||||
@@ -840,7 +856,7 @@
|
|||||||
"pushFailed": "リモートに新しいコミットがあるため、プッシュに失敗しました。プルしてマージしてから、再度プッシュしてください。",
|
"pushFailed": "リモートに新しいコミットがあるため、プッシュに失敗しました。プルしてマージしてから、再度プッシュしてください。",
|
||||||
"push": "プッシュ",
|
"push": "プッシュ",
|
||||||
"pull": "プル",
|
"pull": "プル",
|
||||||
"unablePull": "<p>リモートの変更のプル失敗:ステージングされていないローカルの変更を上書きされてしまいます。</p><p>変更をコミットしてから再度実行してください。</p>",
|
"unablePull": "<p>リモートの変更のプル失敗:ステージングされていないローカルの変更が上書きされてしまいます。</p><p>変更をコミットしてから再度実行してください。</p>",
|
||||||
"showUnstagedChanges": "ステージングされていない変更を表示",
|
"showUnstagedChanges": "ステージングされていない変更を表示",
|
||||||
"connectionFailed": "リモートリポジトリに接続できません: ",
|
"connectionFailed": "リモートリポジトリに接続できません: ",
|
||||||
"pullUnrelatedHistory": "<p>リモートに関連のないコミット履歴があります。</p><p>本当に変更をプルしてローカルリポジトリに反映しますか?</p>",
|
"pullUnrelatedHistory": "<p>リモートに関連のないコミット履歴があります。</p><p>本当に変更をプルしてローカルリポジトリに反映しますか?</p>",
|
||||||
@@ -891,8 +907,20 @@
|
|||||||
"addTitle": "要素を追加"
|
"addTitle": "要素を追加"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"history": "検索履歴",
|
||||||
|
"clear": "全て削除",
|
||||||
"empty": "一致したものが見つかりませんでした",
|
"empty": "一致したものが見つかりませんでした",
|
||||||
"addNode": "ノードを追加..."
|
"addNode": "ノードを追加...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "設定ノード",
|
||||||
|
"unusedConfigNodes": "未使用の設定ノード",
|
||||||
|
"invalidNodes": "不正なノード",
|
||||||
|
"uknownNodes": "未知のノード",
|
||||||
|
"unusedSubflows": "未使用のサブフロー",
|
||||||
|
"hiddenFlows": "非表示のフロー",
|
||||||
|
"modifiedNodes": "修正したノードやフロー",
|
||||||
|
"thisFlow": "現在のフロー"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "関数",
|
"functions": "関数",
|
||||||
@@ -909,8 +937,11 @@
|
|||||||
"errors": {
|
"errors": {
|
||||||
"invalid-expr": "不正なJSONata式:\n __message__",
|
"invalid-expr": "不正なJSONata式:\n __message__",
|
||||||
"invalid-msg": "不正なJSONメッセージ例:\n __message__",
|
"invalid-msg": "不正なJSONメッセージ例:\n __message__",
|
||||||
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト機能をテストできません",
|
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト関数をテストできません",
|
||||||
"eval": "表現評価エラー:\n __message__"
|
"env-unsupported": "$env関数はテストできません",
|
||||||
|
"moment-unsupported": "$moment関数はテストできません",
|
||||||
|
"clone-unsupported": "$clone関数はテストできません",
|
||||||
|
"eval": "式評価エラー:\n __message__"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"monaco": {
|
"monaco": {
|
||||||
@@ -927,6 +958,8 @@
|
|||||||
"format": "JSONフォーマット",
|
"format": "JSONフォーマット",
|
||||||
"rawMode": "JSONを編集",
|
"rawMode": "JSONを編集",
|
||||||
"uiMode": "ビジュアルエディタ",
|
"uiMode": "ビジュアルエディタ",
|
||||||
|
"rawMode-readonly": "JSON",
|
||||||
|
"uiMode-readonly": "ビジュアル",
|
||||||
"insertAbove": "上に挿入",
|
"insertAbove": "上に挿入",
|
||||||
"insertBelow": "下に挿入",
|
"insertBelow": "下に挿入",
|
||||||
"addItem": "要素を追加",
|
"addItem": "要素を追加",
|
||||||
@@ -1088,7 +1121,8 @@
|
|||||||
"not-git": "Gitリポジトリではありません",
|
"not-git": "Gitリポジトリではありません",
|
||||||
"no-resource": "リポジトリが見つかりません",
|
"no-resource": "リポジトリが見つかりません",
|
||||||
"cant-get-ssh-key-path": "エラー! 選択したSSHキーのパスを取得できません。",
|
"cant-get-ssh-key-path": "エラー! 選択したSSHキーのパスを取得できません。",
|
||||||
"unexpected_error": "予期しないエラー"
|
"unexpected_error": "予期しないエラー",
|
||||||
|
"clearContext": "プロジェクトを切り替る際にコンテキストを初期化"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"confirm": "プロジェクトを削除しても良いですか?"
|
"confirm": "プロジェクトを削除しても良いですか?"
|
||||||
@@ -1138,7 +1172,11 @@
|
|||||||
"tourGuide": {
|
"tourGuide": {
|
||||||
"takeATour": "ツアーを開始",
|
"takeATour": "ツアーを開始",
|
||||||
"start": "開始",
|
"start": "開始",
|
||||||
"next": "次へ"
|
"next": "次へ",
|
||||||
|
"welcomeTours": "ウェルカムツアー"
|
||||||
|
},
|
||||||
|
"diagnostics": {
|
||||||
|
"title": "システム情報"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"de": "ドイツ語",
|
"de": "ドイツ語",
|
||||||
@@ -1148,5 +1186,172 @@
|
|||||||
"ru": "ロシア語",
|
"ru": "ロシア語",
|
||||||
"zh-CN": "中国語(簡体)",
|
"zh-CN": "中国語(簡体)",
|
||||||
"zh-TW": "中国語(繁体)"
|
"zh-TW": "中国語(繁体)"
|
||||||
|
},
|
||||||
|
"validator": {
|
||||||
|
"errors": {
|
||||||
|
"invalid-json": "JSONデータが不正: __error__",
|
||||||
|
"invalid-json-prop": "__prop__: JSONデータが不正: __error__",
|
||||||
|
"invalid-prop": "プロパティ式が不正",
|
||||||
|
"invalid-prop-prop": "__prop__: プロパティ式が不正",
|
||||||
|
"invalid-num": "数値が不正",
|
||||||
|
"invalid-num-prop": "__prop__: 数値が不正",
|
||||||
|
"invalid-regexp": "入力パターンが不正",
|
||||||
|
"invalid-regex-prop": "__prop__: 入力パターンが不正",
|
||||||
|
"missing-required-prop": "__prop__: プロパティが未設定",
|
||||||
|
"invalid-config": "__prop__: 設定ノードが不正",
|
||||||
|
"missing-config": "__prop__: 設定ノードが存在しません",
|
||||||
|
"validation-error": "__prop__: チェックエラー: __node__, __id__: __error__"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contextMenu": {
|
||||||
|
"insert": "挿入",
|
||||||
|
"node": "ノード",
|
||||||
|
"junction": "分岐点",
|
||||||
|
"linkNodes": "Linkノード"
|
||||||
|
},
|
||||||
|
"action-list": {
|
||||||
|
"toggle-show-tips": "ヒント表示切替",
|
||||||
|
"show-about": "Node-REDの説明を表示",
|
||||||
|
"show-welcome-tour": "ウェルカムツアー表示",
|
||||||
|
"show-next-tab": "次のタブを表示",
|
||||||
|
"show-previous-tab": "前のタブを表示",
|
||||||
|
"add-flow": "フローを追加",
|
||||||
|
"add-flow-to-right": "フローを右に追加",
|
||||||
|
"edit-flow": "フローを編集",
|
||||||
|
"remove-flow": "フローを削除",
|
||||||
|
"enable-flow": "フローを有効化",
|
||||||
|
"disable-flow": "フローを無効化",
|
||||||
|
"hide-flow": "フローを隠す",
|
||||||
|
"hide-other-flows": "他のフローを非表示",
|
||||||
|
"hide-all-flows": "全てのフローを非表示",
|
||||||
|
"show-all-flows": "全てのフローを表示",
|
||||||
|
"show-last-hidden-flow": "最後に非表示にしたフローを表示",
|
||||||
|
"list-modified-nodes": "修正したフローを表示",
|
||||||
|
"list-hidden-flows": "非表示フローを表示",
|
||||||
|
"list-flows": "フロー一覧",
|
||||||
|
"list-subflows": "サブフロー一覧",
|
||||||
|
"go-to-previous-location": "前の位置に移動",
|
||||||
|
"go-to-next-location": "次の位置に移動",
|
||||||
|
"copy-selection-to-internal-clipboard": "選択をクリップボードにコピー",
|
||||||
|
"cut-selection-to-internal-clipboard": "選択をクリップボードに切り取り",
|
||||||
|
"paste-from-internal-clipboard": "クリップボードから貼り付け",
|
||||||
|
"detach-selected-nodes": "選択ノードを接続から外す",
|
||||||
|
"delete-selection": "選択を削除",
|
||||||
|
"delete-selection-and-reconnect": "選択を削除し再接続",
|
||||||
|
"edit-selected-node": "選択したノードを編集",
|
||||||
|
"go-to-selection": "選択に移動",
|
||||||
|
"undo": "変更操作を戻す",
|
||||||
|
"redo": "変更操作をやり直し",
|
||||||
|
"select-all-nodes": "全てのノードを選択",
|
||||||
|
"select-none": "ノードを選択",
|
||||||
|
"enable-selected-nodes": "選択ノードを有効化",
|
||||||
|
"disable-selected-nodes": "選択ノードを無効化",
|
||||||
|
"toggle-show-grid": "グリッド表示切替",
|
||||||
|
"toggle-snap-grid": "ノードの配置補助切替",
|
||||||
|
"toggle-status": "ステータス表示切替",
|
||||||
|
"show-selected-node-labels": "選択したノードのラベルを表示",
|
||||||
|
"hide-selected-node-labels": "選択したノードのラベルを非表示",
|
||||||
|
"scroll-view-up": "上スクロール",
|
||||||
|
"scroll-view-right": "右スクロール",
|
||||||
|
"scroll-view-down": "下スクロール",
|
||||||
|
"scroll-view-left": "左スクロール",
|
||||||
|
"step-view-up": "一単位上スクロール",
|
||||||
|
"step-view-right": "一単位右スクロール",
|
||||||
|
"step-view-down": "一単位下スクロール",
|
||||||
|
"step-view-left": "一単位左スクロール",
|
||||||
|
"move-selection-up": "選択を上移動",
|
||||||
|
"move-selection-right": "選択を右移動",
|
||||||
|
"move-selection-down": "選択を下移動",
|
||||||
|
"move-selection-left": "選択を左移動",
|
||||||
|
"move-selection-forwards": "選択を前面に移動",
|
||||||
|
"move-selection-backwards": "選択を背面に移動",
|
||||||
|
"move-selection-to-front": "選択を最前面に移動",
|
||||||
|
"move-selection-to-back": "選択を最背面に移動",
|
||||||
|
"step-selection-up": "選択を一単位上移動",
|
||||||
|
"step-selection-right": "選択を一単位右移動",
|
||||||
|
"step-selection-down": "選択を一単位下移動",
|
||||||
|
"step-selection-left": "選択を一単位左移動",
|
||||||
|
"select-connected-nodes": "接続されたノードを選択",
|
||||||
|
"select-downstream-nodes": "後方に接続されたノードを選択",
|
||||||
|
"select-upstream-nodes": "前方に接続されたノードを選択",
|
||||||
|
"go-to-next-node": "次のノードに移動",
|
||||||
|
"go-to-previous-node": "前のノードに移動",
|
||||||
|
"go-to-next-sibling": "次の兄弟ノードに移動",
|
||||||
|
"go-to-previous-sibling": "前の兄弟ノードに移動",
|
||||||
|
"go-to-nearest-node-on-left": "最も近い左側ノードに移動",
|
||||||
|
"go-to-nearest-node-on-right": "最も近い右側ノードに移動",
|
||||||
|
"go-to-nearest-node-above": "最も近い上側ノードに移動",
|
||||||
|
"go-to-nearest-node-below": "最も近い下側ノードに移動",
|
||||||
|
"align-selection-to-grid": "選択を整列",
|
||||||
|
"align-selection-to-left": "選択を左揃え",
|
||||||
|
"align-selection-to-right": "選択を右揃え",
|
||||||
|
"align-selection-to-top": "選択を上揃え",
|
||||||
|
"align-selection-to-bottom": "選択を下揃え",
|
||||||
|
"align-selection-to-middle": "選択を上下中央揃え",
|
||||||
|
"align-selection-to-center": "選択を左右中央揃え",
|
||||||
|
"distribute-selection-horizontally": "選択を左右に整列",
|
||||||
|
"distribute-selection-vertically": "選択を上下に整列",
|
||||||
|
"wire-series-of-nodes": "ノードを一続きに接続",
|
||||||
|
"wire-node-to-multiple": "ノードを複数に接続",
|
||||||
|
"split-wire-with-link-nodes": "ワイヤーをlinkノードで分割",
|
||||||
|
"generate-node-names": "ノード名を生成",
|
||||||
|
"show-user-settings": "ユーザ設定を表示",
|
||||||
|
"show-help": "ヘルプを表示",
|
||||||
|
"toggle-palette": "パレットの表示切替",
|
||||||
|
"show-event-log": "イベントログを表示",
|
||||||
|
"manage-palette": "パレットの管理",
|
||||||
|
"toggle-sidebar": "サイドバーの表示切替",
|
||||||
|
"show-info-tab": "ノード情報タブの表示",
|
||||||
|
"show-help-tab": "ノードヘルプタブの表示",
|
||||||
|
"show-config-tab": "設定ノードタブの表示",
|
||||||
|
"select-all-config-nodes": "全ての設定ノードを選択",
|
||||||
|
"delete-config-selection": "選択した設定ノードを削除",
|
||||||
|
"show-context-tab": "コンテキストデータタブを表示",
|
||||||
|
"create-subflow": "サブフローを作成",
|
||||||
|
"convert-to-subflow": "選択をサブフローに変換",
|
||||||
|
"group-selection": "選択をグループ化",
|
||||||
|
"ungroup-selection": "選択をグループ解除",
|
||||||
|
"merge-selection-to-group": "選択をグループにマージ",
|
||||||
|
"remove-selection-from-group": "選択をグループから削除",
|
||||||
|
"copy-group-style": "グループのスタイルをコピー",
|
||||||
|
"paste-group-style": "グループのスタイルを貼り付け",
|
||||||
|
"show-export-dialog": "書き出しダイアログを表示",
|
||||||
|
"show-import-dialog": "読み込みダイアログを表示",
|
||||||
|
"show-library-export-dialog": "ライブラリ書き出しダイアログを表示",
|
||||||
|
"show-library-import-dialog": "ライブラリ読み込みダイアログを表示",
|
||||||
|
"show-examples-import-dialog": "サンプル読み込みダイアログを表示",
|
||||||
|
"search": "検索",
|
||||||
|
"search-previous": "前を検索",
|
||||||
|
"search-next": "次を検索",
|
||||||
|
"show-action-list": "動作一覧を表示",
|
||||||
|
"confirm-edit-tray": "編集を完了",
|
||||||
|
"cancel-edit-tray": "編集をキャンセル",
|
||||||
|
"show-remote-diff": "リモートとの変更差分を表示",
|
||||||
|
"deploy-flows": "フローをデプロイ",
|
||||||
|
"restart-flows": "フローを再起動",
|
||||||
|
"set-deploy-type-to-full": "デプロイを「全て」に設定",
|
||||||
|
"set-deploy-type-to-modified-flows": "デプロイを「変更したフロー」に設定",
|
||||||
|
"set-deploy-type-to-modified-nodes": "デプロイを「変更したノード」に設定",
|
||||||
|
"show-debug-tab": "デバッグタブを表示",
|
||||||
|
"clear-debug-messages": "デバッグメッセージを削除",
|
||||||
|
"clear-filtered-debug-messages": "フィルタしたデバッグメッセージを削除",
|
||||||
|
"activate-selected-debug-nodes": "選択したデバッグノードを有効化",
|
||||||
|
"activate-all-debug-nodes": "全てのデバッグノードを有効化",
|
||||||
|
"activate-all-flow-debug-nodes": "フロー内の全デバッグノードを有効化",
|
||||||
|
"deactivate-selected-debug-nodes": "選択したデバッグノードを無効化",
|
||||||
|
"deactivate-all-debug-nodes": "全てのデバッグノードを無効化",
|
||||||
|
"deactivate-all-flow-debug-nodes": "フロー内の全デバッグノードを無効化",
|
||||||
|
"zoom-in": "ズームイン",
|
||||||
|
"zoom-out": "ズームアウト",
|
||||||
|
"zoom-reset": "ズームリセット",
|
||||||
|
"toggle-navigator": "ナビゲータ表示切替",
|
||||||
|
"show-system-info": "システム情報",
|
||||||
|
"split-wires-with-junctions": "分岐点によりワイヤーを分割",
|
||||||
|
"new-project": "新しいプロジェクト",
|
||||||
|
"open-project": "プロジェクトを開く",
|
||||||
|
"show-project-settings": "プロジェクト設定を表示",
|
||||||
|
"show-version-control-tab": "バージョンコントロールタブを表示",
|
||||||
|
"start-flows": "フローを開始",
|
||||||
|
"stop-flows": "フローを停止"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
|
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
|
||||||
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
|
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
|
||||||
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
|
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
|
||||||
"tip17": "ノードのプロバティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
|
"tip17": "ノードのプロパティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
|
||||||
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
|
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
packages/node_modules/@node-red/editor-client/locales/ko/editor.json
vendored
Executable file → Normal file
7
packages/node_modules/@node-red/editor-client/locales/ko/editor.json
vendored
Executable file → Normal file
@@ -141,7 +141,8 @@
|
|||||||
"create-default-package": "기본 패키지 파일 생성",
|
"create-default-package": "기본 패키지 파일 생성",
|
||||||
"no-thanks": "괜찮습니다",
|
"no-thanks": "괜찮습니다",
|
||||||
"create-default-project": "기본 프로젝트 파일 생성",
|
"create-default-project": "기본 프로젝트 파일 생성",
|
||||||
"show-merge-conflicts": "병합 충돌 보여주기"
|
"show-merge-conflicts": "병합 충돌 보여주기",
|
||||||
|
"unknownNodesButton": "알 수 없는 노드 검색"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -203,7 +204,9 @@
|
|||||||
"successfulRestart": "플로우 재시작을 성공했습니다",
|
"successfulRestart": "플로우 재시작을 성공했습니다",
|
||||||
"deployFailed": "배포 실패 : __message__",
|
"deployFailed": "배포 실패 : __message__",
|
||||||
"unusedConfigNodes": "사용되지 않는 설정노드가 있습니다",
|
"unusedConfigNodes": "사용되지 않는 설정노드가 있습니다",
|
||||||
"unusedConfigNodesLink": "여기를 클릭하면 볼 수 있습니다",
|
"unusedConfigNodesButton":"사용하지 않는 구성 노드 검색",
|
||||||
|
"unknownNodesButton":"알 수 없는 노드 검색",
|
||||||
|
"invalidNodesButton":"잘못된 노드 검색",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "서버의 응답이 없습니다"
|
"noResponse": "서버의 응답이 없습니다"
|
||||||
},
|
},
|
||||||
|
|||||||
0
packages/node_modules/@node-red/editor-client/locales/ko/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ko/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ko/jsonata.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ko/jsonata.json
vendored
Executable file → Normal file
25
packages/node_modules/@node-red/editor-client/locales/ru/editor.json
vendored
Executable file → Normal file
25
packages/node_modules/@node-red/editor-client/locales/ru/editor.json
vendored
Executable file → Normal file
@@ -183,7 +183,8 @@
|
|||||||
"create-default-package": "Создать файл пакета по умолчанию",
|
"create-default-package": "Создать файл пакета по умолчанию",
|
||||||
"no-thanks": "Нет, спасибо",
|
"no-thanks": "Нет, спасибо",
|
||||||
"create-default-project": "Создать файлы проекта по умолчанию",
|
"create-default-project": "Создать файлы проекта по умолчанию",
|
||||||
"show-merge-conflicts": "Показать конфликты слияния"
|
"show-merge-conflicts": "Показать конфликты слияния",
|
||||||
|
"unknownNodesButton": "Поиск неизвестных узлов"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -277,7 +278,9 @@
|
|||||||
"successfulRestart": "Потоки успешно перезапущены",
|
"successfulRestart": "Потоки успешно перезапущены",
|
||||||
"deployFailed": "Развертывание не удалось: __message__",
|
"deployFailed": "Развертывание не удалось: __message__",
|
||||||
"unusedConfigNodes":"У вас есть неиспользуемых узлы конфигурации.",
|
"unusedConfigNodes":"У вас есть неиспользуемых узлы конфигурации.",
|
||||||
"unusedConfigNodesLink":"Нажмите здесь, чтобы их увидеть",
|
"unusedConfigNodesButton":"Поиск неиспользуемых узлов конфигурации",
|
||||||
|
"unknownNodesButton":"Поиск неизвестных узлов",
|
||||||
|
"invalidNodesButton":"Поиск недопустимых узлов",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "нет ответа от сервера"
|
"noResponse": "нет ответа от сервера"
|
||||||
},
|
},
|
||||||
@@ -650,14 +653,7 @@
|
|||||||
"empty": "пусто",
|
"empty": "пусто",
|
||||||
"globalConfig": "Глобальные конфиг узлы",
|
"globalConfig": "Глобальные конфиг узлы",
|
||||||
"triggerAction": "Вызвать действие",
|
"triggerAction": "Вызвать действие",
|
||||||
"find": "Найти в рабочей области",
|
"find": "Найти в рабочей области"
|
||||||
"search": {
|
|
||||||
"configNodes": "Узлы конфигурации",
|
|
||||||
"unusedConfigNodes": "Неиспользуемые узлы конфигурации",
|
|
||||||
"invalidNodes": "Недействительные узлы",
|
|
||||||
"uknownNodes": "Неизвестные узлы",
|
|
||||||
"unusedSubflows": "Неиспользуемые подпотоки"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "Справка",
|
"name": "Справка",
|
||||||
@@ -888,7 +884,14 @@
|
|||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"empty": "Ничего не найдено",
|
"empty": "Ничего не найдено",
|
||||||
"addNode": "добавить узел..."
|
"addNode": "добавить узел...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "Узлы конфигурации",
|
||||||
|
"unusedConfigNodes": "Неиспользуемые узлы конфигурации",
|
||||||
|
"invalidNodes": "Недействительные узлы",
|
||||||
|
"uknownNodes": "Неизвестные узлы",
|
||||||
|
"unusedSubflows": "Неиспользуемые подпотоки"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "Функции",
|
"functions": "Функции",
|
||||||
|
|||||||
0
packages/node_modules/@node-red/editor-client/locales/ru/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ru/infotips.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ru/jsonata.json
vendored
Executable file → Normal file
0
packages/node_modules/@node-red/editor-client/locales/ru/jsonata.json
vendored
Executable file → Normal file
@@ -97,7 +97,7 @@
|
|||||||
"rename": "重命名",
|
"rename": "重命名",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
"keyboardShortcuts": "键盘快捷方式",
|
"keyboardShortcuts": "键盘快捷方式",
|
||||||
"login": "登陆",
|
"login": "登录",
|
||||||
"logout": "退出",
|
"logout": "退出",
|
||||||
"editPalette": "节点管理",
|
"editPalette": "节点管理",
|
||||||
"other": "其他",
|
"other": "其他",
|
||||||
@@ -122,16 +122,16 @@
|
|||||||
"zoom-in": "放大"
|
"zoom-in": "放大"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"loggedInAs": "作为 __name__ 登陆",
|
"loggedInAs": "作为 __name__ 登录",
|
||||||
"username": "账号",
|
"username": "账号",
|
||||||
"password": "密码",
|
"password": "密码",
|
||||||
"login": "登陆",
|
"login": "登录",
|
||||||
"loginFailed": "登陆失败",
|
"loginFailed": "登录失败",
|
||||||
"notAuthorized": "未授权",
|
"notAuthorized": "未授权",
|
||||||
"errors": {
|
"errors": {
|
||||||
"settings": "设置信息需要登陆后才能访问",
|
"settings": "设置信息需要登录后才能访问",
|
||||||
"deploy": "改动需要登陆后才能部署",
|
"deploy": "改动需要登录后才能部署",
|
||||||
"notAuthorized": "此操作需要登陆后才能执行"
|
"notAuthorized": "此操作需要登录后才能执行"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
@@ -182,7 +182,8 @@
|
|||||||
"create-default-package": "创建默认的包文件",
|
"create-default-package": "创建默认的包文件",
|
||||||
"no-thanks": "不了,谢谢",
|
"no-thanks": "不了,谢谢",
|
||||||
"create-default-project": "创建默认项目文件",
|
"create-default-project": "创建默认项目文件",
|
||||||
"show-merge-conflicts": "显示合并冲突"
|
"show-merge-conflicts": "显示合并冲突",
|
||||||
|
"unknownNodesButton": "搜索未知节点"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -264,7 +265,9 @@
|
|||||||
"successfulRestart": "成功重启流程",
|
"successfulRestart": "成功重启流程",
|
||||||
"deployFailed": "部署失败: __message__",
|
"deployFailed": "部署失败: __message__",
|
||||||
"unusedConfigNodes": "您有一些未使用的配置节点",
|
"unusedConfigNodes": "您有一些未使用的配置节点",
|
||||||
"unusedConfigNodesLink": "点击此处查看它们",
|
"unusedConfigNodesButton":"搜索未使用的配置节点",
|
||||||
|
"unknownNodesButton":"搜索未知节点",
|
||||||
|
"invalidNodesButton":"搜索无效节点",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "服务器没有响应"
|
"noResponse": "服务器没有响应"
|
||||||
},
|
},
|
||||||
@@ -614,14 +617,7 @@
|
|||||||
"empty": "空的",
|
"empty": "空的",
|
||||||
"globalConfig": "全局配置节点",
|
"globalConfig": "全局配置节点",
|
||||||
"triggerAction": "触发动作",
|
"triggerAction": "触发动作",
|
||||||
"find": "在工作区中查找",
|
"find": "在工作区中查找"
|
||||||
"search": {
|
|
||||||
"configNodes": "配置节点",
|
|
||||||
"unusedConfigNodes": "未使用的配置节点",
|
|
||||||
"invalidNodes": "无效的节点",
|
|
||||||
"uknownNodes": "未知的节点",
|
|
||||||
"unusedSubflows": "未使用的子流程"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "帮助",
|
"name": "帮助",
|
||||||
@@ -842,7 +838,14 @@
|
|||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"empty": "找不到匹配",
|
"empty": "找不到匹配",
|
||||||
"addNode": "添加一个节点..."
|
"addNode": "添加一个节点...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "配置节点",
|
||||||
|
"unusedConfigNodes": "未使用的配置节点",
|
||||||
|
"invalidNodes": "无效的节点",
|
||||||
|
"uknownNodes": "未知的节点",
|
||||||
|
"unusedSubflows": "未使用的子流程"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "功能",
|
"functions": "功能",
|
||||||
|
|||||||
@@ -182,7 +182,8 @@
|
|||||||
"create-default-package": "創建默認的包文件",
|
"create-default-package": "創建默認的包文件",
|
||||||
"no-thanks": "不了,謝謝",
|
"no-thanks": "不了,謝謝",
|
||||||
"create-default-project": "創建默認項目文件",
|
"create-default-project": "創建默認項目文件",
|
||||||
"show-merge-conflicts": "顯示合併衝突"
|
"show-merge-conflicts": "顯示合併衝突",
|
||||||
|
"unknownNodesButton": "搜索未知節點"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
@@ -264,7 +265,9 @@
|
|||||||
"successfulRestart": "成功重啟流程",
|
"successfulRestart": "成功重啟流程",
|
||||||
"deployFailed": "部署失敗: __message__",
|
"deployFailed": "部署失敗: __message__",
|
||||||
"unusedConfigNodes": "您有一些未使用的配置節點",
|
"unusedConfigNodes": "您有一些未使用的配置節點",
|
||||||
"unusedConfigNodesLink": "點擊此處查看它們",
|
"unusedConfigNodesButton":"搜索未使用的配置節點",
|
||||||
|
"unknownNodesButton":"搜索未知節點",
|
||||||
|
"invalidNodesButton":"搜索無效節點",
|
||||||
"errors": {
|
"errors": {
|
||||||
"noResponse": "伺服器沒有回應"
|
"noResponse": "伺服器沒有回應"
|
||||||
},
|
},
|
||||||
@@ -614,14 +617,7 @@
|
|||||||
"empty": "空的",
|
"empty": "空的",
|
||||||
"globalConfig": "全局配置節點",
|
"globalConfig": "全局配置節點",
|
||||||
"triggerAction": "觸發動作",
|
"triggerAction": "觸發動作",
|
||||||
"find": "在工作區中查找",
|
"find": "在工作區中查找"
|
||||||
"search": {
|
|
||||||
"configNodes": "配置節點",
|
|
||||||
"unusedConfigNodes": "未使用的配置節點",
|
|
||||||
"invalidNodes": "無效的節點",
|
|
||||||
"uknownNodes": "未知的節點",
|
|
||||||
"unusedSubflows": "未使用的子流程"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "幫助",
|
"name": "幫助",
|
||||||
@@ -842,7 +838,14 @@
|
|||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"empty": "找不到匹配",
|
"empty": "找不到匹配",
|
||||||
"addNode": "添加一個節點..."
|
"addNode": "添加一個節點...",
|
||||||
|
"options": {
|
||||||
|
"configNodes": "配置節點",
|
||||||
|
"unusedConfigNodes": "未使用的配置節點",
|
||||||
|
"invalidNodes": "無效的節點",
|
||||||
|
"uknownNodes": "未知的節點",
|
||||||
|
"unusedSubflows": "未使用的子流程"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
"functions": "功能",
|
"functions": "功能",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-client",
|
"name": "@node-red/editor-client",
|
||||||
"version": "2.1.4",
|
"version": "3.0.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.setOptions = function(options) {
|
this.setOptions = function(options) {
|
||||||
this.options = {
|
o.options = {
|
||||||
// undef: true,
|
// undef: true,
|
||||||
// unused: true,
|
// unused: true,
|
||||||
esversion: 9,
|
esversion: 9,
|
||||||
@@ -98,7 +98,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
|||||||
if (options) {
|
if (options) {
|
||||||
for (var opt in options) {
|
for (var opt in options) {
|
||||||
if (options.hasOwnProperty(opt)) {
|
if (options.hasOwnProperty(opt)) {
|
||||||
this.options[opt] = options.opt;
|
o.options[opt] = options[opt];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 90 B |
1
packages/node_modules/@node-red/editor-client/src/images/grip-horizontal.svg
vendored
Normal file
1
packages/node_modules/@node-red/editor-client/src/images/grip-horizontal.svg
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg width="50" height="5" viewBox="0, 0, 50, 5" xmlns="http://www.w3.org/2000/svg"><path d="M0 1H50V4H0Z" fill="#CCC"/></svg>
|
||||||
|
After Width: | Height: | Size: 127 B |
Binary file not shown.
|
Before Width: | Height: | Size: 192 B |
1
packages/node_modules/@node-red/editor-client/src/images/grip.svg
vendored
Normal file
1
packages/node_modules/@node-red/editor-client/src/images/grip.svg
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg width="5" height="50" viewBox="0, 0, 5, 50" xmlns="http://www.w3.org/2000/svg"><path d="M1 0H4V50H1Z" fill="#CCC"/></svg>
|
||||||
|
After Width: | Height: | Size: 127 B |
4
packages/node_modules/@node-red/editor-client/src/images/start.svg
vendored
Normal file
4
packages/node_modules/@node-red/editor-client/src/images/start.svg
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path color="#000" fill="#8c101c" d="M0 0h32v32H0z"></path>
|
||||||
|
<path style="fill:#ffffff;stroke:#000000;stroke-width:0" d="M 24,16 8,24 8,8 Z" fill="none" stroke="#000" stroke-width="1.5"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 271 B |
4
packages/node_modules/@node-red/editor-client/src/images/stop.svg
vendored
Normal file
4
packages/node_modules/@node-red/editor-client/src/images/stop.svg
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path color="#000" fill="#8c101c" d="M0 0h32v32H0z"></path>
|
||||||
|
<rect style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0;" width="15" height="15" x="8" y="8.5"></rect>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 256 B |
@@ -13,10 +13,23 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An API for undo / redo history buffer
|
||||||
|
* @namespace RED.history
|
||||||
|
*/
|
||||||
RED.history = (function() {
|
RED.history = (function() {
|
||||||
var undoHistory = [];
|
var undoHistory = [];
|
||||||
var redoHistory = [];
|
var redoHistory = [];
|
||||||
|
|
||||||
|
function nodeOrJunction(id) {
|
||||||
|
var node = RED.nodes.node(id);
|
||||||
|
if (node) {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
return RED.nodes.junction(id);
|
||||||
|
}
|
||||||
|
|
||||||
function undoEvent(ev) {
|
function undoEvent(ev) {
|
||||||
var i;
|
var i;
|
||||||
var len;
|
var len;
|
||||||
@@ -101,6 +114,23 @@ RED.history = (function() {
|
|||||||
RED.nodes.removeLink(ev.links[i]);
|
RED.nodes.removeLink(ev.links[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ev.junctions) {
|
||||||
|
inverseEv.junctions = [];
|
||||||
|
for (i=0;i<ev.junctions.length;i++) {
|
||||||
|
inverseEv.junctions.push(ev.junctions[i]);
|
||||||
|
RED.nodes.removeJunction(ev.junctions[i]);
|
||||||
|
if (ev.junctions[i].g) {
|
||||||
|
var group = RED.nodes.group(ev.junctions[i].g);
|
||||||
|
var index = group.nodes.indexOf(ev.junctions[i]);
|
||||||
|
if (index !== -1) {
|
||||||
|
group.nodes.splice(index,1);
|
||||||
|
RED.group.markDirty(group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ev.groups) {
|
if (ev.groups) {
|
||||||
inverseEv.groups = [];
|
inverseEv.groups = [];
|
||||||
for (i = ev.groups.length - 1;i>=0;i--) {
|
for (i = ev.groups.length - 1;i>=0;i--) {
|
||||||
@@ -267,6 +297,21 @@ RED.history = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ev.junctions) {
|
||||||
|
inverseEv.junctions = [];
|
||||||
|
for (i=0;i<ev.junctions.length;i++) {
|
||||||
|
inverseEv.junctions.push(ev.junctions[i]);
|
||||||
|
RED.nodes.addJunction(ev.junctions[i]);
|
||||||
|
if (ev.junctions[i].g) {
|
||||||
|
group = RED.nodes.group(ev.junctions[i].g);
|
||||||
|
if (group.nodes.indexOf(ev.junctions[i]) === -1) {
|
||||||
|
group.nodes.push(ev.junctions[i]);
|
||||||
|
}
|
||||||
|
RED.group.markDirty(group)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ev.links) {
|
if (ev.links) {
|
||||||
inverseEv.links = [];
|
inverseEv.links = [];
|
||||||
for (i=0;i<ev.links.length;i++) {
|
for (i=0;i<ev.links.length;i++) {
|
||||||
@@ -477,6 +522,7 @@ RED.history = (function() {
|
|||||||
var z = ev.activeWorkspace;
|
var z = ev.activeWorkspace;
|
||||||
var fullNodeList = RED.nodes.filterNodes({z:ev.subflow.subflow.id});
|
var fullNodeList = RED.nodes.filterNodes({z:ev.subflow.subflow.id});
|
||||||
fullNodeList = fullNodeList.concat(RED.nodes.groups(ev.subflow.subflow.id))
|
fullNodeList = fullNodeList.concat(RED.nodes.groups(ev.subflow.subflow.id))
|
||||||
|
fullNodeList = fullNodeList.concat(RED.nodes.junctions(ev.subflow.subflow.id))
|
||||||
fullNodeList.forEach(function(n) {
|
fullNodeList.forEach(function(n) {
|
||||||
n.x += ev.subflow.offsetX;
|
n.x += ev.subflow.offsetX;
|
||||||
n.y += ev.subflow.offsetY;
|
n.y += ev.subflow.offsetY;
|
||||||
@@ -486,7 +532,7 @@ RED.history = (function() {
|
|||||||
});
|
});
|
||||||
inverseEv.subflows = [];
|
inverseEv.subflows = [];
|
||||||
for (i=0;i<ev.nodes.length;i++) {
|
for (i=0;i<ev.nodes.length;i++) {
|
||||||
inverseEv.subflows.push(RED.nodes.node(ev.nodes[i]));
|
inverseEv.subflows.push(nodeOrJunction(ev.nodes[i]));
|
||||||
RED.nodes.remove(ev.nodes[i]);
|
RED.nodes.remove(ev.nodes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -684,6 +730,13 @@ RED.history = (function() {
|
|||||||
peek: function() {
|
peek: function() {
|
||||||
return undoHistory[undoHistory.length-1];
|
return undoHistory[undoHistory.length-1];
|
||||||
},
|
},
|
||||||
|
replace: function(ev) {
|
||||||
|
if (undoHistory.length === 0) {
|
||||||
|
RED.history.push(ev);
|
||||||
|
} else {
|
||||||
|
undoHistory[undoHistory.length-1] = ev;
|
||||||
|
}
|
||||||
|
},
|
||||||
clear: function() {
|
clear: function() {
|
||||||
undoHistory = [];
|
undoHistory = [];
|
||||||
redoHistory = [];
|
redoHistory = [];
|
||||||
|
|||||||
@@ -3,16 +3,12 @@
|
|||||||
"alt-shift-p":"core:manage-palette",
|
"alt-shift-p":"core:manage-palette",
|
||||||
"ctrl-f": "core:search",
|
"ctrl-f": "core:search",
|
||||||
"ctrl-shift-f": "core:list-flows",
|
"ctrl-shift-f": "core:list-flows",
|
||||||
"ctrl-+": "core:zoom-in",
|
|
||||||
"ctrl--": "core:zoom-out",
|
|
||||||
"ctrl-0": "core:zoom-reset",
|
|
||||||
"ctrl-enter": "core:confirm-edit-tray",
|
|
||||||
"ctrl-escape": "core:cancel-edit-tray",
|
|
||||||
"ctrl-d": "core:deploy-flows",
|
"ctrl-d": "core:deploy-flows",
|
||||||
"ctrl-g i": "core:show-info-tab",
|
|
||||||
"ctrl-g h": "core:show-help-tab",
|
|
||||||
"ctrl-g d": "core:show-debug-tab",
|
|
||||||
"ctrl-g c": "core:show-config-tab",
|
"ctrl-g c": "core:show-config-tab",
|
||||||
|
"ctrl-g d": "core:show-debug-tab",
|
||||||
|
"ctrl-g h": "core:show-help-tab",
|
||||||
|
"ctrl-g i": "core:show-info-tab",
|
||||||
|
"ctrl-g v": "core:show-version-control-tab",
|
||||||
"ctrl-g x": "core:show-context-tab",
|
"ctrl-g x": "core:show-context-tab",
|
||||||
"ctrl-e": "core:show-export-dialog",
|
"ctrl-e": "core:show-export-dialog",
|
||||||
"ctrl-i": "core:show-import-dialog",
|
"ctrl-i": "core:show-import-dialog",
|
||||||
@@ -23,11 +19,8 @@
|
|||||||
"ctrl-alt-r": "core:show-remote-diff",
|
"ctrl-alt-r": "core:show-remote-diff",
|
||||||
"ctrl-alt-n": "core:new-project",
|
"ctrl-alt-n": "core:new-project",
|
||||||
"ctrl-alt-o": "core:open-project",
|
"ctrl-alt-o": "core:open-project",
|
||||||
"ctrl-g v": "core:show-version-control-tab",
|
|
||||||
"ctrl-shift-l": "core:show-event-log",
|
"ctrl-shift-l": "core:show-event-log",
|
||||||
"ctrl-shift-p":"core:show-action-list",
|
"ctrl-shift-p":"core:show-action-list"
|
||||||
"alt-w": "core:hide-flow",
|
|
||||||
"alt-shift-w": "core:show-last-hidden-flow"
|
|
||||||
},
|
},
|
||||||
"red-ui-sidebar-node-config": {
|
"red-ui-sidebar-node-config": {
|
||||||
"backspace": "core:delete-config-selection",
|
"backspace": "core:delete-config-selection",
|
||||||
@@ -38,7 +31,9 @@
|
|||||||
},
|
},
|
||||||
"red-ui-workspace": {
|
"red-ui-workspace": {
|
||||||
"backspace": "core:delete-selection",
|
"backspace": "core:delete-selection",
|
||||||
|
"ctrl-backspace": "core:delete-selection-and-reconnect",
|
||||||
"delete": "core:delete-selection",
|
"delete": "core:delete-selection",
|
||||||
|
"ctrl-delete": "core:delete-selection-and-reconnect",
|
||||||
"enter": "core:edit-selected-node",
|
"enter": "core:edit-selected-node",
|
||||||
"ctrl-enter": "core:go-to-selection",
|
"ctrl-enter": "core:go-to-selection",
|
||||||
"ctrl-c": "core:copy-selection-to-internal-clipboard",
|
"ctrl-c": "core:copy-selection-to-internal-clipboard",
|
||||||
@@ -88,6 +83,19 @@
|
|||||||
"alt-a m": "core:align-selection-to-middle",
|
"alt-a m": "core:align-selection-to-middle",
|
||||||
"alt-a c": "core:align-selection-to-center",
|
"alt-a c": "core:align-selection-to-center",
|
||||||
"alt-a h": "core:distribute-selection-horizontally",
|
"alt-a h": "core:distribute-selection-horizontally",
|
||||||
"alt-a v": "core:distribute-selection-vertically"
|
"alt-a v": "core:distribute-selection-vertically",
|
||||||
|
"shift-f": "core:search-previous",
|
||||||
|
"f": "core:search-next",
|
||||||
|
"alt-l l": "core:split-wire-with-link-nodes",
|
||||||
|
"alt-w": "core:hide-flow",
|
||||||
|
"alt-shift-w": "core:show-last-hidden-flow",
|
||||||
|
"ctrl-+": "core:zoom-in",
|
||||||
|
"ctrl--": "core:zoom-out",
|
||||||
|
"ctrl-0": "core:zoom-reset"
|
||||||
|
|
||||||
|
},
|
||||||
|
"red-ui-editor-stack": {
|
||||||
|
"ctrl-enter": "core:confirm-edit-tray",
|
||||||
|
"ctrl-escape": "core:cancel-edit-tray"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,16 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Interface to nodes and utility functions for creating/adding/deleting nodes and links
|
||||||
|
* @namespace RED.nodes
|
||||||
|
*/
|
||||||
RED.nodes = (function() {
|
RED.nodes = (function() {
|
||||||
|
|
||||||
|
var PORT_TYPE_INPUT = 1;
|
||||||
|
var PORT_TYPE_OUTPUT = 0;
|
||||||
|
|
||||||
var node_defs = {};
|
var node_defs = {};
|
||||||
var linkTabMap = {};
|
var linkTabMap = {};
|
||||||
|
|
||||||
@@ -30,6 +38,9 @@ RED.nodes = (function() {
|
|||||||
var groups = {};
|
var groups = {};
|
||||||
var groupsByZ = {};
|
var groupsByZ = {};
|
||||||
|
|
||||||
|
var junctions = {};
|
||||||
|
var junctionsByZ = {};
|
||||||
|
|
||||||
var initialLoad;
|
var initialLoad;
|
||||||
|
|
||||||
var dirty = false;
|
var dirty = false;
|
||||||
@@ -597,6 +608,14 @@ RED.nodes = (function() {
|
|||||||
RED.events.emit('nodes:add',n);
|
RED.events.emit('nodes:add',n);
|
||||||
}
|
}
|
||||||
function addLink(l) {
|
function addLink(l) {
|
||||||
|
if (nodeLinks[l.source.id]) {
|
||||||
|
const isUnique = nodeLinks[l.source.id].out.every(function(link) {
|
||||||
|
return link.sourcePort !== l.sourcePort || link.target.id !== l.target.id
|
||||||
|
})
|
||||||
|
if (!isUnique) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
links.push(l);
|
links.push(l);
|
||||||
if (l.source) {
|
if (l.source) {
|
||||||
// Possible the node hasn't been added yet
|
// Possible the node hasn't been added yet
|
||||||
@@ -719,6 +738,10 @@ RED.nodes = (function() {
|
|||||||
moveGroupToTab(node,z);
|
moveGroupToTab(node,z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (node.type === "junction") {
|
||||||
|
moveJunctionToTab(node,z);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var oldZ = node.z;
|
var oldZ = node.z;
|
||||||
allNodes.moveNode(node,z);
|
allNodes.moveNode(node,z);
|
||||||
var nl = nodeLinks[node.id];
|
var nl = nodeLinks[node.id];
|
||||||
@@ -753,6 +776,39 @@ RED.nodes = (function() {
|
|||||||
RED.events.emit("groups:change",group);
|
RED.events.emit("groups:change",group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function moveJunctionToTab(junction, z) {
|
||||||
|
var index = junctionsByZ[junction.z].indexOf(junction);
|
||||||
|
junctionsByZ[junction.z].splice(index,1);
|
||||||
|
junctionsByZ[z] = junctionsByZ[z] || [];
|
||||||
|
junctionsByZ[z].push(junction);
|
||||||
|
|
||||||
|
var oldZ = junction.z;
|
||||||
|
junction.z = z;
|
||||||
|
|
||||||
|
var nl = nodeLinks[junction.id];
|
||||||
|
if (nl) {
|
||||||
|
nl.in.forEach(function(l) {
|
||||||
|
var idx = linkTabMap[oldZ].indexOf(l);
|
||||||
|
if (idx != -1) {
|
||||||
|
linkTabMap[oldZ].splice(idx, 1);
|
||||||
|
}
|
||||||
|
if ((l.source.z === z) && linkTabMap[z]) {
|
||||||
|
linkTabMap[z].push(l);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
nl.out.forEach(function(l) {
|
||||||
|
var idx = linkTabMap[oldZ].indexOf(l);
|
||||||
|
if (idx != -1) {
|
||||||
|
linkTabMap[oldZ].splice(idx, 1);
|
||||||
|
}
|
||||||
|
if ((l.target.z === z) && linkTabMap[z]) {
|
||||||
|
linkTabMap[z].push(l);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
RED.events.emit("junctions:change",junction);
|
||||||
|
}
|
||||||
|
|
||||||
function removeLink(l) {
|
function removeLink(l) {
|
||||||
var index = links.indexOf(l);
|
var index = links.indexOf(l);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
@@ -803,6 +859,7 @@ RED.nodes = (function() {
|
|||||||
var removedNodes = [];
|
var removedNodes = [];
|
||||||
var removedLinks = [];
|
var removedLinks = [];
|
||||||
var removedGroups = [];
|
var removedGroups = [];
|
||||||
|
var removedJunctions = [];
|
||||||
if (ws) {
|
if (ws) {
|
||||||
delete workspaces[id];
|
delete workspaces[id];
|
||||||
delete linkTabMap[id];
|
delete linkTabMap[id];
|
||||||
@@ -821,11 +878,16 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
removedJunctions = RED.nodes.junctions(id)
|
||||||
|
|
||||||
for (i=0;i<removedNodes.length;i++) {
|
for (i=0;i<removedNodes.length;i++) {
|
||||||
var result = removeNode(removedNodes[i].id);
|
var result = removeNode(removedNodes[i].id);
|
||||||
removedLinks = removedLinks.concat(result.links);
|
removedLinks = removedLinks.concat(result.links);
|
||||||
}
|
}
|
||||||
|
for (i=0;i<removedJunctions.length;i++) {
|
||||||
|
var result = removeJunction(removedJunctions[i])
|
||||||
|
removedLinks = removedLinks.concat(result.links)
|
||||||
|
}
|
||||||
|
|
||||||
// Must get 'removedGroups' in the right order.
|
// Must get 'removedGroups' in the right order.
|
||||||
// - start with the top-most groups
|
// - start with the top-most groups
|
||||||
@@ -845,7 +907,7 @@ RED.nodes = (function() {
|
|||||||
allNodes.removeTab(id);
|
allNodes.removeTab(id);
|
||||||
RED.events.emit('flows:remove',ws);
|
RED.events.emit('flows:remove',ws);
|
||||||
}
|
}
|
||||||
return {nodes:removedNodes,links:removedLinks, groups: removedGroups};
|
return {nodes:removedNodes,links:removedLinks, groups: removedGroups, junctions: removedJunctions};
|
||||||
}
|
}
|
||||||
|
|
||||||
function addSubflow(sf, createNewIds) {
|
function addSubflow(sf, createNewIds) {
|
||||||
@@ -1102,7 +1164,7 @@ RED.nodes = (function() {
|
|||||||
delete node.env;
|
delete node.env;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (n._def.category != "config") {
|
if (n._def.category != "config" || n.type === 'junction') {
|
||||||
node.x = n.x;
|
node.x = n.x;
|
||||||
node.y = n.y;
|
node.y = n.y;
|
||||||
if (exportDimensions) {
|
if (exportDimensions) {
|
||||||
@@ -1263,7 +1325,6 @@ RED.nodes = (function() {
|
|||||||
} else {
|
} else {
|
||||||
nodeSet = [sf];
|
nodeSet = [sf];
|
||||||
}
|
}
|
||||||
console.log(nodeSet);
|
|
||||||
return createExportableNodeSet(nodeSet);
|
return createExportableNodeSet(nodeSet);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -1299,6 +1360,10 @@ RED.nodes = (function() {
|
|||||||
exportedConfigNodes[n.id] = true;
|
exportedConfigNodes[n.id] = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
subflowSet = subflowSet.concat(RED.nodes.junctions(subflowId))
|
||||||
|
subflowSet = subflowSet.concat(RED.nodes.groups(subflowId))
|
||||||
|
|
||||||
var exportableSubflow = createExportableNodeSet(subflowSet, exportedIds, exportedSubflows, exportedConfigNodes);
|
var exportableSubflow = createExportableNodeSet(subflowSet, exportedIds, exportedSubflows, exportedConfigNodes);
|
||||||
nns = exportableSubflow.concat(nns);
|
nns = exportableSubflow.concat(nns);
|
||||||
}
|
}
|
||||||
@@ -1365,6 +1430,11 @@ RED.nodes = (function() {
|
|||||||
nns.push(convertNode(groups[i], opts));
|
nns.push(convertNode(groups[i], opts));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (i in junctions) {
|
||||||
|
if (junctions.hasOwnProperty(i)) {
|
||||||
|
nns.push(convertNode(junctions[i], opts));
|
||||||
|
}
|
||||||
|
}
|
||||||
for (i in configNodes) {
|
for (i in configNodes) {
|
||||||
if (configNodes.hasOwnProperty(i)) {
|
if (configNodes.hasOwnProperty(i)) {
|
||||||
nns.push(convertNode(configNodes[i], opts));
|
nns.push(convertNode(configNodes[i], opts));
|
||||||
@@ -1446,6 +1516,7 @@ RED.nodes = (function() {
|
|||||||
tabs: {},
|
tabs: {},
|
||||||
subflows: {},
|
subflows: {},
|
||||||
groups: {},
|
groups: {},
|
||||||
|
junctions: {},
|
||||||
configs: {},
|
configs: {},
|
||||||
nodes: {},
|
nodes: {},
|
||||||
all: [],
|
all: [],
|
||||||
@@ -1461,6 +1532,8 @@ RED.nodes = (function() {
|
|||||||
imported.subflows[n.id] = n;
|
imported.subflows[n.id] = n;
|
||||||
} else if (n.type === "group") {
|
} else if (n.type === "group") {
|
||||||
imported.groups[n.id] = n;
|
imported.groups[n.id] = n;
|
||||||
|
} else if (n.type === "junction") {
|
||||||
|
imported.junctions[n.id] = n;
|
||||||
} else if (n.hasOwnProperty("x") && n.hasOwnProperty("y")) {
|
} else if (n.hasOwnProperty("x") && n.hasOwnProperty("y")) {
|
||||||
imported.nodes[n.id] = n;
|
imported.nodes[n.id] = n;
|
||||||
} else {
|
} else {
|
||||||
@@ -1469,7 +1542,7 @@ RED.nodes = (function() {
|
|||||||
var nodeZ = n.z || "__global__";
|
var nodeZ = n.z || "__global__";
|
||||||
imported.zMap[nodeZ] = imported.zMap[nodeZ] || [];
|
imported.zMap[nodeZ] = imported.zMap[nodeZ] || [];
|
||||||
imported.zMap[nodeZ].push(n)
|
imported.zMap[nodeZ].push(n)
|
||||||
if (allNodes.hasNode(n.id) || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id]) {
|
if (allNodes.hasNode(n.id) || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id] || junctions[n.id]) {
|
||||||
imported.conflicted[n.id] = n;
|
imported.conflicted[n.id] = n;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1578,21 +1651,20 @@ RED.nodes = (function() {
|
|||||||
* Options:
|
* Options:
|
||||||
* - generateIds - whether to replace all node ids
|
* - generateIds - whether to replace all node ids
|
||||||
* - addFlow - whether to import nodes to a new tab
|
* - addFlow - whether to import nodes to a new tab
|
||||||
* - importToCurrent
|
* - reimport - if node has a .z property, dont overwrite it
|
||||||
|
* Only applicible when `generateIds` is false
|
||||||
* - importMap - how to resolve any conflicts.
|
* - importMap - how to resolve any conflicts.
|
||||||
* - id:import - import as-is
|
* - id:import - import as-is
|
||||||
* - id:copy - import with new id
|
* - id:copy - import with new id
|
||||||
* - id:replace - import over the top of existing
|
* - id:replace - import over the top of existing
|
||||||
*/
|
*/
|
||||||
function importNodes(newNodesObj,options) { // createNewIds,createMissingWorkspace) {
|
function importNodes(newNodesObj,options) { // createNewIds,createMissingWorkspace) {
|
||||||
options = options || {
|
const defOpts = { generateIds: false, addFlow: false, reimport: false, importMap: {} }
|
||||||
generateIds: false,
|
options = Object.assign({}, defOpts, options)
|
||||||
addFlow: false,
|
options.importMap = options.importMap || {}
|
||||||
}
|
const createNewIds = options.generateIds;
|
||||||
options.importMap = options.importMap || {};
|
const reimport = (!createNewIds && !!options.reimport)
|
||||||
|
const createMissingWorkspace = options.addFlow;
|
||||||
var createNewIds = options.generateIds;
|
|
||||||
var createMissingWorkspace = options.addFlow;
|
|
||||||
var i;
|
var i;
|
||||||
var n;
|
var n;
|
||||||
var newNodes;
|
var newNodes;
|
||||||
@@ -1635,7 +1707,7 @@ RED.nodes = (function() {
|
|||||||
if (!options.generateIds) {
|
if (!options.generateIds) {
|
||||||
if (!options.importMap[id]) {
|
if (!options.importMap[id]) {
|
||||||
// No conflict resolution for this node
|
// No conflict resolution for this node
|
||||||
var existing = allNodes.getNode(id) || configNodes[id] || workspaces[id] || subflows[id] || groups[id];
|
var existing = allNodes.getNode(id) || configNodes[id] || workspaces[id] || subflows[id] || groups[id] || junctions[id];
|
||||||
if (existing) {
|
if (existing) {
|
||||||
existingNodes.push({existing:existing, imported:n});
|
existingNodes.push({existing:existing, imported:n});
|
||||||
}
|
}
|
||||||
@@ -1689,6 +1761,7 @@ RED.nodes = (function() {
|
|||||||
n.type != "tab" &&
|
n.type != "tab" &&
|
||||||
n.type != "subflow" &&
|
n.type != "subflow" &&
|
||||||
n.type != "group" &&
|
n.type != "group" &&
|
||||||
|
n.type != 'junction' &&
|
||||||
!registry.getNodeType(n.type) &&
|
!registry.getNodeType(n.type) &&
|
||||||
n.type.substring(0,8) != "subflow:" &&
|
n.type.substring(0,8) != "subflow:" &&
|
||||||
unknownTypes.indexOf(n.type)==-1) {
|
unknownTypes.indexOf(n.type)==-1) {
|
||||||
@@ -1761,6 +1834,7 @@ RED.nodes = (function() {
|
|||||||
var new_nodes = [];
|
var new_nodes = [];
|
||||||
var new_links = [];
|
var new_links = [];
|
||||||
var new_groups = [];
|
var new_groups = [];
|
||||||
|
var new_junctions = [];
|
||||||
var new_group_set = new Set();
|
var new_group_set = new Set();
|
||||||
var nid;
|
var nid;
|
||||||
var def;
|
var def;
|
||||||
@@ -1891,7 +1965,8 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (n.z && !workspace_map[n.z] && !subflow_map[n.z]) {
|
const keepNodesCurrentZ = reimport && n.z && (RED.workspaces.contains(n.z) || RED.nodes.subflow(n.z))
|
||||||
|
if (!keepNodesCurrentZ && n.z && !workspace_map[n.z] && !subflow_map[n.z]) {
|
||||||
n.z = activeWorkspace;
|
n.z = activeWorkspace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1952,12 +2027,15 @@ RED.nodes = (function() {
|
|||||||
changed:false,
|
changed:false,
|
||||||
_config:{}
|
_config:{}
|
||||||
}
|
}
|
||||||
if (n.type !== "group") {
|
if (n.type !== "group" && n.type !== 'junction') {
|
||||||
node.wires = n.wires||[];
|
node.wires = n.wires||[];
|
||||||
node.inputLabels = n.inputLabels;
|
node.inputLabels = n.inputLabels;
|
||||||
node.outputLabels = n.outputLabels;
|
node.outputLabels = n.outputLabels;
|
||||||
node.icon = n.icon;
|
node.icon = n.icon;
|
||||||
}
|
}
|
||||||
|
if (n.type === 'junction') {
|
||||||
|
node.wires = n.wires||[];
|
||||||
|
}
|
||||||
if (n.hasOwnProperty('l')) {
|
if (n.hasOwnProperty('l')) {
|
||||||
node.l = n.l;
|
node.l = n.l;
|
||||||
}
|
}
|
||||||
@@ -1989,7 +2067,8 @@ RED.nodes = (function() {
|
|||||||
node.id = getID();
|
node.id = getID();
|
||||||
} else {
|
} else {
|
||||||
node.id = n.id;
|
node.id = n.id;
|
||||||
if (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z])) {
|
const keepNodesCurrentZ = reimport && node.z && (RED.workspaces.contains(node.z) || RED.nodes.subflow(node.z))
|
||||||
|
if (!keepNodesCurrentZ && (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z]))) {
|
||||||
if (createMissingWorkspace) {
|
if (createMissingWorkspace) {
|
||||||
if (missingWorkspace === null) {
|
if (missingWorkspace === null) {
|
||||||
missingWorkspace = RED.workspaces.add(null,true);
|
missingWorkspace = RED.workspaces.add(null,true);
|
||||||
@@ -2026,6 +2105,15 @@ RED.nodes = (function() {
|
|||||||
node.outputs = subflow.out.length;
|
node.outputs = subflow.out.length;
|
||||||
node.inputs = subflow.in.length;
|
node.inputs = subflow.in.length;
|
||||||
node.env = n.env;
|
node.env = n.env;
|
||||||
|
} else if (n.type === 'junction') {
|
||||||
|
node._def = {defaults:{}}
|
||||||
|
node._config.x = node.x
|
||||||
|
node._config.y = node.y
|
||||||
|
node.inputs = 1
|
||||||
|
node.outputs = 1
|
||||||
|
node.w = 0;
|
||||||
|
node.h = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!node._def) {
|
if (!node._def) {
|
||||||
if (node.x && node.y) {
|
if (node.x && node.y) {
|
||||||
@@ -2109,7 +2197,9 @@ RED.nodes = (function() {
|
|||||||
node_map[n.id] = node;
|
node_map[n.id] = node;
|
||||||
// If an 'unknown' config node, it will not have been caught by the
|
// If an 'unknown' config node, it will not have been caught by the
|
||||||
// proper config node handling, so needs adding to new_nodes here
|
// proper config node handling, so needs adding to new_nodes here
|
||||||
if (node.type === "unknown" || node._def.category !== "config") {
|
if (node.type === 'junction') {
|
||||||
|
new_junctions.push(node)
|
||||||
|
} else if (node.type === "unknown" || node._def.category !== "config") {
|
||||||
new_nodes.push(node);
|
new_nodes.push(node);
|
||||||
} else if (node.type === "group") {
|
} else if (node.type === "group") {
|
||||||
new_groups.push(node);
|
new_groups.push(node);
|
||||||
@@ -2120,11 +2210,15 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remap all wires and config node references
|
// Remap all wires and config node references
|
||||||
for (i=0;i<new_nodes.length;i++) {
|
for (i=0;i<new_nodes.length+new_junctions.length;i++) {
|
||||||
n = new_nodes[i];
|
if (i<new_nodes.length) {
|
||||||
|
n = new_nodes[i];
|
||||||
|
} else {
|
||||||
|
n = new_junctions[i - new_nodes.length]
|
||||||
|
}
|
||||||
if (n.wires) {
|
if (n.wires) {
|
||||||
for (var w1=0;w1<n.wires.length;w1++) {
|
for (var w1=0;w1<n.wires.length;w1++) {
|
||||||
var wires = (n.wires[w1] instanceof Array)?n.wires[w1]:[n.wires[w1]];
|
var wires = (Array.isArray(n.wires[w1]))?n.wires[w1]:[n.wires[w1]];
|
||||||
for (var w2=0;w2<wires.length;w2++) {
|
for (var w2=0;w2<wires.length;w2++) {
|
||||||
if (node_map.hasOwnProperty(wires[w2])) {
|
if (node_map.hasOwnProperty(wires[w2])) {
|
||||||
if (n.z === node_map[wires[w2]].z) {
|
if (n.z === node_map[wires[w2]].z) {
|
||||||
@@ -2260,6 +2354,12 @@ RED.nodes = (function() {
|
|||||||
addGroup(n);
|
addGroup(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i=0;i<new_junctions.length;i++) {
|
||||||
|
var junction = new_junctions[i];
|
||||||
|
addJunction(junction);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Now the nodes have been fully updated, add them.
|
// Now the nodes have been fully updated, add them.
|
||||||
for (i=0;i<new_nodes.length;i++) {
|
for (i=0;i<new_nodes.length;i++) {
|
||||||
var node = new_nodes[i];
|
var node = new_nodes[i];
|
||||||
@@ -2290,6 +2390,7 @@ RED.nodes = (function() {
|
|||||||
nodes:new_nodes,
|
nodes:new_nodes,
|
||||||
links:new_links,
|
links:new_links,
|
||||||
groups:new_groups,
|
groups:new_groups,
|
||||||
|
junctions: new_junctions,
|
||||||
workspaces:new_workspaces,
|
workspaces:new_workspaces,
|
||||||
subflows:new_subflows,
|
subflows:new_subflows,
|
||||||
missingWorkspace: missingWorkspace,
|
missingWorkspace: missingWorkspace,
|
||||||
@@ -2396,6 +2497,8 @@ RED.nodes = (function() {
|
|||||||
workspacesOrder = [];
|
workspacesOrder = [];
|
||||||
groups = {};
|
groups = {};
|
||||||
groupsByZ = {};
|
groupsByZ = {};
|
||||||
|
junctions = {};
|
||||||
|
junctionsByZ = {};
|
||||||
|
|
||||||
var subflowIds = Object.keys(subflows);
|
var subflowIds = Object.keys(subflows);
|
||||||
subflowIds.forEach(function(id) {
|
subflowIds.forEach(function(id) {
|
||||||
@@ -2445,6 +2548,30 @@ RED.nodes = (function() {
|
|||||||
RED.events.emit("groups:remove",group);
|
RED.events.emit("groups:remove",group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addJunction(junction) {
|
||||||
|
junctionsByZ[junction.z] = junctionsByZ[junction.z] || []
|
||||||
|
junctionsByZ[junction.z].push(junction)
|
||||||
|
junctions[junction.id] = junction;
|
||||||
|
if (!nodeLinks[junction.id]) {
|
||||||
|
nodeLinks[junction.id] = {in:[],out:[]};
|
||||||
|
}
|
||||||
|
RED.events.emit("junctions:add", junction)
|
||||||
|
}
|
||||||
|
function removeJunction(junction) {
|
||||||
|
var i = junctionsByZ[junction.z].indexOf(junction)
|
||||||
|
junctionsByZ[junction.z].splice(i, 1)
|
||||||
|
if (junctionsByZ[junction.z].length === 0) {
|
||||||
|
delete junctionsByZ[junction.z]
|
||||||
|
}
|
||||||
|
delete junctions[junction.id]
|
||||||
|
delete nodeLinks[junction.id];
|
||||||
|
RED.events.emit("junctions:remove", junction)
|
||||||
|
|
||||||
|
var removedLinks = links.filter(function(l) { return (l.source === junction) || (l.target === junction); });
|
||||||
|
removedLinks.forEach(removeLink);
|
||||||
|
return { links: removedLinks }
|
||||||
|
}
|
||||||
|
|
||||||
function getNodeHelp(type) {
|
function getNodeHelp(type) {
|
||||||
var helpContent = "";
|
var helpContent = "";
|
||||||
var helpElement = $("script[data-help-name='"+type+"']");
|
var helpElement = $("script[data-help-name='"+type+"']");
|
||||||
@@ -2458,6 +2585,144 @@ RED.nodes = (function() {
|
|||||||
return helpContent;
|
return helpContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNodeIslands(nodes) {
|
||||||
|
var selectedNodes = new Set(nodes);
|
||||||
|
// Maps node => island index
|
||||||
|
var nodeToIslandIndex = new Map();
|
||||||
|
// Maps island index => [nodes in island]
|
||||||
|
var islandIndexToNodes = new Map();
|
||||||
|
var internalLinks = new Set();
|
||||||
|
nodes.forEach((node, index) => {
|
||||||
|
nodeToIslandIndex.set(node,index);
|
||||||
|
islandIndexToNodes.set(index, [node]);
|
||||||
|
var inboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_INPUT);
|
||||||
|
var outboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
|
||||||
|
inboundLinks.forEach(l => {
|
||||||
|
if (selectedNodes.has(l.source)) {
|
||||||
|
internalLinks.add(l)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
outboundLinks.forEach(l => {
|
||||||
|
if (selectedNodes.has(l.target)) {
|
||||||
|
internalLinks.add(l)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
internalLinks.forEach(l => {
|
||||||
|
let source = l.source;
|
||||||
|
let target = l.target;
|
||||||
|
if (nodeToIslandIndex.get(source) !== nodeToIslandIndex.get(target)) {
|
||||||
|
let sourceIsland = nodeToIslandIndex.get(source);
|
||||||
|
let islandToMove = nodeToIslandIndex.get(target);
|
||||||
|
let nodesToMove = islandIndexToNodes.get(islandToMove);
|
||||||
|
nodesToMove.forEach(n => {
|
||||||
|
nodeToIslandIndex.set(n,sourceIsland);
|
||||||
|
islandIndexToNodes.get(sourceIsland).push(n);
|
||||||
|
})
|
||||||
|
islandIndexToNodes.delete(islandToMove);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const result = [];
|
||||||
|
islandIndexToNodes.forEach((nodes,index) => {
|
||||||
|
result.push(nodes);
|
||||||
|
})
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function detachNodes(nodes) {
|
||||||
|
let allSelectedNodes = [];
|
||||||
|
nodes.forEach(node => {
|
||||||
|
if (node.type === 'group') {
|
||||||
|
let groupNodes = RED.group.getNodes(node,true,true);
|
||||||
|
allSelectedNodes = allSelectedNodes.concat(groupNodes);
|
||||||
|
} else {
|
||||||
|
allSelectedNodes.push(node);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (allSelectedNodes.length > 0 ) {
|
||||||
|
const nodeIslands = RED.nodes.getNodeIslands(allSelectedNodes);
|
||||||
|
let removedLinks = [];
|
||||||
|
let newLinks = [];
|
||||||
|
let createdLinkIds = new Set();
|
||||||
|
|
||||||
|
nodeIslands.forEach(nodes => {
|
||||||
|
let selectedNodes = new Set(nodes);
|
||||||
|
let allInboundLinks = [];
|
||||||
|
let allOutboundLinks = [];
|
||||||
|
// Identify links that enter or exit this island of nodes
|
||||||
|
nodes.forEach(node => {
|
||||||
|
var inboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_INPUT);
|
||||||
|
var outboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
|
||||||
|
inboundLinks.forEach(l => {
|
||||||
|
if (!selectedNodes.has(l.source)) {
|
||||||
|
allInboundLinks.push(l)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
outboundLinks.forEach(l => {
|
||||||
|
if (!selectedNodes.has(l.target)) {
|
||||||
|
allOutboundLinks.push(l)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Identify the links to restore
|
||||||
|
allInboundLinks.forEach(inLink => {
|
||||||
|
// For Each inbound link,
|
||||||
|
// - get source node.
|
||||||
|
// - trace through to all outbound links
|
||||||
|
let sourceNode = inLink.source;
|
||||||
|
let targetNodes = new Set();
|
||||||
|
let visited = new Set();
|
||||||
|
let stack = [inLink.target];
|
||||||
|
while (stack.length > 0) {
|
||||||
|
let node = stack.pop(stack);
|
||||||
|
visited.add(node)
|
||||||
|
let links = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
|
||||||
|
links.forEach(l => {
|
||||||
|
if (visited.has(l.target)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
visited.add(l.target);
|
||||||
|
if (selectedNodes.has(l.target)) {
|
||||||
|
// internal link
|
||||||
|
stack.push(l.target)
|
||||||
|
} else {
|
||||||
|
targetNodes.add(l.target)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
targetNodes.forEach(target => {
|
||||||
|
let linkId = `${sourceNode.id}[${inLink.sourcePort}] -> ${target.id}`
|
||||||
|
if (!createdLinkIds.has(linkId)) {
|
||||||
|
createdLinkIds.add(linkId);
|
||||||
|
let link = {
|
||||||
|
source: sourceNode,
|
||||||
|
sourcePort: inLink.sourcePort,
|
||||||
|
target: target
|
||||||
|
}
|
||||||
|
let existingLinks = RED.nodes.filterLinks(link)
|
||||||
|
if (existingLinks.length === 0) {
|
||||||
|
newLinks.push(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 2. delete all those links
|
||||||
|
allInboundLinks.forEach(l => { RED.nodes.removeLink(l); removedLinks.push(l)})
|
||||||
|
allOutboundLinks.forEach(l => { RED.nodes.removeLink(l); removedLinks.push(l)})
|
||||||
|
})
|
||||||
|
|
||||||
|
newLinks.forEach(l => RED.nodes.addLink(l));
|
||||||
|
return {
|
||||||
|
newLinks,
|
||||||
|
removedLinks
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function() {
|
init: function() {
|
||||||
RED.events.on("registry:node-type-added",function(type) {
|
RED.events.on("registry:node-type-added",function(type) {
|
||||||
@@ -2475,6 +2740,7 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const nodeGroupMap = {}
|
||||||
var replaceNodeIds = Object.keys(replaceNodes);
|
var replaceNodeIds = Object.keys(replaceNodes);
|
||||||
if (replaceNodeIds.length > 0) {
|
if (replaceNodeIds.length > 0) {
|
||||||
var reimportList = [];
|
var reimportList = [];
|
||||||
@@ -2485,6 +2751,12 @@ RED.nodes = (function() {
|
|||||||
} else {
|
} else {
|
||||||
allNodes.removeNode(n);
|
allNodes.removeNode(n);
|
||||||
}
|
}
|
||||||
|
if (n.g) {
|
||||||
|
// reimporting a node *without* including its group object
|
||||||
|
// will cause the g property to be cleared. Cache it
|
||||||
|
// here so we can restore it
|
||||||
|
nodeGroupMap[n.id] = n.g
|
||||||
|
}
|
||||||
reimportList.push(convertNode(n));
|
reimportList.push(convertNode(n));
|
||||||
RED.events.emit('nodes:remove',n);
|
RED.events.emit('nodes:remove',n);
|
||||||
});
|
});
|
||||||
@@ -2502,10 +2774,22 @@ RED.nodes = (function() {
|
|||||||
// Force the redraw to be synchronous so the view updates
|
// Force the redraw to be synchronous so the view updates
|
||||||
// *now* and removes the unknown node
|
// *now* and removes the unknown node
|
||||||
RED.view.redraw(true, true);
|
RED.view.redraw(true, true);
|
||||||
var result = importNodes(reimportList,{generateIds:false});
|
var result = importNodes(reimportList,{generateIds:false, reimport: true});
|
||||||
var newNodeMap = {};
|
var newNodeMap = {};
|
||||||
result.nodes.forEach(function(n) {
|
result.nodes.forEach(function(n) {
|
||||||
newNodeMap[n.id] = n;
|
newNodeMap[n.id] = n;
|
||||||
|
if (nodeGroupMap[n.id]) {
|
||||||
|
// This node is in a group - need to substitute the
|
||||||
|
// node reference inside the group
|
||||||
|
n.g = nodeGroupMap[n.id]
|
||||||
|
const group = RED.nodes.group(n.g)
|
||||||
|
if (group) {
|
||||||
|
var index = group.nodes.findIndex(gn => gn.id === n.id)
|
||||||
|
if (index > -1) {
|
||||||
|
group.nodes[index] = n
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
RED.nodes.eachLink(function(l) {
|
RED.nodes.eachLink(function(l) {
|
||||||
if (newNodeMap.hasOwnProperty(l.source.id)) {
|
if (newNodeMap.hasOwnProperty(l.source.id)) {
|
||||||
@@ -2535,11 +2819,10 @@ RED.nodes = (function() {
|
|||||||
getType: registry.getNodeType,
|
getType: registry.getNodeType,
|
||||||
getNodeHelp: getNodeHelp,
|
getNodeHelp: getNodeHelp,
|
||||||
convertNode: convertNode,
|
convertNode: convertNode,
|
||||||
|
|
||||||
add: addNode,
|
add: addNode,
|
||||||
remove: removeNode,
|
remove: removeNode,
|
||||||
clear: clear,
|
clear: clear,
|
||||||
|
detachNodes: detachNodes,
|
||||||
moveNodesForwards: moveNodesForwards,
|
moveNodesForwards: moveNodesForwards,
|
||||||
moveNodesBackwards: moveNodesBackwards,
|
moveNodesBackwards: moveNodesBackwards,
|
||||||
moveNodesToFront: moveNodesToFront,
|
moveNodesToFront: moveNodesToFront,
|
||||||
@@ -2551,7 +2834,20 @@ RED.nodes = (function() {
|
|||||||
|
|
||||||
addLink: addLink,
|
addLink: addLink,
|
||||||
removeLink: removeLink,
|
removeLink: removeLink,
|
||||||
|
getNodeLinks: function(id, portType) {
|
||||||
|
if (typeof id !== 'string') {
|
||||||
|
id = id.id;
|
||||||
|
}
|
||||||
|
if (nodeLinks[id]) {
|
||||||
|
if (portType === 1) {
|
||||||
|
// Return cloned arrays so they can be safely modified by caller
|
||||||
|
return [].concat(nodeLinks[id].in)
|
||||||
|
} else {
|
||||||
|
return [].concat(nodeLinks[id].out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
addWorkspace: addWorkspace,
|
addWorkspace: addWorkspace,
|
||||||
removeWorkspace: removeWorkspace,
|
removeWorkspace: removeWorkspace,
|
||||||
getWorkspaceOrder: function() { return workspacesOrder },
|
getWorkspaceOrder: function() { return workspacesOrder },
|
||||||
@@ -2568,6 +2864,11 @@ RED.nodes = (function() {
|
|||||||
group: function(id) { return groups[id] },
|
group: function(id) { return groups[id] },
|
||||||
groups: function(z) { return groupsByZ[z]?groupsByZ[z].slice():[] },
|
groups: function(z) { return groupsByZ[z]?groupsByZ[z].slice():[] },
|
||||||
|
|
||||||
|
addJunction: addJunction,
|
||||||
|
removeJunction: removeJunction,
|
||||||
|
junction: function(id) { return junctions[id] },
|
||||||
|
junctions: function(z) { return junctionsByZ[z]?junctionsByZ[z].slice():[] },
|
||||||
|
|
||||||
eachNode: function(cb) {
|
eachNode: function(cb) {
|
||||||
allNodes.eachNode(cb);
|
allNodes.eachNode(cb);
|
||||||
},
|
},
|
||||||
@@ -2625,6 +2926,7 @@ RED.nodes = (function() {
|
|||||||
getAllFlowNodes: getAllFlowNodes,
|
getAllFlowNodes: getAllFlowNodes,
|
||||||
getAllUpstreamNodes: getAllUpstreamNodes,
|
getAllUpstreamNodes: getAllUpstreamNodes,
|
||||||
getAllDownstreamNodes: getAllDownstreamNodes,
|
getAllDownstreamNodes: getAllDownstreamNodes,
|
||||||
|
getNodeIslands: getNodeIslands,
|
||||||
createExportableNodeSet: createExportableNodeSet,
|
createExportableNodeSet: createExportableNodeSet,
|
||||||
createCompleteNodeSet: createCompleteNodeSet,
|
createCompleteNodeSet: createCompleteNodeSet,
|
||||||
updateConfigNodeUsers: updateConfigNodeUsers,
|
updateConfigNodeUsers: updateConfigNodeUsers,
|
||||||
|
|||||||
@@ -252,8 +252,21 @@ var RED = (function() {
|
|||||||
if (/^#flow\/.+$/.test(currentHash)) {
|
if (/^#flow\/.+$/.test(currentHash)) {
|
||||||
RED.workspaces.show(currentHash.substring(6),true);
|
RED.workspaces.show(currentHash.substring(6),true);
|
||||||
}
|
}
|
||||||
if (RED.workspaces.active() === 0 && RED.workspaces.count() > 0) {
|
if (RED.workspaces.count() > 0) {
|
||||||
RED.workspaces.show(RED.nodes.getWorkspaceOrder()[0])
|
const hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
||||||
|
const workspaces = RED.nodes.getWorkspaceOrder();
|
||||||
|
if (RED.workspaces.active() === 0) {
|
||||||
|
for (let index = 0; index < workspaces.length; index++) {
|
||||||
|
const ws = workspaces[index];
|
||||||
|
if (!hiddenTabs[ws]) {
|
||||||
|
RED.workspaces.show(ws);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (RED.workspaces.active() === 0) {
|
||||||
|
RED.workspaces.show(workspaces[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
@@ -284,6 +297,10 @@ var RED = (function() {
|
|||||||
// handled below
|
// handled below
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (notificationId === "flows-run-state") {
|
||||||
|
// handled in editor-client/src/js/runtime.js
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (notificationId === "project-update") {
|
if (notificationId === "project-update") {
|
||||||
loader.start(RED._("event.loadingProject"), 0);
|
loader.start(RED._("event.loadingProject"), 0);
|
||||||
RED.nodes.clear();
|
RED.nodes.clear();
|
||||||
@@ -304,6 +321,8 @@ var RED = (function() {
|
|||||||
loader.end()
|
loader.end()
|
||||||
RED.notify($("<p>").text(message));
|
RED.notify($("<p>").text(message));
|
||||||
RED.sidebar.info.refresh()
|
RED.sidebar.info.refresh()
|
||||||
|
RED.menu.setDisabled('menu-item-projects-open',false);
|
||||||
|
RED.menu.setDisabled('menu-item-projects-settings',false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -319,7 +338,6 @@ var RED = (function() {
|
|||||||
id: notificationId
|
id: notificationId
|
||||||
}
|
}
|
||||||
if (notificationId === "runtime-state") {
|
if (notificationId === "runtime-state") {
|
||||||
RED.events.emit("runtime-state",msg);
|
|
||||||
if (msg.error === "safe-mode") {
|
if (msg.error === "safe-mode") {
|
||||||
options.buttons = [
|
options.buttons = [
|
||||||
{
|
{
|
||||||
@@ -345,6 +363,14 @@ var RED = (function() {
|
|||||||
} else {
|
} else {
|
||||||
options.buttons = [
|
options.buttons = [
|
||||||
{
|
{
|
||||||
|
text: RED._("notification.label.unknownNodesButton"),
|
||||||
|
class: "pull-left",
|
||||||
|
click: function() {
|
||||||
|
RED.actions.invoke("core:search", "type:unknown ");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
class: "primary",
|
||||||
text: RED._("common.label.close"),
|
text: RED._("common.label.close"),
|
||||||
click: function() {
|
click: function() {
|
||||||
persistentNotifications[notificationId].hideNotification();
|
persistentNotifications[notificationId].hideNotification();
|
||||||
@@ -452,16 +478,16 @@ var RED = (function() {
|
|||||||
} else if (persistentNotifications.hasOwnProperty(notificationId)) {
|
} else if (persistentNotifications.hasOwnProperty(notificationId)) {
|
||||||
persistentNotifications[notificationId].close();
|
persistentNotifications[notificationId].close();
|
||||||
delete persistentNotifications[notificationId];
|
delete persistentNotifications[notificationId];
|
||||||
if (notificationId === 'runtime-state') {
|
}
|
||||||
RED.events.emit("runtime-state",msg);
|
if (notificationId === 'runtime-state') {
|
||||||
}
|
RED.events.emit("runtime-state",msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.comms.subscribe("status/#",function(topic,msg) {
|
RED.comms.subscribe("status/#",function(topic,msg) {
|
||||||
var parts = topic.split("/");
|
var parts = topic.split("/");
|
||||||
var node = RED.nodes.node(parts[1]);
|
var node = RED.nodes.node(parts[1]);
|
||||||
if (node) {
|
if (node) {
|
||||||
if (msg.hasOwnProperty("text") && msg.text !== null && /^[a-zA-Z]/.test(msg.text)) {
|
if (msg.hasOwnProperty("text") && msg.text !== null && /^[@a-zA-Z]/.test(msg.text)) {
|
||||||
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString()});
|
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString()});
|
||||||
}
|
}
|
||||||
node.status = msg;
|
node.status = msg;
|
||||||
@@ -556,8 +582,7 @@ var RED = (function() {
|
|||||||
|
|
||||||
$(".red-ui-header-toolbar").show();
|
$(".red-ui-header-toolbar").show();
|
||||||
|
|
||||||
|
RED.sidebar.show(":first", true);
|
||||||
RED.sidebar.show(":first");
|
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
loader.end();
|
loader.end();
|
||||||
@@ -603,7 +628,10 @@ var RED = (function() {
|
|||||||
null,
|
null,
|
||||||
{id: "menu-item-edit-select-all", label:RED._("keyboard.selectAll"), onselect: "core:select-all-nodes"},
|
{id: "menu-item-edit-select-all", label:RED._("keyboard.selectAll"), onselect: "core:select-all-nodes"},
|
||||||
{id: "menu-item-edit-select-connected", label:RED._("keyboard.selectAllConnected"), onselect: "core:select-connected-nodes"},
|
{id: "menu-item-edit-select-connected", label:RED._("keyboard.selectAllConnected"), onselect: "core:select-connected-nodes"},
|
||||||
{id: "menu-item-edit-select-none", label:RED._("keyboard.selectNone"), onselect: "core:select-none"}
|
{id: "menu-item-edit-select-none", label:RED._("keyboard.selectNone"), onselect: "core:select-none"},
|
||||||
|
null,
|
||||||
|
{id: "menu-item-edit-split-wire-with-links", label:RED._("keyboard.splitWireWithLinks"), onselect: "core:split-wire-with-link-nodes"},
|
||||||
|
|
||||||
]});
|
]});
|
||||||
|
|
||||||
menuOptions.push({id:"menu-item-view-menu",label:RED._("menu.label.view.view"),options:[
|
menuOptions.push({id:"menu-item-view-menu",label:RED._("menu.label.view.view"),options:[
|
||||||
@@ -715,6 +743,7 @@ var RED = (function() {
|
|||||||
RED.search.init();
|
RED.search.init();
|
||||||
RED.actionList.init();
|
RED.actionList.init();
|
||||||
RED.editor.init();
|
RED.editor.init();
|
||||||
|
RED.diagnostics.init();
|
||||||
RED.diff.init();
|
RED.diff.init();
|
||||||
|
|
||||||
|
|
||||||
@@ -723,6 +752,7 @@ var RED = (function() {
|
|||||||
RED.keyboard.init(buildMainMenu);
|
RED.keyboard.init(buildMainMenu);
|
||||||
|
|
||||||
RED.nodes.init();
|
RED.nodes.init();
|
||||||
|
RED.runtime.init()
|
||||||
RED.comms.connect();
|
RED.comms.connect();
|
||||||
|
|
||||||
$("#red-ui-main-container").show();
|
$("#red-ui-main-container").show();
|
||||||
@@ -738,7 +768,7 @@ var RED = (function() {
|
|||||||
$('<div id="red-ui-header-shade" class="hide"></div>').appendTo(header);
|
$('<div id="red-ui-header-shade" class="hide"></div>').appendTo(header);
|
||||||
$('<div id="red-ui-main-container" class="red-ui-sidebar-closed hide">'+
|
$('<div id="red-ui-main-container" class="red-ui-sidebar-closed hide">'+
|
||||||
'<div id="red-ui-workspace"></div>'+
|
'<div id="red-ui-workspace"></div>'+
|
||||||
'<div id="red-ui-editor-stack"></div>'+
|
'<div id="red-ui-editor-stack" tabindex="-1"></div>'+
|
||||||
'<div id="red-ui-palette"></div>'+
|
'<div id="red-ui-palette"></div>'+
|
||||||
'<div id="red-ui-sidebar"></div>'+
|
'<div id="red-ui-sidebar"></div>'+
|
||||||
'<div id="red-ui-sidebar-separator"></div>'+
|
'<div id="red-ui-sidebar-separator"></div>'+
|
||||||
|
|||||||
36
packages/node_modules/@node-red/editor-client/src/js/runtime.js
vendored
Normal file
36
packages/node_modules/@node-red/editor-client/src/js/runtime.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
RED.runtime = (function() {
|
||||||
|
let state = ""
|
||||||
|
let settings = { ui: false, enabled: false };
|
||||||
|
const STOPPED = "stop"
|
||||||
|
const STARTED = "start"
|
||||||
|
const SAFE = "safe"
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: function() {
|
||||||
|
// refresh the current runtime status from server
|
||||||
|
settings = Object.assign({}, settings, RED.settings.runtimeState);
|
||||||
|
RED.events.on("runtime-state", function(msg) {
|
||||||
|
if (msg.state) {
|
||||||
|
const currentState = state
|
||||||
|
state = msg.state
|
||||||
|
$(".red-ui-flow-node-button").toggleClass("red-ui-flow-node-button-stopped", state !== STARTED)
|
||||||
|
if(settings.enabled === true && settings.ui === true) {
|
||||||
|
RED.menu.setVisible("deploymenu-item-runtime-stop", state === STARTED)
|
||||||
|
RED.menu.setVisible("deploymenu-item-runtime-start", state !== STARTED)
|
||||||
|
}
|
||||||
|
// Do not notify the user about this event if:
|
||||||
|
// - This is the very first event we've received after loading the editor (currentState = '')
|
||||||
|
// - The state matches what we already thought was the case (state === currentState)
|
||||||
|
// - The event was triggered by a deploy (msg.deploy === true)
|
||||||
|
// - The event is a safe mode event - that gets notified separately
|
||||||
|
if (currentState !== '' && state !== currentState && !msg.deploy && state !== SAFE) {
|
||||||
|
RED.notify(RED._("notification.state.flows"+(state === STOPPED?'Stopped':'Started'), msg), "success")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
get started() {
|
||||||
|
return state === STARTED
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -160,18 +160,19 @@ RED.actionList = (function() {
|
|||||||
createDialog();
|
createDialog();
|
||||||
}
|
}
|
||||||
dialog.slideDown(300);
|
dialog.slideDown(300);
|
||||||
searchInput.searchBox('value',v)
|
searchInput.searchBox('value',v);
|
||||||
searchResults.editableList('empty');
|
searchResults.editableList('empty');
|
||||||
results = [];
|
results = [];
|
||||||
var actions = RED.actions.list();
|
var actions = RED.actions.list();
|
||||||
actions.sort(function(A,B) {
|
actions.sort(function(A,B) {
|
||||||
return A.id.localeCompare(B.id);
|
var Akey = A.label;
|
||||||
|
var Bkey = B.label;
|
||||||
|
return Akey.localeCompare(Bkey);
|
||||||
});
|
});
|
||||||
actions.forEach(function(action) {
|
actions.forEach(function(action) {
|
||||||
action.label = action.id.replace(/:/,": ").replace(/-/g," ").replace(/(^| )./g,function() { return arguments[0].toUpperCase()});
|
|
||||||
action._label = action.label.toLowerCase();
|
action._label = action.label.toLowerCase();
|
||||||
searchResults.editableList('addItem',action)
|
searchResults.editableList('addItem',action);
|
||||||
})
|
});
|
||||||
RED.events.emit("actionList:open");
|
RED.events.emit("actionList:open");
|
||||||
visible = true;
|
visible = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,67 @@
|
|||||||
RED.actions = (function() {
|
RED.actions = (function() {
|
||||||
var actions = {
|
var actions = {
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
function addAction(name,handler) {
|
function addAction(name,handler,options) {
|
||||||
if (typeof handler !== 'function') {
|
if (typeof handler !== 'function') {
|
||||||
throw new Error("Action handler not a function");
|
throw new Error("Action handler not a function");
|
||||||
}
|
}
|
||||||
if (actions[name]) {
|
if (actions[name]) {
|
||||||
throw new Error("Cannot override existing action");
|
throw new Error("Cannot override existing action");
|
||||||
}
|
}
|
||||||
actions[name] = handler;
|
actions[name] = {
|
||||||
|
handler: handler,
|
||||||
|
options: options,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function removeAction(name) {
|
function removeAction(name) {
|
||||||
delete actions[name];
|
delete actions[name];
|
||||||
}
|
}
|
||||||
function getAction(name) {
|
function getAction(name) {
|
||||||
return actions[name];
|
return actions[name].handler;
|
||||||
}
|
}
|
||||||
|
function getActionLabel(name) {
|
||||||
|
let def = actions[name]
|
||||||
|
if (!def) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
if (!def.label) {
|
||||||
|
var options = def.options;
|
||||||
|
var key = options ? options.label : undefined;
|
||||||
|
if (!key) {
|
||||||
|
key = "action-list." +name.replace(/^.*:/,"");
|
||||||
|
}
|
||||||
|
var label = RED._(key);
|
||||||
|
if (label === key) {
|
||||||
|
// no translation. convert `name` to description
|
||||||
|
label = name.replace(/(^.+:([a-z]))|(-([a-z]))/g, function() {
|
||||||
|
if (arguments[5] === 0) {
|
||||||
|
return arguments[2].toUpperCase();
|
||||||
|
} else {
|
||||||
|
return " "+arguments[4].toUpperCase();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
def.label = label;
|
||||||
|
}
|
||||||
|
return def.label
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function invokeAction() {
|
function invokeAction() {
|
||||||
var args = Array.prototype.slice.call(arguments);
|
var args = Array.prototype.slice.call(arguments);
|
||||||
var name = args.shift();
|
var name = args.shift();
|
||||||
if (actions.hasOwnProperty(name)) {
|
if (actions.hasOwnProperty(name)) {
|
||||||
actions[name].apply(null, args);
|
var handler = actions[name].handler;
|
||||||
|
handler.apply(null, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function listActions() {
|
function listActions() {
|
||||||
var result = [];
|
var result = [];
|
||||||
|
|
||||||
Object.keys(actions).forEach(function(action) {
|
Object.keys(actions).forEach(function(action) {
|
||||||
|
var def = actions[action];
|
||||||
var shortcut = RED.keyboard.getShortcut(action);
|
var shortcut = RED.keyboard.getShortcut(action);
|
||||||
var isUser = false;
|
var isUser = false;
|
||||||
if (shortcut) {
|
if (shortcut) {
|
||||||
@@ -35,19 +69,25 @@ RED.actions = (function() {
|
|||||||
} else {
|
} else {
|
||||||
isUser = !!RED.keyboard.getUserShortcut(action);
|
isUser = !!RED.keyboard.getUserShortcut(action);
|
||||||
}
|
}
|
||||||
|
if (!def.label) {
|
||||||
|
def.label = getActionLabel(action)
|
||||||
|
}
|
||||||
result.push({
|
result.push({
|
||||||
id:action,
|
id:action,
|
||||||
scope:shortcut?shortcut.scope:undefined,
|
scope:shortcut?shortcut.scope:undefined,
|
||||||
key:shortcut?shortcut.key:undefined,
|
key:shortcut?shortcut.key:undefined,
|
||||||
user:isUser
|
user:isUser,
|
||||||
})
|
label: def.label,
|
||||||
})
|
options: def.options,
|
||||||
|
});
|
||||||
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
add: addAction,
|
add: addAction,
|
||||||
remove: removeAction,
|
remove: removeAction,
|
||||||
get: getAction,
|
get: getAction,
|
||||||
|
getLabel: getActionLabel,
|
||||||
invoke: invokeAction,
|
invoke: invokeAction,
|
||||||
list: listActions
|
list: listActions
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ RED.clipboard = (function() {
|
|||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ // red-ui-clipboard-dialog-download
|
{ // red-ui-clipboard-dialog-download
|
||||||
@@ -81,6 +82,7 @@ RED.clipboard = (function() {
|
|||||||
var data = $("#red-ui-clipboard-dialog-export-text").val();
|
var data = $("#red-ui-clipboard-dialog-export-text").val();
|
||||||
downloadData("flows.json", data);
|
downloadData("flows.json", data);
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ // red-ui-clipboard-dialog-export
|
{ // red-ui-clipboard-dialog-export
|
||||||
@@ -95,6 +97,7 @@ RED.clipboard = (function() {
|
|||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
copyText(flowData);
|
copyText(flowData);
|
||||||
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
|
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
|
||||||
|
RED.view.focus();
|
||||||
} else {
|
} else {
|
||||||
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
|
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
|
||||||
var selectedPath = activeLibraries[activeTab].getSelected();
|
var selectedPath = activeLibraries[activeTab].getSelected();
|
||||||
@@ -110,6 +113,7 @@ RED.clipboard = (function() {
|
|||||||
contentType: "application/json; charset=utf-8"
|
contentType: "application/json; charset=utf-8"
|
||||||
}).done(function() {
|
}).done(function() {
|
||||||
$(dialog).dialog( "close" );
|
$(dialog).dialog( "close" );
|
||||||
|
RED.view.focus();
|
||||||
RED.notify(RED._("library.exportedToLibrary"),"success");
|
RED.notify(RED._("library.exportedToLibrary"),"success");
|
||||||
}).fail(function(xhr,textStatus,err) {
|
}).fail(function(xhr,textStatus,err) {
|
||||||
if (xhr.status === 401) {
|
if (xhr.status === 401) {
|
||||||
@@ -171,6 +175,7 @@ RED.clipboard = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ // red-ui-clipboard-dialog-import-conflict
|
{ // red-ui-clipboard-dialog-import-conflict
|
||||||
@@ -203,6 +208,7 @@ RED.clipboard = (function() {
|
|||||||
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
|
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
|
||||||
RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
|
RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -703,6 +709,7 @@ RED.clipboard = (function() {
|
|||||||
} else if (type === 'flow') {
|
} else if (type === 'flow') {
|
||||||
var activeWorkspace = RED.workspaces.active();
|
var activeWorkspace = RED.workspaces.active();
|
||||||
nodes = RED.nodes.groups(activeWorkspace);
|
nodes = RED.nodes.groups(activeWorkspace);
|
||||||
|
nodes = nodes.concat(RED.nodes.junctions(activeWorkspace));
|
||||||
nodes = nodes.concat(RED.nodes.filterNodes({z:activeWorkspace}));
|
nodes = nodes.concat(RED.nodes.filterNodes({z:activeWorkspace}));
|
||||||
RED.nodes.eachConfig(function(n) {
|
RED.nodes.eachConfig(function(n) {
|
||||||
if (n.z === RED.workspaces.active() && n._def.hasUsers === false) {
|
if (n.z === RED.workspaces.active() && n._def.hasUsers === false) {
|
||||||
@@ -940,7 +947,8 @@ RED.clipboard = (function() {
|
|||||||
if (truncated) {
|
if (truncated) {
|
||||||
msg += "_truncated";
|
msg += "_truncated";
|
||||||
}
|
}
|
||||||
$("#red-ui-clipboard-hidden").val(value).focus().select();
|
var clipboardHidden = $('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo(document.body);
|
||||||
|
clipboardHidden.val(value).focus().select();
|
||||||
var result = document.execCommand("copy");
|
var result = document.execCommand("copy");
|
||||||
if (result && element) {
|
if (result && element) {
|
||||||
var popover = RED.popover.create({
|
var popover = RED.popover.create({
|
||||||
@@ -954,14 +962,13 @@ RED.clipboard = (function() {
|
|||||||
},1000);
|
},1000);
|
||||||
popover.open();
|
popover.open();
|
||||||
}
|
}
|
||||||
$("#red-ui-clipboard-hidden").val("");
|
clipboardHidden.remove();
|
||||||
if (currentFocus) {
|
if (currentFocus) {
|
||||||
$(currentFocus).focus();
|
$(currentFocus).focus();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function importNodes(nodesStr,addFlow) {
|
function importNodes(nodesStr,addFlow) {
|
||||||
var newNodes = nodesStr;
|
var newNodes = nodesStr;
|
||||||
if (typeof nodesStr === 'string') {
|
if (typeof nodesStr === 'string') {
|
||||||
@@ -981,6 +988,7 @@ RED.clipboard = (function() {
|
|||||||
try {
|
try {
|
||||||
RED.view.importNodes(newNodes, importOptions);
|
RED.view.importNodes(newNodes, importOptions);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
console.log(error.importConfig)
|
||||||
// Thrown for import_conflict
|
// Thrown for import_conflict
|
||||||
confirmImport(error.importConfig, newNodes, importOptions);
|
confirmImport(error.importConfig, newNodes, importOptions);
|
||||||
}
|
}
|
||||||
@@ -1236,8 +1244,6 @@ RED.clipboard = (function() {
|
|||||||
init: function() {
|
init: function() {
|
||||||
setupDialogs();
|
setupDialogs();
|
||||||
|
|
||||||
$('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo("#red-ui-editor");
|
|
||||||
|
|
||||||
RED.actions.add("core:show-export-dialog",showExportNodes);
|
RED.actions.add("core:show-export-dialog",showExportNodes);
|
||||||
RED.actions.add("core:show-import-dialog",showImportNodes);
|
RED.actions.add("core:show-import-dialog",showImportNodes);
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,14 @@
|
|||||||
*
|
*
|
||||||
* options:
|
* options:
|
||||||
*
|
*
|
||||||
* search : function(value, [done])
|
* search: function(value, [done])
|
||||||
* A function that is passed the current contents of the input whenever
|
* A function that is passed the current contents of the input whenever
|
||||||
* it changes.
|
* it changes.
|
||||||
* The function must either return auto-complete options, or pass them
|
* The function must either return auto-complete options, or pass them
|
||||||
* to the optional 'done' parameter.
|
* to the optional 'done' parameter.
|
||||||
* If the function signature includes 'done', it must be used
|
* If the function signature includes 'done', it must be used
|
||||||
|
* minLength: number
|
||||||
|
* If `minLength` is 0, pressing down arrow will show the list
|
||||||
*
|
*
|
||||||
* The auto-complete options should be an array of objects in the form:
|
* The auto-complete options should be an array of objects in the form:
|
||||||
* {
|
* {
|
||||||
@@ -26,10 +28,11 @@
|
|||||||
|
|
||||||
$.widget( "nodered.autoComplete", {
|
$.widget( "nodered.autoComplete", {
|
||||||
_create: function() {
|
_create: function() {
|
||||||
var that = this;
|
const that = this;
|
||||||
this.completionMenuShown = false;
|
this.completionMenuShown = false;
|
||||||
this.options.search = this.options.search || function() { return [] }
|
this.options.minLength = parseInteger(this.options.minLength, 1, 0);
|
||||||
this.element.addClass("red-ui-autoComplete")
|
this.options.search = this.options.search || function() { return [] };
|
||||||
|
this.element.addClass("red-ui-autoComplete");
|
||||||
this.element.on("keydown.red-ui-autoComplete", function(evt) {
|
this.element.on("keydown.red-ui-autoComplete", function(evt) {
|
||||||
if ((evt.keyCode === 13 || evt.keyCode === 9) && that.completionMenuShown) {
|
if ((evt.keyCode === 13 || evt.keyCode === 9) && that.completionMenuShown) {
|
||||||
var opts = that.menu.options();
|
var opts = that.menu.options();
|
||||||
@@ -71,8 +74,8 @@
|
|||||||
this.completionMenuShown = true;
|
this.completionMenuShown = true;
|
||||||
},
|
},
|
||||||
_updateCompletions: function(val) {
|
_updateCompletions: function(val) {
|
||||||
var that = this;
|
const that = this;
|
||||||
if (val.trim() === "") {
|
if (val.trim().length < this.options.minLength) {
|
||||||
if (this.completionMenuShown) {
|
if (this.completionMenuShown) {
|
||||||
this.menu.hide();
|
this.menu.hide();
|
||||||
}
|
}
|
||||||
@@ -96,7 +99,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.options.search.length === 2) {
|
if (this.options.search.length === 2) {
|
||||||
var requestId = 1+Math.floor(Math.random()*10000);
|
const requestId = 1+Math.floor(Math.random()*10000);
|
||||||
this.pendingRequest = requestId;
|
this.pendingRequest = requestId;
|
||||||
this.options.search(val,function(completions) { displayResults(completions,requestId);})
|
this.options.search(val,function(completions) { displayResults(completions,requestId);})
|
||||||
} else {
|
} else {
|
||||||
@@ -112,4 +115,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
function parseInteger(input, def, min, max) {
|
||||||
|
if(input == null) { return (def || 0); }
|
||||||
|
min = min == null ? Number.NEGATIVE_INFINITY : min;
|
||||||
|
max = max == null ? Number.POSITIVE_INFINITY : max;
|
||||||
|
let n = parseInt(input);
|
||||||
|
if(isNaN(n) || n < min || n > max) { n = def || 0; }
|
||||||
|
return n;
|
||||||
|
}
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
this.element.css("maxHeight",null);
|
this.element.css("maxHeight",null);
|
||||||
}
|
}
|
||||||
if (this.options.height !== 'auto') {
|
if (this.options.height !== 'auto') {
|
||||||
this.uiContainer.css("overflow-y","scroll");
|
this.uiContainer.css("overflow-y","auto");
|
||||||
if (!isNaN(this.options.height)) {
|
if (!isNaN(this.options.height)) {
|
||||||
this.uiHeight = this.options.height;
|
this.uiHeight = this.options.height;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
RED.menu = (function() {
|
RED.menu = (function() {
|
||||||
|
|
||||||
var menuItems = {};
|
var menuItems = {};
|
||||||
|
let menuItemCount = 0
|
||||||
|
|
||||||
function createMenuItem(opt) {
|
function createMenuItem(opt) {
|
||||||
var item;
|
var item;
|
||||||
@@ -59,15 +60,16 @@ RED.menu = (function() {
|
|||||||
item = $('<li class="red-ui-menu-divider"></li>');
|
item = $('<li class="red-ui-menu-divider"></li>');
|
||||||
} else {
|
} else {
|
||||||
item = $('<li></li>');
|
item = $('<li></li>');
|
||||||
|
if (!opt.id) {
|
||||||
|
opt.id = 'red-ui-menu-item-'+(menuItemCount++)
|
||||||
|
}
|
||||||
if (opt.group) {
|
if (opt.group) {
|
||||||
item.addClass("red-ui-menu-group-"+opt.group);
|
item.addClass("red-ui-menu-group-"+opt.group);
|
||||||
|
|
||||||
}
|
}
|
||||||
var linkContent = '<a '+(opt.id?'id="'+opt.id+'" ':'')+'tabindex="-1" href="#">';
|
var linkContent = '<a '+(opt.id?'id="'+opt.id+'" ':'')+'tabindex="-1" href="#">';
|
||||||
if (opt.toggle) {
|
if (opt.toggle) {
|
||||||
linkContent += '<i class="fa fa-square pull-left"></i>';
|
linkContent += '<i class="fa fa-square'+(opt.direction!=='right'?" pull-left":"")+'"></i>';
|
||||||
linkContent += '<i class="fa fa-check-square pull-left"></i>';
|
linkContent += '<i class="fa fa-check-square'+(opt.direction!=='right'?" pull-left":"")+'"></i>';
|
||||||
|
|
||||||
}
|
}
|
||||||
if (opt.icon !== undefined) {
|
if (opt.icon !== undefined) {
|
||||||
@@ -77,12 +79,15 @@ RED.menu = (function() {
|
|||||||
linkContent += '<i class="'+(opt.icon?opt.icon:'" style="display: inline-block;"')+'"></i> ';
|
linkContent += '<i class="'+(opt.icon?opt.icon:'" style="display: inline-block;"')+'"></i> ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let label = opt.label
|
||||||
|
if (!opt.label && typeof opt.onselect === 'string') {
|
||||||
|
label = RED.actions.getLabel(opt.onselect)
|
||||||
|
}
|
||||||
if (opt.sublabel) {
|
if (opt.sublabel) {
|
||||||
linkContent += '<span class="red-ui-menu-label-container"><span class="red-ui-menu-label">'+opt.label+'</span>'+
|
linkContent += '<span class="red-ui-menu-label-container"><span class="red-ui-menu-label">'+label+'</span>'+
|
||||||
'<span class="red-ui-menu-sublabel">'+opt.sublabel+'</span></span>'
|
'<span class="red-ui-menu-sublabel">'+opt.sublabel+'</span></span>'
|
||||||
} else {
|
} else {
|
||||||
linkContent += '<span class="red-ui-menu-label"><span>'+opt.label+'</span></span>'
|
linkContent += '<span class="red-ui-menu-label"><span>'+label+'</span></span>'
|
||||||
}
|
}
|
||||||
|
|
||||||
linkContent += '</a>';
|
linkContent += '</a>';
|
||||||
@@ -126,19 +131,45 @@ RED.menu = (function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (opt.options) {
|
if (opt.options) {
|
||||||
item.addClass("red-ui-menu-dropdown-submenu pull-left");
|
item.addClass("red-ui-menu-dropdown-submenu"+(opt.direction!=='right'?" pull-left":""));
|
||||||
var submenu = $('<ul id="'+opt.id+'-submenu" class="red-ui-menu-dropdown"></ul>').appendTo(item);
|
var submenu = $('<ul id="'+opt.id+'-submenu" class="red-ui-menu-dropdown"></ul>').appendTo(item);
|
||||||
|
var hasIcons = false
|
||||||
|
var hasSubmenus = false
|
||||||
|
|
||||||
for (var i=0;i<opt.options.length;i++) {
|
for (var i=0;i<opt.options.length;i++) {
|
||||||
|
|
||||||
|
if (opt.options[i]) {
|
||||||
|
if (opt.onpreselect && opt.options[i].onpreselect === undefined) {
|
||||||
|
opt.options[i].onpreselect = opt.onpreselect
|
||||||
|
}
|
||||||
|
if (opt.onpostselect && opt.options[i].onpostselect === undefined) {
|
||||||
|
opt.options[i].onpostselect = opt.onpostselect
|
||||||
|
}
|
||||||
|
opt.options[i].direction = opt.direction
|
||||||
|
hasIcons = hasIcons || (opt.options[i].icon);
|
||||||
|
hasSubmenus = hasSubmenus || (opt.options[i].options);
|
||||||
|
}
|
||||||
|
|
||||||
var li = createMenuItem(opt.options[i]);
|
var li = createMenuItem(opt.options[i]);
|
||||||
if (li) {
|
if (li) {
|
||||||
li.appendTo(submenu);
|
li.appendTo(submenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!hasIcons) {
|
||||||
|
submenu.addClass("red-ui-menu-dropdown-noicons")
|
||||||
|
}
|
||||||
|
if (hasSubmenus) {
|
||||||
|
submenu.addClass("red-ui-menu-dropdown-submenus")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (opt.disabled) {
|
if (opt.disabled) {
|
||||||
item.addClass("disabled");
|
item.addClass("disabled");
|
||||||
}
|
}
|
||||||
|
if (opt.visible === false) {
|
||||||
|
item.addClass("hide");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -147,7 +178,9 @@ RED.menu = (function() {
|
|||||||
}
|
}
|
||||||
function createMenu(options) {
|
function createMenu(options) {
|
||||||
var topMenu = $("<ul/>",{class:"red-ui-menu red-ui-menu-dropdown pull-right"});
|
var topMenu = $("<ul/>",{class:"red-ui-menu red-ui-menu-dropdown pull-right"});
|
||||||
|
if (options.direction) {
|
||||||
|
topMenu.addClass("red-ui-menu-dropdown-direction-"+options.direction)
|
||||||
|
}
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
topMenu.attr({id:options.id+"-submenu"});
|
topMenu.attr({id:options.id+"-submenu"});
|
||||||
var menuParent = $("#"+options.id);
|
var menuParent = $("#"+options.id);
|
||||||
@@ -173,9 +206,22 @@ RED.menu = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var lastAddedSeparator = false;
|
var lastAddedSeparator = false;
|
||||||
|
var hasSubmenus = false;
|
||||||
|
var hasIcons = false;
|
||||||
for (var i=0;i<options.options.length;i++) {
|
for (var i=0;i<options.options.length;i++) {
|
||||||
var opt = options.options[i];
|
var opt = options.options[i];
|
||||||
|
if (opt) {
|
||||||
|
if (options.onpreselect && opt.onpreselect === undefined) {
|
||||||
|
opt.onpreselect = options.onpreselect
|
||||||
|
}
|
||||||
|
if (options.onpostselect && opt.onpostselect === undefined) {
|
||||||
|
opt.onpostselect = options.onpostselect
|
||||||
|
}
|
||||||
|
opt.direction = options.direction || 'left'
|
||||||
|
}
|
||||||
if (opt !== null || !lastAddedSeparator) {
|
if (opt !== null || !lastAddedSeparator) {
|
||||||
|
hasIcons = hasIcons || (opt && opt.icon);
|
||||||
|
hasSubmenus = hasSubmenus || (opt && opt.options);
|
||||||
var li = createMenuItem(opt);
|
var li = createMenuItem(opt);
|
||||||
if (li) {
|
if (li) {
|
||||||
li.appendTo(topMenu);
|
li.appendTo(topMenu);
|
||||||
@@ -183,13 +229,21 @@ RED.menu = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!hasIcons) {
|
||||||
|
topMenu.addClass("red-ui-menu-dropdown-noicons")
|
||||||
|
}
|
||||||
|
if (hasSubmenus) {
|
||||||
|
topMenu.addClass("red-ui-menu-dropdown-submenus")
|
||||||
|
}
|
||||||
return topMenu;
|
return topMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerAction(id, args) {
|
function triggerAction(id, args) {
|
||||||
var opt = menuItems[id];
|
var opt = menuItems[id];
|
||||||
var callback = opt.onselect;
|
var callback = opt.onselect;
|
||||||
|
if (opt.onpreselect) {
|
||||||
|
opt.onpreselect.call(opt,args)
|
||||||
|
}
|
||||||
if (typeof opt.onselect === 'string') {
|
if (typeof opt.onselect === 'string') {
|
||||||
callback = RED.actions.get(opt.onselect);
|
callback = RED.actions.get(opt.onselect);
|
||||||
}
|
}
|
||||||
@@ -198,6 +252,9 @@ RED.menu = (function() {
|
|||||||
} else {
|
} else {
|
||||||
console.log("No callback for",id,opt.onselect);
|
console.log("No callback for",id,opt.onselect);
|
||||||
}
|
}
|
||||||
|
if (opt.onpostselect) {
|
||||||
|
opt.onpostselect.call(opt,args)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSelected(id) {
|
function isSelected(id) {
|
||||||
@@ -249,6 +306,14 @@ RED.menu = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setVisible(id,state) {
|
||||||
|
if (!state) {
|
||||||
|
$("#"+id).parent().addClass("hide");
|
||||||
|
} else {
|
||||||
|
$("#"+id).parent().removeClass("hide");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function addItem(id,opt) {
|
function addItem(id,opt) {
|
||||||
var item = createMenuItem(opt);
|
var item = createMenuItem(opt);
|
||||||
if (opt !== null && opt.group) {
|
if (opt !== null && opt.group) {
|
||||||
@@ -305,6 +370,7 @@ RED.menu = (function() {
|
|||||||
isSelected: isSelected,
|
isSelected: isSelected,
|
||||||
toggleSelected: toggleSelected,
|
toggleSelected: toggleSelected,
|
||||||
setDisabled: setDisabled,
|
setDisabled: setDisabled,
|
||||||
|
setVisible: setVisible,
|
||||||
addItem: addItem,
|
addItem: addItem,
|
||||||
removeItem: removeItem,
|
removeItem: removeItem,
|
||||||
setAction: setAction,
|
setAction: setAction,
|
||||||
|
|||||||
@@ -350,6 +350,16 @@ RED.popover = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target.on("remove", function (ev) {
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer);
|
||||||
|
}
|
||||||
|
if (active) {
|
||||||
|
active = false;
|
||||||
|
setTimeout(closePopup,delay.hide);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (trigger === 'hover') {
|
if (trigger === 'hover') {
|
||||||
target.on('mouseenter',function(e) {
|
target.on('mouseenter',function(e) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
@@ -461,6 +471,11 @@ RED.popover = (function() {
|
|||||||
popover.setAction = function(newAction) {
|
popover.setAction = function(newAction) {
|
||||||
action = newAction;
|
action = newAction;
|
||||||
}
|
}
|
||||||
|
popover.delete = function() {
|
||||||
|
popover.close(true)
|
||||||
|
target.off("mouseenter");
|
||||||
|
target.off("mouseleave");
|
||||||
|
};
|
||||||
return popover;
|
return popover;
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -595,10 +610,13 @@ RED.popover = (function() {
|
|||||||
var target = options.target;
|
var target = options.target;
|
||||||
var align = options.align || "right";
|
var align = options.align || "right";
|
||||||
var offset = options.offset || [0,0];
|
var offset = options.offset || [0,0];
|
||||||
|
var xPos = options.x;
|
||||||
|
var yPos = options.y;
|
||||||
|
var isAbsolutePosition = (xPos !== undefined && yPos !== undefined)
|
||||||
|
|
||||||
var pos = target.offset();
|
var pos = isAbsolutePosition?{left:xPos, top: yPos}:target.offset();
|
||||||
var targetWidth = target.width();
|
var targetWidth = isAbsolutePosition?0:target.width();
|
||||||
var targetHeight = target.outerHeight();
|
var targetHeight = isAbsolutePosition?0:target.outerHeight();
|
||||||
var panelHeight = panel.height();
|
var panelHeight = panel.height();
|
||||||
var panelWidth = panel.width();
|
var panelWidth = panel.width();
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.element.on("keydown",function(e) {
|
this.element.on("keydown",function(e) {
|
||||||
if (!menuShown && e.keyCode === 40) {
|
if (!menuShown && e.keyCode === 40 && $(this).val() === '') {
|
||||||
//DOWN
|
//DOWN (only show menu if search field is emty)
|
||||||
showMenu();
|
showMenu();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -557,28 +557,24 @@ RED.tabs = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
li.one("transitionend", function(evt) {
|
li.remove();
|
||||||
li.remove();
|
if (tabs[id].pinned) {
|
||||||
if (tabs[id].pinned) {
|
pinnedTabsCount--;
|
||||||
pinnedTabsCount--;
|
}
|
||||||
}
|
if (options.onremove) {
|
||||||
if (options.onremove) {
|
options.onremove(tabs[id]);
|
||||||
options.onremove(tabs[id]);
|
}
|
||||||
}
|
delete tabs[id];
|
||||||
delete tabs[id];
|
updateTabWidths();
|
||||||
updateTabWidths();
|
if (collapsibleMenu) {
|
||||||
if (collapsibleMenu) {
|
collapsibleMenu.remove();
|
||||||
collapsibleMenu.remove();
|
collapsibleMenu = null;
|
||||||
collapsibleMenu = null;
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
li.addClass("hide-tab");
|
|
||||||
li.width(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function findPreviousVisibleTab(li) {
|
function findPreviousVisibleTab(li) {
|
||||||
if (!li) {
|
if (!li) {
|
||||||
li = ul.find("li.active").parent();
|
li = ul.find("li.active");
|
||||||
}
|
}
|
||||||
var previous = li.prev();
|
var previous = li.prev();
|
||||||
while(previous.length > 0 && previous.hasClass("hide-tab")) {
|
while(previous.length > 0 && previous.hasClass("hide-tab")) {
|
||||||
@@ -588,9 +584,9 @@ RED.tabs = (function() {
|
|||||||
}
|
}
|
||||||
function findNextVisibleTab(li) {
|
function findNextVisibleTab(li) {
|
||||||
if (!li) {
|
if (!li) {
|
||||||
li = ul.find("li.active").parent();
|
li = ul.find("li.active");
|
||||||
}
|
}
|
||||||
var next = ul.find("li.active").next();
|
var next = li.next();
|
||||||
while(next.length > 0 && next.hasClass("hide-tab")) {
|
while(next.length > 0 && next.hasClass("hide-tab")) {
|
||||||
next = next.next();
|
next = next.next();
|
||||||
}
|
}
|
||||||
@@ -674,7 +670,7 @@ RED.tabs = (function() {
|
|||||||
}
|
}
|
||||||
var link = $("<a/>",{href:"#"+tab.id, class:"red-ui-tab-label"}).appendTo(li);
|
var link = $("<a/>",{href:"#"+tab.id, class:"red-ui-tab-label"}).appendTo(li);
|
||||||
if (tab.icon) {
|
if (tab.icon) {
|
||||||
$('<img src="'+tab.icon+'" class="red-ui-tab-icon"/>').appendTo(link);
|
$('<i>',{class:"red-ui-tab-icon", style:"mask-image: url("+tab.icon+"); -webkit-mask-image: url("+tab.icon+");"}).appendTo(link);
|
||||||
} else if (tab.iconClass) {
|
} else if (tab.iconClass) {
|
||||||
$('<i>',{class:"red-ui-tab-icon "+tab.iconClass}).appendTo(link);
|
$('<i>',{class:"red-ui-tab-icon "+tab.iconClass}).appendTo(link);
|
||||||
}
|
}
|
||||||
@@ -832,7 +828,7 @@ RED.tabs = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// link.attr("title",tab.label);
|
// link.attr("title",tab.label);
|
||||||
RED.popover.tooltip(link,function() { return tab.label})
|
RED.popover.tooltip(link,function() { return RED.utils.sanitize(tab.label); });
|
||||||
|
|
||||||
if (options.onadd) {
|
if (options.onadd) {
|
||||||
options.onadd(tab);
|
options.onadd(tab);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
* - multi : boolean - if true, .selected will return an array of results
|
* - multi : boolean - if true, .selected will return an array of results
|
||||||
* otherwise, returns the first selected item
|
* otherwise, returns the first selected item
|
||||||
* - sortable: boolean/string - TODO: see editableList
|
* - sortable: boolean/string - TODO: see editableList
|
||||||
|
* - selectable: boolean - default true - whether individual items can be selected
|
||||||
* - rootSortable: boolean - if 'sortable' is set, then setting this to
|
* - rootSortable: boolean - if 'sortable' is set, then setting this to
|
||||||
* false, prevents items being sorted to the
|
* false, prevents items being sorted to the
|
||||||
* top level of the tree
|
* top level of the tree
|
||||||
@@ -118,6 +119,7 @@
|
|||||||
switch(evt.keyCode) {
|
switch(evt.keyCode) {
|
||||||
case 32: // SPACE
|
case 32: // SPACE
|
||||||
case 13: // ENTER
|
case 13: // ENTER
|
||||||
|
if (!that.options.selectable) { return }
|
||||||
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
|
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,34 +55,46 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var autoComplete = function(options) {
|
var autoComplete = function(options) {
|
||||||
|
function getMatch(value, searchValue) {
|
||||||
|
const idx = value.toLowerCase().indexOf(searchValue.toLowerCase());
|
||||||
|
const len = idx > -1 ? searchValue.length : 0;
|
||||||
|
return {
|
||||||
|
index: idx,
|
||||||
|
found: idx > -1,
|
||||||
|
pre: value.substring(0,idx),
|
||||||
|
match: value.substring(idx,idx+len),
|
||||||
|
post: value.substring(idx+len),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function generateSpans(match) {
|
||||||
|
const els = [];
|
||||||
|
if(match.pre) { els.push($('<span/>').text(match.pre)); }
|
||||||
|
if(match.match) { els.push($('<span/>',{style:"font-weight: bold; color: var(--red-ui-text-color-link);"}).text(match.match)); }
|
||||||
|
if(match.post) { els.push($('<span/>').text(match.post)); }
|
||||||
|
return els;
|
||||||
|
}
|
||||||
return function(val) {
|
return function(val) {
|
||||||
var matches = [];
|
var matches = [];
|
||||||
options.forEach(opt => {
|
options.forEach(opt => {
|
||||||
let v = opt.value;
|
const optVal = opt.value;
|
||||||
var i = v.toLowerCase().indexOf(val.toLowerCase());
|
const optSrc = (opt.source||[]).join(",");
|
||||||
if (i > -1) {
|
const valMatch = getMatch(optVal, val);
|
||||||
var pre = v.substring(0,i);
|
const srcMatch = getMatch(optSrc, val);
|
||||||
var matchedVal = v.substring(i,i+val.length);
|
if (valMatch.found || srcMatch.found) {
|
||||||
var post = v.substring(i+val.length)
|
const element = $('<div>',{style: "display: flex"});
|
||||||
|
const valEl = $('<div/>',{style:"font-family: var(--red-ui-monospace-font); white-space:nowrap; overflow: hidden; flex-grow:1"});
|
||||||
var el = $('<div/>',{style:"white-space:nowrap; overflow: hidden; flex-grow:1"});
|
valEl.append(generateSpans(valMatch));
|
||||||
$('<span/>').text(pre).appendTo(el);
|
valEl.appendTo(element);
|
||||||
$('<span/>',{style:"font-weight: bold"}).text(matchedVal).appendTo(el);
|
if (optSrc) {
|
||||||
$('<span/>').text(post).appendTo(el);
|
const optEl = $('<div>').css({ "font-size": "0.8em" });
|
||||||
|
optEl.append(generateSpans(srcMatch));
|
||||||
var element = $('<div>',{style: "display: flex"});
|
optEl.appendTo(element);
|
||||||
el.appendTo(element);
|
|
||||||
if (opt.source) {
|
|
||||||
$('<div>').css({
|
|
||||||
"font-size": "0.8em"
|
|
||||||
}).text(opt.source.join(",")).appendTo(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
matches.push({
|
matches.push({
|
||||||
value: v,
|
value: optVal,
|
||||||
label: element,
|
label: element,
|
||||||
i:i
|
i: (valMatch.found ? valMatch.index : srcMatch.index)
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
matches.sort(function(A,B){return A.i-B.i})
|
matches.sort(function(A,B){return A.i-B.i})
|
||||||
@@ -93,6 +105,36 @@
|
|||||||
// This is a hand-generated list of completions for the core nodes (based on the node help html).
|
// This is a hand-generated list of completions for the core nodes (based on the node help html).
|
||||||
var msgCompletions = [
|
var msgCompletions = [
|
||||||
{ value: "payload" },
|
{ value: "payload" },
|
||||||
|
{ value: "topic", source: ["mqtt","inject","rbe"] },
|
||||||
|
{ value: "action", source: ["mqtt"] },
|
||||||
|
{ value: "complete", source: ["join"] },
|
||||||
|
{ value: "contentType", source: ["mqtt"] },
|
||||||
|
{ value: "cookies", source: ["http request","http response"] },
|
||||||
|
{ value: "correlationData", source: ["mqtt"] },
|
||||||
|
{ value: "delay", source: ["delay","trigger"] },
|
||||||
|
{ value: "encoding", source: ["file"] },
|
||||||
|
{ value: "error", source: ["catch"] },
|
||||||
|
{ value: "error.message", source: ["catch"] },
|
||||||
|
{ value: "error.source", source: ["catch"] },
|
||||||
|
{ value: "error.source.id", source: ["catch"] },
|
||||||
|
{ value: "error.source.type", source: ["catch"] },
|
||||||
|
{ value: "error.source.name", source: ["catch"] },
|
||||||
|
{ value: "filename", source: ["file","file in"] },
|
||||||
|
{ value: "flush", source: ["delay"] },
|
||||||
|
{ value: "followRedirects", source: ["http request"] },
|
||||||
|
{ value: "headers", source: ["http response","http request"] },
|
||||||
|
{ value: "host", source: ["tcp request","http request"] },
|
||||||
|
{ value: "ip", source: ["udp out"] },
|
||||||
|
{ value: "kill", source: ["exec"] },
|
||||||
|
{ value: "messageExpiryInterval", source: ["mqtt"] },
|
||||||
|
{ value: "method", source: ["http request"] },
|
||||||
|
{ value: "options", source: ["xml"] },
|
||||||
|
{ value: "parts", source: ["split","join","batch","sort"] },
|
||||||
|
{ value: "pid", source: ["exec"] },
|
||||||
|
{ value: "port", source: ["tcp request"," udp out"] },
|
||||||
|
{ value: "qos", source: ["mqtt"] },
|
||||||
|
{ value: "rate", source: ["delay"] },
|
||||||
|
{ value: "rejectUnauthorized", source: ["http request"] },
|
||||||
{ value: "req", source: ["http in"]},
|
{ value: "req", source: ["http in"]},
|
||||||
{ value: "req.body", source: ["http in"]},
|
{ value: "req.body", source: ["http in"]},
|
||||||
{ value: "req.headers", source: ["http in"]},
|
{ value: "req.headers", source: ["http in"]},
|
||||||
@@ -100,38 +142,28 @@
|
|||||||
{ value: "req.params", source: ["http in"]},
|
{ value: "req.params", source: ["http in"]},
|
||||||
{ value: "req.cookies", source: ["http in"]},
|
{ value: "req.cookies", source: ["http in"]},
|
||||||
{ value: "req.files", source: ["http in"]},
|
{ value: "req.files", source: ["http in"]},
|
||||||
{ value: "complete", source: ["join"] },
|
|
||||||
{ value: "contentType", source: ["mqtt"] },
|
|
||||||
{ value: "cookies", source: ["http in","http request"] },
|
|
||||||
{ value: "correlationData", source: ["mqtt"] },
|
|
||||||
{ value: "delay", source: ["delay","trigger"] },
|
|
||||||
{ value: "encoding", source: ["file"] },
|
|
||||||
{ value: "error", source: ["catch"] },
|
|
||||||
{ value: "filename", source: ["file","file in"] },
|
|
||||||
{ value: "flush", source: ["delay"] },
|
|
||||||
{ value: "followRedirects", source: ["http request"] },
|
|
||||||
{ value: "headers", source: ["http in"," http request"] },
|
|
||||||
{ value: "kill", source: ["exec"] },
|
|
||||||
{ value: "messageExpiryInterval", source: ["mqtt"] },
|
|
||||||
{ value: "method", source: ["http-request"] },
|
|
||||||
{ value: "options", source: ["xml"] },
|
|
||||||
{ value: "parts", source: ["split","join"] },
|
|
||||||
{ value: "pid", source: ["exec"] },
|
|
||||||
{ value: "qos", source: ["mqtt"] },
|
|
||||||
{ value: "rate", source: ["delay"] },
|
|
||||||
{ value: "rejectUnauthorized", source: ["http request"] },
|
|
||||||
{ value: "requestTimeout", source: ["http request"] },
|
{ value: "requestTimeout", source: ["http request"] },
|
||||||
{ value: "reset", source: ["delay","trigger","join","rbe"] },
|
{ value: "reset", source: ["delay","trigger","join","rbe"] },
|
||||||
|
{ value: "responseCookies", source: ["http request"] },
|
||||||
{ value: "responseTopic", source: ["mqtt"] },
|
{ value: "responseTopic", source: ["mqtt"] },
|
||||||
|
{ value: "responseUrl", source: ["http request"] },
|
||||||
{ value: "restartTimeout", source: ["join"] },
|
{ value: "restartTimeout", source: ["join"] },
|
||||||
{ value: "retain", source: ["mqtt"] },
|
{ value: "retain", source: ["mqtt"] },
|
||||||
|
{ value: "schema", source: ["json"] },
|
||||||
{ value: "select", source: ["html"] },
|
{ value: "select", source: ["html"] },
|
||||||
{ value: "statusCode", source: ["http in"] },
|
{ value: "statusCode", source: ["http response","http request"] },
|
||||||
|
{ value: "status", source: ["status"] },
|
||||||
|
{ value: "status.text", source: ["status"] },
|
||||||
|
{ value: "status.source", source: ["status"] },
|
||||||
|
{ value: "status.source.type", source: ["status"] },
|
||||||
|
{ value: "status.source.id", source: ["status"] },
|
||||||
|
{ value: "status.source.name", source: ["status"] },
|
||||||
|
{ value: "target", source: ["link call"] },
|
||||||
{ value: "template", source: ["template"] },
|
{ value: "template", source: ["template"] },
|
||||||
{ value: "toFront", source: ["delay"] },
|
{ value: "toFront", source: ["delay"] },
|
||||||
{ value: "topic", source: ["inject","mqtt","rbe"] },
|
|
||||||
{ value: "url", source: ["http request"] },
|
{ value: "url", source: ["http request"] },
|
||||||
{ value: "userProperties", source: ["mqtt"] }
|
{ value: "userProperties", source: ["mqtt"] },
|
||||||
|
{ value: "_session", source: ["websocket out","tcp out"] },
|
||||||
]
|
]
|
||||||
var allOptions = {
|
var allOptions = {
|
||||||
msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression, autoComplete: autoComplete(msgCompletions)},
|
msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression, autoComplete: autoComplete(msgCompletions)},
|
||||||
@@ -166,6 +198,8 @@
|
|||||||
}
|
}
|
||||||
RED.editor.editJSON({
|
RED.editor.editJSON({
|
||||||
value: value,
|
value: value,
|
||||||
|
stateId: RED.editor.generateViewStateId("typedInput", that, "json"),
|
||||||
|
focus: true,
|
||||||
complete: function(v) {
|
complete: function(v) {
|
||||||
var value = v;
|
var value = v;
|
||||||
try {
|
try {
|
||||||
@@ -188,6 +222,8 @@
|
|||||||
var that = this;
|
var that = this;
|
||||||
RED.editor.editExpression({
|
RED.editor.editExpression({
|
||||||
value: this.value().replace(/\t/g,"\n"),
|
value: this.value().replace(/\t/g,"\n"),
|
||||||
|
stateId: RED.editor.generateViewStateId("typedInput", that, "jsonata"),
|
||||||
|
focus: true,
|
||||||
complete: function(v) {
|
complete: function(v) {
|
||||||
that.value(v.replace(/\n/g,"\t"));
|
that.value(v.replace(/\n/g,"\t"));
|
||||||
}
|
}
|
||||||
@@ -202,6 +238,8 @@
|
|||||||
var that = this;
|
var that = this;
|
||||||
RED.editor.editBuffer({
|
RED.editor.editBuffer({
|
||||||
value: this.value(),
|
value: this.value(),
|
||||||
|
stateId: RED.editor.generateViewStateId("typedInput", that, "bin"),
|
||||||
|
focus: true,
|
||||||
complete: function(v) {
|
complete: function(v) {
|
||||||
that.value(v);
|
that.value(v);
|
||||||
}
|
}
|
||||||
@@ -463,7 +501,7 @@
|
|||||||
this.options.types = this.options.types||Object.keys(allOptions);
|
this.options.types = this.options.types||Object.keys(allOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectTrigger = $('<button class="red-ui-typedInput-type-select" tabindex="0"></button>').prependTo(this.uiSelect);
|
this.selectTrigger = $('<button type="button" class="red-ui-typedInput-type-select" tabindex="0"></button>').prependTo(this.uiSelect);
|
||||||
$('<i class="red-ui-typedInput-icon fa fa-caret-down"></i>').toggle(this.options.types.length > 1).appendTo(this.selectTrigger);
|
$('<i class="red-ui-typedInput-icon fa fa-caret-down"></i>').toggle(this.options.types.length > 1).appendTo(this.selectTrigger);
|
||||||
|
|
||||||
this.selectLabel = $('<span class="red-ui-typedInput-type-label"></span>').appendTo(this.selectTrigger);
|
this.selectLabel = $('<span class="red-ui-typedInput-type-label"></span>').appendTo(this.selectTrigger);
|
||||||
@@ -532,7 +570,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
// explicitly set optionSelectTrigger display to inline-block otherwise jQ sets it to 'inline'
|
// explicitly set optionSelectTrigger display to inline-block otherwise jQ sets it to 'inline'
|
||||||
this.optionSelectTrigger = $('<button tabindex="0" class="red-ui-typedInput-option-trigger" style="display:inline-block"><span class="red-ui-typedInput-option-caret"><i class="red-ui-typedInput-icon fa fa-caret-down"></i></span></button>').appendTo(this.uiSelect);
|
this.optionSelectTrigger = $('<button type="button" tabindex="0" class="red-ui-typedInput-option-trigger" style="display:inline-block"><span class="red-ui-typedInput-option-caret"><i class="red-ui-typedInput-icon fa fa-caret-down"></i></span></button>').appendTo(this.uiSelect);
|
||||||
this.optionSelectLabel = $('<span class="red-ui-typedInput-option-label"></span>').prependTo(this.optionSelectTrigger);
|
this.optionSelectLabel = $('<span class="red-ui-typedInput-option-label"></span>').prependTo(this.optionSelectTrigger);
|
||||||
// RED.popover.tooltip(this.optionSelectLabel,function() {
|
// RED.popover.tooltip(this.optionSelectLabel,function() {
|
||||||
// return that.optionValue;
|
// return that.optionValue;
|
||||||
@@ -553,7 +591,7 @@
|
|||||||
that.uiSelect.addClass('red-ui-typedInput-focus');
|
that.uiSelect.addClass('red-ui-typedInput-focus');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.optionExpandButton = $('<button tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"></button>').appendTo(this.uiSelect);
|
this.optionExpandButton = $('<button type="button" tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"></button>').appendTo(this.uiSelect);
|
||||||
this.optionExpandButtonIcon = $('<i class="red-ui-typedInput-icon fa fa-ellipsis-h"></i>').appendTo(this.optionExpandButton);
|
this.optionExpandButtonIcon = $('<i class="red-ui-typedInput-icon fa fa-ellipsis-h"></i>').appendTo(this.optionExpandButton);
|
||||||
|
|
||||||
this.type(this.typeField.val() || this.options.default||this.typeList[0].value);
|
this.type(this.typeField.val() || this.options.default||this.typeList[0].value);
|
||||||
@@ -637,7 +675,7 @@
|
|||||||
if (opt.icon.indexOf("<") === 0) {
|
if (opt.icon.indexOf("<") === 0) {
|
||||||
$(opt.icon).prependTo(op);
|
$(opt.icon).prependTo(op);
|
||||||
} else if (opt.icon.indexOf("/") !== -1) {
|
} else if (opt.icon.indexOf("/") !== -1) {
|
||||||
$('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px; height: 18px;"}).prependTo(op);
|
$('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+");"}).prependTo(op);
|
||||||
} else {
|
} else {
|
||||||
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(op);
|
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(op);
|
||||||
}
|
}
|
||||||
@@ -988,10 +1026,7 @@
|
|||||||
$(opt.icon).prependTo(this.selectLabel);
|
$(opt.icon).prependTo(this.selectLabel);
|
||||||
}
|
}
|
||||||
else if (opt.icon.indexOf("/") !== -1) {
|
else if (opt.icon.indexOf("/") !== -1) {
|
||||||
image = new Image();
|
$('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+"); margin-right: 4px;height: 18px;width:13px"}).prependTo(this.selectLabel);
|
||||||
image.name = opt.icon;
|
|
||||||
image.src = mapDeprecatedIcon(opt.icon);
|
|
||||||
$('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel);
|
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel);
|
||||||
@@ -1147,7 +1182,8 @@
|
|||||||
this.elementDiv.show();
|
this.elementDiv.show();
|
||||||
if (opt.autoComplete) {
|
if (opt.autoComplete) {
|
||||||
this.input.autoComplete({
|
this.input.autoComplete({
|
||||||
search: opt.autoComplete
|
search: opt.autoComplete,
|
||||||
|
minLength: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
203
packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js
vendored
Normal file
203
packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
RED.contextMenu = (function () {
|
||||||
|
|
||||||
|
let menu;
|
||||||
|
function createMenu() {
|
||||||
|
// menu = RED.popover.menu({
|
||||||
|
// options: [
|
||||||
|
// {
|
||||||
|
// label: 'delete selection',
|
||||||
|
// onselect: function() {
|
||||||
|
// RED.actions.invoke('core:delete-selection')
|
||||||
|
// RED.view.focus()
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// { label: 'world' }
|
||||||
|
// ],
|
||||||
|
// width: 200,
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
|
function disposeMenu() {
|
||||||
|
$(document).off("mousedown.red-ui-workspace-context-menu");
|
||||||
|
if (menu) {
|
||||||
|
menu.remove();
|
||||||
|
}
|
||||||
|
menu = null;
|
||||||
|
}
|
||||||
|
function show(options) {
|
||||||
|
if (menu) {
|
||||||
|
menu.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
const selection = RED.view.selection()
|
||||||
|
const noSelection = !selection || Object.keys(selection).length === 0
|
||||||
|
const hasSelection = (selection.nodes && selection.nodes.length > 0);
|
||||||
|
const hasMultipleSelection = hasSelection && selection.nodes.length > 1;
|
||||||
|
const virtulLinks = (selection.links && selection.links.filter(e => !!e.link)) || [];
|
||||||
|
const wireLinks = (selection.links && selection.links.filter(e => !e.link)) || [];
|
||||||
|
const hasLinks = wireLinks.length > 0;
|
||||||
|
const isSingleLink = !hasSelection && hasLinks && wireLinks.length === 1
|
||||||
|
const isMultipleLinks = !hasSelection && hasLinks && wireLinks.length > 1
|
||||||
|
const canDelete = hasSelection || hasLinks
|
||||||
|
const isGroup = hasSelection && selection.nodes.length === 1 && selection.nodes[0].type === 'group'
|
||||||
|
|
||||||
|
const canRemoveFromGroup = hasSelection && !!selection.nodes[0].g
|
||||||
|
const offset = $("#red-ui-workspace-chart").offset()
|
||||||
|
|
||||||
|
// addX/addY must be the position in the workspace accounting for both scroll and scale
|
||||||
|
// The +5 is because we display the contextMenu -5,-5 to actual click position
|
||||||
|
let addX = (options.x + 5 - offset.left + $("#red-ui-workspace-chart").scrollLeft()) / RED.view.scale()
|
||||||
|
let addY = (options.y + 5 - offset.top + $("#red-ui-workspace-chart").scrollTop()) / RED.view.scale()
|
||||||
|
|
||||||
|
const menuItems = [
|
||||||
|
{ onselect: 'core:show-action-list', onpostselect: function () { } },
|
||||||
|
{
|
||||||
|
label: RED._("contextMenu.insert"),
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: RED._("contextMenu.node"),
|
||||||
|
onselect: function () {
|
||||||
|
RED.view.showQuickAddDialog({
|
||||||
|
position: [addX, addY],
|
||||||
|
touchTrigger: true,
|
||||||
|
splice: isSingleLink ? selection.links[0] : undefined,
|
||||||
|
// spliceMultiple: isMultipleLinks
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onpostselect: function() {
|
||||||
|
// ensure quick add dialog search input has focus
|
||||||
|
$('#red-ui-type-search-input').trigger('focus')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(hasLinks) ? { // has least 1 wire selected
|
||||||
|
label: RED._("contextMenu.junction"),
|
||||||
|
onselect: 'core:split-wires-with-junctions',
|
||||||
|
disabled: !hasLinks
|
||||||
|
} : {
|
||||||
|
label: RED._("contextMenu.junction"),
|
||||||
|
onselect: function () {
|
||||||
|
const nn = {
|
||||||
|
_def: { defaults: {} },
|
||||||
|
type: 'junction',
|
||||||
|
z: RED.workspaces.active(),
|
||||||
|
id: RED.nodes.id(),
|
||||||
|
x: addX,
|
||||||
|
y: addY,
|
||||||
|
w: 0, h: 0,
|
||||||
|
outputs: 1,
|
||||||
|
inputs: 1,
|
||||||
|
dirty: true
|
||||||
|
}
|
||||||
|
const historyEvent = {
|
||||||
|
dirty: RED.nodes.dirty(),
|
||||||
|
t: 'add',
|
||||||
|
junctions: [nn]
|
||||||
|
}
|
||||||
|
RED.nodes.addJunction(nn);
|
||||||
|
RED.history.push(historyEvent);
|
||||||
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.select({nodes: [nn] });
|
||||||
|
RED.view.redraw(true)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: RED._("contextMenu.linkNodes"),
|
||||||
|
onselect: 'core:split-wire-with-link-nodes',
|
||||||
|
disabled: !hasLinks
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
menuItems.push(
|
||||||
|
null,
|
||||||
|
{ onselect: 'core:undo', disabled: RED.history.list().length === 0 },
|
||||||
|
{ onselect: 'core:redo', disabled: RED.history.listRedo().length === 0 },
|
||||||
|
null,
|
||||||
|
{ onselect: 'core:cut-selection-to-internal-clipboard', label: RED._("keyboard.cutNode"), disabled: !hasSelection },
|
||||||
|
{ onselect: 'core:copy-selection-to-internal-clipboard', label: RED._("keyboard.copyNode"), disabled: !hasSelection },
|
||||||
|
{ onselect: 'core:paste-from-internal-clipboard', label: RED._("keyboard.pasteNode"), disabled: !RED.view.clipboard() },
|
||||||
|
{ onselect: 'core:delete-selection', disabled: !canDelete },
|
||||||
|
{ onselect: 'core:show-export-dialog', label: RED._("menu.label.export") },
|
||||||
|
{ onselect: 'core:select-all-nodes' }
|
||||||
|
)
|
||||||
|
|
||||||
|
if (hasSelection) {
|
||||||
|
menuItems.push(
|
||||||
|
null,
|
||||||
|
isGroup ?
|
||||||
|
{ onselect: 'core:ungroup-selection', disabled: !isGroup }
|
||||||
|
: { onselect: 'core:group-selection', disabled: !hasSelection }
|
||||||
|
)
|
||||||
|
if (canRemoveFromGroup) {
|
||||||
|
menuItems.push({ onselect: 'core:remove-selection-from-group', label: RED._("menu.label.groupRemoveSelection") })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var direction = "right";
|
||||||
|
var MENU_WIDTH = 500; // can not use menu width here
|
||||||
|
if ((options.x -$(document).scrollLeft()) >
|
||||||
|
($(window).width() -MENU_WIDTH)) {
|
||||||
|
direction = "left";
|
||||||
|
}
|
||||||
|
|
||||||
|
menu = RED.menu.init({
|
||||||
|
direction: direction,
|
||||||
|
onpreselect: function() {
|
||||||
|
disposeMenu()
|
||||||
|
},
|
||||||
|
onpostselect: function () {
|
||||||
|
RED.view.focus()
|
||||||
|
},
|
||||||
|
options: menuItems
|
||||||
|
});
|
||||||
|
|
||||||
|
menu.attr("id", "red-ui-workspace-context-menu");
|
||||||
|
menu.css({
|
||||||
|
position: "absolute"
|
||||||
|
})
|
||||||
|
menu.appendTo("body");
|
||||||
|
|
||||||
|
// TODO: prevent the menu from overflowing the window.
|
||||||
|
|
||||||
|
var top = options.y
|
||||||
|
var left = options.x
|
||||||
|
|
||||||
|
if (top + menu.height() - $(document).scrollTop() > $(window).height()) {
|
||||||
|
top -= (top + menu.height()) - $(window).height() + 22;
|
||||||
|
}
|
||||||
|
if (left + menu.width() - $(document).scrollLeft() > $(window).width()) {
|
||||||
|
left -= (left + menu.width()) - $(window).width() + 18;
|
||||||
|
}
|
||||||
|
menu.css({
|
||||||
|
top: top + "px",
|
||||||
|
left: left + "px"
|
||||||
|
})
|
||||||
|
$(".red-ui-menu.red-ui-menu-dropdown").hide();
|
||||||
|
$(document).on("mousedown.red-ui-workspace-context-menu", function (evt) {
|
||||||
|
if (menu && menu[0].contains(evt.target)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
disposeMenu()
|
||||||
|
});
|
||||||
|
menu.show();
|
||||||
|
// set focus to first item so that pressing escape key closes the menu
|
||||||
|
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
|
||||||
|
|
||||||
|
}
|
||||||
|
// Allow escape key hook and other editor events to close context menu
|
||||||
|
RED.keyboard.add("red-ui-workspace-context-menu", "escape", function () { RED.contextMenu.hide() })
|
||||||
|
RED.events.on("editor:open", function () { RED.contextMenu.hide() });
|
||||||
|
RED.events.on("search:open", function () { RED.contextMenu.hide() });
|
||||||
|
RED.events.on("type-search:open", function () { RED.contextMenu.hide() });
|
||||||
|
RED.events.on("actionList:open", function () { RED.contextMenu.hide() });
|
||||||
|
RED.events.on("view:selection-changed", function () { RED.contextMenu.hide() });
|
||||||
|
return {
|
||||||
|
show: show,
|
||||||
|
hide: disposeMenu
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -63,16 +63,18 @@ RED.deploy = (function() {
|
|||||||
'</a>'+
|
'</a>'+
|
||||||
'<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
|
'<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
|
||||||
'</span></li>').prependTo(".red-ui-header-toolbar");
|
'</span></li>').prependTo(".red-ui-header-toolbar");
|
||||||
RED.menu.init({id:"red-ui-header-button-deploy-options",
|
const mainMenuItems = [
|
||||||
options: [
|
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
|
||||||
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
|
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.svg",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}},
|
||||||
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.svg",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}},
|
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}},
|
||||||
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}},
|
null
|
||||||
null,
|
]
|
||||||
{id:"deploymenu-item-reload", icon:"red/images/deploy-reload.svg",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"},
|
if (RED.settings.runtimeState && RED.settings.runtimeState.ui === true) {
|
||||||
|
mainMenuItems.push({id:"deploymenu-item-runtime-start", icon:"red/images/start.svg",label:RED._("deploy.startFlows"),sublabel:RED._("deploy.startFlowsDesc"),onselect:"core:start-flows", visible:false})
|
||||||
]
|
mainMenuItems.push({id:"deploymenu-item-runtime-stop", icon:"red/images/stop.svg",label:RED._("deploy.stopFlows"),sublabel:RED._("deploy.stopFlowsDesc"),onselect:"core:stop-flows", visible:false})
|
||||||
});
|
}
|
||||||
|
mainMenuItems.push({id:"deploymenu-item-reload", icon:"red/images/deploy-reload.svg",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"})
|
||||||
|
RED.menu.init({id:"red-ui-header-button-deploy-options", options: mainMenuItems });
|
||||||
} else if (type == "simple") {
|
} else if (type == "simple") {
|
||||||
var label = options.label || RED._("deploy.deploy");
|
var label = options.label || RED._("deploy.deploy");
|
||||||
var icon = 'red/images/deploy-full-o.svg';
|
var icon = 'red/images/deploy-full-o.svg';
|
||||||
@@ -100,6 +102,10 @@ RED.deploy = (function() {
|
|||||||
|
|
||||||
RED.actions.add("core:deploy-flows",save);
|
RED.actions.add("core:deploy-flows",save);
|
||||||
if (type === "default") {
|
if (type === "default") {
|
||||||
|
if (RED.settings.runtimeState && RED.settings.runtimeState.ui === true) {
|
||||||
|
RED.actions.add("core:stop-flows",function() { stopStartFlows("stop") });
|
||||||
|
RED.actions.add("core:start-flows",function() { stopStartFlows("start") });
|
||||||
|
}
|
||||||
RED.actions.add("core:restart-flows",restart);
|
RED.actions.add("core:restart-flows",restart);
|
||||||
RED.actions.add("core:set-deploy-type-to-full",function() { RED.menu.setSelected("deploymenu-item-full",true);});
|
RED.actions.add("core:set-deploy-type-to-full",function() { RED.menu.setSelected("deploymenu-item-full",true);});
|
||||||
RED.actions.add("core:set-deploy-type-to-modified-flows",function() { RED.menu.setSelected("deploymenu-item-flow",true); });
|
RED.actions.add("core:set-deploy-type-to-modified-flows",function() { RED.menu.setSelected("deploymenu-item-flow",true); });
|
||||||
@@ -270,18 +276,73 @@ RED.deploy = (function() {
|
|||||||
function sanitize(html) {
|
function sanitize(html) {
|
||||||
return html.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")
|
return html.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")
|
||||||
}
|
}
|
||||||
function restart() {
|
|
||||||
var startTime = Date.now();
|
function shadeShow() {
|
||||||
$(".red-ui-deploy-button-content").css('opacity',0);
|
|
||||||
$(".red-ui-deploy-button-spinner").show();
|
|
||||||
var deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled");
|
|
||||||
$("#red-ui-header-button-deploy").addClass("disabled");
|
|
||||||
deployInflight = true;
|
|
||||||
$("#red-ui-header-shade").show();
|
$("#red-ui-header-shade").show();
|
||||||
$("#red-ui-editor-shade").show();
|
$("#red-ui-editor-shade").show();
|
||||||
$("#red-ui-palette-shade").show();
|
$("#red-ui-palette-shade").show();
|
||||||
$("#red-ui-sidebar-shade").show();
|
$("#red-ui-sidebar-shade").show();
|
||||||
|
}
|
||||||
|
function shadeHide() {
|
||||||
|
$("#red-ui-header-shade").hide();
|
||||||
|
$("#red-ui-editor-shade").hide();
|
||||||
|
$("#red-ui-palette-shade").hide();
|
||||||
|
$("#red-ui-sidebar-shade").hide();
|
||||||
|
}
|
||||||
|
function deployButtonSetBusy(){
|
||||||
|
$(".red-ui-deploy-button-content").css('opacity',0);
|
||||||
|
$(".red-ui-deploy-button-spinner").show();
|
||||||
|
$("#red-ui-header-button-deploy").addClass("disabled");
|
||||||
|
}
|
||||||
|
function deployButtonClearBusy(){
|
||||||
|
$(".red-ui-deploy-button-content").css('opacity',1);
|
||||||
|
$(".red-ui-deploy-button-spinner").hide();
|
||||||
|
}
|
||||||
|
function stopStartFlows(state) {
|
||||||
|
const startTime = Date.now()
|
||||||
|
const deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled")
|
||||||
|
deployInflight = true
|
||||||
|
deployButtonSetBusy()
|
||||||
|
shadeShow()
|
||||||
|
$.ajax({
|
||||||
|
url:"flows/state",
|
||||||
|
type: "POST",
|
||||||
|
data: {state: state}
|
||||||
|
}).done(function(data,textStatus,xhr) {
|
||||||
|
if (deployWasEnabled) {
|
||||||
|
$("#red-ui-header-button-deploy").removeClass("disabled")
|
||||||
|
}
|
||||||
|
}).fail(function(xhr,textStatus,err) {
|
||||||
|
if (deployWasEnabled) {
|
||||||
|
$("#red-ui-header-button-deploy").removeClass("disabled")
|
||||||
|
}
|
||||||
|
if (xhr.status === 401) {
|
||||||
|
RED.notify(RED._("notification.error", { message: RED._("user.notAuthorized") }), "error")
|
||||||
|
} else if (xhr.responseText) {
|
||||||
|
const errorDetail = { message: err ? (err + "") : "" }
|
||||||
|
try {
|
||||||
|
errorDetail.message = JSON.parse(xhr.responseText).message
|
||||||
|
} finally {
|
||||||
|
errorDetail.message = errorDetail.message || xhr.responseText
|
||||||
|
}
|
||||||
|
RED.notify(RED._("notification.error", errorDetail), "error")
|
||||||
|
} else {
|
||||||
|
RED.notify(RED._("notification.error", { message: RED._("deploy.errors.noResponse") }), "error")
|
||||||
|
}
|
||||||
|
}).always(function() {
|
||||||
|
const delta = Math.max(0, 300 - (Date.now() - startTime))
|
||||||
|
setTimeout(function () {
|
||||||
|
deployButtonClearBusy()
|
||||||
|
shadeHide()
|
||||||
|
deployInflight = false
|
||||||
|
}, delta);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function restart() {
|
||||||
|
var startTime = Date.now();
|
||||||
|
var deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled");
|
||||||
|
deployInflight = true;
|
||||||
|
deployButtonSetBusy();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"flows",
|
url:"flows",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -307,204 +368,244 @@ RED.deploy = (function() {
|
|||||||
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
|
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
|
||||||
}
|
}
|
||||||
}).always(function() {
|
}).always(function() {
|
||||||
deployInflight = false;
|
|
||||||
var delta = Math.max(0,300-(Date.now()-startTime));
|
var delta = Math.max(0,300-(Date.now()-startTime));
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$(".red-ui-deploy-button-content").css('opacity',1);
|
deployButtonClearBusy();
|
||||||
$(".red-ui-deploy-button-spinner").hide();
|
deployInflight = false;
|
||||||
$("#red-ui-header-shade").hide();
|
|
||||||
$("#red-ui-editor-shade").hide();
|
|
||||||
$("#red-ui-palette-shade").hide();
|
|
||||||
$("#red-ui-sidebar-shade").hide();
|
|
||||||
},delta);
|
},delta);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function save(skipValidation,force) {
|
function save(skipValidation, force) {
|
||||||
if (!$("#red-ui-header-button-deploy").hasClass("disabled")) {
|
if ($("#red-ui-header-button-deploy").hasClass("disabled")) {
|
||||||
if (!RED.user.hasPermission("flows.write")) {
|
return; //deploy is disabled
|
||||||
RED.notify(RED._("user.errors.deploy"),"error");
|
}
|
||||||
|
if ($("#red-ui-header-shade").is(":visible")) {
|
||||||
|
return; //deploy is shaded
|
||||||
|
}
|
||||||
|
if (!RED.user.hasPermission("flows.write")) {
|
||||||
|
RED.notify(RED._("user.errors.deploy"), "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let hasUnusedConfig = false;
|
||||||
|
if (!skipValidation) {
|
||||||
|
let hasUnknown = false;
|
||||||
|
let hasInvalid = false;
|
||||||
|
const unknownNodes = [];
|
||||||
|
const invalidNodes = [];
|
||||||
|
|
||||||
|
RED.nodes.eachConfig(function (node) {
|
||||||
|
if (node.valid === undefined) {
|
||||||
|
RED.editor.validateNode(node);
|
||||||
|
}
|
||||||
|
if (!node.valid && !node.d) {
|
||||||
|
invalidNodes.push(getNodeInfo(node));
|
||||||
|
}
|
||||||
|
if (node.type === "unknown") {
|
||||||
|
if (unknownNodes.indexOf(node.name) == -1) {
|
||||||
|
unknownNodes.push(node.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RED.nodes.eachNode(function (node) {
|
||||||
|
if (!node.valid && !node.d) {
|
||||||
|
invalidNodes.push(getNodeInfo(node));
|
||||||
|
}
|
||||||
|
if (node.type === "unknown") {
|
||||||
|
if (unknownNodes.indexOf(node.name) == -1) {
|
||||||
|
unknownNodes.push(node.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hasUnknown = unknownNodes.length > 0;
|
||||||
|
hasInvalid = invalidNodes.length > 0;
|
||||||
|
|
||||||
|
const unusedConfigNodes = [];
|
||||||
|
RED.nodes.eachConfig(function (node) {
|
||||||
|
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
|
||||||
|
unusedConfigNodes.push(getNodeInfo(node));
|
||||||
|
hasUnusedConfig = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let showWarning = false;
|
||||||
|
let notificationMessage;
|
||||||
|
let notificationButtons = [];
|
||||||
|
let notification;
|
||||||
|
if (hasUnknown && !ignoreDeployWarnings.unknown) {
|
||||||
|
showWarning = true;
|
||||||
|
notificationMessage = "<p>" + RED._('deploy.confirm.unknown') + "</p>" +
|
||||||
|
'<ul class="red-ui-deploy-dialog-confirm-list"><li>' + cropList(unknownNodes).map(function (n) { return sanitize(n) }).join("</li><li>") + "</li></ul><p>" +
|
||||||
|
RED._('deploy.confirm.confirm') +
|
||||||
|
"</p>";
|
||||||
|
|
||||||
|
notificationButtons = [
|
||||||
|
{
|
||||||
|
text: RED._("deploy.unknownNodesButton"),
|
||||||
|
class: "pull-left",
|
||||||
|
click: function() {
|
||||||
|
notification.close();
|
||||||
|
RED.actions.invoke("core:search","type:unknown ");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
||||||
|
text: RED._("deploy.confirm.button.confirm"),
|
||||||
|
class: "primary",
|
||||||
|
click: function () {
|
||||||
|
save(true);
|
||||||
|
notification.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
} else if (hasInvalid && !ignoreDeployWarnings.invalid) {
|
||||||
|
showWarning = true;
|
||||||
|
invalidNodes.sort(sortNodeInfo);
|
||||||
|
|
||||||
|
notificationMessage = "<p>" + RED._('deploy.confirm.improperlyConfigured') + "</p>" +
|
||||||
|
'<ul class="red-ui-deploy-dialog-confirm-list"><li>' + cropList(invalidNodes.map(function (A) { return sanitize((A.tab ? "[" + A.tab + "] " : "") + A.label + " (" + A.type + ")") })).join("</li><li>") + "</li></ul><p>" +
|
||||||
|
RED._('deploy.confirm.confirm') +
|
||||||
|
"</p>";
|
||||||
|
notificationButtons = [
|
||||||
|
{
|
||||||
|
text: RED._("deploy.invalidNodesButton"),
|
||||||
|
class: "pull-left",
|
||||||
|
click: function() {
|
||||||
|
notification.close();
|
||||||
|
RED.actions.invoke("core:search","is:invalid ");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
||||||
|
text: RED._("deploy.confirm.button.confirm"),
|
||||||
|
class: "primary",
|
||||||
|
click: function () {
|
||||||
|
save(true);
|
||||||
|
notification.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if (showWarning) {
|
||||||
|
notificationButtons.unshift(
|
||||||
|
{
|
||||||
|
text: RED._("common.label.cancel"),
|
||||||
|
click: function () {
|
||||||
|
notification.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
notification = RED.notify(notificationMessage, {
|
||||||
|
modal: true,
|
||||||
|
fixed: true,
|
||||||
|
buttons: notificationButtons
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!skipValidation) {
|
|
||||||
var hasUnknown = false;
|
|
||||||
var hasInvalid = false;
|
|
||||||
var hasUnusedConfig = false;
|
|
||||||
|
|
||||||
var unknownNodes = [];
|
|
||||||
var invalidNodes = [];
|
|
||||||
|
|
||||||
RED.nodes.eachNode(function(node) {
|
|
||||||
if (!node.valid && !node.d) {
|
|
||||||
invalidNodes.push(getNodeInfo(node));
|
|
||||||
}
|
|
||||||
if (node.type === "unknown") {
|
|
||||||
if (unknownNodes.indexOf(node.name) == -1) {
|
|
||||||
unknownNodes.push(node.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
hasUnknown = unknownNodes.length > 0;
|
|
||||||
hasInvalid = invalidNodes.length > 0;
|
|
||||||
|
|
||||||
var unusedConfigNodes = [];
|
|
||||||
RED.nodes.eachConfig(function(node) {
|
|
||||||
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
|
|
||||||
unusedConfigNodes.push(getNodeInfo(node));
|
|
||||||
hasUnusedConfig = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var showWarning = false;
|
|
||||||
var notificationMessage;
|
|
||||||
var notificationButtons = [];
|
|
||||||
var notification;
|
|
||||||
if (hasUnknown && !ignoreDeployWarnings.unknown) {
|
|
||||||
showWarning = true;
|
|
||||||
notificationMessage = "<p>"+RED._('deploy.confirm.unknown')+"</p>"+
|
|
||||||
'<ul class="red-ui-deploy-dialog-confirm-list"><li>'+cropList(unknownNodes).map(function(n) { return sanitize(n) }).join("</li><li>")+"</li></ul><p>"+
|
|
||||||
RED._('deploy.confirm.confirm')+
|
|
||||||
"</p>";
|
|
||||||
|
|
||||||
notificationButtons= [
|
|
||||||
{
|
|
||||||
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
|
||||||
text: RED._("deploy.confirm.button.confirm"),
|
|
||||||
class: "primary",
|
|
||||||
click: function() {
|
|
||||||
save(true);
|
|
||||||
notification.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
} else if (hasInvalid && !ignoreDeployWarnings.invalid) {
|
|
||||||
showWarning = true;
|
|
||||||
invalidNodes.sort(sortNodeInfo);
|
|
||||||
|
|
||||||
notificationMessage = "<p>"+RED._('deploy.confirm.improperlyConfigured')+"</p>"+
|
|
||||||
'<ul class="red-ui-deploy-dialog-confirm-list"><li>'+cropList(invalidNodes.map(function(A) { return sanitize( (A.tab?"["+A.tab+"] ":"")+A.label+" ("+A.type+")")})).join("</li><li>")+"</li></ul><p>"+
|
|
||||||
RED._('deploy.confirm.confirm')+
|
|
||||||
"</p>";
|
|
||||||
notificationButtons= [
|
|
||||||
{
|
|
||||||
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
|
||||||
text: RED._("deploy.confirm.button.confirm"),
|
|
||||||
class: "primary",
|
|
||||||
click: function() {
|
|
||||||
save(true);
|
|
||||||
notification.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (showWarning) {
|
|
||||||
notificationButtons.unshift(
|
|
||||||
{
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
notification.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
notification = RED.notify(notificationMessage,{
|
|
||||||
modal: true,
|
|
||||||
fixed: true,
|
|
||||||
buttons:notificationButtons
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var nns = RED.nodes.createCompleteNodeSet();
|
|
||||||
|
|
||||||
var startTime = Date.now();
|
|
||||||
$(".red-ui-deploy-button-content").css('opacity',0);
|
|
||||||
$(".red-ui-deploy-button-spinner").show();
|
|
||||||
$("#red-ui-header-button-deploy").addClass("disabled");
|
|
||||||
|
|
||||||
var data = {flows:nns};
|
|
||||||
|
|
||||||
if (!force) {
|
|
||||||
data.rev = RED.nodes.version();
|
|
||||||
}
|
|
||||||
|
|
||||||
deployInflight = true;
|
|
||||||
$("#red-ui-header-shade").show();
|
|
||||||
$("#red-ui-editor-shade").show();
|
|
||||||
$("#red-ui-palette-shade").show();
|
|
||||||
$("#red-ui-sidebar-shade").show();
|
|
||||||
$.ajax({
|
|
||||||
url:"flows",
|
|
||||||
type: "POST",
|
|
||||||
data: JSON.stringify(data),
|
|
||||||
contentType: "application/json; charset=utf-8",
|
|
||||||
headers: {
|
|
||||||
"Node-RED-Deployment-Type":deploymentType
|
|
||||||
}
|
|
||||||
}).done(function(data,textStatus,xhr) {
|
|
||||||
RED.nodes.dirty(false);
|
|
||||||
RED.nodes.version(data.rev);
|
|
||||||
RED.nodes.originalFlow(nns);
|
|
||||||
if (hasUnusedConfig) {
|
|
||||||
RED.notify(
|
|
||||||
'<p>'+RED._("deploy.successfulDeploy")+'</p>'+
|
|
||||||
'<p>'+RED._("deploy.unusedConfigNodes")+' <a href="#" onclick="RED.sidebar.config.show(true); return false;">'+RED._("deploy.unusedConfigNodesLink")+'</a></p>',"success",false,6000);
|
|
||||||
} else {
|
|
||||||
RED.notify('<p>'+RED._("deploy.successfulDeploy")+'</p>',"success");
|
|
||||||
}
|
|
||||||
RED.nodes.eachNode(function(node) {
|
|
||||||
if (node.changed) {
|
|
||||||
node.dirty = true;
|
|
||||||
node.changed = false;
|
|
||||||
}
|
|
||||||
if (node.moved) {
|
|
||||||
node.dirty = true;
|
|
||||||
node.moved = false;
|
|
||||||
}
|
|
||||||
if(node.credentials) {
|
|
||||||
delete node.credentials;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RED.nodes.eachConfig(function (confNode) {
|
|
||||||
confNode.changed = false;
|
|
||||||
if (confNode.credentials) {
|
|
||||||
delete confNode.credentials;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RED.nodes.eachSubflow(function(subflow) {
|
|
||||||
subflow.changed = false;
|
|
||||||
});
|
|
||||||
RED.nodes.eachWorkspace(function(ws) {
|
|
||||||
ws.changed = false;
|
|
||||||
});
|
|
||||||
// Once deployed, cannot undo back to a clean state
|
|
||||||
RED.history.markAllDirty();
|
|
||||||
RED.view.redraw();
|
|
||||||
RED.events.emit("deploy");
|
|
||||||
}).fail(function(xhr,textStatus,err) {
|
|
||||||
RED.nodes.dirty(true);
|
|
||||||
$("#red-ui-header-button-deploy").removeClass("disabled");
|
|
||||||
if (xhr.status === 401) {
|
|
||||||
RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error");
|
|
||||||
} else if (xhr.status === 409) {
|
|
||||||
resolveConflict(nns, true);
|
|
||||||
} else if (xhr.responseText) {
|
|
||||||
RED.notify(RED._("deploy.deployFailed",{message:xhr.responseText}),"error");
|
|
||||||
} else {
|
|
||||||
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
|
|
||||||
}
|
|
||||||
}).always(function() {
|
|
||||||
deployInflight = false;
|
|
||||||
var delta = Math.max(0,300-(Date.now()-startTime));
|
|
||||||
setTimeout(function() {
|
|
||||||
$(".red-ui-deploy-button-content").css('opacity',1);
|
|
||||||
$(".red-ui-deploy-button-spinner").hide();
|
|
||||||
$("#red-ui-header-shade").hide();
|
|
||||||
$("#red-ui-editor-shade").hide();
|
|
||||||
$("#red-ui-palette-shade").hide();
|
|
||||||
$("#red-ui-sidebar-shade").hide();
|
|
||||||
},delta);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nns = RED.nodes.createCompleteNodeSet();
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
deployButtonSetBusy();
|
||||||
|
const data = { flows: nns };
|
||||||
|
if (!force) {
|
||||||
|
data.rev = RED.nodes.version();
|
||||||
|
}
|
||||||
|
|
||||||
|
deployInflight = true;
|
||||||
|
shadeShow();
|
||||||
|
$.ajax({
|
||||||
|
url: "flows",
|
||||||
|
type: "POST",
|
||||||
|
data: JSON.stringify(data),
|
||||||
|
contentType: "application/json; charset=utf-8",
|
||||||
|
headers: {
|
||||||
|
"Node-RED-Deployment-Type": deploymentType
|
||||||
|
}
|
||||||
|
}).done(function (data, textStatus, xhr) {
|
||||||
|
RED.nodes.dirty(false);
|
||||||
|
RED.nodes.version(data.rev);
|
||||||
|
RED.nodes.originalFlow(nns);
|
||||||
|
if (hasUnusedConfig) {
|
||||||
|
let notification;
|
||||||
|
const opts = {
|
||||||
|
type: "success",
|
||||||
|
fixed: false,
|
||||||
|
timeout: 6000,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: RED._("deploy.unusedConfigNodesButton"),
|
||||||
|
class: "pull-left",
|
||||||
|
click: function() {
|
||||||
|
notification.close();
|
||||||
|
RED.actions.invoke("core:search","is:config is:unused ");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: RED._("common.label.close"),
|
||||||
|
class: "primary",
|
||||||
|
click: function () {
|
||||||
|
save(true);
|
||||||
|
notification.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
notification = RED.notify(
|
||||||
|
'<p>' + RED._("deploy.successfulDeploy") + '</p>' +
|
||||||
|
'<p>' + RED._("deploy.unusedConfigNodes") + '</p>', opts);
|
||||||
|
} else {
|
||||||
|
RED.notify('<p>' + RED._("deploy.successfulDeploy") + '</p>', "success");
|
||||||
|
}
|
||||||
|
RED.nodes.eachNode(function (node) {
|
||||||
|
if (node.changed) {
|
||||||
|
node.dirty = true;
|
||||||
|
node.changed = false;
|
||||||
|
}
|
||||||
|
if (node.moved) {
|
||||||
|
node.dirty = true;
|
||||||
|
node.moved = false;
|
||||||
|
}
|
||||||
|
if (node.credentials) {
|
||||||
|
delete node.credentials;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RED.nodes.eachConfig(function (confNode) {
|
||||||
|
confNode.changed = false;
|
||||||
|
if (confNode.credentials) {
|
||||||
|
delete confNode.credentials;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RED.nodes.eachSubflow(function (subflow) {
|
||||||
|
subflow.changed = false;
|
||||||
|
});
|
||||||
|
RED.nodes.eachWorkspace(function (ws) {
|
||||||
|
ws.changed = false;
|
||||||
|
});
|
||||||
|
// Once deployed, cannot undo back to a clean state
|
||||||
|
RED.history.markAllDirty();
|
||||||
|
RED.view.redraw();
|
||||||
|
RED.events.emit("deploy");
|
||||||
|
}).fail(function (xhr, textStatus, err) {
|
||||||
|
RED.nodes.dirty(true);
|
||||||
|
$("#red-ui-header-button-deploy").removeClass("disabled");
|
||||||
|
if (xhr.status === 401) {
|
||||||
|
RED.notify(RED._("deploy.deployFailed", { message: RED._("user.notAuthorized") }), "error");
|
||||||
|
} else if (xhr.status === 409) {
|
||||||
|
resolveConflict(nns, true);
|
||||||
|
} else if (xhr.responseText) {
|
||||||
|
RED.notify(RED._("deploy.deployFailed", { message: xhr.responseText }), "error");
|
||||||
|
} else {
|
||||||
|
RED.notify(RED._("deploy.deployFailed", { message: RED._("deploy.errors.noResponse") }), "error");
|
||||||
|
}
|
||||||
|
}).always(function () {
|
||||||
|
const delta = Math.max(0, 300 - (Date.now() - startTime));
|
||||||
|
setTimeout(function () {
|
||||||
|
deployInflight = false;
|
||||||
|
deployButtonClearBusy()
|
||||||
|
shadeHide()
|
||||||
|
}, delta);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
init: init,
|
init: init,
|
||||||
|
|||||||
61
packages/node_modules/@node-red/editor-client/src/js/ui/diagnostics.js
vendored
Normal file
61
packages/node_modules/@node-red/editor-client/src/js/ui/diagnostics.js
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
RED.diagnostics = (function () {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
if (RED.settings.get('diagnostics.ui', true) === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RED.actions.add("core:show-system-info", function () { show(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
function show() {
|
||||||
|
$.ajax({
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json"
|
||||||
|
},
|
||||||
|
cache: false,
|
||||||
|
url: 'diagnostics',
|
||||||
|
success: function (data) {
|
||||||
|
var json = JSON.stringify(data || {}, "", 4);
|
||||||
|
if (json === "{}") {
|
||||||
|
json = "{\n\n}";
|
||||||
|
}
|
||||||
|
RED.editor.editJSON({
|
||||||
|
title: RED._('diagnostics.title'),
|
||||||
|
value: json,
|
||||||
|
requireValid: true,
|
||||||
|
readOnly: true,
|
||||||
|
toolbarButtons: [
|
||||||
|
{
|
||||||
|
text: RED._('clipboard.export.copy'),
|
||||||
|
icon: 'fa fa-copy',
|
||||||
|
click: function () {
|
||||||
|
RED.clipboard.copyText(json, $(this), RED._('clipboard.copyMessageValue'))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: RED._('clipboard.download'),
|
||||||
|
icon: 'fa fa-download',
|
||||||
|
click: function () {
|
||||||
|
var element = document.createElement('a');
|
||||||
|
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(json));
|
||||||
|
element.setAttribute('download', "system-info.json");
|
||||||
|
element.style.display = 'none';
|
||||||
|
document.body.appendChild(element);
|
||||||
|
element.click();
|
||||||
|
document.body.removeChild(element);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
console.log("Unexpected error loading system info:", jqXHR.status, textStatus, errorThrown);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: init,
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -110,7 +110,11 @@ RED.editor = (function() {
|
|||||||
var result = [];
|
var result = [];
|
||||||
for (var prop in definition) {
|
for (var prop in definition) {
|
||||||
if (definition.hasOwnProperty(prop)) {
|
if (definition.hasOwnProperty(prop)) {
|
||||||
if (!validateNodeProperty(node, definition, prop, properties[prop])) {
|
var valid = validateNodeProperty(node, definition, prop, properties[prop]);
|
||||||
|
if ((typeof valid) === "string") {
|
||||||
|
result.push(valid);
|
||||||
|
}
|
||||||
|
else if(!valid) {
|
||||||
result.push(prop);
|
result.push(prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,7 +128,7 @@ RED.editor = (function() {
|
|||||||
* @param definition - the node property definitions (either def.defaults or def.creds)
|
* @param definition - the node property definitions (either def.defaults or def.creds)
|
||||||
* @param property - the property name being validated
|
* @param property - the property name being validated
|
||||||
* @param value - the property value being validated
|
* @param value - the property value being validated
|
||||||
* @returns {boolean} whether the node proprty is valid
|
* @returns {boolean|string} whether the node proprty is valid. `true`: valid `false|String`: invalid
|
||||||
*/
|
*/
|
||||||
function validateNodeProperty(node,definition,property,value) {
|
function validateNodeProperty(node,definition,property,value) {
|
||||||
var valid = true;
|
var valid = true;
|
||||||
@@ -136,22 +140,74 @@ RED.editor = (function() {
|
|||||||
if (/^\$\{[a-zA-Z_][a-zA-Z0-9_]*\}$/.test(value)) {
|
if (/^\$\{[a-zA-Z_][a-zA-Z0-9_]*\}$/.test(value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
var label = null;
|
||||||
|
if (("label" in definition[property]) &&
|
||||||
|
((typeof definition[property].label) == "string")) {
|
||||||
|
label = definition[property].label;
|
||||||
|
}
|
||||||
if ("required" in definition[property] && definition[property].required) {
|
if ("required" in definition[property] && definition[property].required) {
|
||||||
valid = value !== "";
|
valid = value !== "";
|
||||||
|
if (!valid && label) {
|
||||||
|
return RED._("validator.errors.missing-required-prop", {
|
||||||
|
prop: label
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (valid && "validate" in definition[property]) {
|
if (valid && "validate" in definition[property]) {
|
||||||
try {
|
try {
|
||||||
valid = definition[property].validate.call(node,value);
|
var opt = {};
|
||||||
|
if (label) {
|
||||||
|
opt.label = label;
|
||||||
|
}
|
||||||
|
valid = definition[property].validate.call(node,value, opt);
|
||||||
|
// If the validator takes two arguments, it is a 3.x validator that
|
||||||
|
// can return a String to mean 'invalid' and provide a reason
|
||||||
|
if ((definition[property].validate.length === 2) &&
|
||||||
|
((typeof valid) === "string")) {
|
||||||
|
return valid;
|
||||||
|
} else {
|
||||||
|
// Otherwise, a 2.x returns a truth-like/false-like value that
|
||||||
|
// we should cooerce to a boolean.
|
||||||
|
valid = !!valid
|
||||||
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.log("Validation error:",node.type,node.id,"property: "+property,"value:",value,err);
|
console.log("Validation error:",node.type,node.id,"property: "+property,"value:",value,err);
|
||||||
|
return RED._("validator.errors.validation-error", {
|
||||||
|
prop: property,
|
||||||
|
node: node.type,
|
||||||
|
id: node.id,
|
||||||
|
error: err.message
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (valid && definition[property].type && RED.nodes.getType(definition[property].type) && !("validate" in definition[property])) {
|
if (valid && definition[property].type && RED.nodes.getType(definition[property].type) && !("validate" in definition[property])) {
|
||||||
if (!value || value == "_ADD_") {
|
if (!value || value == "_ADD_") {
|
||||||
valid = definition[property].hasOwnProperty("required") && !definition[property].required;
|
valid = definition[property].hasOwnProperty("required") && !definition[property].required;
|
||||||
|
if (!valid && label) {
|
||||||
|
return RED._("validator.errors.missing-required-prop", {
|
||||||
|
prop: label
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var configNode = RED.nodes.node(value);
|
var configNode = RED.nodes.node(value);
|
||||||
valid = (configNode && (configNode.valid == null || configNode.valid));
|
if (configNode) {
|
||||||
|
if ((configNode.valid == null) || configNode.valid) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (label) {
|
||||||
|
return RED._("validator.errors.invalid-config", {
|
||||||
|
prop: label
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (label) {
|
||||||
|
return RED._("validator.errors.missing-config", {
|
||||||
|
prop: label
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
@@ -179,10 +235,28 @@ RED.editor = (function() {
|
|||||||
if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
|
if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
|
||||||
value = input.text();
|
value = input.text();
|
||||||
}
|
}
|
||||||
if (!validateNodeProperty(node, defaults, property,value)) {
|
var valid = validateNodeProperty(node, defaults, property,value);
|
||||||
|
if (((typeof valid) === "string") || !valid) {
|
||||||
input.addClass("input-error");
|
input.addClass("input-error");
|
||||||
|
input.next(".red-ui-typedInput-container").addClass("input-error");
|
||||||
|
if ((typeof valid) === "string") {
|
||||||
|
var tooltip = input.data("tooltip");
|
||||||
|
if (tooltip) {
|
||||||
|
tooltip.setContent(valid);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tooltip = RED.popover.tooltip(input, valid);
|
||||||
|
input.data("tooltip", tooltip);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
input.removeClass("input-error");
|
input.removeClass("input-error");
|
||||||
|
input.next(".red-ui-typedInput-container").removeClass("input-error");
|
||||||
|
var tooltip = input.data("tooltip");
|
||||||
|
if (tooltip) {
|
||||||
|
input.data("tooltip", null);
|
||||||
|
tooltip.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,20 +423,11 @@ RED.editor = (function() {
|
|||||||
* @param prefix - the prefix to use in the input element ids (node-input|node-config-input)
|
* @param prefix - the prefix to use in the input element ids (node-input|node-config-input)
|
||||||
*/
|
*/
|
||||||
function attachPropertyChangeHandler(node,definition,property,prefix) {
|
function attachPropertyChangeHandler(node,definition,property,prefix) {
|
||||||
var input = $("#"+prefix+"-"+property);
|
$("#"+prefix+"-"+property).on("change keyup paste", function(event) {
|
||||||
if (definition !== undefined && "format" in definition[property] && definition[property].format !== "" && input[0].nodeName === "DIV") {
|
if (!$(this).attr("skipValidation")) {
|
||||||
$("#"+prefix+"-"+property).on('change keyup', function(event) {
|
validateNodeEditor(node,prefix);
|
||||||
if (!$(this).attr("skipValidation")) {
|
}
|
||||||
validateNodeEditor(node,prefix);
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$("#"+prefix+"-"+property).on("change", function(event) {
|
|
||||||
if (!$(this).attr("skipValidation")) {
|
|
||||||
validateNodeEditor(node,prefix);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -796,6 +861,7 @@ RED.editor = (function() {
|
|||||||
if (buildingEditDialog) { return }
|
if (buildingEditDialog) { return }
|
||||||
buildingEditDialog = true;
|
buildingEditDialog = true;
|
||||||
var editing_node = node;
|
var editing_node = node;
|
||||||
|
var removeInfoEditorOnClose = false;
|
||||||
var skipInfoRefreshOnClose = false;
|
var skipInfoRefreshOnClose = false;
|
||||||
var activeEditPanes = [];
|
var activeEditPanes = [];
|
||||||
|
|
||||||
@@ -991,6 +1057,14 @@ RED.editor = (function() {
|
|||||||
}
|
}
|
||||||
if (!node._def.defaults || !node._def.defaults.hasOwnProperty('info')) {
|
if (!node._def.defaults || !node._def.defaults.hasOwnProperty('info')) {
|
||||||
nodeEditPanes.push('editor-tab-description');
|
nodeEditPanes.push('editor-tab-description');
|
||||||
|
removeInfoEditorOnClose = true;
|
||||||
|
if(node.infoEditor) {
|
||||||
|
//As 'editor-tab-description' adds `node.infoEditor` store original & set a
|
||||||
|
//flag to NOT remove this property
|
||||||
|
node.infoEditor__orig = node.infoEditor;
|
||||||
|
delete node.infoEditor;
|
||||||
|
removeInfoEditorOnClose = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nodeEditPanes.push("editor-tab-appearance");
|
nodeEditPanes.push("editor-tab-appearance");
|
||||||
|
|
||||||
@@ -1006,8 +1080,17 @@ RED.editor = (function() {
|
|||||||
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
|
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
|
||||||
RED.view.state(RED.state.DEFAULT);
|
RED.view.state(RED.state.DEFAULT);
|
||||||
}
|
}
|
||||||
if (editing_node && !skipInfoRefreshOnClose) {
|
if (editing_node) {
|
||||||
RED.sidebar.info.refresh(editing_node);
|
if (editing_node.infoEditor__orig) {
|
||||||
|
editing_node.infoEditor = editing_node.infoEditor__orig;
|
||||||
|
delete editing_node.infoEditor__orig;
|
||||||
|
}
|
||||||
|
if (removeInfoEditorOnClose) {
|
||||||
|
delete editing_node.infoEditor;
|
||||||
|
}
|
||||||
|
if (!skipInfoRefreshOnClose) {
|
||||||
|
RED.sidebar.info.refresh(editing_node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RED.workspaces.refresh();
|
RED.workspaces.refresh();
|
||||||
|
|
||||||
@@ -1024,6 +1107,10 @@ RED.editor = (function() {
|
|||||||
if (editing_node) {
|
if (editing_node) {
|
||||||
RED.sidebar.info.refresh(editing_node);
|
RED.sidebar.info.refresh(editing_node);
|
||||||
RED.sidebar.help.show(editing_node.type, false);
|
RED.sidebar.help.show(editing_node.type, false);
|
||||||
|
//ensure focused element is NOT body (for keyboard scope to operate correctly)
|
||||||
|
if (document.activeElement.tagName === 'BODY') {
|
||||||
|
$('#red-ui-editor-stack').trigger('focus')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1867,6 +1954,48 @@ RED.editor = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Genrate a consistent but unique ID for saving and restoring the code editors view state */
|
||||||
|
function generateViewStateId(source, thing, suffix) {
|
||||||
|
try {
|
||||||
|
thing = thing || {};
|
||||||
|
const thingOptions = typeof thing.options === "object" ? thing.options : {};
|
||||||
|
let stateId;
|
||||||
|
if (thing.hasOwnProperty("stateId")) {
|
||||||
|
stateId = thing.stateId
|
||||||
|
} else if (thingOptions.hasOwnProperty("stateId")) {
|
||||||
|
stateId = thing.stateId
|
||||||
|
}
|
||||||
|
if (stateId === false) { return false; }
|
||||||
|
if (!stateId) {
|
||||||
|
let id;
|
||||||
|
const selection = RED.view.selection();
|
||||||
|
if (source === "node" && thing.id) {
|
||||||
|
id = thing.id;
|
||||||
|
} else if (selection.nodes && selection.nodes.length) {
|
||||||
|
id = selection.nodes[0].id;
|
||||||
|
} else {
|
||||||
|
return false; //cant obtain Id.
|
||||||
|
}
|
||||||
|
//Use a string builder to build an ID
|
||||||
|
const sb = [id];
|
||||||
|
//get the index of the el - there may be more than one editor.
|
||||||
|
const el = $(thing.element || thingOptions.element);
|
||||||
|
if(el.length) {
|
||||||
|
sb.push(el.closest(".form-row").index());
|
||||||
|
sb.push(el.index());
|
||||||
|
}
|
||||||
|
if (source == "typedInput") {
|
||||||
|
sb.push(el.closest("li").index());//for when embeded in editable list
|
||||||
|
if (!suffix && thing.propertyType) { suffix = thing.propertyType }
|
||||||
|
}
|
||||||
|
stateId = sb.join("/");
|
||||||
|
}
|
||||||
|
if (stateId && suffix) { stateId += "/" + suffix; }
|
||||||
|
return stateId;
|
||||||
|
} catch (error) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
init: function() {
|
init: function() {
|
||||||
if(window.ace) { window.ace.config.set('basePath', 'vendor/ace'); }
|
if(window.ace) { window.ace.config.set('basePath', 'vendor/ace'); }
|
||||||
@@ -1883,6 +2012,7 @@ RED.editor = (function() {
|
|||||||
});
|
});
|
||||||
RED.editor.codeEditor.init();
|
RED.editor.codeEditor.init();
|
||||||
},
|
},
|
||||||
|
generateViewStateId: generateViewStateId,
|
||||||
edit: showEditDialog,
|
edit: showEditDialog,
|
||||||
editConfig: showEditConfigNodeDialog,
|
editConfig: showEditConfigNodeDialog,
|
||||||
editFlow: showEditFlowDialog,
|
editFlow: showEditFlowDialog,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
var definition = {
|
var definition = {
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_buffer"
|
var type = "_buffer"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
@@ -60,12 +61,14 @@
|
|||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: "inherit",
|
width: "inherit",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if (onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -74,7 +77,8 @@
|
|||||||
text: RED._("common.label.done"),
|
text: RED._("common.label.done"),
|
||||||
class: "primary",
|
class: "primary",
|
||||||
click: function() {
|
click: function() {
|
||||||
onComplete(JSON.stringify(bufferBinValue));
|
bufferStringEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(JSON.stringify(bufferBinValue),null,bufferStringEditor); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,19 +90,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
open: function(tray) {
|
open: function(tray) {
|
||||||
var trayBody = tray.find('.red-ui-tray-body');
|
|
||||||
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
||||||
|
|
||||||
bufferStringEditor = RED.editor.createEditor({
|
bufferStringEditor = RED.editor.createEditor({
|
||||||
id: 'red-ui-editor-type-buffer-str',
|
id: 'red-ui-editor-type-buffer-str',
|
||||||
value: "",
|
value: value||"",
|
||||||
|
stateId: RED.editor.generateViewStateId("buffer", options, ""),
|
||||||
|
focus: true,
|
||||||
mode:"ace/mode/text"
|
mode:"ace/mode/text"
|
||||||
});
|
});
|
||||||
bufferStringEditor.getSession().setValue(value||"",-1);
|
|
||||||
|
|
||||||
bufferBinEditor = RED.editor.createEditor({
|
bufferBinEditor = RED.editor.createEditor({
|
||||||
id: 'red-ui-editor-type-buffer-bin',
|
id: 'red-ui-editor-type-buffer-bin',
|
||||||
value: "",
|
value: "",
|
||||||
|
stateId: false,
|
||||||
|
focus: false,
|
||||||
mode:"ace/mode/text",
|
mode:"ace/mode/text",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
const MONACO = "monaco";
|
const MONACO = "monaco";
|
||||||
const ACE = "ace";
|
const ACE = "ace";
|
||||||
const defaultEditor = ACE;
|
const defaultEditor = MONACO;
|
||||||
const DEFAULT_SETTINGS = { lib: defaultEditor, options: {} };
|
const DEFAULT_SETTINGS = { lib: defaultEditor, options: {} };
|
||||||
var selectedCodeEditor = null;
|
var selectedCodeEditor = null;
|
||||||
var initialised = false;
|
var initialised = false;
|
||||||
@@ -48,12 +48,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function create(options) {
|
function create(options) {
|
||||||
//TODO: (quandry - for consideration)
|
//TODO: (quandry - for consideration)
|
||||||
// Below, I had to create a hidden element if options.id || options.element is not in the DOM
|
// Below, I had to create a hidden element if options.id || options.element is not in the DOM
|
||||||
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
|
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
|
||||||
// invalid (non existing html element selector) (e.g. node-red-contrib-components does this)
|
// invalid (non existing html element selector) (e.g. node-red-contrib-components does this)
|
||||||
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
|
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
|
||||||
// code is thus skipped.
|
// code is thus skipped.
|
||||||
// In ACE mode, creating an ACE editor (with an invalid ID) allows the editor to be created (but obviously there is no UI)
|
// In ACE mode, creating an ACE editor (with an invalid ID) allows the editor to be created (but obviously there is no UI)
|
||||||
// Because one (or more) contrib nodes have left this bad code in place, how would we handle this?
|
// Because one (or more) contrib nodes have left this bad code in place, how would we handle this?
|
||||||
// For compatibility, I have decided to create a hidden element so that at least an editor is created & errors do not occur.
|
// For compatibility, I have decided to create a hidden element so that at least an editor is created & errors do not occur.
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
return this.editor.create(options);//fallback to ACE
|
return this.editor.create(options);//fallback to ACE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: init,
|
init: init,
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Get user selected code editor
|
* Get user selected code editor
|
||||||
* @return {string} Returns
|
* @return {string} Returns
|
||||||
* @memberof RED.editor.codeEditor
|
* @memberof RED.editor.codeEditor
|
||||||
*/
|
*/
|
||||||
get editor() {
|
get editor() {
|
||||||
@@ -104,4 +104,4 @@
|
|||||||
*/
|
*/
|
||||||
create: create
|
create: create
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ RED.editor.codeEditor.ace = (function() {
|
|||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
}
|
}
|
||||||
|
if (!options.stateId && options.stateId !== false) {
|
||||||
|
options.stateId = RED.editor.generateViewStateId("ace", options, (options.mode || options.title).split("/").pop());
|
||||||
|
}
|
||||||
if (options.mode === 'ace/mode/markdown') {
|
if (options.mode === 'ace/mode/markdown') {
|
||||||
$(el).addClass("red-ui-editor-text-container-toolbar");
|
$(el).addClass("red-ui-editor-text-container-toolbar");
|
||||||
editor.toolbar = RED.editor.customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
|
editor.toolbar = RED.editor.customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
|
||||||
@@ -92,11 +95,15 @@ RED.editor.codeEditor.ace = (function() {
|
|||||||
RED.editor.editMarkdown({
|
RED.editor.editMarkdown({
|
||||||
value: value,
|
value: value,
|
||||||
width: "Infinity",
|
width: "Infinity",
|
||||||
cursor: editor.getCursorPosition(),
|
stateId: options.stateId,
|
||||||
|
focus: true,
|
||||||
|
cancel: function () {
|
||||||
|
editor.focus();
|
||||||
|
},
|
||||||
complete: function(v,cursor) {
|
complete: function(v,cursor) {
|
||||||
editor.setValue(v, -1);
|
editor.setValue(v, -1);
|
||||||
editor.gotoLine(cursor.row+1,cursor.column,false);
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
editor.restoreView();
|
||||||
editor.focus();
|
editor.focus();
|
||||||
},300);
|
},300);
|
||||||
}
|
}
|
||||||
@@ -117,11 +124,56 @@ RED.editor.codeEditor.ace = (function() {
|
|||||||
editor._destroy = editor.destroy;
|
editor._destroy = editor.destroy;
|
||||||
editor.destroy = function() {
|
editor.destroy = function() {
|
||||||
try {
|
try {
|
||||||
|
editor.saveView();
|
||||||
|
editor._initState = null;
|
||||||
this._destroy();
|
this._destroy();
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
$(el).remove();
|
$(el).remove();
|
||||||
$(toolbarRow).remove();
|
$(toolbarRow).remove();
|
||||||
}
|
}
|
||||||
|
editor.on("blur", function () {
|
||||||
|
editor.focusMemory = false;
|
||||||
|
editor.saveView();
|
||||||
|
})
|
||||||
|
editor.on("focus", function () {
|
||||||
|
if (editor._initState) {
|
||||||
|
editor.restoreView(editor._initState);
|
||||||
|
editor._initState = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
editor.getView = function () {
|
||||||
|
var session = editor.getSession();
|
||||||
|
return {
|
||||||
|
selection: session.selection.toJSON(),
|
||||||
|
scrollTop: session.getScrollTop(),
|
||||||
|
scrollLeft: session.getScrollLeft(),
|
||||||
|
options: session.getOptions()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
editor.saveView = function () {
|
||||||
|
if (!options.stateId) { return; } //only possible if created with a unique stateId
|
||||||
|
window._editorStateAce = window._editorStateAce || {};
|
||||||
|
var state = editor.getView();
|
||||||
|
window._editorStateAce[options.stateId] = state;
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
editor.restoreView = function (state) {
|
||||||
|
if (!options.stateId) { return; } //only possible if created with a unique stateId
|
||||||
|
window._editorStateAce = window._editorStateAce || {};
|
||||||
|
var _state = state || window._editorStateAce[options.stateId];
|
||||||
|
if (!_state) { return; } //no view state available
|
||||||
|
try {
|
||||||
|
var session = editor.getSession();
|
||||||
|
session.setOptions(_state.options);
|
||||||
|
session.selection.fromJSON(_state.selection);
|
||||||
|
session.setScrollTop(_state.scrollTop);
|
||||||
|
session.setScrollLeft(_state.scrollLeft);
|
||||||
|
editor._initState = _state;
|
||||||
|
} catch (error) {
|
||||||
|
delete window._editorStateMonaco[options.stateId];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
editor.restoreView();
|
||||||
editor.type = type;
|
editor.type = type;
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
"node-red-util": {package: "node-red", module: "util", path: "node-red/util.d.ts" },
|
"node-red-util": {package: "node-red", module: "util", path: "node-red/util.d.ts" },
|
||||||
"node-red-func": {package: "node-red", module: "func", path: "node-red/func.d.ts" },
|
"node-red-func": {package: "node-red", module: "func", path: "node-red/func.d.ts" },
|
||||||
}
|
}
|
||||||
const defaultServerSideTypes = [ knownModules["node-red-util"], knownModules["node-red-func"], knownModules["globals"], knownModules["console"], knownModules["buffer"] ];
|
const defaultServerSideTypes = [ knownModules["node-red-util"], knownModules["node-red-func"], knownModules["globals"], knownModules["console"], knownModules["buffer"] , knownModules["util"] ];
|
||||||
|
|
||||||
const modulesCache = {};
|
const modulesCache = {};
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
window.MonacoEnvironment = window.MonacoEnvironment || {};
|
window.MonacoEnvironment = window.MonacoEnvironment || {};
|
||||||
window.MonacoEnvironment.getWorkerUrl = function (moduleId, label) {
|
window.MonacoEnvironment.getWorkerUrl = window.MonacoEnvironment.getWorkerUrl || function (moduleId, label) {
|
||||||
if (label === 'json') { return './vendor/monaco/dist/json.worker.js'; }
|
if (label === 'json') { return './vendor/monaco/dist/json.worker.js'; }
|
||||||
if (label === 'css' || label === 'scss') { return './vendor/monaco/dist/css.worker.js'; }
|
if (label === 'css' || label === 'scss') { return './vendor/monaco/dist/css.worker.js'; }
|
||||||
if (label === 'html' || label === 'handlebars') { return './vendor/monaco/dist/html.worker.js'; }
|
if (label === 'html' || label === 'handlebars') { return './vendor/monaco/dist/html.worker.js'; }
|
||||||
@@ -577,7 +577,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
createMonacoCompletionItem("set (flow context)", 'flow.set("${1:name}", ${1:value});','Set a value in flow context',range),
|
createMonacoCompletionItem("set (flow context)", 'flow.set("${1:name}", ${1:value});','Set a value in flow context',range),
|
||||||
createMonacoCompletionItem("get (global context)", 'global.get("${1:name}");','Get a value from global context',range),
|
createMonacoCompletionItem("get (global context)", 'global.get("${1:name}");','Get a value from global context',range),
|
||||||
createMonacoCompletionItem("set (global context)", 'global.set("${1:name}", ${1:value});','Set a value in global context',range),
|
createMonacoCompletionItem("set (global context)", 'global.set("${1:name}", ${1:value});','Set a value in global context',range),
|
||||||
createMonacoCompletionItem("get (env)", 'env.get("${1:name}");','Get env variable value',range),
|
createMonacoCompletionItem("get (env)", 'env.get("${1|NR_NODE_ID,NR_NODE_NAME,NR_NODE_PATH,NR_GROUP_ID,NR_GROUP_NAME,NR_FLOW_ID,NR_FLOW_NAME|}");','Get env variable value',range),
|
||||||
createMonacoCompletionItem("cloneMessage (RED.util)", 'RED.util.cloneMessage(${1:msg});',
|
createMonacoCompletionItem("cloneMessage (RED.util)", 'RED.util.cloneMessage(${1:msg});',
|
||||||
["```typescript",
|
["```typescript",
|
||||||
"RED.util.cloneMessage<T extends registry.NodeMessage>(msg: T): T",
|
"RED.util.cloneMessage<T extends registry.NodeMessage>(msg: T): T",
|
||||||
@@ -747,13 +747,25 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
mode = "html";
|
mode = "html";
|
||||||
break;
|
break;
|
||||||
case "appcache":
|
case "appcache":
|
||||||
|
case "sh":
|
||||||
|
case "bash":
|
||||||
mode = "shell";
|
mode = "shell";
|
||||||
break;
|
break;
|
||||||
|
case "batchfile":
|
||||||
|
mode = "bat";
|
||||||
|
break;
|
||||||
|
case "protobuf":
|
||||||
|
mode = "proto";
|
||||||
|
break;
|
||||||
//TODO: add other compatability types.
|
//TODO: add other compatability types.
|
||||||
}
|
}
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!options.stateId && options.stateId !== false) {
|
||||||
|
options.stateId = RED.editor.generateViewStateId("monaco", options, (options.mode || options.title || "").split("/").pop());
|
||||||
|
}
|
||||||
var el = options.element || $("#"+options.id)[0];
|
var el = options.element || $("#"+options.id)[0];
|
||||||
var toolbarRow = $("<div>").appendTo(el);
|
var toolbarRow = $("<div>").appendTo(el);
|
||||||
el = $("<div>").appendTo(el).addClass("red-ui-editor-text-container")[0];
|
el = $("<div>").appendTo(el).addClass("red-ui-editor-text-container")[0];
|
||||||
@@ -1098,6 +1110,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
try {
|
try {
|
||||||
var m = this.getModel();
|
var m = this.getModel();
|
||||||
if(m && !m.isDisposed()) {
|
if(m && !m.isDisposed()) {
|
||||||
|
ed._initState = null;
|
||||||
m.dispose();
|
m.dispose();
|
||||||
}
|
}
|
||||||
this.setModel(null);
|
this.setModel(null);
|
||||||
@@ -1151,7 +1164,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
try {
|
try {
|
||||||
var _model = ed.getModel();
|
var _model = ed.getModel();
|
||||||
if (_model !== null) {
|
if (_model !== null) {
|
||||||
var id = _model.getModeId(); // e.g. javascript
|
var id = _model._languageId; // e.g. javascript
|
||||||
var ra = _model._associatedResource.authority; //e.g. model
|
var ra = _model._associatedResource.authority; //e.g. model
|
||||||
var rp = _model._associatedResource.path; //e.g. /18
|
var rp = _model._associatedResource.path; //e.g. /18
|
||||||
var rs = _model._associatedResource.scheme; //e.g. inmemory
|
var rs = _model._associatedResource.scheme; //e.g. inmemory
|
||||||
@@ -1243,14 +1256,7 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
//#endregion "ACE compatability"
|
//#endregion "ACE compatability"
|
||||||
|
|
||||||
//final setup
|
//final setup
|
||||||
if (options.cursor) {
|
ed.focusMemory = options.focus;
|
||||||
var row = options.cursor.row || options.cursor.lineNumber;
|
|
||||||
var col = options.cursor.column || options.cursor.col;
|
|
||||||
ed.gotoLine(row, col);
|
|
||||||
}
|
|
||||||
if (options.focus) {
|
|
||||||
ed.focus();
|
|
||||||
}
|
|
||||||
ed._mode = editorOptions.language;
|
ed._mode = editorOptions.language;
|
||||||
|
|
||||||
//as models are signleton, consts and let are avialable to other javascript instances
|
//as models are signleton, consts and let are avialable to other javascript instances
|
||||||
@@ -1262,11 +1268,12 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ed.onDidBlurEditorWidget(function() {
|
ed.onDidBlurEditorWidget(function() {
|
||||||
|
ed.focusMemory = false;
|
||||||
|
ed.saveView();
|
||||||
if(isVisible(el) == false) {
|
if(isVisible(el) == false) {
|
||||||
onVisibilityChange(false, 0, el);
|
onVisibilityChange(false, 0, el);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onDidFocusEditorWidget(function() {
|
ed.onDidFocusEditorWidget(function() {
|
||||||
onVisibilityChange(true, 10, el);
|
onVisibilityChange(true, 10, el);
|
||||||
});
|
});
|
||||||
@@ -1300,17 +1307,33 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onVisibilityChange(visible, delay, element) {
|
function onVisibilityChange(visible, delay, element) {
|
||||||
if(visible) {
|
delay = delay || 50;
|
||||||
if(ed._mode == "javascript" && ed._tempMode == "text") {
|
if (visible) {
|
||||||
|
if (ed.focusMemory) {
|
||||||
|
setTimeout(function () {
|
||||||
|
if (element.parentElement) { //ensure el is still in DOM
|
||||||
|
ed.focus();
|
||||||
|
}
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
if (ed._initState) {
|
||||||
|
setTimeout(function () {
|
||||||
|
if (element.parentElement) { //ensure el is still in DOM
|
||||||
|
ed.restoreViewState(ed._initState);
|
||||||
|
ed._initState = null;
|
||||||
|
}
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
if (ed._mode == "javascript" && ed._tempMode == "text") {
|
||||||
ed._tempMode = "";
|
ed._tempMode = "";
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
if(element.parentElement) { //ensure el is still in DOM
|
if (element.parentElement) { //ensure el is still in DOM
|
||||||
ed.setMode('javascript', undefined, false);
|
ed.setMode('javascript', undefined, false);
|
||||||
}
|
}
|
||||||
}, delay || 50);
|
}, delay);
|
||||||
}
|
}
|
||||||
} else if(ed._mode == "javascript" && ed._tempMode != "text") {
|
} else if (ed._mode == "javascript" && ed._tempMode != "text") {
|
||||||
if(element.parentElement) { //ensure el is still in DOM
|
if (element.parentElement) { //ensure el is still in DOM
|
||||||
ed.setMode('text', undefined, false);
|
ed.setMode('text', undefined, false);
|
||||||
ed._tempMode = "text";
|
ed._tempMode = "text";
|
||||||
}
|
}
|
||||||
@@ -1329,15 +1352,19 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
expandButton.on("click", function (e) {
|
expandButton.on("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var value = ed.getValue();
|
var value = ed.getValue();
|
||||||
|
ed.saveView();
|
||||||
RED.editor.editMarkdown({
|
RED.editor.editMarkdown({
|
||||||
value: value,
|
value: value,
|
||||||
width: "Infinity",
|
width: "Infinity",
|
||||||
cursor: ed.getCursorPosition(),
|
stateId: options.stateId,
|
||||||
|
cancel: function () {
|
||||||
|
ed.focus();
|
||||||
|
},
|
||||||
complete: function (v, cursor) {
|
complete: function (v, cursor) {
|
||||||
ed.setValue(v, -1);
|
ed.setValue(v, -1);
|
||||||
ed.gotoLine(cursor.row + 1, cursor.column, false);
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
ed.focus();
|
ed.focus();
|
||||||
|
ed.restoreView();
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1353,7 +1380,37 @@ RED.editor.codeEditor.monaco = (function() {
|
|||||||
autoClose: 50
|
autoClose: 50
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
ed.getView = function () {
|
||||||
|
return ed.saveViewState();
|
||||||
|
}
|
||||||
|
ed.saveView = function (debuginfo) {
|
||||||
|
if (!options.stateId) { return; } //only possible if created with a unique stateId
|
||||||
|
window._editorStateMonaco = window._editorStateMonaco || {};
|
||||||
|
var state = ed.getView();
|
||||||
|
window._editorStateMonaco[options.stateId] = state;
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
ed.restoreView = function (state) {
|
||||||
|
if (!options.stateId) { return; } //only possible if created with a unique stateId
|
||||||
|
window._editorStateMonaco = window._editorStateMonaco || {};
|
||||||
|
var _state = state || window._editorStateMonaco[options.stateId];
|
||||||
|
if (!_state) { return; } //no view state available
|
||||||
|
try {
|
||||||
|
if (ed.type) { //is editor already initialised?
|
||||||
|
ed.restoreViewState(_state);
|
||||||
|
} else {
|
||||||
|
ed._initState = _state;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
delete window._editorStateMonaco[options.stateId];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ed.restoreView();
|
||||||
|
if (options.cursor && !ed._initState) {
|
||||||
|
var row = options.cursor.row || options.cursor.lineNumber;
|
||||||
|
var col = options.cursor.column || options.cursor.col;
|
||||||
|
ed.gotoLine(row, col);
|
||||||
|
}
|
||||||
ed.type = type;
|
ed.type = type;
|
||||||
return ed;
|
return ed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ RED.editor.colorPicker = RED.colorPicker = (function() {
|
|||||||
var focusTarget = colorInput;
|
var focusTarget = colorInput;
|
||||||
colorInput.on("change", function (e) {
|
colorInput.on("change", function (e) {
|
||||||
var color = colorInput.val();
|
var color = colorInput.val();
|
||||||
|
if (options.defaultValue && !color.match(/^([a-z]+|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3})$/)) {
|
||||||
|
color = options.defaultValue;
|
||||||
|
}
|
||||||
colorHiddenInput.val(color).trigger('change');
|
colorHiddenInput.val(color).trigger('change');
|
||||||
refreshDisplay(color);
|
refreshDisplay(color);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,8 +41,12 @@ RED.editor.envVarList = (function() {
|
|||||||
style: "width:100%",
|
style: "width:100%",
|
||||||
class: "node-input-env-value",
|
class: "node-input-env-value",
|
||||||
type: "text",
|
type: "text",
|
||||||
}).attr("autocomplete","disable").appendTo(envRow)
|
}).attr("autocomplete","disable").appendTo(envRow);
|
||||||
valueField.typedInput({default:'str',types:isTemplateNode?DEFAULT_ENV_TYPE_LIST:DEFAULT_ENV_TYPE_LIST_INC_CRED});
|
var types = (opt.ui && opt.ui.opts && opt.ui.opts.types);
|
||||||
|
if (!types) {
|
||||||
|
types = isTemplateNode ? DEFAULT_ENV_TYPE_LIST : DEFAULT_ENV_TYPE_LIST_INC_CRED;
|
||||||
|
}
|
||||||
|
valueField.typedInput({default:'str',types:types});
|
||||||
valueField.typedInput('type', opt.type);
|
valueField.typedInput('type', opt.type);
|
||||||
if (opt.type === "cred") {
|
if (opt.type === "cred") {
|
||||||
if (opt.value) {
|
if (opt.value) {
|
||||||
@@ -94,6 +98,11 @@ RED.editor.envVarList = (function() {
|
|||||||
}
|
}
|
||||||
opt.ui.label = opt.ui.label || {};
|
opt.ui.label = opt.ui.label || {};
|
||||||
opt.ui.type = opt.ui.type || "input";
|
opt.ui.type = opt.ui.type || "input";
|
||||||
|
if ((opt.ui.type === "cred") &&
|
||||||
|
opt.ui.opts &&
|
||||||
|
opt.ui.opts.types) {
|
||||||
|
opt.ui.type = "input";
|
||||||
|
}
|
||||||
|
|
||||||
var uiRow = $('<div/>').appendTo(container).hide();
|
var uiRow = $('<div/>').appendTo(container).hide();
|
||||||
// save current info for reverting on cancel
|
// save current info for reverting on cancel
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
show: function(options) {
|
show: function(options) {
|
||||||
var expressionTestCacheId = options.parent||"_";
|
var expressionTestCacheId = options.parent||"_";
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_expression"
|
var type = "_expression"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
@@ -63,12 +64,14 @@
|
|||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: "inherit",
|
width: "inherit",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if(onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -78,7 +81,8 @@
|
|||||||
class: "primary",
|
class: "primary",
|
||||||
click: function() {
|
click: function() {
|
||||||
$("#red-ui-editor-type-expression-help").text("");
|
$("#red-ui-editor-type-expression-help").text("");
|
||||||
onComplete(expressionEditor.getValue());
|
expressionEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(),expressionEditor); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,6 +114,8 @@
|
|||||||
id: 'red-ui-editor-type-expression',
|
id: 'red-ui-editor-type-expression',
|
||||||
value: "",
|
value: "",
|
||||||
mode:"ace/mode/jsonata",
|
mode:"ace/mode/jsonata",
|
||||||
|
stateId: options.stateId,
|
||||||
|
focus: true,
|
||||||
options: {
|
options: {
|
||||||
enableBasicAutocompletion:true,
|
enableBasicAutocompletion:true,
|
||||||
enableSnippets:true,
|
enableSnippets:true,
|
||||||
@@ -233,6 +239,8 @@
|
|||||||
testDataEditor = RED.editor.createEditor({
|
testDataEditor = RED.editor.createEditor({
|
||||||
id: 'red-ui-editor-type-expression-test-data',
|
id: 'red-ui-editor-type-expression-test-data',
|
||||||
value: expressionTestCache[expressionTestCacheId] || '{\n "payload": "hello world"\n}',
|
value: expressionTestCache[expressionTestCacheId] || '{\n "payload": "hello world"\n}',
|
||||||
|
stateId: false,
|
||||||
|
focus: false,
|
||||||
mode:"ace/mode/json",
|
mode:"ace/mode/json",
|
||||||
lineNumbers: false
|
lineNumbers: false
|
||||||
});
|
});
|
||||||
@@ -247,7 +255,10 @@
|
|||||||
var currentExpression = expressionEditor.getValue();
|
var currentExpression = expressionEditor.getValue();
|
||||||
var expr;
|
var expr;
|
||||||
var usesContext = false;
|
var usesContext = false;
|
||||||
var legacyMode = /(^|[^a-zA-Z0-9_'"])msg([^a-zA-Z0-9_'"]|$)/.test(currentExpression);
|
var usesEnv = false;
|
||||||
|
var usesMoment = false;
|
||||||
|
var usesClone = false;
|
||||||
|
var legacyMode = /(^|[^a-zA-Z0-9_'".])msg([^a-zA-Z0-9_'"]|$)/.test(currentExpression);
|
||||||
$(".red-ui-editor-type-expression-legacy").toggle(legacyMode);
|
$(".red-ui-editor-type-expression-legacy").toggle(legacyMode);
|
||||||
try {
|
try {
|
||||||
expr = jsonata(currentExpression);
|
expr = jsonata(currentExpression);
|
||||||
@@ -259,6 +270,18 @@
|
|||||||
usesContext = true;
|
usesContext = true;
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
expr.assign("env", function(name) {
|
||||||
|
usesEnv = true;
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
expr.assign("moment", function(name) {
|
||||||
|
usesMoment = true;
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
expr.assign("clone", function(name) {
|
||||||
|
usesClone = true;
|
||||||
|
return null;
|
||||||
|
});
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
testResultEditor.setValue(RED._("expressionEditor.errors.invalid-expr",{message:err.message}),-1);
|
testResultEditor.setValue(RED._("expressionEditor.errors.invalid-expr",{message:err.message}),-1);
|
||||||
return;
|
return;
|
||||||
@@ -276,6 +299,18 @@
|
|||||||
testResultEditor.setValue(RED._("expressionEditor.errors.context-unsupported"),-1);
|
testResultEditor.setValue(RED._("expressionEditor.errors.context-unsupported"),-1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (usesEnv) {
|
||||||
|
testResultEditor.setValue(RED._("expressionEditor.errors.env-unsupported"),-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (usesMoment) {
|
||||||
|
testResultEditor.setValue(RED._("expressionEditor.errors.moment-unsupported"),-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (usesClone) {
|
||||||
|
testResultEditor.setValue(RED._("expressionEditor.errors.clone-unsupported"),-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var formattedResult;
|
var formattedResult;
|
||||||
if (result !== undefined) {
|
if (result !== undefined) {
|
||||||
@@ -302,6 +337,8 @@
|
|||||||
testResultEditor = RED.editor.createEditor({
|
testResultEditor = RED.editor.createEditor({
|
||||||
id: 'red-ui-editor-type-expression-test-result',
|
id: 'red-ui-editor-type-expression-test-result',
|
||||||
value: "",
|
value: "",
|
||||||
|
stateId: false,
|
||||||
|
focus: false,
|
||||||
mode:"ace/mode/json",
|
mode:"ace/mode/json",
|
||||||
lineNumbers: false,
|
lineNumbers: false,
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
var definition = {
|
var definition = {
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_js"
|
var type = "_js"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
@@ -28,16 +29,16 @@
|
|||||||
}
|
}
|
||||||
RED.view.state(RED.state.EDITING);
|
RED.view.state(RED.state.EDITING);
|
||||||
var expressionEditor;
|
var expressionEditor;
|
||||||
var changeTimer;
|
|
||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: options.width||"inherit",
|
width: options.width||"inherit",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if (onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -46,7 +47,8 @@
|
|||||||
text: RED._("common.label.done"),
|
text: RED._("common.label.done"),
|
||||||
class: "primary",
|
class: "primary",
|
||||||
click: function() {
|
click: function() {
|
||||||
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
|
expressionEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(expressionEditor.getValue(), expressionEditor.getCursorPosition(), expressionEditor); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,11 +64,12 @@
|
|||||||
expressionEditor.resize();
|
expressionEditor.resize();
|
||||||
},
|
},
|
||||||
open: function(tray) {
|
open: function(tray) {
|
||||||
var trayBody = tray.find('.red-ui-tray-body');
|
|
||||||
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
||||||
expressionEditor = RED.editor.createEditor({
|
expressionEditor = RED.editor.createEditor({
|
||||||
id: 'node-input-js',
|
id: 'node-input-js',
|
||||||
mode: options.mode || 'ace/mode/javascript',
|
mode: options.mode || 'ace/mode/javascript',
|
||||||
|
stateId: options.stateId,
|
||||||
|
focus: true,
|
||||||
value: value,
|
value: value,
|
||||||
globals: {
|
globals: {
|
||||||
msg:true,
|
msg:true,
|
||||||
@@ -81,21 +84,19 @@
|
|||||||
clearTimeout: true,
|
clearTimeout: true,
|
||||||
setInterval: true,
|
setInterval: true,
|
||||||
clearInterval: true
|
clearInterval: true
|
||||||
}
|
},
|
||||||
|
extraLibs: options.extraLibs
|
||||||
});
|
});
|
||||||
if (options.cursor) {
|
if (options.cursor && !expressionEditor._initState) {
|
||||||
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
||||||
}
|
}
|
||||||
dialogForm.i18n();
|
dialogForm.i18n();
|
||||||
setTimeout(function() {
|
|
||||||
expressionEditor.focus();
|
|
||||||
},300);
|
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
expressionEditor.destroy();
|
|
||||||
if (options.onclose) {
|
if (options.onclose) {
|
||||||
options.onclose();
|
options.onclose();
|
||||||
}
|
}
|
||||||
|
expressionEditor.destroy();
|
||||||
},
|
},
|
||||||
show: function() {}
|
show: function() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
'<ul id="red-ui-editor-type-json-tabs"></ul>'+
|
'<ul id="red-ui-editor-type-json-tabs"></ul>'+
|
||||||
'<div id="red-ui-editor-type-json-tab-raw" class="red-ui-editor-type-json-tab-content hide">'+
|
'<div id="red-ui-editor-type-json-tab-raw" class="red-ui-editor-type-json-tab-content hide">'+
|
||||||
'<div class="form-row" style="margin-bottom: 3px; text-align: right;">'+
|
'<div class="form-row" style="margin-bottom: 3px; text-align: right;">'+
|
||||||
'<button id="node-input-json-reformat" class="red-ui-button red-ui-button-small"><span data-i18n="jsonEditor.format"></span></button>'+
|
'<span class="button-group">'+
|
||||||
|
'<button id="node-input-json-reformat" class="red-ui-button red-ui-button-small"><span data-i18n="jsonEditor.format"></span></button>'+
|
||||||
|
'<span class="button-group">'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<div class="form-row node-text-editor-row">'+
|
'<div class="form-row node-text-editor-row">'+
|
||||||
'<div style="height: 200px;min-height: 150px;" class="node-text-editor" id="node-input-json"></div>'+
|
'<div style="height: 200px;min-height: 150px;" class="node-text-editor" id="node-input-json"></div>'+
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
|
|
||||||
var activeTab;
|
var activeTab;
|
||||||
|
|
||||||
function insertNewItem(parent,index,copyIndex) {
|
function insertNewItem(parent,index,copyIndex,readOnly) {
|
||||||
var newValue = "";
|
var newValue = "";
|
||||||
|
|
||||||
if (parent.children.length > 0) {
|
if (parent.children.length > 0) {
|
||||||
@@ -60,26 +62,26 @@
|
|||||||
newKey = keyRoot+"-"+(keySuffix++);
|
newKey = keyRoot+"-"+(keySuffix++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var newItem = handleItem(newKey,newValue,parent.depth+1,parent);
|
var newItem = handleItem(newKey,newValue,parent.depth+1,parent,readOnly);
|
||||||
parent.treeList.insertChildAt(newItem, index, true);
|
parent.treeList.insertChildAt(newItem, index, true);
|
||||||
parent.treeList.expand();
|
parent.treeList.expand();
|
||||||
}
|
}
|
||||||
function showObjectMenu(button,item) {
|
function showObjectMenu(button,item,readOnly) {
|
||||||
var elementPos = button.offset();
|
var elementPos = button.offset();
|
||||||
var options = [];
|
var options = [];
|
||||||
if (item.parent) {
|
if (item.parent) {
|
||||||
options.push({id:"red-ui-editor-type-json-menu-insert-above", icon:"fa fa-toggle-up", label:RED._('jsonEditor.insertAbove'),onselect:function(){
|
options.push({id:"red-ui-editor-type-json-menu-insert-above", icon:"fa fa-toggle-up", label:RED._('jsonEditor.insertAbove'),onselect:function(){
|
||||||
var index = item.parent.children.indexOf(item);
|
var index = item.parent.children.indexOf(item);
|
||||||
insertNewItem(item.parent,index,index);
|
insertNewItem(item.parent,index,index,readOnly);
|
||||||
}});
|
}});
|
||||||
options.push({id:"red-ui-editor-type-json-menu-insert-below", icon:"fa fa-toggle-down", label:RED._('jsonEditor.insertBelow'),onselect:function(){
|
options.push({id:"red-ui-editor-type-json-menu-insert-below", icon:"fa fa-toggle-down", label:RED._('jsonEditor.insertBelow'),onselect:function(){
|
||||||
var index = item.parent.children.indexOf(item)+1;
|
var index = item.parent.children.indexOf(item)+1;
|
||||||
insertNewItem(item.parent,index,index-1);
|
insertNewItem(item.parent,index,index-1,readOnly);
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
if (item.type === 'array' || item.type === 'object') {
|
if (item.type === 'array' || item.type === 'object') {
|
||||||
options.push({id:"red-ui-editor-type-json-menu-add-child", icon:"fa fa-plus", label:RED._('jsonEditor.addItem'),onselect:function(){
|
options.push({id:"red-ui-editor-type-json-menu-add-child", icon:"fa fa-plus", label:RED._('jsonEditor.addItem'),onselect:function(){
|
||||||
insertNewItem(item,item.children.length,item.children.length-1);
|
insertNewItem(item,item.children.length,item.children.length-1,readOnly);
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
if (item.parent) {
|
if (item.parent) {
|
||||||
@@ -121,7 +123,7 @@
|
|||||||
newKey = keyRoot+"-"+(keySuffix++);
|
newKey = keyRoot+"-"+(keySuffix++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var newItem = handleItem(newKey,convertToObject(item),item.parent.depth+1,item.parent);
|
var newItem = handleItem(newKey,convertToObject(item),item.parent.depth+1,item.parent,readOnly);
|
||||||
var index = item.parent.children.indexOf(item)+1;
|
var index = item.parent.children.indexOf(item)+1;
|
||||||
|
|
||||||
item.parent.treeList.insertChildAt(newItem, index, true);
|
item.parent.treeList.insertChildAt(newItem, index, true);
|
||||||
@@ -171,24 +173,24 @@
|
|||||||
menuOptionMenu.show();
|
menuOptionMenu.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseObject(obj,depth,parent) {
|
function parseObject(obj,depth,parent,readOnly) {
|
||||||
var result = [];
|
var result = [];
|
||||||
for (var prop in obj) {
|
for (var prop in obj) {
|
||||||
if (obj.hasOwnProperty(prop)) {
|
if (obj.hasOwnProperty(prop)) {
|
||||||
result.push(handleItem(prop,obj[prop],depth,parent));
|
result.push(handleItem(prop,obj[prop],depth,parent,readOnly));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function parseArray(obj,depth,parent) {
|
function parseArray(obj,depth,parent,readOnly) {
|
||||||
var result = [];
|
var result = [];
|
||||||
var l = obj.length;
|
var l = obj.length;
|
||||||
for (var i=0;i<l;i++) {
|
for (var i=0;i<l;i++) {
|
||||||
result.push(handleItem(i,obj[i],depth,parent));
|
result.push(handleItem(i,obj[i],depth,parent,readOnly));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function handleItem(key,val,depth,parent) {
|
function handleItem(key,val,depth,parent,readOnly) {
|
||||||
var item = {depth:depth, type: typeof val};
|
var item = {depth:depth, type: typeof val};
|
||||||
var container = $('<span class="red-ui-editor-type-json-editor-label">');
|
var container = $('<span class="red-ui-editor-type-json-editor-label">');
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
@@ -204,11 +206,14 @@
|
|||||||
if (parent && parent.type === "array") {
|
if (parent && parent.type === "array") {
|
||||||
keyLabel.addClass("red-ui-editor-type-json-editor-label-array-key")
|
keyLabel.addClass("red-ui-editor-type-json-editor-label-array-key")
|
||||||
}
|
}
|
||||||
|
if(readOnly) {
|
||||||
|
keyLabel.addClass("readonly")
|
||||||
|
}
|
||||||
keyLabel.on("click", function(evt) {
|
keyLabel.on("click", function(evt) {
|
||||||
if (item.parent.type === 'array') {
|
if (item.parent.type === 'array') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (readOnly) { return; }
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
var w = Math.max(150,keyLabel.width());
|
var w = Math.max(150,keyLabel.width());
|
||||||
@@ -253,10 +258,10 @@
|
|||||||
item.expanded = depth < 2;
|
item.expanded = depth < 2;
|
||||||
item.type = "array";
|
item.type = "array";
|
||||||
item.deferBuild = depth >= 2;
|
item.deferBuild = depth >= 2;
|
||||||
item.children = parseArray(val,depth+1,item);
|
item.children = parseArray(val,depth+1,item,readOnly);
|
||||||
} else if (val !== null && item.type === "object") {
|
} else if (val !== null && item.type === "object") {
|
||||||
item.expanded = depth < 2;
|
item.expanded = depth < 2;
|
||||||
item.children = parseObject(val,depth+1,item);
|
item.children = parseObject(val,depth+1,item,readOnly);
|
||||||
item.deferBuild = depth >= 2;
|
item.deferBuild = depth >= 2;
|
||||||
} else {
|
} else {
|
||||||
item.value = val;
|
item.value = val;
|
||||||
@@ -287,7 +292,11 @@
|
|||||||
//
|
//
|
||||||
var orphanedChildren;
|
var orphanedChildren;
|
||||||
var valueLabel = $('<span class="red-ui-editor-type-json-editor-label-value">').addClass(valClass).text(valValue).appendTo(container);
|
var valueLabel = $('<span class="red-ui-editor-type-json-editor-label-value">').addClass(valClass).text(valValue).appendTo(container);
|
||||||
|
if (readOnly) {
|
||||||
|
valueLabel.addClass("readonly")
|
||||||
|
}
|
||||||
valueLabel.on("click", function(evt) {
|
valueLabel.on("click", function(evt) {
|
||||||
|
if (readOnly) { return; }
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
if (valType === 'str') {
|
if (valType === 'str') {
|
||||||
@@ -302,8 +311,8 @@
|
|||||||
types:[
|
types:[
|
||||||
'str','num','bool',
|
'str','num','bool',
|
||||||
{value:"null",label:RED._("common.type.null"),hasValue:false},
|
{value:"null",label:RED._("common.type.null"),hasValue:false},
|
||||||
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"},
|
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"},
|
||||||
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}
|
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"}
|
||||||
],
|
],
|
||||||
default: valType
|
default: valType
|
||||||
});
|
});
|
||||||
@@ -395,17 +404,19 @@
|
|||||||
valueLabel.hide();
|
valueLabel.hide();
|
||||||
})
|
})
|
||||||
item.gutter = $('<span class="red-ui-editor-type-json-editor-item-gutter"></span>');
|
item.gutter = $('<span class="red-ui-editor-type-json-editor-item-gutter"></span>');
|
||||||
|
if(!readOnly) {
|
||||||
if (parent) {//red-ui-editor-type-json-editor-item-handle
|
if (parent) {
|
||||||
$('<span class="red-ui-editor-type-json-editor-item-handle"><i class="fa fa-bars"></span>').appendTo(item.gutter);
|
$('<span class="red-ui-editor-type-json-editor-item-handle"><i class="fa fa-bars"></span>').appendTo(item.gutter);
|
||||||
} else {
|
} else {
|
||||||
$('<span></span>').appendTo(item.gutter);
|
$('<span></span>').appendTo(item.gutter);
|
||||||
|
}
|
||||||
|
$('<button type="button" class="editor-button editor-button-small"><i class="fa fa-caret-down"></button>').appendTo(item.gutter).on("click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
showObjectMenu($(this), item, readOnly);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
$('<button type="button" class="editor-button editor-button-small"><i class="fa fa-caret-down"></button>').appendTo(item.gutter).on("click", function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
evt.stopPropagation();
|
|
||||||
showObjectMenu($(this), item);
|
|
||||||
});
|
|
||||||
item.element = container;
|
item.element = container;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
@@ -434,6 +445,7 @@
|
|||||||
var definition = {
|
var definition = {
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_json"
|
var type = "_json"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
@@ -455,15 +467,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var rootNode;
|
var rootNode;
|
||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: options.width||700,
|
width: options.width||700,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if (onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -485,7 +498,8 @@
|
|||||||
} else if (activeTab === "json-raw") {
|
} else if (activeTab === "json-raw") {
|
||||||
result = expressionEditor.getValue();
|
result = expressionEditor.getValue();
|
||||||
}
|
}
|
||||||
if (onComplete) { onComplete(result) }
|
expressionEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(result,null,expressionEditor) }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,10 +512,29 @@
|
|||||||
open: function(tray) {
|
open: function(tray) {
|
||||||
var trayBody = tray.find('.red-ui-tray-body');
|
var trayBody = tray.find('.red-ui-tray-body');
|
||||||
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
||||||
|
var toolbarButtons = options.toolbarButtons || [];
|
||||||
|
if (toolbarButtons.length) {
|
||||||
|
toolbarButtons.forEach(function (button) {
|
||||||
|
var element = $('<button type="button" class="red-ui-button red-ui-button-small"> </button>')
|
||||||
|
.insertBefore("#node-input-json-reformat")
|
||||||
|
.on("click", function (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
if (button.click !== undefined) {
|
||||||
|
button.click.call(element, evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (button.id) { element.attr("id", button.id); }
|
||||||
|
if (button.title) { element.attr("title", button.title); }
|
||||||
|
if (button.icon) { element.append($("<i></i>").attr("class", button.icon)); }
|
||||||
|
if (button.label || button.text) {
|
||||||
|
element.append($("<span></span>").text(" " + (button.label || button.text)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"});
|
var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"});
|
||||||
var filterDepth = Infinity;
|
var filterDepth = Infinity;
|
||||||
var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({
|
var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({
|
||||||
|
selectable: false,
|
||||||
rootSortable: false,
|
rootSortable: false,
|
||||||
sortable: ".red-ui-editor-type-json-editor-item-handle",
|
sortable: ".red-ui-editor-type-json-editor-item-handle",
|
||||||
}).on("treelistchangeparent", function(event, evt) {
|
}).on("treelistchangeparent", function(event, evt) {
|
||||||
@@ -528,13 +561,15 @@
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
expressionEditor = RED.editor.createEditor({
|
expressionEditor = RED.editor.createEditor({
|
||||||
id: 'node-input-json',
|
id: 'node-input-json',
|
||||||
value: "",
|
value: value||"",
|
||||||
mode:"ace/mode/json"
|
mode:"ace/mode/json",
|
||||||
|
readOnly: !!options.readOnly,
|
||||||
|
stateId: options.stateId,
|
||||||
|
focus: true
|
||||||
});
|
});
|
||||||
expressionEditor.getSession().setValue(value||"",-1);
|
|
||||||
if (options.requireValid) {
|
if (options.requireValid) {
|
||||||
expressionEditor.getSession().on('change', function() {
|
expressionEditor.getSession().on('change', function() {
|
||||||
clearTimeout(changeTimer);
|
clearTimeout(changeTimer);
|
||||||
@@ -571,7 +606,7 @@
|
|||||||
var raw = expressionEditor.getValue().trim() ||"{}";
|
var raw = expressionEditor.getValue().trim() ||"{}";
|
||||||
try {
|
try {
|
||||||
var parsed = JSON.parse(raw);
|
var parsed = JSON.parse(raw);
|
||||||
rootNode = handleItem(null,parsed,0,null);
|
rootNode = handleItem(null,parsed,0,null,options.readOnly);
|
||||||
rootNode.class = "red-ui-editor-type-json-root-node"
|
rootNode.class = "red-ui-editor-type-json-root-node"
|
||||||
list.treeList('data',[rootNode]);
|
list.treeList('data',[rootNode]);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
@@ -589,17 +624,15 @@
|
|||||||
|
|
||||||
tabs.addTab({
|
tabs.addTab({
|
||||||
id: 'json-raw',
|
id: 'json-raw',
|
||||||
label: RED._('jsonEditor.rawMode'),
|
label: options.readOnly ? RED._('jsonEditor.rawMode-readonly') : RED._('jsonEditor.rawMode'),
|
||||||
content: $("#red-ui-editor-type-json-tab-raw")
|
content: $("#red-ui-editor-type-json-tab-raw")
|
||||||
});
|
});
|
||||||
tabs.addTab({
|
tabs.addTab({
|
||||||
id: 'json-ui',
|
id: 'json-ui',
|
||||||
label: RED._('jsonEditor.uiMode'),
|
label: options.readOnly ? RED._('jsonEditor.uiMode-readonly') : RED._('jsonEditor.uiMode'),
|
||||||
content: $("#red-ui-editor-type-json-tab-ui")
|
content: $("#red-ui-editor-type-json-tab-ui")
|
||||||
});
|
});
|
||||||
finishedBuild = true;
|
finishedBuild = true;
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
if (options.onclose) {
|
if (options.onclose) {
|
||||||
|
|||||||
@@ -54,24 +54,26 @@
|
|||||||
var definition = {
|
var definition = {
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_markdown"
|
var type = "_markdown"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
$(template).appendTo("#red-ui-editor-node-configs");
|
$(template).appendTo("#red-ui-editor-node-configs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RED.view.state(RED.state.EDITING);
|
RED.view.state(RED.state.EDITING);
|
||||||
var expressionEditor;
|
var expressionEditor;
|
||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: options.width||Infinity,
|
width: options.width||Infinity,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if (onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -80,7 +82,8 @@
|
|||||||
text: RED._("common.label.done"),
|
text: RED._("common.label.done"),
|
||||||
class: "primary",
|
class: "primary",
|
||||||
click: function() {
|
click: function() {
|
||||||
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
|
expressionEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(), expressionEditor); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,6 +102,8 @@
|
|||||||
expressionEditor = RED.editor.createEditor({
|
expressionEditor = RED.editor.createEditor({
|
||||||
id: 'red-ui-editor-type-markdown',
|
id: 'red-ui-editor-type-markdown',
|
||||||
value: value,
|
value: value,
|
||||||
|
stateId: options.stateId,
|
||||||
|
focus: true,
|
||||||
mode:"ace/mode/markdown",
|
mode:"ace/mode/markdown",
|
||||||
expandable: false
|
expandable: false
|
||||||
});
|
});
|
||||||
@@ -143,17 +148,17 @@
|
|||||||
});
|
});
|
||||||
RED.popover.tooltip($("#node-btn-markdown-preview"), RED._("markdownEditor.toggle-preview"));
|
RED.popover.tooltip($("#node-btn-markdown-preview"), RED._("markdownEditor.toggle-preview"));
|
||||||
|
|
||||||
if (options.cursor) {
|
if (options.cursor && !expressionEditor._initState) {
|
||||||
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogForm.i18n();
|
dialogForm.i18n();
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
expressionEditor.destroy();
|
|
||||||
if (options.onclose) {
|
if (options.onclose) {
|
||||||
options.onclose();
|
options.onclose();
|
||||||
}
|
}
|
||||||
|
expressionEditor.destroy();
|
||||||
},
|
},
|
||||||
show: function() {}
|
show: function() {}
|
||||||
}
|
}
|
||||||
@@ -168,7 +173,7 @@
|
|||||||
'b': { before:"**", after: "**", tooltip: RED._("markdownEditor.bold")},
|
'b': { before:"**", after: "**", tooltip: RED._("markdownEditor.bold")},
|
||||||
'i': { before:"_", after: "_", tooltip: RED._("markdownEditor.italic")},
|
'i': { before:"_", after: "_", tooltip: RED._("markdownEditor.italic")},
|
||||||
'code': { before:"`", after: "`", tooltip: RED._("markdownEditor.code")},
|
'code': { before:"`", after: "`", tooltip: RED._("markdownEditor.code")},
|
||||||
'ol': { before:" * ", newline: true, tooltip: RED._("markdownEditor.ordered-list")},
|
'ol': { before:" 1. ", newline: true, tooltip: RED._("markdownEditor.ordered-list")},
|
||||||
'ul': { before:" - ", newline: true, tooltip: RED._("markdownEditor.unordered-list")},
|
'ul': { before:" - ", newline: true, tooltip: RED._("markdownEditor.unordered-list")},
|
||||||
'bq': { before:"> ", newline: true, tooltip: RED._("markdownEditor.quote")},
|
'bq': { before:"> ", newline: true, tooltip: RED._("markdownEditor.quote")},
|
||||||
'link': { before:"[", after: "]()", tooltip: RED._("markdownEditor.link")},
|
'link': { before:"[", after: "]()", tooltip: RED._("markdownEditor.link")},
|
||||||
|
|||||||
@@ -35,9 +35,9 @@
|
|||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
if (!node._def.defaults || !node._def.defaults.hasOwnProperty("icon")) {
|
if (!node._def.defaults || !node._def.defaults.hasOwnProperty("icon")) {
|
||||||
var icon = $("#red-ui-editor-node-icon").val()||""
|
var icon = $("#red-ui-editor-node-icon").val()||"";
|
||||||
if (!this.isDefaultIcon) {
|
if (!this.isDefaultIcon) {
|
||||||
if (icon !== node.icon) {
|
if ((node.icon && icon !== node.icon) || (!node.icon && icon !== "")) {
|
||||||
editState.changes.icon = node.icon;
|
editState.changes.icon = node.icon;
|
||||||
node.icon = icon;
|
node.icon = icon;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
@@ -101,14 +101,14 @@
|
|||||||
if (showLabel) {
|
if (showLabel) {
|
||||||
// Default to show label
|
// Default to show label
|
||||||
if (node.l !== false) {
|
if (node.l !== false) {
|
||||||
editState.changes.l = node.l
|
editState.changes.l = node.l;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
node.l = false;
|
node.l = false;
|
||||||
} else {
|
} else {
|
||||||
// Node has showLabel:false (eg link nodes)
|
// Node has showLabel:false (eg link nodes)
|
||||||
if (node.hasOwnProperty('l') && node.l) {
|
if (node.hasOwnProperty('l') && node.l) {
|
||||||
editState.changes.l = node.l
|
editState.changes.l = node.l;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
delete node.l;
|
delete node.l;
|
||||||
@@ -118,20 +118,20 @@
|
|||||||
if (showLabel) {
|
if (showLabel) {
|
||||||
// Default to show label
|
// Default to show label
|
||||||
if (node.hasOwnProperty('l') && !node.l) {
|
if (node.hasOwnProperty('l') && !node.l) {
|
||||||
editState.changes.l = node.l
|
editState.changes.l = node.l;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
delete node.l;
|
delete node.l;
|
||||||
} else {
|
} else {
|
||||||
if (!node.l) {
|
if (!node.l) {
|
||||||
editState.changes.l = node.l
|
editState.changes.l = node.l;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
node.l = true;
|
node.l = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
function buildAppearanceForm(container,node) {
|
function buildAppearanceForm(container,node) {
|
||||||
@@ -164,10 +164,10 @@
|
|||||||
var categories = RED.palette.getCategories();
|
var categories = RED.palette.getCategories();
|
||||||
categories.sort(function(A,B) {
|
categories.sort(function(A,B) {
|
||||||
return A.label.localeCompare(B.label);
|
return A.label.localeCompare(B.label);
|
||||||
})
|
});
|
||||||
categories.forEach(function(cat) {
|
categories.forEach(function(cat) {
|
||||||
categorySelector.append($("<option/>").val(cat.id).text(cat.label));
|
categorySelector.append($("<option/>").val(cat.id).text(cat.label));
|
||||||
})
|
});
|
||||||
categorySelector.append($("<option/>").attr('disabled',true).text("---"));
|
categorySelector.append($("<option/>").attr('disabled',true).text("---"));
|
||||||
categorySelector.append($("<option/>").val("_custom_").text(RED._("palette.addCategory")));
|
categorySelector.append($("<option/>").val("_custom_").text(RED._("palette.addCategory")));
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
$("#subflow-appearance-input-category").width(250);
|
$("#subflow-appearance-input-category").width(250);
|
||||||
$("#subflow-appearance-input-custom-category").hide();
|
$("#subflow-appearance-input-custom-category").hide();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
$("#subflow-appearance-input-category").val(node.category||"subflows");
|
$("#subflow-appearance-input-category").val(node.category||"subflows");
|
||||||
var userCount = 0;
|
var userCount = 0;
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
$("#node-input-show-label").toggleButton({
|
$("#node-input-show-label").toggleButton({
|
||||||
enabledLabel: RED._("editor.show"),
|
enabledLabel: RED._("editor.show"),
|
||||||
disabledLabel: RED._("editor.hide")
|
disabledLabel: RED._("editor.hide")
|
||||||
})
|
});
|
||||||
|
|
||||||
if (!node.hasOwnProperty("l")) {
|
if (!node.hasOwnProperty("l")) {
|
||||||
// Show label unless def.showLabel set to false
|
// Show label unless def.showLabel set to false
|
||||||
@@ -230,11 +230,12 @@
|
|||||||
"#E9967A", "#F3B567", "#FDD0A2",
|
"#E9967A", "#F3B567", "#FDD0A2",
|
||||||
"#FDF0C2", "#FFAAAA", "#FFCC66",
|
"#FDF0C2", "#FFAAAA", "#FFCC66",
|
||||||
"#FFF0F0", "#FFFFFF"
|
"#FFF0F0", "#FFFFFF"
|
||||||
]
|
];
|
||||||
|
|
||||||
RED.editor.colorPicker.create({
|
RED.editor.colorPicker.create({
|
||||||
id: "red-ui-editor-node-color",
|
id: "red-ui-editor-node-color",
|
||||||
value: color,
|
value: color,
|
||||||
|
defaultValue: "#DDAA99",
|
||||||
palette: recommendedColors,
|
palette: recommendedColors,
|
||||||
sortPalette: function (a, b) {return a.l - b.l;}
|
sortPalette: function (a, b) {return a.l - b.l;}
|
||||||
}).appendTo(colorRow);
|
}).appendTo(colorRow);
|
||||||
@@ -245,9 +246,9 @@
|
|||||||
nodeDiv.css('backgroundColor',colour);
|
nodeDiv.css('backgroundColor',colour);
|
||||||
var borderColor = RED.utils.getDarkerColor(colour);
|
var borderColor = RED.utils.getDarkerColor(colour);
|
||||||
if (borderColor !== colour) {
|
if (borderColor !== colour) {
|
||||||
nodeDiv.css('border-color',borderColor)
|
nodeDiv.css('border-color',borderColor);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -264,7 +265,7 @@
|
|||||||
nodeDiv.css('backgroundColor',colour);
|
nodeDiv.css('backgroundColor',colour);
|
||||||
var borderColor = RED.utils.getDarkerColor(colour);
|
var borderColor = RED.utils.getDarkerColor(colour);
|
||||||
if (borderColor !== colour) {
|
if (borderColor !== colour) {
|
||||||
nodeDiv.css('border-color',borderColor)
|
nodeDiv.css('border-color',borderColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
||||||
@@ -292,7 +293,7 @@
|
|||||||
|
|
||||||
RED.popover.tooltip(iconButton, function() {
|
RED.popover.tooltip(iconButton, function() {
|
||||||
return $("#red-ui-editor-node-icon").val() || RED._("editor.default");
|
return $("#red-ui-editor-node-icon").val() || RED._("editor.default");
|
||||||
})
|
});
|
||||||
$('<input type="hidden" id="red-ui-editor-node-icon">').val(node.icon).appendTo(iconRow);
|
$('<input type="hidden" id="red-ui-editor-node-icon">').val(node.icon).appendTo(iconRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,11 +418,11 @@
|
|||||||
});
|
});
|
||||||
rows.sort(function(A,B) {
|
rows.sort(function(A,B) {
|
||||||
return A.i-B.i;
|
return A.i-B.i;
|
||||||
})
|
});
|
||||||
rows.forEach(function(r,i) {
|
rows.forEach(function(r,i) {
|
||||||
r.r.find("label").text((i+1)+".");
|
r.r.find("label").text((i+1)+".");
|
||||||
r.r.appendTo(outputsDiv);
|
r.r.appendTo(outputsDiv);
|
||||||
})
|
});
|
||||||
if (rows.length === 0) {
|
if (rows.length === 0) {
|
||||||
buildLabelRow("output",i,"").appendTo(outputsDiv);
|
buildLabelRow("output",i,"").appendTo(outputsDiv);
|
||||||
} else {
|
} else {
|
||||||
@@ -467,7 +468,7 @@
|
|||||||
clear.on("click", function(evt) {
|
clear.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
input.val("");
|
input.val("");
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -501,6 +502,12 @@
|
|||||||
}
|
}
|
||||||
var v = $(this).val();
|
var v = $(this).val();
|
||||||
hasNonBlankLabel = hasNonBlankLabel || v!== "";
|
hasNonBlankLabel = hasNonBlankLabel || v!== "";
|
||||||
|
|
||||||
|
// mark changed output port labels as dirty
|
||||||
|
if (node.type === "subflow" && (!node.outputLabels || node.outputLabels[index] !== v)) {
|
||||||
|
node.out[index].dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
newValue[index] = v;
|
newValue[index] = v;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -509,6 +516,12 @@
|
|||||||
changes.outputLabels = node.outputLabels;
|
changes.outputLabels = node.outputLabels;
|
||||||
node.outputLabels = newValue;
|
node.outputLabels = newValue;
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
|
// trigger redraw of dirty port labels
|
||||||
|
if (node.type === "subflow") {
|
||||||
|
RED.view.redraw();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
create: function(container) {
|
create: function(container) {
|
||||||
this.editor = buildDescriptionForm(container,node);
|
this.editor = buildDescriptionForm(container,node);
|
||||||
RED.e = this.editor;
|
|
||||||
},
|
},
|
||||||
resize: function(size) {
|
resize: function(size) {
|
||||||
this.editor.resize();
|
this.editor.resize();
|
||||||
@@ -58,11 +57,9 @@
|
|||||||
var nodeInfoEditor = RED.editor.createEditor({
|
var nodeInfoEditor = RED.editor.createEditor({
|
||||||
id: editorId,
|
id: editorId,
|
||||||
mode: 'ace/mode/markdown',
|
mode: 'ace/mode/markdown',
|
||||||
value: ""
|
stateId: RED.editor.generateViewStateId("node", node, "nodeinfo"),
|
||||||
|
value: node.info || ""
|
||||||
});
|
});
|
||||||
if (node.info) {
|
|
||||||
nodeInfoEditor.getSession().setValue(node.info, -1);
|
|
||||||
}
|
|
||||||
node.infoEditor = nodeInfoEditor;
|
node.infoEditor = nodeInfoEditor;
|
||||||
return nodeInfoEditor;
|
return nodeInfoEditor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!isSameObj(old_env, new_env)) {
|
if (!old_env && new_env.length === 0) {
|
||||||
|
delete node.env;
|
||||||
|
} else if (!isSameObj(old_env, new_env)) {
|
||||||
editState.changes.env = node.env;
|
editState.changes.env = node.env;
|
||||||
if (new_env.length === 0) {
|
if (new_env.length === 0) {
|
||||||
delete node.env;
|
delete node.env;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
newValue = "";
|
newValue = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node[d] != newValue) {
|
if (!isEqual(node[d], newValue)) {
|
||||||
if (node._def.defaults[d].type) {
|
if (node._def.defaults[d].type) {
|
||||||
// Change to a related config node
|
// Change to a related config node
|
||||||
var configNode = RED.nodes.node(node[d]);
|
var configNode = RED.nodes.node(node[d]);
|
||||||
@@ -139,6 +139,23 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares `newValue` with `originalValue` for equality.
|
||||||
|
* @param {*} originalValue Original value
|
||||||
|
* @param {*} newValue New value
|
||||||
|
* @returns {boolean} true if originalValue equals newValue, otherwise false
|
||||||
|
*/
|
||||||
|
function isEqual(originalValue, newValue) {
|
||||||
|
try {
|
||||||
|
if(originalValue == newValue) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return JSON.stringify(originalValue) === JSON.stringify(newValue);
|
||||||
|
} catch (err) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the node credentials from the edit form
|
* Update the node credentials from the edit form
|
||||||
* @param node - the node containing the credentials
|
* @param node - the node containing the credentials
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
var definition = {
|
var definition = {
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
var value = options.value;
|
var value = options.value;
|
||||||
|
var onCancel = options.cancel;
|
||||||
var onComplete = options.complete;
|
var onComplete = options.complete;
|
||||||
var type = "_text"
|
var type = "_text"
|
||||||
if ($("script[data-template-name='"+type+"']").length === 0) {
|
if ($("script[data-template-name='"+type+"']").length === 0) {
|
||||||
@@ -28,16 +29,16 @@
|
|||||||
}
|
}
|
||||||
RED.view.state(RED.state.EDITING);
|
RED.view.state(RED.state.EDITING);
|
||||||
var expressionEditor;
|
var expressionEditor;
|
||||||
var changeTimer;
|
|
||||||
|
|
||||||
var trayOptions = {
|
var trayOptions = {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
focusElement: options.focusElement,
|
||||||
width: options.width||"inherit",
|
width: options.width||"inherit",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
id: "node-dialog-cancel",
|
id: "node-dialog-cancel",
|
||||||
text: RED._("common.label.cancel"),
|
text: RED._("common.label.cancel"),
|
||||||
click: function() {
|
click: function() {
|
||||||
|
if(onCancel) { onCancel(); }
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -46,7 +47,8 @@
|
|||||||
text: RED._("common.label.done"),
|
text: RED._("common.label.done"),
|
||||||
class: "primary",
|
class: "primary",
|
||||||
click: function() {
|
click: function() {
|
||||||
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
|
expressionEditor.saveView();
|
||||||
|
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(),expressionEditor);}
|
||||||
RED.tray.close();
|
RED.tray.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,31 +57,27 @@
|
|||||||
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
|
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
|
||||||
var editorRow = $("#dialog-form>div.node-text-editor-row");
|
var editorRow = $("#dialog-form>div.node-text-editor-row");
|
||||||
var height = $("#dialog-form").height();
|
var height = $("#dialog-form").height();
|
||||||
// for (var i=0;i<rows.size();i++) {
|
|
||||||
// height -= $(rows[i]).outerHeight(true);
|
|
||||||
// }
|
|
||||||
// height -= (parseInt($("#dialog-form").css("marginTop"))+parseInt($("#dialog-form").css("marginBottom")));
|
|
||||||
$(".node-text-editor").css("height",height+"px");
|
$(".node-text-editor").css("height",height+"px");
|
||||||
expressionEditor.resize();
|
expressionEditor.resize();
|
||||||
},
|
},
|
||||||
open: function(tray) {
|
open: function(tray) {
|
||||||
var trayBody = tray.find('.red-ui-tray-body');
|
|
||||||
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
|
||||||
expressionEditor = RED.editor.createEditor({
|
expressionEditor = RED.editor.createEditor({
|
||||||
id: 'node-input-text',
|
id: 'node-input-text',
|
||||||
value: "",
|
value: value||"",
|
||||||
mode:"ace/mode/"+(options.mode||"text")
|
stateId: options.stateId,
|
||||||
|
mode:"ace/mode/"+(options.mode||"text"),
|
||||||
|
focus: true,
|
||||||
});
|
});
|
||||||
expressionEditor.getSession().setValue(value||"",-1);
|
if (options.cursor && !expressionEditor._initState) {
|
||||||
if (options.cursor) {
|
|
||||||
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
expressionEditor.destroy();
|
|
||||||
if (options.onclose) {
|
if (options.onclose) {
|
||||||
options.onclose();
|
options.onclose();
|
||||||
}
|
}
|
||||||
|
expressionEditor.destroy();
|
||||||
},
|
},
|
||||||
show: function() {}
|
show: function() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ RED.group = (function() {
|
|||||||
RED.editor.colorPicker.create({
|
RED.editor.colorPicker.create({
|
||||||
id:"node-input-style-stroke",
|
id:"node-input-style-stroke",
|
||||||
value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4",
|
value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4",
|
||||||
|
defaultValue: "#a4a4a4",
|
||||||
palette: colorPalette,
|
palette: colorPalette,
|
||||||
cellPerRow: colorCount,
|
cellPerRow: colorCount,
|
||||||
cellWidth: 16,
|
cellWidth: 16,
|
||||||
@@ -112,6 +113,7 @@ RED.group = (function() {
|
|||||||
RED.editor.colorPicker.create({
|
RED.editor.colorPicker.create({
|
||||||
id:"node-input-style-fill",
|
id:"node-input-style-fill",
|
||||||
value: style.fill || defaultGroupStyle.fill ||"none",
|
value: style.fill || defaultGroupStyle.fill ||"none",
|
||||||
|
defaultValue: "none",
|
||||||
palette: colorPalette,
|
palette: colorPalette,
|
||||||
cellPerRow: colorCount,
|
cellPerRow: colorCount,
|
||||||
cellWidth: 16,
|
cellWidth: 16,
|
||||||
@@ -129,6 +131,7 @@ RED.group = (function() {
|
|||||||
RED.editor.colorPicker.create({
|
RED.editor.colorPicker.create({
|
||||||
id:"node-input-style-color",
|
id:"node-input-style-color",
|
||||||
value: style.color || defaultGroupStyle.color ||"#a4a4a4",
|
value: style.color || defaultGroupStyle.color ||"#a4a4a4",
|
||||||
|
defaultValue: "#a4a4a4",
|
||||||
palette: colorPalette,
|
palette: colorPalette,
|
||||||
cellPerRow: colorCount,
|
cellPerRow: colorCount,
|
||||||
cellWidth: 16,
|
cellWidth: 16,
|
||||||
@@ -308,6 +311,7 @@ RED.group = (function() {
|
|||||||
RED.history.push(historyEvent);
|
RED.history.push(historyEvent);
|
||||||
RED.view.select({nodes:[group]});
|
RED.view.select({nodes:[group]});
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -323,9 +327,6 @@ RED.group = (function() {
|
|||||||
groups: [ ],
|
groups: [ ],
|
||||||
dirty: RED.nodes.dirty()
|
dirty: RED.nodes.dirty()
|
||||||
}
|
}
|
||||||
RED.history.push(historyEvent);
|
|
||||||
|
|
||||||
|
|
||||||
groups.forEach(function(g) {
|
groups.forEach(function(g) {
|
||||||
newSelection = newSelection.concat(ungroup(g))
|
newSelection = newSelection.concat(ungroup(g))
|
||||||
historyEvent.groups.push(g);
|
historyEvent.groups.push(g);
|
||||||
@@ -333,6 +334,7 @@ RED.group = (function() {
|
|||||||
RED.history.push(historyEvent);
|
RED.history.push(historyEvent);
|
||||||
RED.view.select({nodes:newSelection})
|
RED.view.select({nodes:newSelection})
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,8 +354,10 @@ RED.group = (function() {
|
|||||||
}
|
}
|
||||||
if (n.type === 'group') {
|
if (n.type === 'group') {
|
||||||
RED.events.emit("groups:change",n)
|
RED.events.emit("groups:change",n)
|
||||||
} else {
|
} else if (n.type !== 'junction') {
|
||||||
RED.events.emit("nodes:change",n)
|
RED.events.emit("nodes:change",n)
|
||||||
|
} else {
|
||||||
|
RED.events.emit("junctions:change",n)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
RED.nodes.removeGroup(g);
|
RED.nodes.removeGroup(g);
|
||||||
@@ -425,6 +429,7 @@ RED.group = (function() {
|
|||||||
});
|
});
|
||||||
RED.history.push(historyEvent);
|
RED.history.push(historyEvent);
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,6 +457,7 @@ RED.group = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
RED.view.select({nodes:selection.nodes})
|
RED.view.select({nodes:selection.nodes})
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function createGroup(nodes) {
|
function createGroup(nodes) {
|
||||||
@@ -547,8 +553,10 @@ RED.group = (function() {
|
|||||||
group.h = Math.max(group.h,n.y+n.h/2+25-group.y);
|
group.h = Math.max(group.h,n.y+n.h/2+25-group.y);
|
||||||
if (n.type === 'group') {
|
if (n.type === 'group') {
|
||||||
RED.events.emit("groups:change",n)
|
RED.events.emit("groups:change",n)
|
||||||
} else {
|
} else if (n.type !== 'junction') {
|
||||||
RED.events.emit("nodes:change",n)
|
RED.events.emit("nodes:change",n)
|
||||||
|
} else {
|
||||||
|
RED.events.emit("junctions:change",n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -583,19 +591,23 @@ RED.group = (function() {
|
|||||||
}
|
}
|
||||||
if (n.type === 'group') {
|
if (n.type === 'group') {
|
||||||
RED.events.emit("groups:change",n)
|
RED.events.emit("groups:change",n)
|
||||||
} else {
|
} else if (n.type !== 'junction') {
|
||||||
RED.events.emit("nodes:change",n)
|
RED.events.emit("nodes:change",n)
|
||||||
|
} else {
|
||||||
|
RED.events.emit("junctions:change",n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
markDirty(group);
|
markDirty(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNodes(group,recursive) {
|
function getNodes(group,recursive,excludeGroup) {
|
||||||
var nodes = [];
|
var nodes = [];
|
||||||
group.nodes.forEach(function(n) {
|
group.nodes.forEach(function(n) {
|
||||||
nodes.push(n);
|
if (n.type !== 'group' || !excludeGroup) {
|
||||||
|
nodes.push(n);
|
||||||
|
}
|
||||||
if (recursive && n.type === 'group') {
|
if (recursive && n.type === 'group') {
|
||||||
nodes = nodes.concat(getNodes(n,recursive))
|
nodes = nodes.concat(getNodes(n,recursive,excludeGroup))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return nodes;
|
return nodes;
|
||||||
|
|||||||
@@ -49,15 +49,15 @@ RED.keyboard = (function() {
|
|||||||
"]": 221,
|
"]": 221,
|
||||||
"{": 219,// <- QWERTY specific
|
"{": 219,// <- QWERTY specific
|
||||||
"}": 221 // <- QWERTY specific
|
"}": 221 // <- QWERTY specific
|
||||||
}
|
};
|
||||||
var metaKeyCodes = {
|
var metaKeyCodes = {
|
||||||
16: true,
|
16: true,
|
||||||
17: true,
|
17: true,
|
||||||
18: true,
|
18: true,
|
||||||
91: true,
|
91: true,
|
||||||
93: true
|
93: true
|
||||||
}
|
};
|
||||||
var actionToKeyMap = {}
|
var actionToKeyMap = {};
|
||||||
var defaultKeyMap = {};
|
var defaultKeyMap = {};
|
||||||
|
|
||||||
// FF generates some different keycodes because reasons.
|
// FF generates some different keycodes because reasons.
|
||||||
@@ -65,7 +65,7 @@ RED.keyboard = (function() {
|
|||||||
59:186,
|
59:186,
|
||||||
61:187,
|
61:187,
|
||||||
173:189
|
173:189
|
||||||
}
|
};
|
||||||
|
|
||||||
function migrateOldKeymap() {
|
function migrateOldKeymap() {
|
||||||
// pre-0.18
|
// pre-0.18
|
||||||
@@ -80,7 +80,7 @@ RED.keyboard = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getUserKey(action) {
|
function getUserKey(action) {
|
||||||
return RED.settings.get('editor.keymap',{})[action]
|
return RED.settings.get('editor.keymap',{})[action];
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeKeymaps(defaultKeymap, themeKeymap) {
|
function mergeKeymaps(defaultKeymap, themeKeymap) {
|
||||||
@@ -105,7 +105,7 @@ RED.keyboard = (function() {
|
|||||||
scope:scope,
|
scope:scope,
|
||||||
key:key,
|
key:key,
|
||||||
user:false
|
user:false
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,13 +115,13 @@ RED.keyboard = (function() {
|
|||||||
if (themeKeymap.hasOwnProperty(action)) {
|
if (themeKeymap.hasOwnProperty(action)) {
|
||||||
if (!themeKeymap[action].key) {
|
if (!themeKeymap[action].key) {
|
||||||
// No key for this action - default is no keybinding
|
// No key for this action - default is no keybinding
|
||||||
delete mergedKeymap[action]
|
delete mergedKeymap[action];
|
||||||
} else {
|
} else {
|
||||||
mergedKeymap[action] = [{
|
mergedKeymap[action] = [{
|
||||||
scope: themeKeymap[action].scope || "*",
|
scope: themeKeymap[action].scope || "*",
|
||||||
key: themeKeymap[action].key,
|
key: themeKeymap[action].key,
|
||||||
user: false
|
user: false
|
||||||
}]
|
}];
|
||||||
if (mergedKeymap[action][0].scope === "workspace") {
|
if (mergedKeymap[action][0].scope === "workspace") {
|
||||||
mergedKeymap[action][0].scope = "red-ui-workspace";
|
mergedKeymap[action][0].scope = "red-ui-workspace";
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ RED.keyboard = (function() {
|
|||||||
close: function() {
|
close: function() {
|
||||||
RED.menu.refreshShortcuts();
|
RED.menu.refreshShortcuts();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function revertToDefault(action) {
|
function revertToDefault(action) {
|
||||||
@@ -265,13 +265,18 @@ RED.keyboard = (function() {
|
|||||||
if (partialState) {
|
if (partialState) {
|
||||||
partialState = null;
|
partialState = null;
|
||||||
return resolveKeyEvent(evt);
|
return resolveKeyEvent(evt);
|
||||||
} else if (Object.keys(handler).length > 0) {
|
|
||||||
partialState = handler;
|
|
||||||
evt.preventDefault();
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
if (Object.keys(handler).length > 0) {
|
||||||
|
// check if there's a potential combined handler initiated by this keyCode
|
||||||
|
for (let h in handler) {
|
||||||
|
if (matchHandlerToEvent(evt,handler[h]) > -1) {
|
||||||
|
partialState = handler;
|
||||||
|
evt.preventDefault();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
} else {
|
} else {
|
||||||
var depth = Infinity;
|
var depth = Infinity;
|
||||||
var matchedHandler;
|
var matchedHandler;
|
||||||
@@ -327,7 +332,7 @@ RED.keyboard = (function() {
|
|||||||
scope:scope,
|
scope:scope,
|
||||||
key:key,
|
key:key,
|
||||||
user:false
|
user:false
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
if (!ondown) {
|
if (!ondown) {
|
||||||
var userAction = getUserKey(cbdown);
|
var userAction = getUserKey(cbdown);
|
||||||
@@ -350,7 +355,7 @@ RED.keyboard = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
keys.push([key,mod])
|
keys.push([key,mod]);
|
||||||
}
|
}
|
||||||
var slot = handlers;
|
var slot = handlers;
|
||||||
for (i=0;i<keys.length;i++) {
|
for (i=0;i<keys.length;i++) {
|
||||||
@@ -373,7 +378,7 @@ RED.keyboard = (function() {
|
|||||||
//slot[key] = {scope: scope, ondown:cbdown};
|
//slot[key] = {scope: scope, ondown:cbdown};
|
||||||
}
|
}
|
||||||
slot.handlers = slot.handlers || [];
|
slot.handlers = slot.handlers || [];
|
||||||
slot.handlers.push({scope:scope,ondown:cbdown})
|
slot.handlers.push({scope:scope,ondown:cbdown});
|
||||||
slot.scope = scope;
|
slot.scope = scope;
|
||||||
slot.ondown = cbdown;
|
slot.ondown = cbdown;
|
||||||
}
|
}
|
||||||
@@ -390,12 +395,12 @@ RED.keyboard = (function() {
|
|||||||
if (parsedKey) {
|
if (parsedKey) {
|
||||||
keys.push(parsedKey);
|
keys.push(parsedKey);
|
||||||
} else {
|
} else {
|
||||||
console.log("Unrecognised key specifier:",key)
|
console.log("Unrecognised key specifier:",key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
keys.push([key,mod])
|
keys.push([key,mod]);
|
||||||
}
|
}
|
||||||
var slot = handlers;
|
var slot = handlers;
|
||||||
for (i=0;i<keys.length;i++) {
|
for (i=0;i<keys.length;i++) {
|
||||||
@@ -417,7 +422,7 @@ RED.keyboard = (function() {
|
|||||||
}
|
}
|
||||||
if (typeof slot.ondown === "string") {
|
if (typeof slot.ondown === "string") {
|
||||||
if (typeof modifiers === 'boolean' && modifiers) {
|
if (typeof modifiers === 'boolean' && modifiers) {
|
||||||
actionToKeyMap[slot.ondown] = {user: modifiers}
|
actionToKeyMap[slot.ondown] = {user: modifiers};
|
||||||
} else {
|
} else {
|
||||||
delete actionToKeyMap[slot.ondown];
|
delete actionToKeyMap[slot.ondown];
|
||||||
}
|
}
|
||||||
@@ -433,11 +438,11 @@ RED.keyboard = (function() {
|
|||||||
function formatKey(key,plain) {
|
function formatKey(key,plain) {
|
||||||
var formattedKey = isMac?key.replace(/ctrl-?/,"⌘"):key;
|
var formattedKey = isMac?key.replace(/ctrl-?/,"⌘"):key;
|
||||||
formattedKey = isMac?formattedKey.replace(/alt-?/,"⌥"):key;
|
formattedKey = isMac?formattedKey.replace(/alt-?/,"⌥"):key;
|
||||||
formattedKey = formattedKey.replace(/shift-?/,"⇧")
|
formattedKey = formattedKey.replace(/shift-?/,"⇧");
|
||||||
formattedKey = formattedKey.replace(/left/,"←")
|
formattedKey = formattedKey.replace(/left/,"←");
|
||||||
formattedKey = formattedKey.replace(/up/,"↑")
|
formattedKey = formattedKey.replace(/up/,"↑");
|
||||||
formattedKey = formattedKey.replace(/right/,"→")
|
formattedKey = formattedKey.replace(/right/,"→");
|
||||||
formattedKey = formattedKey.replace(/down/,"↓")
|
formattedKey = formattedKey.replace(/down/,"↓");
|
||||||
if (plain) {
|
if (plain) {
|
||||||
return formattedKey;
|
return formattedKey;
|
||||||
}
|
}
|
||||||
@@ -461,7 +466,6 @@ RED.keyboard = (function() {
|
|||||||
var container = $(this);
|
var container = $(this);
|
||||||
var object = container.data('data');
|
var object = container.data('data');
|
||||||
|
|
||||||
|
|
||||||
if (!container.hasClass('keyboard-shortcut-entry-expanded')) {
|
if (!container.hasClass('keyboard-shortcut-entry-expanded')) {
|
||||||
endEditShortcut();
|
endEditShortcut();
|
||||||
|
|
||||||
@@ -485,7 +489,7 @@ RED.keyboard = (function() {
|
|||||||
}
|
}
|
||||||
$(this).toggleClass("input-error",!valid);
|
$(this).toggleClass("input-error",!valid);
|
||||||
okButton.attr("disabled",!valid);
|
okButton.attr("disabled",!valid);
|
||||||
})
|
});
|
||||||
|
|
||||||
var scopeSelect = $('<select><option value="*" data-i18n="keyboard.global"></option><option value="red-ui-workspace" data-i18n="keyboard.workspace"></option></select>').appendTo(scope);
|
var scopeSelect = $('<select><option value="*" data-i18n="keyboard.global"></option><option value="red-ui-workspace" data-i18n="keyboard.workspace"></option></select>').appendTo(scope);
|
||||||
scopeSelect.i18n();
|
scopeSelect.i18n();
|
||||||
@@ -495,7 +499,7 @@ RED.keyboard = (function() {
|
|||||||
scopeSelect.val(object.scope||'*');
|
scopeSelect.val(object.scope||'*');
|
||||||
scopeSelect.on("change", function() {
|
scopeSelect.on("change", function() {
|
||||||
keyInput.trigger("change");
|
keyInput.trigger("change");
|
||||||
})
|
});
|
||||||
|
|
||||||
var div = $('<div class="keyboard-shortcut-edit button-group-vertical"></div>').appendTo(scope);
|
var div = $('<div class="keyboard-shortcut-edit button-group-vertical"></div>').appendTo(scope);
|
||||||
var okButton = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-check"></i></button>').appendTo(div);
|
var okButton = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-check"></i></button>').appendTo(div);
|
||||||
@@ -521,10 +525,13 @@ RED.keyboard = (function() {
|
|||||||
id:object.id,
|
id:object.id,
|
||||||
scope:shortcut?shortcut.scope:undefined,
|
scope:shortcut?shortcut.scope:undefined,
|
||||||
key:shortcut?shortcut.key:undefined,
|
key:shortcut?shortcut.key:undefined,
|
||||||
user:shortcut?shortcut.user:undefined
|
user:shortcut?shortcut.user:undefined,
|
||||||
}
|
|
||||||
|
label: object.label,
|
||||||
|
options: object.options,
|
||||||
|
};
|
||||||
buildShortcutRow(container,obj);
|
buildShortcutRow(container,obj);
|
||||||
})
|
});
|
||||||
|
|
||||||
keyInput.trigger("focus");
|
keyInput.trigger("focus");
|
||||||
}
|
}
|
||||||
@@ -559,7 +566,7 @@ RED.keyboard = (function() {
|
|||||||
delete object.scope;
|
delete object.scope;
|
||||||
} else {
|
} else {
|
||||||
keyDiv.parent().removeClass("keyboard-shortcut-entry-unassigned");
|
keyDiv.parent().removeClass("keyboard-shortcut-entry-unassigned");
|
||||||
keyDiv.append(RED.keyboard.formatKey(key))
|
keyDiv.append(RED.keyboard.formatKey(key));
|
||||||
$("<span>").text(scope).appendTo(scopeDiv);
|
$("<span>").text(scope).appendTo(scopeDiv);
|
||||||
object.key = key;
|
object.key = key;
|
||||||
object.scope = scope;
|
object.scope = scope;
|
||||||
@@ -572,7 +579,7 @@ RED.keyboard = (function() {
|
|||||||
userKeymap[object.id] = {
|
userKeymap[object.id] = {
|
||||||
scope:shortcut.scope,
|
scope:shortcut.scope,
|
||||||
key:shortcut.key
|
key:shortcut.key
|
||||||
}
|
};
|
||||||
RED.settings.set('editor.keymap',userKeymap);
|
RED.settings.set('editor.keymap',userKeymap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -588,13 +595,7 @@ RED.keyboard = (function() {
|
|||||||
var item = $('<div class="keyboard-shortcut-entry">').appendTo(container);
|
var item = $('<div class="keyboard-shortcut-entry">').appendTo(container);
|
||||||
container.data('data',object);
|
container.data('data',object);
|
||||||
|
|
||||||
var text = object.id.replace(/(^.+:([a-z]))|(-([a-z]))/g,function() {
|
var text = object.label;
|
||||||
if (arguments[5] === 0) {
|
|
||||||
return arguments[2].toUpperCase();
|
|
||||||
} else {
|
|
||||||
return " "+arguments[4].toUpperCase();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var label = $('<div>').addClass("keyboard-shortcut-entry-text").text(text).appendTo(item);
|
var label = $('<div>').addClass("keyboard-shortcut-entry-text").text(text).appendTo(item);
|
||||||
|
|
||||||
var user = $('<i class="fa fa-user"></i>').prependTo(label);
|
var user = $('<i class="fa fa-user"></i>').prependTo(label);
|
||||||
@@ -629,14 +630,15 @@ RED.keyboard = (function() {
|
|||||||
pane.find("#red-ui-settings-tab-keyboard-filter").searchBox({
|
pane.find("#red-ui-settings-tab-keyboard-filter").searchBox({
|
||||||
delay: 100,
|
delay: 100,
|
||||||
change: function() {
|
change: function() {
|
||||||
var filterValue = $(this).val().trim();
|
var filterValue = $(this).val().trim().toLowerCase();
|
||||||
if (filterValue === "") {
|
if (filterValue === "") {
|
||||||
shortcutList.editableList('filter', null);
|
shortcutList.editableList('filter', null);
|
||||||
} else {
|
} else {
|
||||||
filterValue = filterValue.replace(/\s/g,"");
|
filterValue = filterValue.replace(/\s/g,"");
|
||||||
shortcutList.editableList('filter', function(data) {
|
shortcutList.editableList('filter', function(data) {
|
||||||
return data.id.toLowerCase().replace(/^.*:/,"").replace("-","").indexOf(filterValue) > -1;
|
var label = data.label.toLowerCase();
|
||||||
})
|
return label.indexOf(filterValue) > -1;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -657,9 +659,9 @@ RED.keyboard = (function() {
|
|||||||
});
|
});
|
||||||
var shortcuts = RED.actions.list();
|
var shortcuts = RED.actions.list();
|
||||||
shortcuts.sort(function(A,B) {
|
shortcuts.sort(function(A,B) {
|
||||||
var Aid = A.id.replace(/^.*:/,"").replace(/[ -]/g,"").toLowerCase();
|
var Akey = A.label;
|
||||||
var Bid = B.id.replace(/^.*:/,"").replace(/[ -]/g,"").toLowerCase();
|
var Bkey = B.label;
|
||||||
return Aid.localeCompare(Bid);
|
return Akey.localeCompare(Bkey);
|
||||||
});
|
});
|
||||||
knownShortcuts = new Set();
|
knownShortcuts = new Set();
|
||||||
shortcuts.forEach(function(s) {
|
shortcuts.forEach(function(s) {
|
||||||
|
|||||||
200
packages/node_modules/@node-red/editor-client/src/js/ui/library.js
vendored
Executable file → Normal file
200
packages/node_modules/@node-red/editor-client/src/js/ui/library.js
vendored
Executable file → Normal file
@@ -363,106 +363,112 @@ RED.library = (function() {
|
|||||||
options.onconfirm(item);
|
options.onconfirm(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
|
var itemTools = null;
|
||||||
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
|
|
||||||
.on("click", function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
evt.stopPropagation();
|
|
||||||
var elementPos = menuButton.offset();
|
|
||||||
|
|
||||||
var menuOptionMenu = RED.menu.init({id:"red-ui-library-browser-menu",
|
|
||||||
options: [
|
|
||||||
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
|
|
||||||
var defaultFolderName = "new-folder";
|
|
||||||
var defaultFolderNameMatches = {};
|
|
||||||
|
|
||||||
var selected = dirList.treeList('selected');
|
|
||||||
if (!selected.children) {
|
|
||||||
selected = selected.parent;
|
|
||||||
}
|
|
||||||
var complete = function() {
|
|
||||||
selected.children.forEach(function(c) {
|
|
||||||
if (/^new-folder/.test(c.label)) {
|
|
||||||
defaultFolderNameMatches[c.label] = true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var folderIndex = 2;
|
|
||||||
while(defaultFolderNameMatches[defaultFolderName]) {
|
|
||||||
defaultFolderName = "new-folder-"+(folderIndex++)
|
|
||||||
}
|
|
||||||
|
|
||||||
selected.treeList.expand();
|
|
||||||
var input = $('<input type="text" class="red-ui-treeList-input">').val(defaultFolderName);
|
|
||||||
var newItem = {
|
|
||||||
icon: "fa fa-folder-o",
|
|
||||||
children:[],
|
|
||||||
path: selected.path,
|
|
||||||
element: input
|
|
||||||
}
|
|
||||||
var confirmAdd = function() {
|
|
||||||
var val = input.val().trim();
|
|
||||||
if (val === "") {
|
|
||||||
cancelAdd();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
for (var i=0;i<selected.children.length;i++) {
|
|
||||||
if (selected.children[i].label === val) {
|
|
||||||
cancelAdd();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newItem.treeList.remove();
|
|
||||||
var finalItem = {
|
|
||||||
library: selected.library,
|
|
||||||
type: selected.type,
|
|
||||||
icon: "fa fa-folder",
|
|
||||||
children:[],
|
|
||||||
label: val,
|
|
||||||
path: newItem.path+val+"/"
|
|
||||||
}
|
|
||||||
selected.treeList.addChild(finalItem,true);
|
|
||||||
}
|
|
||||||
var cancelAdd = function() {
|
|
||||||
newItem.treeList.remove();
|
|
||||||
}
|
|
||||||
input.on('keydown', function(evt) {
|
|
||||||
evt.stopPropagation();
|
|
||||||
if (evt.keyCode === 13) {
|
|
||||||
confirmAdd();
|
|
||||||
} else if (evt.keyCode === 27) {
|
|
||||||
cancelAdd();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
input.on("blur", function() {
|
|
||||||
confirmAdd();
|
|
||||||
})
|
|
||||||
selected.treeList.addChild(newItem);
|
|
||||||
setTimeout(function() {
|
|
||||||
input.trigger("focus");
|
|
||||||
input.select();
|
|
||||||
},400);
|
|
||||||
}
|
|
||||||
selected.treeList.expand(complete);
|
|
||||||
|
|
||||||
} },
|
|
||||||
// null,
|
|
||||||
// {id:"red-ui-library-browser-menu-rename",label:"Rename", onselect: function() {} },
|
|
||||||
// {id:"red-ui-library-browser-menu-delete",label:"Delete", onselect: function() {} }
|
|
||||||
]
|
|
||||||
}).on('mouseleave', function(){ $(this).remove(); dirList.focus() })
|
|
||||||
.on('mouseup', function() { var self = $(this);self.hide(); dirList.focus(); setTimeout(function() { self.remove() },100)})
|
|
||||||
.appendTo("body");
|
|
||||||
menuOptionMenu.css({
|
|
||||||
position: "absolute",
|
|
||||||
top: elementPos.top+"px",
|
|
||||||
left: (elementPos.left - menuOptionMenu.width() + 20)+"px"
|
|
||||||
}).show();
|
|
||||||
|
|
||||||
}).appendTo(itemTools);
|
|
||||||
if (options.folderTools) {
|
if (options.folderTools) {
|
||||||
dirList.on('treelistselect', function(event, item) {
|
dirList.on('treelistselect', function(event, item) {
|
||||||
if (item.writable !== false && item.treeList) {
|
if (item.writable !== false && item.treeList) {
|
||||||
|
if (itemTools) {
|
||||||
|
itemTools.remove();
|
||||||
|
}
|
||||||
|
itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
|
||||||
|
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
|
||||||
|
.on("click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
var elementPos = menuButton.offset();
|
||||||
|
|
||||||
|
var menuOptionMenu
|
||||||
|
= RED.menu.init({id:"red-ui-library-browser-menu",
|
||||||
|
options: [
|
||||||
|
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
|
||||||
|
var defaultFolderName = "new-folder";
|
||||||
|
var defaultFolderNameMatches = {};
|
||||||
|
|
||||||
|
var selected = dirList.treeList('selected');
|
||||||
|
if (!selected.children) {
|
||||||
|
selected = selected.parent;
|
||||||
|
}
|
||||||
|
var complete = function() {
|
||||||
|
selected.children.forEach(function(c) {
|
||||||
|
if (/^new-folder/.test(c.label)) {
|
||||||
|
defaultFolderNameMatches[c.label] = true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var folderIndex = 2;
|
||||||
|
while(defaultFolderNameMatches[defaultFolderName]) {
|
||||||
|
defaultFolderName = "new-folder-"+(folderIndex++)
|
||||||
|
}
|
||||||
|
|
||||||
|
selected.treeList.expand();
|
||||||
|
var input = $('<input type="text" class="red-ui-treeList-input">').val(defaultFolderName);
|
||||||
|
var newItem = {
|
||||||
|
icon: "fa fa-folder-o",
|
||||||
|
children:[],
|
||||||
|
path: selected.path,
|
||||||
|
element: input
|
||||||
|
}
|
||||||
|
var confirmAdd = function() {
|
||||||
|
var val = input.val().trim();
|
||||||
|
if (val === "") {
|
||||||
|
cancelAdd();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
for (var i=0;i<selected.children.length;i++) {
|
||||||
|
if (selected.children[i].label === val) {
|
||||||
|
cancelAdd();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newItem.treeList.remove();
|
||||||
|
var finalItem = {
|
||||||
|
library: selected.library,
|
||||||
|
type: selected.type,
|
||||||
|
icon: "fa fa-folder",
|
||||||
|
children:[],
|
||||||
|
label: val,
|
||||||
|
path: newItem.path+val+"/"
|
||||||
|
}
|
||||||
|
selected.treeList.addChild(finalItem,true);
|
||||||
|
}
|
||||||
|
var cancelAdd = function() {
|
||||||
|
newItem.treeList.remove();
|
||||||
|
}
|
||||||
|
input.on('keydown', function(evt) {
|
||||||
|
evt.stopPropagation();
|
||||||
|
if (evt.keyCode === 13) {
|
||||||
|
confirmAdd();
|
||||||
|
} else if (evt.keyCode === 27) {
|
||||||
|
cancelAdd();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
input.on("blur", function() {
|
||||||
|
confirmAdd();
|
||||||
|
})
|
||||||
|
selected.treeList.addChild(newItem);
|
||||||
|
setTimeout(function() {
|
||||||
|
input.trigger("focus");
|
||||||
|
input.select();
|
||||||
|
},400);
|
||||||
|
}
|
||||||
|
selected.treeList.expand(complete);
|
||||||
|
|
||||||
|
} },
|
||||||
|
// null,
|
||||||
|
// {id:"red-ui-library-browser-menu-rename",label:"Rename", onselect: function() {} },
|
||||||
|
// {id:"red-ui-library-browser-menu-delete",label:"Delete", onselect: function() {} }
|
||||||
|
]
|
||||||
|
}).on('mouseleave', function(){ $(this).remove(); dirList.focus() })
|
||||||
|
.on('mouseup', function() { var self = $(this);self.hide(); dirList.focus(); setTimeout(function() { self.remove() },100)})
|
||||||
|
.appendTo("body");
|
||||||
|
menuOptionMenu.css({
|
||||||
|
position: "absolute",
|
||||||
|
top: elementPos.top+"px",
|
||||||
|
left: (elementPos.left - menuOptionMenu.width() + 20)+"px"
|
||||||
|
}).show();
|
||||||
|
|
||||||
|
}).appendTo(itemTools);
|
||||||
|
|
||||||
itemTools.appendTo(item.treeList.label);
|
itemTools.appendTo(item.treeList.label);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
27
packages/node_modules/@node-red/editor-client/src/js/ui/palette.js
vendored
Executable file → Normal file
27
packages/node_modules/@node-red/editor-client/src/js/ui/palette.js
vendored
Executable file → Normal file
@@ -175,9 +175,19 @@ RED.palette = (function() {
|
|||||||
$('<button type="button" onclick="RED.workspaces.show(\''+type.substring(8).replace(/'/g,"\\'")+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-pencil"></i></button>').appendTo(popOverContent)
|
$('<button type="button" onclick="RED.workspaces.show(\''+type.substring(8).replace(/'/g,"\\'")+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-pencil"></i></button>').appendTo(popOverContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
var safeType = type.replace(/'/g,"\\'");
|
const safeType = type.replace(/'/g,"\\'");
|
||||||
|
const wrapStr = function (str) {
|
||||||
|
if(str.indexOf(' ') >= 0) {
|
||||||
|
return '"' + str + '"'
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
$('<button type="button" onclick="RED.search.show(\'type:'+safeType+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-search"></i></button>').appendTo(popOverContent)
|
$('<button type="button"; return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-search"></i></button>')
|
||||||
|
.appendTo(popOverContent)
|
||||||
|
.on('click', function() {
|
||||||
|
RED.search.show('type:' + wrapStr(safeType))
|
||||||
|
})
|
||||||
$('<button type="button" onclick="RED.sidebar.help.show(\''+safeType+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-book"></i></button>').appendTo(popOverContent)
|
$('<button type="button" onclick="RED.sidebar.help.show(\''+safeType+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-book"></i></button>').appendTo(popOverContent)
|
||||||
|
|
||||||
$('<p>',{style:"font-size: 0.8em"}).text(metaData).appendTo(popOverContent);
|
$('<p>',{style:"font-size: 0.8em"}).text(metaData).appendTo(popOverContent);
|
||||||
@@ -208,7 +218,7 @@ RED.palette = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeCategory(category) {
|
function escapeCategory(category) {
|
||||||
return category.replace(/[ /.]/g,"_");
|
return category.replace(/[\x00-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]/g,"_");
|
||||||
}
|
}
|
||||||
function addNodeType(nt,def) {
|
function addNodeType(nt,def) {
|
||||||
if (getPaletteNode(nt).length) {
|
if (getPaletteNode(nt).length) {
|
||||||
@@ -224,14 +234,7 @@ RED.palette = (function() {
|
|||||||
|
|
||||||
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
|
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
|
||||||
|
|
||||||
var label = nt;///^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1];
|
var label = RED.utils.getPaletteLabel(nt, def);///^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1];
|
||||||
if (typeof def.paletteLabel !== "undefined") {
|
|
||||||
try {
|
|
||||||
label = (typeof def.paletteLabel === "function" ? def.paletteLabel.call(def) : def.paletteLabel)||"";
|
|
||||||
} catch(err) {
|
|
||||||
console.log("Definition error: "+nt+".paletteLabel",err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('<div/>', {
|
$('<div/>', {
|
||||||
class: "red-ui-palette-label"+(((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-label-right" : "")
|
class: "red-ui-palette-label"+(((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-label-right" : "")
|
||||||
@@ -429,6 +432,7 @@ RED.palette = (function() {
|
|||||||
categoryNode.find(".red-ui-palette-content").slideToggle();
|
categoryNode.find(".red-ui-palette-content").slideToggle();
|
||||||
categoryNode.find("i").toggleClass("expanded");
|
categoryNode.find("i").toggleClass("expanded");
|
||||||
}
|
}
|
||||||
|
categoryNode.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,6 +511,7 @@ RED.palette = (function() {
|
|||||||
currentCategoryNode.find(".red-ui-palette-content").slideToggle();
|
currentCategoryNode.find(".red-ui-palette-content").slideToggle();
|
||||||
currentCategoryNode.find("i").toggleClass("expanded");
|
currentCategoryNode.find("i").toggleClass("expanded");
|
||||||
}
|
}
|
||||||
|
currentCategoryNode.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ RED.projects.settings = (function() {
|
|||||||
title: RED._('sidebar.project.editDescription'),
|
title: RED._('sidebar.project.editDescription'),
|
||||||
header: $('<span><i class="fa fa-book"></i> README.md</span>'),
|
header: $('<span><i class="fa fa-book"></i> README.md</span>'),
|
||||||
value: activeProject.description,
|
value: activeProject.description,
|
||||||
|
stateId: "sidebar.project.editDescription",
|
||||||
complete: function(v) {
|
complete: function(v) {
|
||||||
container.empty();
|
container.empty();
|
||||||
var spinner = utils.addSpinnerOverlay(container);
|
var spinner = utils.addSpinnerOverlay(container);
|
||||||
|
|||||||
34
packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js
vendored
Executable file → Normal file
34
packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js
vendored
Executable file → Normal file
@@ -545,7 +545,7 @@ RED.projects = (function() {
|
|||||||
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
||||||
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.clone-project.ssh-key-desc")+'</div>').appendTo(sshwarningRow);
|
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.clone-project.ssh-key-desc")+'</div>').appendTo(sshwarningRow);
|
||||||
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
||||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
|
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dialog.dialog( "close" );
|
dialog.dialog( "close" );
|
||||||
RED.userSettings.show('gitconfig');
|
RED.userSettings.show('gitconfig');
|
||||||
@@ -1171,11 +1171,11 @@ RED.projects = (function() {
|
|||||||
|
|
||||||
row = $('<div class="form-row button-group"></div>').appendTo(container);
|
row = $('<div class="form-row button-group"></div>').appendTo(container);
|
||||||
|
|
||||||
var openProject = $('<button data-type="open" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
|
var openProject = $('<button type="button" data-type="open" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
|
||||||
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
|
var createAsEmpty = $('<button type="button" data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
|
||||||
// var createAsCopy = $('<button data-type="copy" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
|
// var createAsCopy = $('<button type="button" data-type="copy" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
|
||||||
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
|
var createAsClone = $('<button type="button" data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
|
||||||
// var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
|
// var createAsClone = $('<button type="button" data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
|
||||||
row.find(".red-ui-projects-dialog-screen-create-type").on("click", function(evt) {
|
row.find(".red-ui-projects-dialog-screen-create-type").on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
container.find(".red-ui-projects-dialog-screen-create-type").removeClass('selected');
|
container.find(".red-ui-projects-dialog-screen-create-type").removeClass('selected');
|
||||||
@@ -1212,6 +1212,9 @@ RED.projects = (function() {
|
|||||||
}
|
}
|
||||||
}).appendTo(row);
|
}).appendTo(row);
|
||||||
|
|
||||||
|
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-open"></div>').hide().appendTo(container);
|
||||||
|
$('<span style="display: flex; align-items: center;"><input style="padding:0; margin: 0 5px 0 0" checked type="checkbox" id="red-ui-projects-dialog-screen-clear-context"> <label for="red-ui-projects-dialog-screen-clear-context" style="padding:0; margin: 0"> <span data-i18n="projects.create.clearContext"></span></label></span>').appendTo(row).i18n();
|
||||||
|
|
||||||
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-empty red-ui-projects-dialog-screen-create-row-clone"></div>').appendTo(container);
|
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-empty red-ui-projects-dialog-screen-create-row-clone"></div>').appendTo(container);
|
||||||
$('<label for="red-ui-projects-dialog-screen-create-project-name">'+RED._("projects.create.project-name")+'</label>').appendTo(row);
|
$('<label for="red-ui-projects-dialog-screen-create-project-name">'+RED._("projects.create.project-name")+'</label>').appendTo(row);
|
||||||
|
|
||||||
@@ -1268,7 +1271,7 @@ RED.projects = (function() {
|
|||||||
var credentialsLeftBox = $('<div class="red-ui-projects-dialog-credentials-box-left">').appendTo(credentialsBox);
|
var credentialsLeftBox = $('<div class="red-ui-projects-dialog-credentials-box-left">').appendTo(credentialsBox);
|
||||||
|
|
||||||
var credentialsEnabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-enabled"></div>').appendTo(credentialsLeftBox);
|
var credentialsEnabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-enabled"></div>').appendTo(credentialsLeftBox);
|
||||||
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="enabled"> <i class="fa fa-lock"></i> <span>'+RED._("projects.encryption-config.enable")+'</span></label>').appendTo(credentialsEnabledBox);
|
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="enabled" checked> <i class="fa fa-lock"></i> <span>'+RED._("projects.encryption-config.enable")+'</span></label>').appendTo(credentialsEnabledBox);
|
||||||
var credentialsDisabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-disabled disabled"></div>').appendTo(credentialsLeftBox);
|
var credentialsDisabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-disabled disabled"></div>').appendTo(credentialsLeftBox);
|
||||||
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="disabled"> <i class="fa fa-unlock"></i> <span>'+RED._("projects.encryption-config.disable")+'</span></label>').appendTo(credentialsDisabledBox);
|
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="disabled"> <i class="fa fa-unlock"></i> <span>'+RED._("projects.encryption-config.disable")+'</span></label>').appendTo(credentialsDisabledBox);
|
||||||
|
|
||||||
@@ -1394,7 +1397,7 @@ RED.projects = (function() {
|
|||||||
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
||||||
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.create.desc2")+'</div>').appendTo(sshwarningRow);
|
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.create.desc2")+'</div>').appendTo(sshwarningRow);
|
||||||
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
||||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
|
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#red-ui-projects-dialog-cancel').trigger("click");
|
$('#red-ui-projects-dialog-cancel').trigger("click");
|
||||||
RED.userSettings.show('gitconfig');
|
RED.userSettings.show('gitconfig');
|
||||||
@@ -1501,7 +1504,8 @@ RED.projects = (function() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if (projectType === 'open') {
|
} else if (projectType === 'open') {
|
||||||
return switchProject(selectedProject.name,function(err,data) {
|
var clearContext = $("#red-ui-projects-dialog-screen-clear-context").prop("checked")
|
||||||
|
return switchProject(selectedProject.name, clearContext, function(err,data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.code !== 'credentials_load_failed') {
|
if (err.code !== 'credentials_load_failed') {
|
||||||
console.log(RED._("projects.create.unexpected_error"),err)
|
console.log(RED._("projects.create.unexpected_error"),err)
|
||||||
@@ -1595,7 +1599,7 @@ RED.projects = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchProject(name,done) {
|
function switchProject(name,clearContext,done) {
|
||||||
RED.deploy.setDeployInflight(true);
|
RED.deploy.setDeployInflight(true);
|
||||||
RED.projects.settings.switchProject(name);
|
RED.projects.settings.switchProject(name);
|
||||||
sendRequest({
|
sendRequest({
|
||||||
@@ -1614,7 +1618,7 @@ RED.projects = (function() {
|
|||||||
'*': done
|
'*': done
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},{active:true}).then(function() {
|
},{active:true, clearContext:clearContext}).then(function() {
|
||||||
dialog.dialog( "close" );
|
dialog.dialog( "close" );
|
||||||
RED.events.emit("project:change", {name:name});
|
RED.events.emit("project:change", {name:name});
|
||||||
}).always(function() {
|
}).always(function() {
|
||||||
@@ -1627,14 +1631,14 @@ RED.projects = (function() {
|
|||||||
function deleteProject(row,name,done) {
|
function deleteProject(row,name,done) {
|
||||||
var cover = $('<div class="red-ui-projects-dialog-project-list-entry-delete-confirm"></div>').on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
|
var cover = $('<div class="red-ui-projects-dialog-project-list-entry-delete-confirm"></div>').on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
|
||||||
$('<span>').text(RED._("projects.delete.confirm")).appendTo(cover);
|
$('<span>').text(RED._("projects.delete.confirm")).appendTo(cover);
|
||||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("common.label.cancel")+'</button>')
|
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("common.label.cancel")+'</button>')
|
||||||
.appendTo(cover)
|
.appendTo(cover)
|
||||||
.on("click", function(e) {
|
.on("click", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
cover.remove();
|
cover.remove();
|
||||||
done(true);
|
done(true);
|
||||||
});
|
});
|
||||||
$('<button class="red-ui-button red-ui-projects-dialog-button primary">'+RED._("common.label.delete")+'</button>')
|
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button primary">'+RED._("common.label.delete")+'</button>')
|
||||||
.appendTo(cover)
|
.appendTo(cover)
|
||||||
.on("click", function(e) {
|
.on("click", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -1687,7 +1691,7 @@ RED.projects = (function() {
|
|||||||
dialogHeight = 590 - (750 - winHeight);
|
dialogHeight = 590 - (750 - winHeight);
|
||||||
}
|
}
|
||||||
$(".red-ui-projects-dialog-box").height(dialogHeight);
|
$(".red-ui-projects-dialog-box").height(dialogHeight);
|
||||||
$(".red-ui-projects-dialog-project-list-inner-container").height(Math.max(500,dialogHeight) - 180);
|
$(".red-ui-projects-dialog-project-list-inner-container").height(Math.max(500,dialogHeight) - 210);
|
||||||
dialog.dialog('option','title',screen.title||"");
|
dialog.dialog('option','title',screen.title||"");
|
||||||
dialog.dialog("open");
|
dialog.dialog("open");
|
||||||
}
|
}
|
||||||
@@ -1818,7 +1822,7 @@ RED.projects = (function() {
|
|||||||
header.addClass("selectable");
|
header.addClass("selectable");
|
||||||
|
|
||||||
var tools = $('<div class="red-ui-projects-dialog-project-list-entry-tools"></div>').appendTo(header);
|
var tools = $('<div class="red-ui-projects-dialog-project-list-entry-tools"></div>').appendTo(header);
|
||||||
$('<button class="red-ui-button red-ui-projects-dialog-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
|
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
|
||||||
.appendTo(tools)
|
.appendTo(tools)
|
||||||
.on("click", function(e) {
|
.on("click", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|||||||
@@ -22,8 +22,11 @@ RED.search = (function() {
|
|||||||
var selected = -1;
|
var selected = -1;
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
|
||||||
|
var searchHistory = [];
|
||||||
var index = {};
|
var index = {};
|
||||||
var currentResults = [];
|
var currentResults = [];
|
||||||
|
var activeResults = [];
|
||||||
|
var currentIndex = 0;
|
||||||
var previousActiveElement;
|
var previousActiveElement;
|
||||||
|
|
||||||
function indexProperty(node,label,property) {
|
function indexProperty(node,label,property) {
|
||||||
@@ -52,10 +55,22 @@ RED.search = (function() {
|
|||||||
}
|
}
|
||||||
l = l||n.label||n.name||n.id||"";
|
l = l||n.label||n.name||n.id||"";
|
||||||
|
|
||||||
|
|
||||||
var properties = ['id','type','name','label','info'];
|
var properties = ['id','type','name','label','info'];
|
||||||
if (n._def && n._def.defaults) {
|
const node_def = n && n._def;
|
||||||
properties = properties.concat(Object.keys(n._def.defaults));
|
if (node_def) {
|
||||||
|
if (node_def.defaults) {
|
||||||
|
properties = properties.concat(Object.keys(node_def.defaults));
|
||||||
|
}
|
||||||
|
if (n.type !== "group" && node_def.paletteLabel && node_def.paletteLabel !== node_def.type) {
|
||||||
|
try {
|
||||||
|
const label = ("" + (typeof node_def.paletteLabel === "function" ? node_def.paletteLabel.call(node_def) : node_def.paletteLabel)).toLowerCase();
|
||||||
|
if(label && label !== (""+node_def.type).toLowerCase()) {
|
||||||
|
indexProperty(n, l, label);
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
console.warn(`error indexing ${l}`, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (var i=0;i<properties.length;i++) {
|
for (var i=0;i<properties.length;i++) {
|
||||||
if (n.hasOwnProperty(properties[i])) {
|
if (n.hasOwnProperty(properties[i])) {
|
||||||
@@ -91,44 +106,62 @@ RED.search = (function() {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function search(val) {
|
function extractType(val, flags) {
|
||||||
var results = [];
|
// extracts: type:XYZ & type:"X Y Z"
|
||||||
var keys = [];
|
const regEx = /(?:type):\s*(?:"([^"]+)"|([^" ]+))/;
|
||||||
var typeFilter;
|
let m
|
||||||
var m = /(?:^| )type:([^ ]+)/.exec(val);
|
while ((m = regEx.exec(val)) !== null) {
|
||||||
if (m) {
|
// avoid infinite loops with zero-width matches
|
||||||
val = val.replace(/(?:^| )type:[^ ]+/,"");
|
if (m.index === regEx.lastIndex) {
|
||||||
typeFilter = m[1];
|
regEx.lastIndex++;
|
||||||
|
}
|
||||||
|
val = val.replace(m[0]," ").trim()
|
||||||
|
const flag = m[2] || m[1] // quoted entries in capture group 1, unquoted in capture group 2
|
||||||
|
flags.type = flags.type || [];
|
||||||
|
flags.type.push(flag);
|
||||||
}
|
}
|
||||||
var flags = {};
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
function search(val) {
|
||||||
|
const results = [];
|
||||||
|
const flags = {};
|
||||||
val = extractFlag(val,"invalid",flags);
|
val = extractFlag(val,"invalid",flags);
|
||||||
val = extractFlag(val,"unused",flags);
|
val = extractFlag(val,"unused",flags);
|
||||||
val = extractFlag(val,"config",flags);
|
val = extractFlag(val,"config",flags);
|
||||||
val = extractFlag(val,"subflow",flags);
|
val = extractFlag(val,"subflow",flags);
|
||||||
val = extractFlag(val,"hidden",flags);
|
val = extractFlag(val,"hidden",flags);
|
||||||
// uses:<node-id>
|
val = extractFlag(val,"modified",flags);
|
||||||
val = extractValue(val,"uses",flags);
|
val = extractValue(val,"flow",flags);// flow:current or flow:<flow-id>
|
||||||
|
val = extractValue(val,"uses",flags);// uses:<node-id>
|
||||||
var hasFlags = Object.keys(flags).length > 0;
|
val = extractType(val,flags);// type:<node-type>
|
||||||
|
|
||||||
val = val.trim();
|
val = val.trim();
|
||||||
|
const hasFlags = Object.keys(flags).length > 0;
|
||||||
if (val.length > 0 || typeFilter || hasFlags) {
|
const hasTypeFilter = flags.type && flags.type.length > 0
|
||||||
|
if (flags.flow && flags.flow.indexOf("current") >= 0) {
|
||||||
|
let idx = flags.flow.indexOf("current");
|
||||||
|
flags.flow[idx] = RED.workspaces.active();//convert 'current' to active flow ID
|
||||||
|
}
|
||||||
|
if (flags.flow && flags.flow.length) {
|
||||||
|
flags.flow = [ ...new Set(flags.flow) ]; //deduplicate
|
||||||
|
}
|
||||||
|
if (val.length > 0 || hasFlags) {
|
||||||
val = val.toLowerCase();
|
val = val.toLowerCase();
|
||||||
var i;
|
let i;
|
||||||
var j;
|
let j;
|
||||||
var list = [];
|
let list = [];
|
||||||
var nodes = {};
|
const nodes = {};
|
||||||
|
let keys = [];
|
||||||
if (flags.uses) {
|
if (flags.uses) {
|
||||||
keys = flags.uses;
|
keys = flags.uses;
|
||||||
} else {
|
} else {
|
||||||
keys = Object.keys(index);
|
keys = Object.keys(index);
|
||||||
}
|
}
|
||||||
for (i=0;i<keys.length;i++) {
|
for (i=0;i<keys.length;i++) {
|
||||||
var key = keys[i];
|
const key = keys[i];
|
||||||
var kpos = keys[i].indexOf(val);
|
const kpos = val ? keys[i].indexOf(val) : -1;
|
||||||
if (kpos > -1) {
|
if (kpos > -1 || (val === "" && hasFlags)) {
|
||||||
var ids = Object.keys(index[key]);
|
const ids = Object.keys(index[key]||{});
|
||||||
for (j=0;j<ids.length;j++) {
|
for (j=0;j<ids.length;j++) {
|
||||||
var node = index[key][ids[j]];
|
var node = index[key][ids[j]];
|
||||||
var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
|
var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
|
||||||
@@ -136,7 +169,7 @@ RED.search = (function() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (flags.hasOwnProperty("invalid")) {
|
if (flags.hasOwnProperty("invalid")) {
|
||||||
var nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
|
const nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
|
||||||
if (flags.invalid === nodeIsValid) {
|
if (flags.invalid === nodeIsValid) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -151,6 +184,11 @@ RED.search = (function() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (flags.hasOwnProperty("modified")) {
|
||||||
|
if (!node.node.changed && !node.node.moved) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (flags.hasOwnProperty("hidden")) {
|
if (flags.hasOwnProperty("hidden")) {
|
||||||
// Only tabs can be hidden
|
// Only tabs can be hidden
|
||||||
if (node.node.type !== 'tab') {
|
if (node.node.type !== 'tab') {
|
||||||
@@ -161,18 +199,27 @@ RED.search = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.hasOwnProperty("unused")) {
|
if (flags.hasOwnProperty("unused")) {
|
||||||
var isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
|
const isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
|
||||||
(isConfigNode && node.node.users.length === 0)
|
(isConfigNode && node.node.users.length === 0 && node.node._def.hasUsers !== false)
|
||||||
if (flags.unused !== isUnused) {
|
if (flags.unused !== isUnused) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!typeFilter || node.node.type === typeFilter) {
|
if (flags.hasOwnProperty("flow")) {
|
||||||
nodes[node.node.id] = nodes[node.node.id] = {
|
if (flags.flow.indexOf(node.node.z || node.node.id) < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let typeIndex = -1
|
||||||
|
if(hasTypeFilter) {
|
||||||
|
typeIndex = flags.type.indexOf(node.node.type)
|
||||||
|
}
|
||||||
|
if (!hasTypeFilter || typeIndex > -1) {
|
||||||
|
nodes[node.node.id] = nodes[node.node.id] || {
|
||||||
node: node.node,
|
node: node.node,
|
||||||
label: node.label
|
label: node.label
|
||||||
};
|
};
|
||||||
nodes[node.node.id].index = Math.min(nodes[node.node.id].index||Infinity,kpos);
|
nodes[node.node.id].index = Math.min(nodes[node.node.id].index || Infinity, typeIndex > -1 ? typeIndex : kpos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,6 +252,20 @@ RED.search = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function populateSearchHistory() {
|
||||||
|
if (searchHistory.length > 0) {
|
||||||
|
searchResults.editableList('addItem',{
|
||||||
|
historyHeader: true
|
||||||
|
});
|
||||||
|
searchHistory.forEach(function(entry) {
|
||||||
|
searchResults.editableList('addItem',{
|
||||||
|
history: true,
|
||||||
|
value: entry
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
function createDialog() {
|
function createDialog() {
|
||||||
dialog = $("<div>",{id:"red-ui-search",class:"red-ui-search"}).appendTo("#red-ui-main-container");
|
dialog = $("<div>",{id:"red-ui-search",class:"red-ui-search"}).appendTo("#red-ui-main-container");
|
||||||
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
|
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
|
||||||
@@ -213,9 +274,14 @@ RED.search = (function() {
|
|||||||
change: function() {
|
change: function() {
|
||||||
searchResults.editableList('empty');
|
searchResults.editableList('empty');
|
||||||
selected = -1;
|
selected = -1;
|
||||||
currentResults = search($(this).val());
|
var value = $(this).val();
|
||||||
|
if (value === "") {
|
||||||
|
populateSearchHistory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currentResults = search(value);
|
||||||
if (currentResults.length > 0) {
|
if (currentResults.length > 0) {
|
||||||
for (i=0;i<Math.min(currentResults.length,25);i++) {
|
for (let i=0;i<Math.min(currentResults.length,25);i++) {
|
||||||
searchResults.editableList('addItem',currentResults[i])
|
searchResults.editableList('addItem',currentResults[i])
|
||||||
}
|
}
|
||||||
if (currentResults.length > 25) {
|
if (currentResults.length > 25) {
|
||||||
@@ -229,9 +295,8 @@ RED.search = (function() {
|
|||||||
} else {
|
} else {
|
||||||
searchResults.editableList('addItem',{});
|
searchResults.editableList('addItem',{});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
options: getSearchOptions()
|
||||||
}
|
|
||||||
});
|
});
|
||||||
var copySearchContainer = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-caret-right"></button>').appendTo(searchDiv).on('click', function(evt) {
|
var copySearchContainer = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-caret-right"></button>').appendTo(searchDiv).on('click', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
@@ -285,9 +350,15 @@ RED.search = (function() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} if ($(children[selected]).hasClass("red-ui-search-history")) {
|
||||||
|
var object = $(children[selected]).find(".red-ui-editableList-item-content").data('data');
|
||||||
|
if (object) {
|
||||||
|
searchInput.searchBox('value',object.value)
|
||||||
|
}
|
||||||
|
} else if (!$(children[selected]).hasClass("red-ui-search-historyHeader")) {
|
||||||
if (currentResults.length > 0) {
|
if (currentResults.length > 0) {
|
||||||
reveal(currentResults[Math.max(0,selected)].node);
|
currentIndex = Math.max(0,selected);
|
||||||
|
reveal(currentResults[currentIndex].node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +372,32 @@ RED.search = (function() {
|
|||||||
addItem: function(container,i,object) {
|
addItem: function(container,i,object) {
|
||||||
var node = object.node;
|
var node = object.node;
|
||||||
var div;
|
var div;
|
||||||
if (object.more) {
|
if (object.historyHeader) {
|
||||||
|
container.parent().addClass("red-ui-search-historyHeader")
|
||||||
|
$('<div>',{class:"red-ui-search-empty"}).text(RED._("search.history")).appendTo(container);
|
||||||
|
$('<button type="button" class="red-ui-button red-ui-button-small"></button>').text(RED._("search.clear")).appendTo(container).on("click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
searchHistory = [];
|
||||||
|
searchResults.editableList('empty');
|
||||||
|
});
|
||||||
|
} else if (object.history) {
|
||||||
|
container.parent().addClass("red-ui-search-history")
|
||||||
|
div = $('<a>',{href:'#',class:"red-ui-search-result"}).appendTo(container);
|
||||||
|
div.text(object.value);
|
||||||
|
div.on("click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
searchInput.searchBox('value',object.value)
|
||||||
|
searchInput.focus();
|
||||||
|
})
|
||||||
|
$('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-remove"></i></button>').appendTo(container).on("click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
var index = searchHistory.indexOf(object.value);
|
||||||
|
searchHistory.splice(index,1);
|
||||||
|
searchResults.editableList('removeItem', object);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
} else if (object.more) {
|
||||||
container.parent().addClass("red-ui-search-more")
|
container.parent().addClass("red-ui-search-more")
|
||||||
div = $('<a>',{href:'#',class:"red-ui-search-result red-ui-search-empty"}).appendTo(container);
|
div = $('<a>',{href:'#',class:"red-ui-search-result red-ui-search-empty"}).appendTo(container);
|
||||||
div.text(RED._("palette.editor.more",{count:object.more.results.length-object.more.start}));
|
div.text(RED._("palette.editor.more",{count:object.more.results.length-object.more.start}));
|
||||||
@@ -346,6 +442,7 @@ RED.search = (function() {
|
|||||||
|
|
||||||
div.on("click", function(evt) {
|
div.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
currentIndex = i;
|
||||||
reveal(node);
|
reveal(node);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -356,12 +453,64 @@ RED.search = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reveal(node) {
|
function reveal(node) {
|
||||||
hide();
|
var searchVal = searchInput.val();
|
||||||
|
var existingIndex = searchHistory.indexOf(searchVal);
|
||||||
|
if (existingIndex > -1) {
|
||||||
|
searchHistory.splice(existingIndex,1);
|
||||||
|
}
|
||||||
|
searchHistory.unshift(searchVal);
|
||||||
|
$("#red-ui-view-searchtools-search").data("term", searchVal);
|
||||||
|
activeResults = Object.assign([], currentResults);
|
||||||
|
hide(null, activeResults.length > 0);
|
||||||
RED.view.reveal(node.id);
|
RED.view.reveal(node.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revealPrev() {
|
||||||
|
if (disabled) {
|
||||||
|
updateSearchToolbar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!searchResults || !activeResults.length) {
|
||||||
|
show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (currentIndex > 0) {
|
||||||
|
currentIndex--;
|
||||||
|
} else {
|
||||||
|
currentIndex = activeResults.length - 1;
|
||||||
|
}
|
||||||
|
const n = activeResults[currentIndex];
|
||||||
|
if (n && n.node && n.node.id) {
|
||||||
|
RED.view.reveal(n.node.id);
|
||||||
|
$("#red-ui-view-searchtools-prev").trigger("focus");
|
||||||
|
}
|
||||||
|
updateSearchToolbar();
|
||||||
|
}
|
||||||
|
function revealNext() {
|
||||||
|
if (disabled) {
|
||||||
|
updateSearchToolbar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!searchResults || !activeResults.length) {
|
||||||
|
show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (currentIndex < activeResults.length - 1) {
|
||||||
|
currentIndex++
|
||||||
|
} else {
|
||||||
|
currentIndex = 0;
|
||||||
|
}
|
||||||
|
const n = activeResults[currentIndex];
|
||||||
|
if (n && n.node && n.node.id) {
|
||||||
|
RED.view.reveal(n.node.id);
|
||||||
|
$("#red-ui-view-searchtools-next").trigger("focus");
|
||||||
|
}
|
||||||
|
updateSearchToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
function show(v) {
|
function show(v) {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
updateSearchToolbar();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
@@ -374,16 +523,21 @@ RED.search = (function() {
|
|||||||
|
|
||||||
if (dialog === null) {
|
if (dialog === null) {
|
||||||
createDialog();
|
createDialog();
|
||||||
|
} else {
|
||||||
|
searchResults.editableList('empty');
|
||||||
}
|
}
|
||||||
dialog.slideDown(300);
|
dialog.slideDown(300);
|
||||||
searchInput.searchBox('value',v)
|
searchInput.searchBox('value',v)
|
||||||
|
if (!v || v === "") {
|
||||||
|
populateSearchHistory();
|
||||||
|
}
|
||||||
RED.events.emit("search:open");
|
RED.events.emit("search:open");
|
||||||
visible = true;
|
visible = true;
|
||||||
}
|
}
|
||||||
searchInput.trigger("focus");
|
searchInput.trigger("focus");
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
function hide(el, keepSearchToolbar) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
visible = false;
|
visible = false;
|
||||||
$("#red-ui-header-shade").hide();
|
$("#red-ui-header-shade").hide();
|
||||||
@@ -397,13 +551,37 @@ RED.search = (function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.events.emit("search:close");
|
RED.events.emit("search:close");
|
||||||
if (previousActiveElement) {
|
if (previousActiveElement && (!keepSearchToolbar || !activeResults.length)) {
|
||||||
$(previousActiveElement).trigger("focus");
|
$(previousActiveElement).trigger("focus");
|
||||||
previousActiveElement = null;
|
|
||||||
}
|
}
|
||||||
|
previousActiveElement = null;
|
||||||
|
}
|
||||||
|
if(!keepSearchToolbar) {
|
||||||
|
clearActiveSearch();
|
||||||
|
}
|
||||||
|
updateSearchToolbar();
|
||||||
|
if(keepSearchToolbar && activeResults.length) {
|
||||||
|
$("#red-ui-view-searchtools-next").trigger("focus");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function updateSearchToolbar() {
|
||||||
|
if (!disabled && currentIndex >= 0 && activeResults && activeResults.length) {
|
||||||
|
let term = $("#red-ui-view-searchtools-search").data("term") || "";
|
||||||
|
if (term.length > 16) {
|
||||||
|
term = term.substring(0, 12) + "..."
|
||||||
|
}
|
||||||
|
const i18nSearchCounterData = {
|
||||||
|
term: term,
|
||||||
|
result: (currentIndex + 1),
|
||||||
|
count: activeResults.length
|
||||||
|
}
|
||||||
|
$("#red-ui-view-searchtools-counter").text(RED._('actions.search-counter', i18nSearchCounterData));
|
||||||
|
$("#view-search-tools > :not(:first-child)").show(); //show other tools
|
||||||
|
} else {
|
||||||
|
clearActiveSearch();
|
||||||
|
$("#view-search-tools > :not(:first-child)").hide(); //hide all but search button
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearIndex() {
|
function clearIndex() {
|
||||||
index = {};
|
index = {};
|
||||||
}
|
}
|
||||||
@@ -425,9 +603,29 @@ RED.search = (function() {
|
|||||||
addItemToIndex(item);
|
addItemToIndex(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearActiveSearch() {
|
||||||
|
activeResults = [];
|
||||||
|
currentIndex = 0;
|
||||||
|
$("#red-ui-view-searchtools-search").data("term", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSearchOptions() {
|
||||||
|
return [
|
||||||
|
{label:RED._("search.options.configNodes"), value:"is:config"},
|
||||||
|
{label:RED._("search.options.unusedConfigNodes"), value:"is:config is:unused"},
|
||||||
|
{label:RED._("search.options.modifiedNodes"), value:"is:modified"},
|
||||||
|
{label:RED._("search.options.invalidNodes"), value: "is:invalid"},
|
||||||
|
{label:RED._("search.options.uknownNodes"), value: "type:unknown"},
|
||||||
|
{label:RED._("search.options.unusedSubflows"), value:"is:subflow is:unused"},
|
||||||
|
{label:RED._("search.options.hiddenFlows"), value:"is:hidden"},
|
||||||
|
{label:RED._("search.options.thisFlow"), value:"flow:current"},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
RED.actions.add("core:search",show);
|
RED.actions.add("core:search",show);
|
||||||
|
RED.actions.add("core:search-previous",revealPrev);
|
||||||
|
RED.actions.add("core:search-next",revealNext);
|
||||||
|
|
||||||
RED.events.on("editor:open",function() { disabled = true; });
|
RED.events.on("editor:open",function() { disabled = true; });
|
||||||
RED.events.on("editor:close",function() { disabled = false; });
|
RED.events.on("editor:close",function() { disabled = false; });
|
||||||
@@ -438,11 +636,21 @@ RED.search = (function() {
|
|||||||
|
|
||||||
RED.keyboard.add("red-ui-search","escape",hide);
|
RED.keyboard.add("red-ui-search","escape",hide);
|
||||||
|
|
||||||
|
RED.keyboard.add("view-search-tools","escape",function() {
|
||||||
|
clearActiveSearch();
|
||||||
|
updateSearchToolbar();
|
||||||
|
});
|
||||||
|
|
||||||
$("#red-ui-header-shade").on('mousedown',hide);
|
$("#red-ui-header-shade").on('mousedown',hide);
|
||||||
$("#red-ui-editor-shade").on('mousedown',hide);
|
$("#red-ui-editor-shade").on('mousedown',hide);
|
||||||
$("#red-ui-palette-shade").on('mousedown',hide);
|
$("#red-ui-palette-shade").on('mousedown',hide);
|
||||||
$("#red-ui-sidebar-shade").on('mousedown',hide);
|
$("#red-ui-sidebar-shade").on('mousedown',hide);
|
||||||
|
|
||||||
|
$("#red-ui-view-searchtools-close").on("click", function close() {
|
||||||
|
clearActiveSearch();
|
||||||
|
updateSearchToolbar();
|
||||||
|
});
|
||||||
|
$("#red-ui-view-searchtools-close").trigger("click");
|
||||||
|
|
||||||
RED.events.on("workspace:clear", clearIndex);
|
RED.events.on("workspace:clear", clearIndex);
|
||||||
|
|
||||||
@@ -468,7 +676,8 @@ RED.search = (function() {
|
|||||||
init: init,
|
init: init,
|
||||||
show: show,
|
show: show,
|
||||||
hide: hide,
|
hide: hide,
|
||||||
search: search
|
search: search,
|
||||||
|
getSearchOptions: getSearchOptions
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ RED.sidebar = (function() {
|
|||||||
var sidebar_tabs;
|
var sidebar_tabs;
|
||||||
var knownTabs = {};
|
var knownTabs = {};
|
||||||
|
|
||||||
|
// We store the current sidebar tab id in localStorage as 'last-sidebar-tab'
|
||||||
|
// This is restored when the editor is reloaded.
|
||||||
|
// We use sidebar_tabs.onchange to update localStorage. However that will
|
||||||
|
// also get triggered when the first tab gets added to the tabs - typically
|
||||||
|
// the 'info' tab. So we use the following variable to store the retrieved
|
||||||
|
// value from localStorage before we start adding the actual tabs
|
||||||
|
var lastSessionSelectedTab = null;
|
||||||
|
|
||||||
|
|
||||||
function addTab(title,content,closeable,visible) {
|
function addTab(title,content,closeable,visible) {
|
||||||
var options;
|
var options;
|
||||||
if (typeof title === "string") {
|
if (typeof title === "string") {
|
||||||
@@ -194,16 +203,16 @@ RED.sidebar = (function() {
|
|||||||
RED.events.emit("sidebar:resize");
|
RED.events.emit("sidebar:resize");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSidebar(id) {
|
function showSidebar(id, skipShowSidebar) {
|
||||||
if (id === ":first") {
|
if (id === ":first") {
|
||||||
id = RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])[0]
|
id = lastSessionSelectedTab || RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])[0]
|
||||||
}
|
}
|
||||||
if (id) {
|
if (id) {
|
||||||
if (!containsTab(id) && knownTabs[id]) {
|
if (!containsTab(id) && knownTabs[id]) {
|
||||||
sidebar_tabs.addTab(knownTabs[id]);
|
sidebar_tabs.addTab(knownTabs[id]);
|
||||||
}
|
}
|
||||||
sidebar_tabs.activateTab(id);
|
sidebar_tabs.activateTab(id);
|
||||||
if (!RED.menu.isSelected("menu-item-sidebar")) {
|
if (!skipShowSidebar && !RED.menu.isSelected("menu-item-sidebar")) {
|
||||||
RED.menu.setSelected("menu-item-sidebar",true);
|
RED.menu.setSelected("menu-item-sidebar",true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,6 +236,7 @@ RED.sidebar = (function() {
|
|||||||
if (tab.toolbar) {
|
if (tab.toolbar) {
|
||||||
$(tab.toolbar).show();
|
$(tab.toolbar).show();
|
||||||
}
|
}
|
||||||
|
RED.settings.setLocal("last-sidebar-tab", tab.id)
|
||||||
},
|
},
|
||||||
onremove: function(tab) {
|
onremove: function(tab) {
|
||||||
$(tab.wrapper).hide();
|
$(tab.wrapper).hide();
|
||||||
@@ -255,7 +265,9 @@ RED.sidebar = (function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.popover.tooltip($("#red-ui-sidebar-separator").find(".red-ui-sidebar-control-right"),RED._("keyboard.toggleSidebar"),"core:toggle-sidebar");
|
RED.popover.tooltip($("#red-ui-sidebar-separator").find(".red-ui-sidebar-control-right"),RED._("keyboard.toggleSidebar"),"core:toggle-sidebar");
|
||||||
showSidebar();
|
|
||||||
|
lastSessionSelectedTab = RED.settings.getLocal("last-sidebar-tab")
|
||||||
|
|
||||||
RED.sidebar.info.init();
|
RED.sidebar.info.init();
|
||||||
RED.sidebar.help.init();
|
RED.sidebar.help.init();
|
||||||
RED.sidebar.config.init();
|
RED.sidebar.config.init();
|
||||||
|
|||||||
@@ -27,5 +27,8 @@ RED.state = {
|
|||||||
PANNING: 10,
|
PANNING: 10,
|
||||||
SELECTING_NODE: 11,
|
SELECTING_NODE: 11,
|
||||||
GROUP_DRAGGING: 12,
|
GROUP_DRAGGING: 12,
|
||||||
GROUP_RESIZE: 13
|
GROUP_RESIZE: 13,
|
||||||
|
DETACHED_DRAGGING: 14,
|
||||||
|
SLICING: 15,
|
||||||
|
SLICING_JUNCTION: 16
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ RED.statusBar = (function() {
|
|||||||
function addWidget(options) {
|
function addWidget(options) {
|
||||||
widgets[options.id] = options;
|
widgets[options.id] = options;
|
||||||
var el = $('<span class="red-ui-statusbar-widget"></span>');
|
var el = $('<span class="red-ui-statusbar-widget"></span>');
|
||||||
|
el.prop('id', options.id);
|
||||||
options.element.appendTo(el);
|
options.element.appendTo(el);
|
||||||
if (options.align === 'left') {
|
if (options.align === 'left') {
|
||||||
leftBucket.append(el);
|
leftBucket.append(el);
|
||||||
|
|||||||
@@ -506,6 +506,13 @@ RED.subflow = (function() {
|
|||||||
RED.nodes.groups(id).forEach(function(n) {
|
RED.nodes.groups(id).forEach(function(n) {
|
||||||
removedGroups.push(n);
|
removedGroups.push(n);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var removedJunctions = RED.nodes.junctions(id)
|
||||||
|
for (var i=0;i<removedJunctions.length;i++) {
|
||||||
|
var removedEntities = RED.nodes.removeJunction(removedJunctions[i])
|
||||||
|
removedLinks = removedLinks.concat(removedEntities.links)
|
||||||
|
}
|
||||||
|
|
||||||
var removedConfigNodes = [];
|
var removedConfigNodes = [];
|
||||||
for (var i=0;i<removedNodes.length;i++) {
|
for (var i=0;i<removedNodes.length;i++) {
|
||||||
var removedEntities = RED.nodes.remove(removedNodes[i].id);
|
var removedEntities = RED.nodes.remove(removedNodes[i].id);
|
||||||
@@ -536,6 +543,7 @@ RED.subflow = (function() {
|
|||||||
nodes:removedNodes,
|
nodes:removedNodes,
|
||||||
links:removedLinks,
|
links:removedLinks,
|
||||||
groups: removedGroups,
|
groups: removedGroups,
|
||||||
|
junctions: removedJunctions,
|
||||||
subflows: [activeSubflow]
|
subflows: [activeSubflow]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -604,6 +612,14 @@ RED.subflow = (function() {
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nodeOrJunction(id) {
|
||||||
|
var node = RED.nodes.node(id);
|
||||||
|
if (node) {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
return RED.nodes.junction(id);
|
||||||
|
}
|
||||||
|
|
||||||
function convertToSubflow() {
|
function convertToSubflow() {
|
||||||
var selection = RED.view.selection();
|
var selection = RED.view.selection();
|
||||||
if (!selection.nodes) {
|
if (!selection.nodes) {
|
||||||
@@ -792,14 +808,15 @@ RED.subflow = (function() {
|
|||||||
|
|
||||||
subflow.in.forEach(function(input) {
|
subflow.in.forEach(function(input) {
|
||||||
input.wires.forEach(function(wire) {
|
input.wires.forEach(function(wire) {
|
||||||
var link = {source: input, sourcePort: 0, target: RED.nodes.node(wire.id) }
|
var link = {source: input, sourcePort: 0, target: nodeOrJunction(wire.id) }
|
||||||
new_links.push(link);
|
new_links.push(link);
|
||||||
RED.nodes.addLink(link);
|
RED.nodes.addLink(link);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
subflow.out.forEach(function(output,i) {
|
subflow.out.forEach(function(output,i) {
|
||||||
output.wires.forEach(function(wire) {
|
output.wires.forEach(function(wire) {
|
||||||
var link = {source: RED.nodes.node(wire.id), sourcePort: wire.port , target: output }
|
var link = {source: nodeOrJunction(wire.id), sourcePort: wire.port , target: output }
|
||||||
new_links.push(link);
|
new_links.push(link);
|
||||||
RED.nodes.addLink(link);
|
RED.nodes.addLink(link);
|
||||||
});
|
});
|
||||||
@@ -815,7 +832,7 @@ RED.subflow = (function() {
|
|||||||
n.links = n.links.filter(function(id) {
|
n.links = n.links.filter(function(id) {
|
||||||
var isLocalLink = nodes.hasOwnProperty(id);
|
var isLocalLink = nodes.hasOwnProperty(id);
|
||||||
if (!isLocalLink) {
|
if (!isLocalLink) {
|
||||||
var otherNode = RED.nodes.node(id);
|
var otherNode = nodeOrJunction(id);
|
||||||
if (otherNode && otherNode.links) {
|
if (otherNode && otherNode.links) {
|
||||||
var i = otherNode.links.indexOf(n.id);
|
var i = otherNode.links.indexOf(n.id);
|
||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
@@ -831,7 +848,6 @@ RED.subflow = (function() {
|
|||||||
RED.nodes.moveNodeToTab(n, subflow.id);
|
RED.nodes.moveNodeToTab(n, subflow.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var historyEvent = {
|
var historyEvent = {
|
||||||
t:'createSubflow',
|
t:'createSubflow',
|
||||||
nodes:[subflowInstance.id],
|
nodes:[subflowInstance.id],
|
||||||
@@ -869,6 +885,7 @@ RED.subflow = (function() {
|
|||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
RED.view.updateActive();
|
RED.view.updateActive();
|
||||||
RED.view.select(null);
|
RED.view.select(null);
|
||||||
|
RED.view.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -983,6 +1000,17 @@ RED.subflow = (function() {
|
|||||||
default: inputType
|
default: inputType
|
||||||
})
|
})
|
||||||
input.typedInput('value',val.value)
|
input.typedInput('value',val.value)
|
||||||
|
if (inputType === 'cred') {
|
||||||
|
if (node.credentials) {
|
||||||
|
if (node.credentials[tenv.name]) {
|
||||||
|
input.typedInput('value', node.credentials[tenv.name]);
|
||||||
|
} else if (node.credentials['has_'+tenv.name]) {
|
||||||
|
input.typedInput('value', "__PWRD__")
|
||||||
|
} else {
|
||||||
|
input.typedInput('value', "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
input.val(val.value)
|
input.val(val.value)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
**/
|
**/
|
||||||
RED.sidebar.config = (function() {
|
RED.sidebar.config = (function() {
|
||||||
|
|
||||||
|
let flashingConfigNode;
|
||||||
|
let flashingConfigNodeTimer;
|
||||||
|
|
||||||
var content = document.createElement("div");
|
var content = document.createElement("div");
|
||||||
content.className = "red-ui-sidebar-node-config";
|
content.className = "red-ui-sidebar-node-config";
|
||||||
@@ -145,6 +147,7 @@ RED.sidebar.config = (function() {
|
|||||||
var entry = $('<li class="red-ui-palette-node_id_'+node.id.replace(/\./g,"-")+'"></li>').appendTo(list);
|
var entry = $('<li class="red-ui-palette-node_id_'+node.id.replace(/\./g,"-")+'"></li>').appendTo(list);
|
||||||
var nodeDiv = $('<div class="red-ui-palette-node-config red-ui-palette-node"></div>').appendTo(entry);
|
var nodeDiv = $('<div class="red-ui-palette-node-config red-ui-palette-node"></div>').appendTo(entry);
|
||||||
entry.data('node',node.id);
|
entry.data('node',node.id);
|
||||||
|
nodeDiv.data('node',node.id);
|
||||||
var label = $('<div class="red-ui-palette-label"></div>').text(label).appendTo(nodeDiv);
|
var label = $('<div class="red-ui-palette-label"></div>').text(label).appendTo(nodeDiv);
|
||||||
if (node.d) {
|
if (node.d) {
|
||||||
nodeDiv.addClass("red-ui-palette-node-config-disabled");
|
nodeDiv.addClass("red-ui-palette-node-config-disabled");
|
||||||
@@ -346,10 +349,36 @@ RED.sidebar.config = (function() {
|
|||||||
refreshConfigNodeList();
|
refreshConfigNodeList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllUnusedConfigNodes"));
|
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllConfigNodes"));
|
||||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'), RED._("sidebar.config.showAllUnusedConfigNodes"));
|
RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'), RED._("sidebar.config.showAllUnusedConfigNodes"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function flashConfigNode(el) {
|
||||||
|
if(flashingConfigNode && flashingConfigNode.length) {
|
||||||
|
//cancel current flashing node before flashing new node
|
||||||
|
clearInterval(flashingConfigNodeTimer);
|
||||||
|
flashingConfigNodeTimer = null;
|
||||||
|
flashingConfigNode.children("div").removeClass('highlighted');
|
||||||
|
flashingConfigNode = null;
|
||||||
|
}
|
||||||
|
if(!el || !el.children("div").length) { return; }
|
||||||
|
|
||||||
|
flashingConfigNodeTimer = setInterval(function(flashEndTime) {
|
||||||
|
if (flashEndTime >= Date.now()) {
|
||||||
|
const highlighted = el.children("div").hasClass("highlighted");
|
||||||
|
el.children("div").toggleClass('highlighted', !highlighted)
|
||||||
|
} else {
|
||||||
|
clearInterval(flashingConfigNodeTimer);
|
||||||
|
flashingConfigNodeTimer = null;
|
||||||
|
flashingConfigNode = null;
|
||||||
|
el.children("div").removeClass('highlighted');
|
||||||
|
}
|
||||||
|
}, 100, Date.now() + 2200);
|
||||||
|
flashingConfigNode = el;
|
||||||
|
el.children("div").addClass('highlighted');
|
||||||
|
}
|
||||||
|
|
||||||
function show(id) {
|
function show(id) {
|
||||||
if (typeof id === 'boolean') {
|
if (typeof id === 'boolean') {
|
||||||
if (id) {
|
if (id) {
|
||||||
@@ -374,19 +403,7 @@ RED.sidebar.config = (function() {
|
|||||||
} else if (y<0) {
|
} else if (y<0) {
|
||||||
scrollWindow.animate({scrollTop: '+='+(y-10)},150);
|
scrollWindow.animate({scrollTop: '+='+(y-10)},150);
|
||||||
}
|
}
|
||||||
var flash = 21;
|
flashConfigNode(node, id);
|
||||||
var flashFunc = function() {
|
|
||||||
if ((flash%2)===0) {
|
|
||||||
node.removeClass('node_highlighted');
|
|
||||||
} else {
|
|
||||||
node.addClass('node_highlighted');
|
|
||||||
}
|
|
||||||
flash--;
|
|
||||||
if (flash >= 0) {
|
|
||||||
setTimeout(flashFunc,100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
flashFunc();
|
|
||||||
},100);
|
},100);
|
||||||
}
|
}
|
||||||
RED.sidebar.show("config");
|
RED.sidebar.show("config");
|
||||||
|
|||||||
@@ -20,10 +20,8 @@ RED.sidebar.help = (function() {
|
|||||||
var helpSection;
|
var helpSection;
|
||||||
var panels;
|
var panels;
|
||||||
var panelRatio;
|
var panelRatio;
|
||||||
var helpTopics = [];
|
|
||||||
var treeList;
|
var treeList;
|
||||||
var tocPanel;
|
var tocPanel;
|
||||||
var helpIndex = {};
|
|
||||||
|
|
||||||
function resizeStack() {
|
function resizeStack() {
|
||||||
var h = $(content).parent().height() - toolbar.outerHeight();
|
var h = $(content).parent().height() - toolbar.outerHeight();
|
||||||
@@ -52,7 +50,7 @@ RED.sidebar.help = (function() {
|
|||||||
|
|
||||||
tocPanel = $("<div>", {class: "red-ui-sidebar-help-toc"}).appendTo(stackContainer);
|
tocPanel = $("<div>", {class: "red-ui-sidebar-help-toc"}).appendTo(stackContainer);
|
||||||
var helpPanel = $("<div>").css({
|
var helpPanel = $("<div>").css({
|
||||||
"overflow-y": "scroll"
|
"overflow-y": "auto"
|
||||||
}).appendTo(stackContainer);
|
}).appendTo(stackContainer);
|
||||||
|
|
||||||
panels = RED.panels.create({
|
panels = RED.panels.create({
|
||||||
@@ -64,15 +62,17 @@ RED.sidebar.help = (function() {
|
|||||||
style: "compact",
|
style: "compact",
|
||||||
delay: 100,
|
delay: 100,
|
||||||
change: function() {
|
change: function() {
|
||||||
var val = $(this).val().toLowerCase();
|
const searchFor = $(this).val().toLowerCase();
|
||||||
if (val) {
|
if (searchFor) {
|
||||||
showTOC();
|
showTOC();
|
||||||
var c = treeList.treeList('filter',function(item) {
|
treeList.treeList('filter',function(item) {
|
||||||
if (item.depth === 0) {
|
if (item.depth === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return (item.nodeType && item.nodeType.indexOf(val) > -1) ||
|
let found = item.nodeType && item.nodeType.toLowerCase().indexOf(searchFor) > -1;
|
||||||
(item.subflowLabel && item.subflowLabel.indexOf(val) > -1)
|
found = found || item.subflowLabel && item.subflowLabel.toLowerCase().indexOf(searchFor) > -1;
|
||||||
|
found = found || item.palleteLabel && item.palleteLabel.toLowerCase().indexOf(searchFor) > -1;
|
||||||
|
return found;
|
||||||
},true)
|
},true)
|
||||||
} else {
|
} else {
|
||||||
treeList.treeList('filter',null);
|
treeList.treeList('filter',null);
|
||||||
@@ -95,7 +95,10 @@ RED.sidebar.help = (function() {
|
|||||||
var pendingContentLoad;
|
var pendingContentLoad;
|
||||||
treeList.on('treelistselect', function(e,item) {
|
treeList.on('treelistselect', function(e,item) {
|
||||||
pendingContentLoad = item;
|
pendingContentLoad = item;
|
||||||
if (item.nodeType) {
|
if (item.tour) {
|
||||||
|
RED.tourGuide.run(item.tour);
|
||||||
|
}
|
||||||
|
else if (item.nodeType) {
|
||||||
showNodeTypeHelp(item.nodeType);
|
showNodeTypeHelp(item.nodeType);
|
||||||
} else if (item.content) {
|
} else if (item.content) {
|
||||||
helpSection.empty();
|
helpSection.empty();
|
||||||
@@ -187,7 +190,6 @@ RED.sidebar.help = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function refreshHelpIndex() {
|
function refreshHelpIndex() {
|
||||||
helpTopics = [];
|
|
||||||
var modules = RED.nodes.registry.getModuleList();
|
var modules = RED.nodes.registry.getModuleList();
|
||||||
var moduleNames = Object.keys(modules);
|
var moduleNames = Object.keys(modules);
|
||||||
moduleNames.sort();
|
moduleNames.sort();
|
||||||
@@ -196,15 +198,32 @@ RED.sidebar.help = (function() {
|
|||||||
label: RED._("sidebar.help.nodeHelp"),
|
label: RED._("sidebar.help.nodeHelp"),
|
||||||
children: [],
|
children: [],
|
||||||
expanded: true
|
expanded: true
|
||||||
}
|
};
|
||||||
|
var tours = RED.tourGuide.list().map(function (item) {
|
||||||
|
return {
|
||||||
|
icon: "fa fa-play-circle-o",
|
||||||
|
label: item.label,
|
||||||
|
tour: item.path,
|
||||||
|
};
|
||||||
|
});
|
||||||
var helpData = [
|
var helpData = [
|
||||||
{
|
{
|
||||||
id: 'changelog',
|
label: "Node-RED",
|
||||||
label: "Node-RED v"+RED.settings.version,
|
children: [
|
||||||
content: getChangelog
|
{
|
||||||
|
id: 'changelog',
|
||||||
|
label: RED._("sidebar.help.changeLog"),
|
||||||
|
content: getChangelog
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: RED._("tourGuide.welcomeTours"),
|
||||||
|
children: tours
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
},
|
},
|
||||||
nodeHelp
|
nodeHelp
|
||||||
]
|
];
|
||||||
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
|
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
|
||||||
if (subflows.length > 0) {
|
if (subflows.length > 0) {
|
||||||
nodeHelp.children.push({
|
nodeHelp.children.push({
|
||||||
@@ -224,17 +243,21 @@ RED.sidebar.help = (function() {
|
|||||||
|
|
||||||
|
|
||||||
moduleNames.forEach(function(moduleName) {
|
moduleNames.forEach(function(moduleName) {
|
||||||
var module = modules[moduleName];
|
const module = modules[moduleName];
|
||||||
var nodeTypes = [];
|
const nodeTypes = [];
|
||||||
|
const moduleSets = module.sets;
|
||||||
var setNames = Object.keys(module.sets);
|
const setNames = Object.keys(moduleSets);
|
||||||
setNames.forEach(function(setName) {
|
setNames.forEach(function(setName) {
|
||||||
module.sets[setName].types.forEach(function(nodeType) {
|
const moduleSet = moduleSets[setName];
|
||||||
|
moduleSet.types.forEach(function(nodeType) {
|
||||||
if ($("script[data-help-name='"+nodeType+"']").length) {
|
if ($("script[data-help-name='"+nodeType+"']").length) {
|
||||||
|
const n = {_def:RED.nodes.getType(nodeType),type:nodeType}
|
||||||
|
n.name = getNodePaletteLabel(n);
|
||||||
nodeTypes.push({
|
nodeTypes.push({
|
||||||
id: "node-type:"+nodeType,
|
id: "node-type:"+nodeType,
|
||||||
nodeType: nodeType,
|
nodeType: nodeType,
|
||||||
element:getNodeLabel({_def:RED.nodes.getType(nodeType),type:nodeType})
|
palleteLabel: n.name,
|
||||||
|
element: getNodeLabel(n)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -254,18 +277,21 @@ RED.sidebar.help = (function() {
|
|||||||
treeList.treeList("data",helpData);
|
treeList.treeList("data",helpData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNodeLabel(n) {
|
function getNodePaletteLabel(n) {
|
||||||
var div = $('<div>',{class:"red-ui-node-list-item"});
|
let label = n.name;
|
||||||
var icon = RED.utils.createNodeIcon(n).appendTo(div);
|
|
||||||
var label = n.name;
|
|
||||||
if (!label && n._def && n._def.paletteLabel) {
|
if (!label && n._def && n._def.paletteLabel) {
|
||||||
try {
|
try {
|
||||||
label = (typeof n._def.paletteLabel === "function" ? n._def.paletteLabel.call(n._def) : n._def.paletteLabel)||"";
|
label = (typeof n._def.paletteLabel === "function" ? n._def.paletteLabel.call(n._def) : n._def.paletteLabel)||"";
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label = label || n.type;
|
return label || n.type;
|
||||||
$('<div>',{class:"red-ui-node-label"}).text(n.name||n.type).appendTo(icon);
|
}
|
||||||
|
|
||||||
|
function getNodeLabel(n) {
|
||||||
|
const div = $('<div>',{class:"red-ui-node-list-item"});
|
||||||
|
const icon = RED.utils.createNodeIcon(n).appendTo(div);
|
||||||
|
$('<div>',{class:"red-ui-node-label"}).text(getNodePaletteLabel(n)).appendTo(icon);
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +387,7 @@ RED.sidebar.help = (function() {
|
|||||||
var node = selection.nodes[0];
|
var node = selection.nodes[0];
|
||||||
if (node.type === "subflow" && node.direction) {
|
if (node.type === "subflow" && node.direction) {
|
||||||
// ignore subflow virtual ports
|
// ignore subflow virtual ports
|
||||||
} else if (node.type !== 'group'){
|
} else if (node.type !== 'group' && node.type !== 'junction'){
|
||||||
showNodeTypeHelp(node.type);
|
showNodeTypeHelp(node.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
RED.workspaces.show(n.id, null, true);
|
RED.workspaces.show(n.id, null, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
RED.popover.tooltip(toggleVisibleButton, function () {
|
||||||
|
var isHidden = !div.hasClass("red-ui-info-outline-item-hidden");
|
||||||
|
return RED._("sidebar.info." + (isHidden ? "hideFlow" : "showFlow"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (n.type !== 'subflow') {
|
if (n.type !== 'subflow') {
|
||||||
var toggleButton = $('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
|
var toggleButton = $('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
|
||||||
@@ -268,14 +272,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
options: [
|
options: RED.search.getSearchOptions()
|
||||||
{label:RED._("sidebar.info.search.configNodes"), value:"is:config"},
|
|
||||||
{label:RED._("sidebar.info.search.unusedConfigNodes"), value:"is:config is:unused"},
|
|
||||||
{label:RED._("sidebar.info.search.invalidNodes"), value: "is:invalid"},
|
|
||||||
{label:RED._("sidebar.info.search.uknownNodes"), value: "type:unknown"},
|
|
||||||
{label:RED._("sidebar.info.search.unusedSubflows"), value:"is:subflow is:unused"},
|
|
||||||
{label:RED._("sidebar.info.search.hiddenFlows"), value:"is:hidden"},
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
projectInfo = $('<div class="red-ui-treeList-label red-ui-info-outline-project"><span class="red-ui-treeList-icon"><i class="fa fa-archive"></i></span></div>').hide().appendTo(container)
|
projectInfo = $('<div class="red-ui-treeList-label red-ui-info-outline-project"><span class="red-ui-treeList-icon"><i class="fa fa-archive"></i></span></div>').hide().appendTo(container)
|
||||||
@@ -287,15 +284,18 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
data:getFlowData()
|
data:getFlowData()
|
||||||
})
|
})
|
||||||
treeList.on('treelistselect', function(e,item) {
|
treeList.on('treelistselect', function(e,item) {
|
||||||
var node = RED.nodes.node(item.id) || RED.nodes.group(item.id);
|
var node = RED.nodes.node(item.id) || RED.nodes.group(item.id) || RED.nodes.workspace(item.id) || RED.nodes.subflow(item.id);
|
||||||
if (node) {
|
if (node) {
|
||||||
if (node.type === 'group' || node._def.category !== "config") {
|
RED.sidebar.info.refresh(node);
|
||||||
// RED.view.select({nodes:[node]})
|
// if (node.type === 'group' || node._def.category !== "config") {
|
||||||
} else if (node._def.category === "config") {
|
// // RED.view.select({nodes:[node]})
|
||||||
RED.sidebar.info.refresh(node);
|
// } else if (node._def.category === "config") {
|
||||||
} else {
|
// RED.sidebar.info.refresh(node);
|
||||||
// RED.view.select({nodes:[]})
|
// } else {
|
||||||
}
|
// // RED.view.select({nodes:[]})
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
RED.sidebar.info.refresh(null);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
treeList.on('treelistconfirm', function(e,item) {
|
treeList.on('treelistconfirm', function(e,item) {
|
||||||
@@ -617,6 +617,9 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
objects[n.id].children = missingParents[n.id];
|
objects[n.id].children = missingParents[n.id];
|
||||||
delete missingParents[n.id]
|
delete missingParents[n.id]
|
||||||
}
|
}
|
||||||
|
if (objects[n.id].children.length === 0) {
|
||||||
|
objects[n.id].children.push(getEmptyItem(n.id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var parent = n.g||n.z||"__global__";
|
var parent = n.g||n.z||"__global__";
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ RED.sidebar.info = (function() {
|
|||||||
|
|
||||||
propertiesPanelContent = $("<div>").css({
|
propertiesPanelContent = $("<div>").css({
|
||||||
"flex":"1 1 auto",
|
"flex":"1 1 auto",
|
||||||
"overflow-y":"scroll",
|
"overflow-y":"auto",
|
||||||
}).appendTo(propertiesPanel);
|
}).appendTo(propertiesPanel);
|
||||||
|
|
||||||
|
|
||||||
@@ -163,6 +163,7 @@ RED.sidebar.info = (function() {
|
|||||||
});
|
});
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(node) {
|
function refresh(node) {
|
||||||
if (node === undefined) {
|
if (node === undefined) {
|
||||||
refreshSelection();
|
refreshSelection();
|
||||||
@@ -271,7 +272,7 @@ RED.sidebar.info = (function() {
|
|||||||
objectType = "group";
|
objectType = "group";
|
||||||
}
|
}
|
||||||
$(propRow.children()[0]).text(RED._("sidebar.info."+objectType))
|
$(propRow.children()[0]).text(RED._("sidebar.info."+objectType))
|
||||||
RED.utils.createObjectElement(node.id).appendTo(propRow.children()[1]);
|
RED.utils.createObjectElement(node.id,{sourceId: node.id}).appendTo(propRow.children()[1]);
|
||||||
|
|
||||||
if (node.type === "tab" || node.type === "subflow") {
|
if (node.type === "tab" || node.type === "subflow") {
|
||||||
// If nothing is selected, but we're on a flow or subflow tab.
|
// If nothing is selected, but we're on a flow or subflow tab.
|
||||||
@@ -301,8 +302,8 @@ RED.sidebar.info = (function() {
|
|||||||
if (typeCounts.groups > 0) {
|
if (typeCounts.groups > 0) {
|
||||||
$('<div>').text(RED._("clipboard.group",{count:typeCounts.groups})).appendTo(counts);
|
$('<div>').text(RED._("clipboard.group",{count:typeCounts.groups})).appendTo(counts);
|
||||||
}
|
}
|
||||||
|
} else if (node.type === 'junction') {
|
||||||
|
propertiesPanelHeaderHelp.hide();
|
||||||
} else {
|
} else {
|
||||||
propertiesPanelHeaderHelp.show();
|
propertiesPanelHeaderHelp.show();
|
||||||
|
|
||||||
@@ -365,7 +366,7 @@ RED.sidebar.info = (function() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
RED.utils.createObjectElement(val).appendTo(propRow.children()[1]);
|
RED.utils.createObjectElement(val,{sourceId: node.id}).appendTo(propRow.children()[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,6 +432,7 @@ RED.sidebar.info = (function() {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setInfoText(infoText,target) {
|
function setInfoText(infoText,target) {
|
||||||
var info = addTargetToExternalLinks($('<div class="red-ui-help"><span class="red-ui-text-bidi-aware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(target);
|
var info = addTargetToExternalLinks($('<div class="red-ui-help"><span class="red-ui-text-bidi-aware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(target);
|
||||||
info.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
info.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
||||||
@@ -447,6 +449,7 @@ RED.sidebar.info = (function() {
|
|||||||
$(this).toggleClass('expanded',!isExpanded);
|
$(this).toggleClass('expanded',!isExpanded);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var tips = (function() {
|
var tips = (function() {
|
||||||
var enabled = true;
|
var enabled = true;
|
||||||
var startDelay = 1000;
|
var startDelay = 1000;
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ RED.tourGuide = (function() {
|
|||||||
}
|
}
|
||||||
$('<div>').css("text-align","left").html(getLocaleText(step.description)).appendTo(stepDescription);
|
$('<div>').css("text-align","left").html(getLocaleText(step.description)).appendTo(stepDescription);
|
||||||
|
|
||||||
|
if (step.image) {
|
||||||
|
$(`<img src="red/tours/${step.image}" />`).appendTo(stepDescription)
|
||||||
|
}
|
||||||
|
|
||||||
var stepToolbar = $('<div>',{class:"red-ui-tourGuide-toolbar"}).appendTo(stepContent);
|
var stepToolbar = $('<div>',{class:"red-ui-tourGuide-toolbar"}).appendTo(stepContent);
|
||||||
|
|
||||||
// var breadcrumbs = $('<div>',{class:"red-ui-tourGuide-breadcrumbs"}).appendTo(stepToolbar);
|
// var breadcrumbs = $('<div>',{class:"red-ui-tourGuide-breadcrumbs"}).appendTo(stepToolbar);
|
||||||
@@ -429,9 +433,30 @@ RED.tourGuide = (function() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function listTour() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
id: "3_0",
|
||||||
|
label: "3.0",
|
||||||
|
path: "./tours/welcome.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2_2",
|
||||||
|
label: "2.2",
|
||||||
|
path: "./tours/2.2/welcome.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2_1",
|
||||||
|
label: "2.1",
|
||||||
|
path: "./tours/2.1/welcome.js"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
load: loadTour,
|
load: loadTour,
|
||||||
run: run,
|
run: run,
|
||||||
|
list: listTour,
|
||||||
reset: function() {
|
reset: function() {
|
||||||
RED.settings.set("editor.tours.welcome",'');
|
RED.settings.set("editor.tours.welcome",'');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,13 @@
|
|||||||
raiseTrayZ();
|
raiseTrayZ();
|
||||||
handleWindowResize();//cause call to monaco layout
|
handleWindowResize();//cause call to monaco layout
|
||||||
},200);
|
},200);
|
||||||
body.find(":focusable:first").trigger("focus");
|
if(!options.hasOwnProperty("focusElement")) {
|
||||||
|
//focusElement is not inside options - default to focusing 1st
|
||||||
|
body.find(":focusable:first").trigger("focus");
|
||||||
|
} else if(options.focusElement !== false) {
|
||||||
|
//focusElement IS specified, focus that instead (if not false)
|
||||||
|
$(options.focusElement).trigger("focus");
|
||||||
|
}
|
||||||
|
|
||||||
},150);
|
},150);
|
||||||
el.css({right:0});
|
el.css({right:0});
|
||||||
|
|||||||
@@ -104,7 +104,9 @@ RED.typeSearch = (function() {
|
|||||||
var index = Math.max(0,selected);
|
var index = Math.max(0,selected);
|
||||||
if (index < children.length) {
|
if (index < children.length) {
|
||||||
var n = $(children[index]).find(".red-ui-editableList-item-content").data('data');
|
var n = $(children[index]).find(".red-ui-editableList-item-content").data('data');
|
||||||
typesUsed[n.type] = Date.now();
|
if (!/^_action_:/.test(n.type)) {
|
||||||
|
typesUsed[n.type] = Date.now();
|
||||||
|
}
|
||||||
if (n.def.outputs === 0) {
|
if (n.def.outputs === 0) {
|
||||||
confirm(n);
|
confirm(n);
|
||||||
} else {
|
} else {
|
||||||
@@ -171,18 +173,27 @@ RED.typeSearch = (function() {
|
|||||||
var div = $('<div>',{class:"red-ui-search-result"}).appendTo(container);
|
var div = $('<div>',{class:"red-ui-search-result"}).appendTo(container);
|
||||||
|
|
||||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(div);
|
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(div);
|
||||||
var colour = RED.utils.getNodeColor(object.type,def);
|
if (object.type === "junction") {
|
||||||
|
nodeDiv.addClass("red-ui-palette-icon-junction");
|
||||||
|
} else if (/^_action_:/.test(object.type)) {
|
||||||
|
nodeDiv.addClass("red-ui-palette-icon-junction")
|
||||||
|
} else {
|
||||||
|
var colour = RED.utils.getNodeColor(object.type,def);
|
||||||
|
nodeDiv.css('backgroundColor',colour);
|
||||||
|
}
|
||||||
var icon_url = RED.utils.getNodeIcon(def);
|
var icon_url = RED.utils.getNodeIcon(def);
|
||||||
nodeDiv.css('backgroundColor',colour);
|
|
||||||
|
|
||||||
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
||||||
RED.utils.createIconElement(icon_url, iconContainer, false);
|
RED.utils.createIconElement(icon_url, iconContainer, false);
|
||||||
|
|
||||||
if (def.inputs > 0) {
|
|
||||||
$('<div/>',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv);
|
if (!/^_action_:/.test(object.type) && object.type !== "junction") {
|
||||||
}
|
if (def.inputs > 0) {
|
||||||
if (def.outputs > 0) {
|
$('<div/>',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv);
|
||||||
$('<div/>',{class:"red-ui-search-result-node-port red-ui-search-result-node-output"}).appendTo(nodeDiv);
|
}
|
||||||
|
if (def.outputs > 0) {
|
||||||
|
$('<div/>',{class:"red-ui-search-result-node-port red-ui-search-result-node-output"}).appendTo(nodeDiv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
|
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
|
||||||
@@ -203,7 +214,9 @@ RED.typeSearch = (function() {
|
|||||||
}
|
}
|
||||||
function confirm(def) {
|
function confirm(def) {
|
||||||
hide();
|
hide();
|
||||||
typesUsed[def.type] = Date.now();
|
if (!/^_action_:/.test(def.type)) {
|
||||||
|
typesUsed[def.type] = Date.now();
|
||||||
|
}
|
||||||
addCallback(def.type);
|
addCallback(def.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,8 +269,8 @@ RED.typeSearch = (function() {
|
|||||||
moveCallback = opts.move;
|
moveCallback = opts.move;
|
||||||
RED.events.emit("type-search:open");
|
RED.events.emit("type-search:open");
|
||||||
//shade.show();
|
//shade.show();
|
||||||
if ($("#red-ui-main-container").height() - opts.y - 150 < 0) {
|
if ($("#red-ui-main-container").height() - opts.y - 195 < 0) {
|
||||||
opts.y = opts.y - 235;
|
opts.y = opts.y - 275;
|
||||||
}
|
}
|
||||||
dialog.css({left:opts.x+"px",top:opts.y+"px"}).show();
|
dialog.css({left:opts.x+"px",top:opts.y+"px"}).show();
|
||||||
searchResultsDiv.slideDown(300);
|
searchResultsDiv.slideDown(300);
|
||||||
@@ -312,9 +325,10 @@ RED.typeSearch = (function() {
|
|||||||
function applyFilter(filter,type,def) {
|
function applyFilter(filter,type,def) {
|
||||||
return !filter ||
|
return !filter ||
|
||||||
(
|
(
|
||||||
|
(!filter.spliceMultiple) &&
|
||||||
(!filter.type || type === filter.type) &&
|
(!filter.type || type === filter.type) &&
|
||||||
(!filter.input || def.inputs > 0) &&
|
(!filter.input || type === 'junction' || def.inputs > 0) &&
|
||||||
(!filter.output || def.outputs > 0)
|
(!filter.output || type === 'junction' || def.outputs > 0)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
function refreshTypeList(opts) {
|
function refreshTypeList(opts) {
|
||||||
@@ -323,9 +337,16 @@ RED.typeSearch = (function() {
|
|||||||
searchInput.searchBox('value','').focus();
|
searchInput.searchBox('value','').focus();
|
||||||
selected = -1;
|
selected = -1;
|
||||||
var common = [
|
var common = [
|
||||||
'inject','debug','function','change','switch'
|
'inject','debug','function','change','switch','junction'
|
||||||
].filter(function(t) { return applyFilter(opts.filter,t,RED.nodes.getType(t)); });
|
].filter(function(t) { return applyFilter(opts.filter,t,RED.nodes.getType(t)); });
|
||||||
|
|
||||||
|
// if (opts.filter && opts.filter.input && opts.filter.output && !opts.filter.type) {
|
||||||
|
// if (opts.filter.spliceMultiple) {
|
||||||
|
// common.push('_action_:core:split-wires-with-junctions')
|
||||||
|
// }
|
||||||
|
// common.push('_action_:core:split-wire-with-link-nodes')
|
||||||
|
// }
|
||||||
|
|
||||||
var recentlyUsed = Object.keys(typesUsed);
|
var recentlyUsed = Object.keys(typesUsed);
|
||||||
recentlyUsed.sort(function(a,b) {
|
recentlyUsed.sort(function(a,b) {
|
||||||
return typesUsed[b]-typesUsed[a];
|
return typesUsed[b]-typesUsed[a];
|
||||||
@@ -348,6 +369,11 @@ RED.typeSearch = (function() {
|
|||||||
var index = 0;
|
var index = 0;
|
||||||
for(i=0;i<common.length;i++) {
|
for(i=0;i<common.length;i++) {
|
||||||
var itemDef = RED.nodes.getType(common[i]);
|
var itemDef = RED.nodes.getType(common[i]);
|
||||||
|
if (common[i] === 'junction') {
|
||||||
|
itemDef = { inputs:1, outputs: 1, label: 'junction', type: 'junction'}
|
||||||
|
} else if (/^_action_:/.test(common[i]) ) {
|
||||||
|
itemDef = { inputs:1, outputs: 1, label: common[i], type: common[i]}
|
||||||
|
}
|
||||||
if (itemDef) {
|
if (itemDef) {
|
||||||
item = {
|
item = {
|
||||||
type: common[i],
|
type: common[i],
|
||||||
|
|||||||
@@ -121,6 +121,13 @@ RED.userSettings = (function() {
|
|||||||
// {setting:"theme", label:"Theme",options:function(done){ done([{val:'',text:'default'}].concat(RED.settings.theme("themes"))) }},
|
// {setting:"theme", label:"Theme",options:function(done){ done([{val:'',text:'default'}].concat(RED.settings.theme("themes"))) }},
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
|
{
|
||||||
|
title: "menu.label.view.view",
|
||||||
|
options: [
|
||||||
|
{setting:"view-store-zoom",label:"menu.label.view.storeZoom", default: false, toggle:true, onchange: function(val) { if (!val) { RED.settings.removeLocal("zoom-level")}}},
|
||||||
|
{setting:"view-store-position",label:"menu.label.view.storePosition", default: false, toggle:true, onchange: function(val) { if (!val) { RED.settings.removeLocal("scroll-positions")}}},
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "menu.label.view.grid",
|
title: "menu.label.view.grid",
|
||||||
options: [
|
options: [
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ RED.utils = (function() {
|
|||||||
window._marked.use({extensions: [descriptionList, description] } );
|
window._marked.use({extensions: [descriptionList, description] } );
|
||||||
|
|
||||||
function renderMarkdown(txt) {
|
function renderMarkdown(txt) {
|
||||||
var rendered = _marked(txt);
|
var rendered = _marked.parse(txt);
|
||||||
var cleaned = DOMPurify.sanitize(rendered, {SAFE_FOR_JQUERY: true})
|
var cleaned = DOMPurify.sanitize(rendered, {SAFE_FOR_JQUERY: true})
|
||||||
return cleaned;
|
return cleaned;
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,16 @@ RED.utils = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildMessageElement(obj,options) {
|
/**
|
||||||
|
* Create a DOM element representation of obj - as used by Debug sidebar etc
|
||||||
|
*
|
||||||
|
* @params obj - the data to display
|
||||||
|
* @params options - a bag of options
|
||||||
|
*
|
||||||
|
* - If you want the Copy Value button, then set `sourceId`
|
||||||
|
* - If you want the Copy Path button, also set `path` to the value to be copied
|
||||||
|
*/
|
||||||
|
function createObjectElement(obj,options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var key = options.key;
|
var key = options.key;
|
||||||
var typeHint = options.typeHint;
|
var typeHint = options.typeHint;
|
||||||
@@ -555,7 +564,7 @@ RED.utils = (function() {
|
|||||||
if (fullLength <= 10) {
|
if (fullLength <= 10) {
|
||||||
for (i=0;i<fullLength;i++) {
|
for (i=0;i<fullLength;i++) {
|
||||||
row = $('<div class="red-ui-debug-msg-object-entry collapsed"></div>').appendTo(arrayRows);
|
row = $('<div class="red-ui-debug-msg-object-entry collapsed"></div>').appendTo(arrayRows);
|
||||||
subElements[path+"["+i+"]"] = buildMessageElement(
|
subElements[path+"["+i+"]"] = createObjectElement(
|
||||||
data[i],
|
data[i],
|
||||||
{
|
{
|
||||||
key: ""+i,
|
key: ""+i,
|
||||||
@@ -585,7 +594,7 @@ RED.utils = (function() {
|
|||||||
return function() {
|
return function() {
|
||||||
for (var i=min;i<=max;i++) {
|
for (var i=min;i<=max;i++) {
|
||||||
var row = $('<div class="red-ui-debug-msg-object-entry collapsed"></div>').appendTo(parent);
|
var row = $('<div class="red-ui-debug-msg-object-entry collapsed"></div>').appendTo(parent);
|
||||||
subElements[path+"["+i+"]"] = buildMessageElement(
|
subElements[path+"["+i+"]"] = createObjectElement(
|
||||||
data[i],
|
data[i],
|
||||||
{
|
{
|
||||||
key: ""+i,
|
key: ""+i,
|
||||||
@@ -641,7 +650,7 @@ RED.utils = (function() {
|
|||||||
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
|
newPath += "[\""+keys[i].replace(/"/,"\\\"")+"\"]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subElements[newPath] = buildMessageElement(
|
subElements[newPath] = createObjectElement(
|
||||||
data[keys[i]],
|
data[keys[i]],
|
||||||
{
|
{
|
||||||
key: keys[i],
|
key: keys[i],
|
||||||
@@ -1019,8 +1028,12 @@ RED.utils = (function() {
|
|||||||
return "font-awesome/fa-object-ungroup";
|
return "font-awesome/fa-object-ungroup";
|
||||||
} else if (node && node.type === 'group') {
|
} else if (node && node.type === 'group') {
|
||||||
return "font-awesome/fa-object-group"
|
return "font-awesome/fa-object-group"
|
||||||
|
} else if ((node && node.type === 'junction') || (def.type === "junction") ) {
|
||||||
|
return "font-awesome/fa-circle-o"
|
||||||
} else if (def.category === 'config') {
|
} else if (def.category === 'config') {
|
||||||
return RED.settings.apiRootUrl+"icons/node-red/cog.svg"
|
return RED.settings.apiRootUrl+"icons/node-red/cog.svg"
|
||||||
|
} else if ((node && /^_action_:/.test(node.type)) || /^_action_:/.test(def.type)) {
|
||||||
|
return "font-awesome/fa-cogs"
|
||||||
} else if (node && node.type === 'tab') {
|
} else if (node && node.type === 'tab') {
|
||||||
return "red-ui-icons/red-ui-icons-flow"
|
return "red-ui-icons/red-ui-icons-flow"
|
||||||
// return RED.settings.apiRootUrl+"images/subflow_tab.svg"
|
// return RED.settings.apiRootUrl+"images/subflow_tab.svg"
|
||||||
@@ -1084,6 +1097,8 @@ RED.utils = (function() {
|
|||||||
l = node.label || defaultLabel
|
l = node.label || defaultLabel
|
||||||
} else if (node.type === 'group') {
|
} else if (node.type === 'group') {
|
||||||
l = node.name || defaultLabel
|
l = node.name || defaultLabel
|
||||||
|
} else if (node.type === 'junction') {
|
||||||
|
l = 'junction'
|
||||||
} else {
|
} else {
|
||||||
l = node._def.label;
|
l = node._def.label;
|
||||||
try {
|
try {
|
||||||
@@ -1096,6 +1111,18 @@ RED.utils = (function() {
|
|||||||
return RED.text.bidi.enforceTextDirectionWithUCC(l);
|
return RED.text.bidi.enforceTextDirectionWithUCC(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPaletteLabel(nodeType, def) {
|
||||||
|
var label = nodeType;
|
||||||
|
if (typeof def.paletteLabel !== "undefined") {
|
||||||
|
try {
|
||||||
|
label = (typeof def.paletteLabel === "function" ? def.paletteLabel.call(def) : def.paletteLabel)||"";
|
||||||
|
} catch(err) {
|
||||||
|
console.log("Definition error: "+nodeType+".paletteLabel",err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return label
|
||||||
|
}
|
||||||
|
|
||||||
var nodeColorCache = {};
|
var nodeColorCache = {};
|
||||||
function clearNodeColorCache() {
|
function clearNodeColorCache() {
|
||||||
nodeColorCache = {};
|
nodeColorCache = {};
|
||||||
@@ -1238,6 +1265,8 @@ RED.utils = (function() {
|
|||||||
nodeDiv.addClass("red-ui-palette-icon-selection");
|
nodeDiv.addClass("red-ui-palette-icon-selection");
|
||||||
} else if (node.type === "group") {
|
} else if (node.type === "group") {
|
||||||
nodeDiv.addClass("red-ui-palette-icon-group");
|
nodeDiv.addClass("red-ui-palette-icon-group");
|
||||||
|
} else if (node.type === "junction") {
|
||||||
|
nodeDiv.addClass("red-ui-palette-icon-junction");
|
||||||
} else if (node.type === 'tab') {
|
} else if (node.type === 'tab') {
|
||||||
nodeDiv.addClass("red-ui-palette-icon-flow");
|
nodeDiv.addClass("red-ui-palette-icon-flow");
|
||||||
} else {
|
} else {
|
||||||
@@ -1369,7 +1398,7 @@ RED.utils = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
createObjectElement: buildMessageElement,
|
createObjectElement: createObjectElement,
|
||||||
getMessageProperty: getMessageProperty,
|
getMessageProperty: getMessageProperty,
|
||||||
setMessageProperty: setMessageProperty,
|
setMessageProperty: setMessageProperty,
|
||||||
normalisePropertyExpression: normalisePropertyExpression,
|
normalisePropertyExpression: normalisePropertyExpression,
|
||||||
@@ -1379,6 +1408,7 @@ RED.utils = (function() {
|
|||||||
getNodeIcon: getNodeIcon,
|
getNodeIcon: getNodeIcon,
|
||||||
getNodeLabel: getNodeLabel,
|
getNodeLabel: getNodeLabel,
|
||||||
getNodeColor: getNodeColor,
|
getNodeColor: getNodeColor,
|
||||||
|
getPaletteLabel: getPaletteLabel,
|
||||||
clearNodeColorCache: clearNodeColorCache,
|
clearNodeColorCache: clearNodeColorCache,
|
||||||
addSpinnerOverlay: addSpinnerOverlay,
|
addSpinnerOverlay: addSpinnerOverlay,
|
||||||
decodeObject: decodeObject,
|
decodeObject: decodeObject,
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ RED.view.tools = (function() {
|
|||||||
$(document).one('keyup',endKeyboardMove);
|
$(document).one('keyup',endKeyboardMove);
|
||||||
endMoveSet = true;
|
endMoveSet = true;
|
||||||
}
|
}
|
||||||
|
var dim = RED.view.dimensions();
|
||||||
|
var space_width = dim.width;
|
||||||
|
var space_height = dim.height;
|
||||||
var minX = 0;
|
var minX = 0;
|
||||||
var minY = 0;
|
var minY = 0;
|
||||||
var node;
|
var node;
|
||||||
@@ -120,6 +123,12 @@ RED.view.tools = (function() {
|
|||||||
node.n.dirty = true;
|
node.n.dirty = true;
|
||||||
node.n.x += dx;
|
node.n.x += dx;
|
||||||
node.n.y += dy;
|
node.n.y += dy;
|
||||||
|
if ((node.n.x +node.n.w/2) >= space_width) {
|
||||||
|
node.n.x = space_width -node.n.w/2;
|
||||||
|
}
|
||||||
|
if ((node.n.y +node.n.h/2) >= space_height) {
|
||||||
|
node.n.y = space_height -node.n.h/2;
|
||||||
|
}
|
||||||
node.n.dirty = true;
|
node.n.dirty = true;
|
||||||
if (node.n.type === "group") {
|
if (node.n.type === "group") {
|
||||||
RED.group.markDirty(node.n);
|
RED.group.markDirty(node.n);
|
||||||
@@ -336,17 +345,17 @@ RED.view.tools = (function() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addNode() {
|
// function addNode() {
|
||||||
var selection = RED.view.selection();
|
// var selection = RED.view.selection();
|
||||||
if (selection.nodes && selection.nodes.length === 1 && selection.nodes[0].outputs > 0) {
|
// if (selection.nodes && selection.nodes.length === 1 && selection.nodes[0].outputs > 0) {
|
||||||
var selectedNode = selection.nodes[0];
|
// var selectedNode = selection.nodes[0];
|
||||||
RED.view.showQuickAddDialog([
|
// RED.view.showQuickAddDialog([
|
||||||
selectedNode.x + selectedNode.w + 50,selectedNode.y
|
// selectedNode.x + selectedNode.w + 50,selectedNode.y
|
||||||
])
|
// ])
|
||||||
} else {
|
// } else {
|
||||||
RED.view.showQuickAddDialog();
|
// RED.view.showQuickAddDialog();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
function gotoNearestNode(direction) {
|
function gotoNearestNode(direction) {
|
||||||
@@ -725,6 +734,464 @@ RED.view.tools = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wireSeriesOfNodes() {
|
||||||
|
var selection = RED.view.selection();
|
||||||
|
if (selection.nodes) {
|
||||||
|
if (selection.nodes.length > 1) {
|
||||||
|
var i = 0;
|
||||||
|
var newLinks = [];
|
||||||
|
while (i < selection.nodes.length - 1) {
|
||||||
|
var nodeA = selection.nodes[i];
|
||||||
|
var nodeB = selection.nodes[i+1];
|
||||||
|
if (nodeA.outputs > 0 && nodeB.inputs > 0) {
|
||||||
|
var existingLinks = RED.nodes.filterLinks({
|
||||||
|
source: nodeA,
|
||||||
|
target: nodeB,
|
||||||
|
sourcePort: 0
|
||||||
|
})
|
||||||
|
if (existingLinks.length === 0) {
|
||||||
|
var newLink = {
|
||||||
|
source: nodeA,
|
||||||
|
target: nodeB,
|
||||||
|
sourcePort: 0
|
||||||
|
}
|
||||||
|
RED.nodes.addLink(newLink);
|
||||||
|
newLinks.push(newLink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (newLinks.length > 0) {
|
||||||
|
RED.history.push({
|
||||||
|
t: 'add',
|
||||||
|
links: newLinks,
|
||||||
|
dirty: RED.nodes.dirty()
|
||||||
|
})
|
||||||
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.redraw(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function wireNodeToMultiple() {
|
||||||
|
var selection = RED.view.selection();
|
||||||
|
if (selection.nodes) {
|
||||||
|
if (selection.nodes.length > 1) {
|
||||||
|
var sourceNode = selection.nodes[0];
|
||||||
|
if (sourceNode.outputs === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var i = 1;
|
||||||
|
var newLinks = [];
|
||||||
|
while (i < selection.nodes.length) {
|
||||||
|
var targetNode = selection.nodes[i];
|
||||||
|
if (targetNode.inputs > 0) {
|
||||||
|
var existingLinks = RED.nodes.filterLinks({
|
||||||
|
source: sourceNode,
|
||||||
|
target: targetNode,
|
||||||
|
sourcePort: Math.min(sourceNode.outputs-1,i-1)
|
||||||
|
})
|
||||||
|
if (existingLinks.length === 0) {
|
||||||
|
var newLink = {
|
||||||
|
source: sourceNode,
|
||||||
|
target: targetNode,
|
||||||
|
sourcePort: Math.min(sourceNode.outputs-1,i-1)
|
||||||
|
}
|
||||||
|
RED.nodes.addLink(newLink);
|
||||||
|
newLinks.push(newLink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (newLinks.length > 0) {
|
||||||
|
RED.history.push({
|
||||||
|
t: 'add',
|
||||||
|
links: newLinks,
|
||||||
|
dirty: RED.nodes.dirty()
|
||||||
|
})
|
||||||
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.redraw(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits selected wires and re-joins them with link-out+link-in
|
||||||
|
* @param {Object || Object[]} wires The wire(s) to split and replace with link-out, link-in nodes.
|
||||||
|
*/
|
||||||
|
function splitWiresWithLinkNodes(wires) {
|
||||||
|
let wiresToSplit = wires || (RED.view.selection().links && RED.view.selection().links.filter(e => !e.link));
|
||||||
|
if (!wiresToSplit) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!Array.isArray(wiresToSplit)) {
|
||||||
|
wiresToSplit = [wiresToSplit];
|
||||||
|
}
|
||||||
|
if (wiresToSplit.length < 1) {
|
||||||
|
return; //nothing selected
|
||||||
|
}
|
||||||
|
|
||||||
|
const history = {
|
||||||
|
t: 'multi',
|
||||||
|
events: [],
|
||||||
|
dirty: RED.nodes.dirty()
|
||||||
|
}
|
||||||
|
const nodeSrcMap = {};
|
||||||
|
const nodeTrgMap = {};
|
||||||
|
const _gridSize = RED.view.gridSize();
|
||||||
|
|
||||||
|
for (let wireIdx = 0; wireIdx < wiresToSplit.length; wireIdx++) {
|
||||||
|
const wire = wiresToSplit[wireIdx];
|
||||||
|
|
||||||
|
//get source and target nodes of this wire link
|
||||||
|
const nSrc = wire.source;
|
||||||
|
const nTrg = wire.target;
|
||||||
|
|
||||||
|
var updateNewNodePosXY = function (origNode, newNode, alignLeft, snap, yOffset) {
|
||||||
|
const nnSize = RED.view.calculateNodeDimensions(newNode);
|
||||||
|
newNode.w = nnSize[0];
|
||||||
|
newNode.h = nnSize[1];
|
||||||
|
const coords = { x: origNode.x || 0, y: origNode.y || 0, w: origNode.w || RED.view.node_width, h: origNode.h || RED.view.node_height };
|
||||||
|
const x = coords.x - (coords.w/2.0);
|
||||||
|
if (alignLeft) {
|
||||||
|
coords.x = x - _gridSize - (newNode.w/2.0);
|
||||||
|
} else {
|
||||||
|
coords.x = x + coords.w + _gridSize + (newNode.w/2.0);
|
||||||
|
}
|
||||||
|
newNode.x = coords.x;
|
||||||
|
newNode.y = coords.y;
|
||||||
|
if (snap !== false) {
|
||||||
|
const offsets = RED.view.tools.calculateGridSnapOffsets(newNode);
|
||||||
|
newNode.x -= offsets.x;
|
||||||
|
newNode.y -= offsets.y;
|
||||||
|
}
|
||||||
|
newNode.y += (yOffset || 0);
|
||||||
|
}
|
||||||
|
const srcPort = (wire.sourcePort || 0);
|
||||||
|
let linkOutMapId = nSrc.id + ':' + srcPort;
|
||||||
|
let nnLinkOut = nodeSrcMap[linkOutMapId];
|
||||||
|
//Create a Link Out if one is not already present
|
||||||
|
if(!nnLinkOut) {
|
||||||
|
const nLinkOut = RED.view.createNode("link out"); //create link node
|
||||||
|
nnLinkOut = nLinkOut.node;
|
||||||
|
nodeSrcMap[linkOutMapId] = nnLinkOut;
|
||||||
|
let yOffset = 0;
|
||||||
|
if(nSrc.outputs > 1) {
|
||||||
|
|
||||||
|
const CENTER_PORT = (((nSrc.outputs-1) / 2) + 1);
|
||||||
|
const offsetCount = Math.abs(CENTER_PORT - (srcPort + 1));
|
||||||
|
yOffset = (_gridSize * 2 * offsetCount);
|
||||||
|
if((srcPort + 1) < CENTER_PORT) {
|
||||||
|
yOffset = -yOffset;
|
||||||
|
}
|
||||||
|
updateNewNodePosXY(nSrc, nnLinkOut, false, false, yOffset);
|
||||||
|
} else {
|
||||||
|
updateNewNodePosXY(nSrc, nnLinkOut, false, RED.view.snapGrid, yOffset);
|
||||||
|
}
|
||||||
|
//add created node
|
||||||
|
RED.nodes.add(nnLinkOut);
|
||||||
|
RED.editor.validateNode(nnLinkOut);
|
||||||
|
history.events.push(nLinkOut.historyEvent);
|
||||||
|
//connect node to link node
|
||||||
|
const link = {
|
||||||
|
source: nSrc,
|
||||||
|
sourcePort: wire.sourcePort || 0,
|
||||||
|
target: nnLinkOut
|
||||||
|
};
|
||||||
|
RED.nodes.addLink(link);
|
||||||
|
history.events.push({
|
||||||
|
t: 'add',
|
||||||
|
links: [link],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let nnLinkIn = nodeTrgMap[nTrg.id];
|
||||||
|
//Create a Link In if one is not already present
|
||||||
|
if(!nnLinkIn) {
|
||||||
|
const nLinkIn = RED.view.createNode("link in"); //create link node
|
||||||
|
nnLinkIn = nLinkIn.node;
|
||||||
|
nodeTrgMap[nTrg.id] = nnLinkIn;
|
||||||
|
updateNewNodePosXY(nTrg, nnLinkIn, true, RED.view.snapGrid, 0);
|
||||||
|
//add created node
|
||||||
|
RED.nodes.add(nnLinkIn);
|
||||||
|
RED.editor.validateNode(nnLinkIn);
|
||||||
|
history.events.push(nLinkIn.historyEvent);
|
||||||
|
//connect node to link node
|
||||||
|
const link = {
|
||||||
|
source: nnLinkIn,
|
||||||
|
sourcePort: 0,
|
||||||
|
target: nTrg
|
||||||
|
};
|
||||||
|
RED.nodes.addLink(link);
|
||||||
|
history.events.push({
|
||||||
|
t: 'add',
|
||||||
|
links: [link],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//connect the link out/link in virtual wires
|
||||||
|
if(nnLinkIn.links.indexOf(nnLinkOut.id) == -1) {
|
||||||
|
nnLinkIn.links.push(nnLinkOut.id);
|
||||||
|
}
|
||||||
|
if(nnLinkOut.links.indexOf(nnLinkIn.id) == -1) {
|
||||||
|
nnLinkOut.links.push(nnLinkIn.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete the original wire
|
||||||
|
RED.nodes.removeLink(wire);
|
||||||
|
history.events.push({
|
||||||
|
t: "delete",
|
||||||
|
links: [wire]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//add all history events to stack
|
||||||
|
RED.history.push(history);
|
||||||
|
|
||||||
|
//select all downstream of new link-in nodes so user can drag to new location
|
||||||
|
RED.view.clearSelection();
|
||||||
|
RED.view.select({nodes: Object.values(nodeTrgMap) });
|
||||||
|
selectConnected("down");
|
||||||
|
|
||||||
|
//update the view
|
||||||
|
RED.nodes.dirty(true);
|
||||||
|
RED.view.redraw(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the required offsets to snap a node
|
||||||
|
* @param {Object} node The node to calculate grid snap offsets for
|
||||||
|
* @param {Object} [options] Options: `align` can be "nearest", "left" or "right"
|
||||||
|
* @returns `{x:number, y:number}` as the offsets to deduct from `x` and `y`
|
||||||
|
*/
|
||||||
|
function calculateGridSnapOffsets(node, options) {
|
||||||
|
options = options || { align: "nearest" };
|
||||||
|
const gridOffset = { x: 0, y: 0 };
|
||||||
|
const gridSize = RED.view.gridSize();
|
||||||
|
const offsetLeft = node.x - (gridSize * Math.round((node.x - node.w / 2) / gridSize) + node.w / 2);
|
||||||
|
const offsetRight = node.x - (gridSize * Math.round((node.x + node.w / 2) / gridSize) - node.w / 2);
|
||||||
|
gridOffset.x = offsetRight;
|
||||||
|
if (options.align === "right") {
|
||||||
|
//skip - already set to right
|
||||||
|
} else if (options.align === "left" || Math.abs(offsetLeft) < Math.abs(offsetRight)) {
|
||||||
|
gridOffset.x = offsetLeft;
|
||||||
|
}
|
||||||
|
gridOffset.y = node.y - (gridSize * Math.round(node.y / gridSize));
|
||||||
|
return gridOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate names for the select nodes.
|
||||||
|
* - it only sets the name if it is currently blank
|
||||||
|
* - it uses `<paletteLabel> <N>` - where N is the next available integer that
|
||||||
|
* doesn't clash with any existing nodes of that type
|
||||||
|
* @param {Object} node The node to set the name of - if not provided, uses current selection
|
||||||
|
* @param {{ renameBlank: boolean, renameClash: boolean, generateHistory: boolean }} options Possible options are `renameBlank`, `renameClash` and `generateHistory`
|
||||||
|
*/
|
||||||
|
function generateNodeNames(node, options) {
|
||||||
|
options = Object.assign({
|
||||||
|
renameBlank: true,
|
||||||
|
renameClash: true,
|
||||||
|
generateHistory: true
|
||||||
|
}, options)
|
||||||
|
let nodes = node;
|
||||||
|
if (node) {
|
||||||
|
if (!Array.isArray(node)) {
|
||||||
|
nodes = [ node ]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nodes = RED.view.selection().nodes;
|
||||||
|
}
|
||||||
|
if (nodes && nodes.length > 0) {
|
||||||
|
// Generate history event if using the workspace selection,
|
||||||
|
// or if the provided node already exists
|
||||||
|
const generateHistory = options.generateHistory && (!node || !!RED.nodes.node(node.id))
|
||||||
|
const historyEvents = []
|
||||||
|
const typeIndex = {}
|
||||||
|
let changed = false;
|
||||||
|
nodes.forEach(n => {
|
||||||
|
const nodeDef = n._def || RED.nodes.getType(n.type)
|
||||||
|
if (nodeDef && nodeDef.defaults && nodeDef.defaults.name) {
|
||||||
|
const paletteLabel = RED.utils.getPaletteLabel(n.type, nodeDef)
|
||||||
|
const defaultNodeNameRE = new RegExp('^'+paletteLabel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')+' (\\d+)$')
|
||||||
|
if (!typeIndex.hasOwnProperty(n.type)) {
|
||||||
|
const existingNodes = RED.nodes.filterNodes({type: n.type})
|
||||||
|
let maxNameNumber = 0;
|
||||||
|
existingNodes.forEach(n => {
|
||||||
|
let match = defaultNodeNameRE.exec(n.name)
|
||||||
|
if (match) {
|
||||||
|
let nodeNumber = parseInt(match[1])
|
||||||
|
if (nodeNumber > maxNameNumber) {
|
||||||
|
maxNameNumber = nodeNumber
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeIndex[n.type] = maxNameNumber + 1
|
||||||
|
}
|
||||||
|
if ((options.renameBlank && n.name === '') || (options.renameClash && defaultNodeNameRE.test(n.name))) {
|
||||||
|
if (generateHistory) {
|
||||||
|
historyEvents.push({
|
||||||
|
t:'edit',
|
||||||
|
node: n,
|
||||||
|
changes: { name: n.name },
|
||||||
|
dirty: RED.nodes.dirty(),
|
||||||
|
changed: n.changed
|
||||||
|
})
|
||||||
|
}
|
||||||
|
n.name = paletteLabel+" "+typeIndex[n.type]
|
||||||
|
n.dirty = true
|
||||||
|
typeIndex[n.type]++
|
||||||
|
changed = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (changed) {
|
||||||
|
if (historyEvents.length > 0) {
|
||||||
|
RED.history.push({
|
||||||
|
t: 'multi',
|
||||||
|
events: historyEvents
|
||||||
|
})
|
||||||
|
}
|
||||||
|
RED.nodes.dirty(true)
|
||||||
|
RED.view.redraw()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addJunctionsToWires(wires) {
|
||||||
|
let wiresToSplit = wires || (RED.view.selection().links && RED.view.selection().links.filter(e => !e.link));
|
||||||
|
if (!wiresToSplit) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!Array.isArray(wiresToSplit)) {
|
||||||
|
wiresToSplit = [wiresToSplit];
|
||||||
|
}
|
||||||
|
if (wiresToSplit.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var removedLinks = new Set()
|
||||||
|
var addedLinks = []
|
||||||
|
var addedJunctions = []
|
||||||
|
|
||||||
|
var groupedLinks = {}
|
||||||
|
wiresToSplit.forEach(function(l) {
|
||||||
|
var sourceId = l.source.id+":"+l.sourcePort
|
||||||
|
groupedLinks[sourceId] = groupedLinks[sourceId] || []
|
||||||
|
groupedLinks[sourceId].push(l)
|
||||||
|
|
||||||
|
groupedLinks[l.target.id] = groupedLinks[l.target.id] || []
|
||||||
|
groupedLinks[l.target.id].push(l)
|
||||||
|
});
|
||||||
|
var linkGroups = Object.keys(groupedLinks)
|
||||||
|
linkGroups.sort(function(A,B) {
|
||||||
|
return groupedLinks[B].length - groupedLinks[A].length
|
||||||
|
})
|
||||||
|
const wasDirty = RED.nodes.dirty()
|
||||||
|
linkGroups.forEach(function(gid) {
|
||||||
|
var links = groupedLinks[gid]
|
||||||
|
var junction = {
|
||||||
|
_def: {defaults:{}},
|
||||||
|
type: 'junction',
|
||||||
|
z: RED.workspaces.active(),
|
||||||
|
id: RED.nodes.id(),
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
w: 0, h: 0,
|
||||||
|
outputs: 1,
|
||||||
|
inputs: 1,
|
||||||
|
dirty: true
|
||||||
|
}
|
||||||
|
links = links.filter(function(l) { return !removedLinks.has(l) })
|
||||||
|
if (links.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let pointCount = 0
|
||||||
|
links.forEach(function(l) {
|
||||||
|
if (l._sliceLocation) {
|
||||||
|
junction.x += l._sliceLocation.x
|
||||||
|
junction.y += l._sliceLocation.y
|
||||||
|
delete l._sliceLocation
|
||||||
|
pointCount++
|
||||||
|
} else {
|
||||||
|
junction.x += l.source.x + l.source.w/2 + l.target.x - l.target.w/2
|
||||||
|
junction.y += l.source.y + l.target.y
|
||||||
|
pointCount += 2
|
||||||
|
}
|
||||||
|
})
|
||||||
|
junction.x = Math.round(junction.x/pointCount)
|
||||||
|
junction.y = Math.round(junction.y/pointCount)
|
||||||
|
if (RED.view.snapGrid) {
|
||||||
|
let gridSize = RED.view.gridSize()
|
||||||
|
junction.x = (gridSize*Math.round(junction.x/gridSize));
|
||||||
|
junction.y = (gridSize*Math.round(junction.y/gridSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
var nodeGroups = new Set()
|
||||||
|
|
||||||
|
RED.nodes.addJunction(junction)
|
||||||
|
addedJunctions.push(junction)
|
||||||
|
let newLink
|
||||||
|
if (gid === links[0].source.id+":"+links[0].sourcePort) {
|
||||||
|
newLink = {
|
||||||
|
source: links[0].source,
|
||||||
|
sourcePort: links[0].sourcePort,
|
||||||
|
target: junction
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newLink = {
|
||||||
|
source: junction,
|
||||||
|
sourcePort: 0,
|
||||||
|
target: links[0].target
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addedLinks.push(newLink)
|
||||||
|
RED.nodes.addLink(newLink)
|
||||||
|
links.forEach(function(l) {
|
||||||
|
removedLinks.add(l)
|
||||||
|
RED.nodes.removeLink(l)
|
||||||
|
let newLink
|
||||||
|
if (gid === l.target.id) {
|
||||||
|
newLink = {
|
||||||
|
source: l.source,
|
||||||
|
sourcePort: l.sourcePort,
|
||||||
|
target: junction
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newLink = {
|
||||||
|
source: junction,
|
||||||
|
sourcePort: 0,
|
||||||
|
target: l.target
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addedLinks.push(newLink)
|
||||||
|
RED.nodes.addLink(newLink)
|
||||||
|
nodeGroups.add(l.source.g || "__NONE__")
|
||||||
|
nodeGroups.add(l.target.g || "__NONE__")
|
||||||
|
})
|
||||||
|
if (nodeGroups.size === 1) {
|
||||||
|
var group = nodeGroups.values().next().value
|
||||||
|
if (group !== "__NONE__") {
|
||||||
|
RED.group.addToGroup(RED.nodes.group(group), junction)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (addedJunctions.length > 0) {
|
||||||
|
RED.history.push({
|
||||||
|
dirty: wasDirty,
|
||||||
|
t: 'add',
|
||||||
|
links: addedLinks,
|
||||||
|
junctions: addedJunctions,
|
||||||
|
removedLinks: Array.from(removedLinks)
|
||||||
|
})
|
||||||
|
RED.nodes.dirty(true)
|
||||||
|
RED.view.select({nodes: addedJunctions });
|
||||||
|
}
|
||||||
|
RED.view.redraw(true);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function() {
|
init: function() {
|
||||||
RED.actions.add("core:show-selected-node-labels", function() { setSelectedNodeLabelState(true); })
|
RED.actions.add("core:show-selected-node-labels", function() { setSelectedNodeLabelState(true); })
|
||||||
@@ -783,7 +1250,13 @@ RED.view.tools = (function() {
|
|||||||
RED.actions.add("core:distribute-selection-horizontally", function() { distributeSelection('h') })
|
RED.actions.add("core:distribute-selection-horizontally", function() { distributeSelection('h') })
|
||||||
RED.actions.add("core:distribute-selection-vertically", function() { distributeSelection('v') })
|
RED.actions.add("core:distribute-selection-vertically", function() { distributeSelection('v') })
|
||||||
|
|
||||||
|
RED.actions.add("core:wire-series-of-nodes", function() { wireSeriesOfNodes() })
|
||||||
|
RED.actions.add("core:wire-node-to-multiple", function() { wireNodeToMultiple() })
|
||||||
|
|
||||||
|
RED.actions.add("core:split-wire-with-link-nodes", function () { splitWiresWithLinkNodes() });
|
||||||
|
RED.actions.add("core:split-wires-with-junctions", function () { addJunctionsToWires() });
|
||||||
|
|
||||||
|
RED.actions.add("core:generate-node-names", generateNodeNames )
|
||||||
|
|
||||||
// RED.actions.add("core:add-node", function() { addNode() })
|
// RED.actions.add("core:add-node", function() { addNode() })
|
||||||
},
|
},
|
||||||
@@ -796,7 +1269,8 @@ RED.view.tools = (function() {
|
|||||||
* @param {Number} dx
|
* @param {Number} dx
|
||||||
* @param {Number} dy
|
* @param {Number} dy
|
||||||
*/
|
*/
|
||||||
moveSelection: moveSelection
|
moveSelection: moveSelection,
|
||||||
|
calculateGridSnapOffsets: calculateGridSnapOffsets
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
1664
packages/node_modules/@node-red/editor-client/src/js/ui/view.js
vendored
Executable file → Normal file
1664
packages/node_modules/@node-red/editor-client/src/js/ui/view.js
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,9 @@ RED.workspaces = (function() {
|
|||||||
var hideStack = [];
|
var hideStack = [];
|
||||||
var viewStackPos = 0;
|
var viewStackPos = 0;
|
||||||
|
|
||||||
|
let flashingTab;
|
||||||
|
let flashingTabTimer;
|
||||||
|
|
||||||
function addToViewStack(id) {
|
function addToViewStack(id) {
|
||||||
if (viewStackPos !== viewStack.length) {
|
if (viewStackPos !== viewStack.length) {
|
||||||
viewStack.splice(viewStackPos);
|
viewStack.splice(viewStackPos);
|
||||||
@@ -66,7 +69,7 @@ RED.workspaces = (function() {
|
|||||||
var tabId = RED.nodes.id();
|
var tabId = RED.nodes.id();
|
||||||
do {
|
do {
|
||||||
workspaceIndex += 1;
|
workspaceIndex += 1;
|
||||||
} while ($("#red-ui-workspace-tabs a[title='"+RED._('workspace.defaultName',{number:workspaceIndex})+"']").size() !== 0);
|
} while ($("#red-ui-workspace-tabs li[flowname='"+RED._('workspace.defaultName',{number:workspaceIndex})+"']").size() !== 0);
|
||||||
|
|
||||||
ws = {
|
ws = {
|
||||||
type: "tab",
|
type: "tab",
|
||||||
@@ -79,12 +82,15 @@ RED.workspaces = (function() {
|
|||||||
};
|
};
|
||||||
RED.nodes.addWorkspace(ws,targetIndex);
|
RED.nodes.addWorkspace(ws,targetIndex);
|
||||||
workspace_tabs.addTab(ws,targetIndex);
|
workspace_tabs.addTab(ws,targetIndex);
|
||||||
|
|
||||||
workspace_tabs.activateTab(tabId);
|
workspace_tabs.activateTab(tabId);
|
||||||
if (!skipHistoryEntry) {
|
if (!skipHistoryEntry) {
|
||||||
RED.history.push({t:'add',workspaces:[ws],dirty:RED.nodes.dirty()});
|
RED.history.push({t:'add',workspaces:[ws],dirty:RED.nodes.dirty()});
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$("#red-ui-tab-"+(ws.id.replace(".","-"))).attr("flowname",ws.label)
|
||||||
|
|
||||||
RED.view.focus();
|
RED.view.focus();
|
||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
@@ -208,10 +214,20 @@ RED.workspaces = (function() {
|
|||||||
},
|
},
|
||||||
onhide: function(tab) {
|
onhide: function(tab) {
|
||||||
hideStack.push(tab.id);
|
hideStack.push(tab.id);
|
||||||
|
|
||||||
|
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
||||||
|
hiddenTabs[tab.id] = true;
|
||||||
|
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
||||||
|
|
||||||
RED.events.emit("workspace:hide",{workspace: tab.id})
|
RED.events.emit("workspace:hide",{workspace: tab.id})
|
||||||
},
|
},
|
||||||
onshow: function(tab) {
|
onshow: function(tab) {
|
||||||
removeFromHideStack(tab.id);
|
removeFromHideStack(tab.id);
|
||||||
|
|
||||||
|
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
||||||
|
delete hiddenTabs[tab.id];
|
||||||
|
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
||||||
|
|
||||||
RED.events.emit("workspace:show",{workspace: tab.id})
|
RED.events.emit("workspace:show",{workspace: tab.id})
|
||||||
},
|
},
|
||||||
minimumActiveTabWidth: 150,
|
minimumActiveTabWidth: 150,
|
||||||
@@ -268,9 +284,22 @@ RED.workspaces = (function() {
|
|||||||
onselect: "core:show-last-hidden-flow"
|
onselect: "core:show-last-hidden-flow"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
if (hideStack.length > 0) {
|
let hiddenFlows = new Set()
|
||||||
|
for (let i = 0; i < hideStack.length; i++) {
|
||||||
|
let ids = hideStack[i]
|
||||||
|
if (!Array.isArray(ids)) {
|
||||||
|
ids = [ids]
|
||||||
|
}
|
||||||
|
ids.forEach(id => {
|
||||||
|
if (RED.nodes.workspace(id)) {
|
||||||
|
hiddenFlows.add(id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const flowCount = hiddenFlows.size;
|
||||||
|
if (flowCount > 0) {
|
||||||
menuItems.unshift({
|
menuItems.unshift({
|
||||||
label: RED._("workspace.hiddenFlows",{count: hideStack.length}),
|
label: RED._("workspace.hiddenFlows",{count: flowCount}),
|
||||||
onselect: "core:list-hidden-flows"
|
onselect: "core:list-hidden-flows"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -415,6 +444,9 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
RED.actions.add("core:list-modified-nodes",function() {
|
||||||
|
RED.actions.invoke("core:search","is:modified ");
|
||||||
|
})
|
||||||
RED.actions.add("core:list-hidden-flows",function() {
|
RED.actions.add("core:list-hidden-flows",function() {
|
||||||
RED.actions.invoke("core:search","is:hidden ");
|
RED.actions.invoke("core:search","is:hidden ");
|
||||||
})
|
})
|
||||||
@@ -515,6 +547,31 @@ RED.workspaces = (function() {
|
|||||||
workspace_tabs.order(order);
|
workspace_tabs.order(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function flashTab(tabId) {
|
||||||
|
if(flashingTab && flashingTab.length) {
|
||||||
|
//cancel current flashing node before flashing new node
|
||||||
|
clearInterval(flashingTabTimer);
|
||||||
|
flashingTabTimer = null;
|
||||||
|
flashingTab.removeClass('highlighted');
|
||||||
|
flashingTab = null;
|
||||||
|
}
|
||||||
|
let tab = $("#red-ui-tab-" + tabId);
|
||||||
|
if(!tab || !tab.length) { return; }
|
||||||
|
|
||||||
|
flashingTabTimer = setInterval(function(flashEndTime) {
|
||||||
|
if (flashEndTime >= Date.now()) {
|
||||||
|
const highlighted = tab.hasClass("highlighted");
|
||||||
|
tab.toggleClass('highlighted', !highlighted)
|
||||||
|
} else {
|
||||||
|
clearInterval(flashingTabTimer);
|
||||||
|
flashingTabTimer = null;
|
||||||
|
flashingTab = null;
|
||||||
|
tab.removeClass('highlighted');
|
||||||
|
}
|
||||||
|
}, 100, Date.now() + 2200);
|
||||||
|
flashingTab = tab;
|
||||||
|
tab.addClass('highlighted');
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
init: init,
|
init: init,
|
||||||
add: addWorkspace,
|
add: addWorkspace,
|
||||||
@@ -542,15 +599,12 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
if (workspace_tabs.contains(id)) {
|
if (workspace_tabs.contains(id)) {
|
||||||
workspace_tabs.hideTab(id);
|
workspace_tabs.hideTab(id);
|
||||||
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
|
||||||
hiddenTabs[id] = true;
|
|
||||||
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(id) {
|
isHidden: function(id) {
|
||||||
return hideStack.includes(id)
|
return hideStack.includes(id)
|
||||||
},
|
},
|
||||||
show: function(id,skipStack,unhideOnly) {
|
show: function(id,skipStack,unhideOnly,flash) {
|
||||||
if (!workspace_tabs.contains(id)) {
|
if (!workspace_tabs.contains(id)) {
|
||||||
var sf = RED.nodes.subflow(id);
|
var sf = RED.nodes.subflow(id);
|
||||||
if (sf) {
|
if (sf) {
|
||||||
@@ -572,14 +626,14 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
workspace_tabs.activateTab(id);
|
workspace_tabs.activateTab(id);
|
||||||
}
|
}
|
||||||
var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
|
if(flash) {
|
||||||
delete hiddenTabs[id];
|
flashTab(id.replace(".","-"))
|
||||||
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
|
}
|
||||||
},
|
},
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
RED.nodes.eachWorkspace(function(ws) {
|
RED.nodes.eachWorkspace(function(ws) {
|
||||||
workspace_tabs.renameTab(ws.id,ws.label);
|
workspace_tabs.renameTab(ws.id,ws.label);
|
||||||
|
$("#red-ui-tab-"+(ws.id.replace(".","-"))).attr("flowname",ws.label)
|
||||||
})
|
})
|
||||||
RED.nodes.eachSubflow(function(sf) {
|
RED.nodes.eachSubflow(function(sf) {
|
||||||
if (workspace_tabs.contains(sf.id)) {
|
if (workspace_tabs.contains(sf.id)) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user