Compare commits
765 Commits
runtime-ap
...
1.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b68835f171 | ||
|
|
32714c5dac | ||
|
|
245e06f026 | ||
|
|
e0111d3fe6 | ||
|
|
a71d4223ff | ||
|
|
20cba6411b | ||
|
|
502a8112b5 | ||
|
|
308c6ee4da | ||
|
|
cae003d4fa | ||
|
|
b9b900e908 | ||
|
|
8bdba9178a | ||
|
|
97f11e38cd | ||
|
|
c4f5df0cd0 | ||
|
|
9ed3a6748a | ||
|
|
359c0354f6 | ||
|
|
fc77c089fa | ||
|
|
137a7ac48c | ||
|
|
42b60aef4e | ||
|
|
5ab7380ad1 | ||
|
|
afa25df1af | ||
|
|
5cb888328e | ||
|
|
78aeb94917 | ||
|
|
5f3e9a19ea | ||
|
|
420e8c001b | ||
|
|
c63b8a4ebc | ||
|
|
5f5feaed5f | ||
|
|
87a1f616b0 | ||
|
|
cc051544f9 | ||
|
|
83d99043a8 | ||
|
|
6a57d25f4a | ||
|
|
91473e731e | ||
|
|
1d91ac1169 | ||
|
|
2850477a71 | ||
|
|
651b1c92c3 | ||
|
|
77e74eb37b | ||
|
|
5bb2bc7077 | ||
|
|
98a001a8ca | ||
|
|
0d75ff336d | ||
|
|
8567f1655e | ||
|
|
68b94737ed | ||
|
|
094c92ed85 | ||
|
|
42ab6deff1 | ||
|
|
3a257e1e00 | ||
|
|
2bf9a353a6 | ||
|
|
bbe41febf1 | ||
|
|
031362a633 | ||
|
|
4418f8bfce | ||
|
|
364175fa9d | ||
|
|
13cf2b48e1 | ||
|
|
e4f6694223 | ||
|
|
59093f1721 | ||
|
|
db5e79a19b | ||
|
|
f0b1585b52 | ||
|
|
50228c5970 | ||
|
|
b98e85016a | ||
|
|
bc540eefb6 | ||
|
|
3f1c4b4117 | ||
|
|
5e7689a151 | ||
|
|
42845cfcc0 | ||
|
|
caad0eca67 | ||
|
|
67f8ec7f87 | ||
|
|
d8d37a66e4 | ||
|
|
69db23f2f6 | ||
|
|
c3f6bcad56 | ||
|
|
ab1521bf26 | ||
|
|
fafe8b88c2 | ||
|
|
9276988ff6 | ||
|
|
85179edf1b | ||
|
|
2f1ba6cf1f | ||
|
|
93674b4e29 | ||
|
|
20851664e8 | ||
|
|
38c87a056c | ||
|
|
ad77565508 | ||
|
|
0e02e21967 | ||
|
|
1e35a6ce5e | ||
|
|
90b167eba1 | ||
|
|
5b1defad9f | ||
|
|
8dc1ad8168 | ||
|
|
126a42056d | ||
|
|
5866dad79a | ||
|
|
9dac679b72 | ||
|
|
12ff3abeda | ||
|
|
0f07fb4479 | ||
|
|
d9d98439b2 | ||
|
|
d251a30cb8 | ||
|
|
a2632fdcc8 | ||
|
|
10c818474c | ||
|
|
5e8279cf51 | ||
|
|
4c8c081c31 | ||
|
|
bad2baba7f | ||
|
|
b5da6f9c74 | ||
|
|
7ec999475e | ||
|
|
742bf85a89 | ||
|
|
c9c6f41aad | ||
|
|
b0d93df387 | ||
|
|
3e20892fdf | ||
|
|
369f8b3fe0 | ||
|
|
337dfba2b8 | ||
|
|
493687b5bb | ||
|
|
c7587960fb | ||
|
|
5c962aa899 | ||
|
|
3e9d2a8062 | ||
|
|
c2aa8a206a | ||
|
|
6d8ea2b6a4 | ||
|
|
b581e33611 | ||
|
|
5e43a02cd3 | ||
|
|
6f37d5ca5c | ||
|
|
3263008379 | ||
|
|
4588089bd6 | ||
|
|
44b75f0b92 | ||
|
|
162bd6a8c3 | ||
|
|
0c13603185 | ||
|
|
ed2a45e975 | ||
|
|
0fa165c606 | ||
|
|
fe63ab1242 | ||
|
|
faf808da69 | ||
|
|
71709cd662 | ||
|
|
d92040b804 | ||
|
|
3662fbb462 | ||
|
|
d89ae3ebbf | ||
|
|
6175fecdd8 | ||
|
|
fab632da62 | ||
|
|
c1e3b0d971 | ||
|
|
7b15ba31ea | ||
|
|
f11d4ccd45 | ||
|
|
fbec803129 | ||
|
|
0f57d1a433 | ||
|
|
63829b6382 | ||
|
|
8ac3899ddc | ||
|
|
59fb4ea6f8 | ||
|
|
92bb9bb3c3 | ||
|
|
1795c491a8 | ||
|
|
ea333c19f7 | ||
|
|
28ef879c07 | ||
|
|
10839abf24 | ||
|
|
9832394f8e | ||
|
|
dd89ea3731 | ||
|
|
5d9fd6dc3b | ||
|
|
f7c87e26db | ||
|
|
f98f4085bf | ||
|
|
543519d055 | ||
|
|
5a9fcd9267 | ||
|
|
fe2360883f | ||
|
|
b45ddadb09 | ||
|
|
a3cbe80a36 | ||
|
|
ee6c6266cc | ||
|
|
d6bd35287f | ||
|
|
962a29110c | ||
|
|
a242475b38 | ||
|
|
d59bf84470 | ||
|
|
161ee17f45 | ||
|
|
8aa00b0cfc | ||
|
|
afe89c3621 | ||
|
|
bdf68311b4 | ||
|
|
afa69f4c0e | ||
|
|
6fe2b24592 | ||
|
|
7442b356e3 | ||
|
|
1d7be6457f | ||
|
|
c9ff05ba80 | ||
|
|
faae184f1c | ||
|
|
515a8a9bbb | ||
|
|
58914e5c5f | ||
|
|
c944eaab5c | ||
|
|
d3d9533493 | ||
|
|
9c474cc089 | ||
|
|
3f1b0b986f | ||
|
|
28e08ebaf5 | ||
|
|
3213c03754 | ||
|
|
4447288a4c | ||
|
|
eee4e83a1e | ||
|
|
a67b492620 | ||
|
|
6062ff2748 | ||
|
|
3b11195caa | ||
|
|
9946ea111c | ||
|
|
7074d66f8e | ||
|
|
008b26f329 | ||
|
|
b246f0779f | ||
|
|
dc89218702 | ||
|
|
3c013b3533 | ||
|
|
fe0d0f08e4 | ||
|
|
38b5063038 | ||
|
|
e55481a454 | ||
|
|
7063a88513 | ||
|
|
a9bf3d0226 | ||
|
|
781b3aff1b | ||
|
|
b011b9203b | ||
|
|
39344fcae5 | ||
|
|
a046b357da | ||
|
|
d8e4020cec | ||
|
|
f80b172022 | ||
|
|
66fc4b536c | ||
|
|
1f97ccdddb | ||
|
|
308d6889a7 | ||
|
|
c3b9982c44 | ||
|
|
fab796e4e4 | ||
|
|
749db6ba82 | ||
|
|
12d6c4ddf5 | ||
|
|
430a03bb14 | ||
|
|
43f21fc7aa | ||
|
|
b27da3d1a0 | ||
|
|
4463a8e3b2 | ||
|
|
9e74ddac48 | ||
|
|
5f62e41d62 | ||
|
|
19a103d3a0 | ||
|
|
8fb6bc059e | ||
|
|
8f61a0d258 | ||
|
|
7fa589e430 | ||
|
|
6d8d826764 | ||
|
|
a40e84e1f6 | ||
|
|
4844c2123f | ||
|
|
236d437430 | ||
|
|
ae726c199b | ||
|
|
e7f54f005c | ||
|
|
e7b1ec6904 | ||
|
|
f4f664a4a2 | ||
|
|
fec52a8151 | ||
|
|
d8b4c1e209 | ||
|
|
eac853c7dd | ||
|
|
a04337a270 | ||
|
|
50d7e16365 | ||
|
|
ef7bc931b7 | ||
|
|
41de771074 | ||
|
|
2ebdd6c5cb | ||
|
|
b51cfcc753 | ||
|
|
91cc03dd80 | ||
|
|
9d673a213e | ||
|
|
97e789538e | ||
|
|
e05ff01d57 | ||
|
|
0748dff355 | ||
|
|
28d4084aa0 | ||
|
|
afd2ccfb4f | ||
|
|
057127f4de | ||
|
|
2937b25d6d | ||
|
|
419f26db87 | ||
|
|
be1b9c0e43 | ||
|
|
894d28c60b | ||
|
|
06cc08d9f7 | ||
|
|
75393c0b28 | ||
|
|
bdc1da70c1 | ||
|
|
7cef990ba6 | ||
|
|
fb0f12bb20 | ||
|
|
e94b8d3e84 | ||
|
|
8c00e1fdf4 | ||
|
|
a31fa82284 | ||
|
|
5d0af45d8f | ||
|
|
e9f248020e | ||
|
|
a8e1058af6 | ||
|
|
1a087fd799 | ||
|
|
50c81533e0 | ||
|
|
5eab9aa4b1 | ||
|
|
1970cbfe37 | ||
|
|
6d736201f9 | ||
|
|
51ec52b573 | ||
|
|
d099387186 | ||
|
|
3f91e4da66 | ||
|
|
4124159378 | ||
|
|
18f3789e29 | ||
|
|
a713c92530 | ||
|
|
7828af591e | ||
|
|
d432dba726 | ||
|
|
72ae87857f | ||
|
|
724acff591 | ||
|
|
482b432e2c | ||
|
|
351c0cb0a8 | ||
|
|
314a0fb5d6 | ||
|
|
a301bf8bf5 | ||
|
|
37b3601c47 | ||
|
|
6e944485f0 | ||
|
|
431266069e | ||
|
|
d48a09e68b | ||
|
|
1db1ec7b5e | ||
|
|
2a8f0a4eab | ||
|
|
79f3669fac | ||
|
|
aab0f2dcd5 | ||
|
|
a47831e278 | ||
|
|
f1a5e8a42c | ||
|
|
723e9b3cba | ||
|
|
ff759a8074 | ||
|
|
4de1056d82 | ||
|
|
884b8da8bf | ||
|
|
044ad77a4b | ||
|
|
1fe8b388a3 | ||
|
|
79fe7d684c | ||
|
|
c409af0ea8 | ||
|
|
5110eaff96 | ||
|
|
db3eee72b5 | ||
|
|
3bcff91328 | ||
|
|
e843f192ec | ||
|
|
f3d2053878 | ||
|
|
efe8fbbd11 | ||
|
|
ce507b3b52 | ||
|
|
85de227003 | ||
|
|
7c6eb7c794 | ||
|
|
2037741b54 | ||
|
|
d534a8952d | ||
|
|
0b05b883cb | ||
|
|
6937aa5ddd | ||
|
|
8f6b24e0aa | ||
|
|
ba3b64a6c6 | ||
|
|
d23b32a830 | ||
|
|
ceba08a801 | ||
|
|
e0bb03a53f | ||
|
|
0881c6a20b | ||
|
|
f88a4b1791 | ||
|
|
2b43e3ee23 | ||
|
|
2e063f91bc | ||
|
|
79062e2034 | ||
|
|
a413f3cded | ||
|
|
4baaaa8d59 | ||
|
|
c99b35428b | ||
|
|
3c8e4f8bbf | ||
|
|
aa9a37da38 | ||
|
|
85efb48c1f | ||
|
|
888e7ee023 | ||
|
|
d7bbf8a8da | ||
|
|
e2ee88de84 | ||
|
|
1d1ab5b7b2 | ||
|
|
54c863d48f | ||
|
|
acc633b4b6 | ||
|
|
766ccf85c2 | ||
|
|
7ab5a2be47 | ||
|
|
7a6e1fe566 | ||
|
|
4749c92252 | ||
|
|
0e035e47df | ||
|
|
1359545e13 | ||
|
|
5b2f24f842 | ||
|
|
bb73e30909 | ||
|
|
490903ca25 | ||
|
|
901b32297e | ||
|
|
dd72046922 | ||
|
|
6286b34d00 | ||
|
|
81f4e0de56 | ||
|
|
596fbfb517 | ||
|
|
da756fa568 | ||
|
|
30aebc4ee3 | ||
|
|
45138ce5ca | ||
|
|
f26b9feeaf | ||
|
|
9e47d933af | ||
|
|
f309a9d537 | ||
|
|
a786b37cb9 | ||
|
|
6a519a30a2 | ||
|
|
81ae552e69 | ||
|
|
0ec04a3624 | ||
|
|
81d5b47fce | ||
|
|
ed31a0cf15 | ||
|
|
201d1926bc | ||
|
|
9ee6655bfa | ||
|
|
c4beab6b0d | ||
|
|
34b6643913 | ||
|
|
98e391b867 | ||
|
|
19eb8e9a6d | ||
|
|
43b7aa40c3 | ||
|
|
747af44fc1 | ||
|
|
a73381e24b | ||
|
|
d5ef428edd | ||
|
|
5fa4d227b8 | ||
|
|
cc7e3b0c26 | ||
|
|
473a2ae275 | ||
|
|
7f5d47f39d | ||
|
|
6031f146aa | ||
|
|
020a469f3b | ||
|
|
091de3aa66 | ||
|
|
b837f7608c | ||
|
|
afe9367bac | ||
|
|
9bd9023cb6 | ||
|
|
8502cf8498 | ||
|
|
33dade0584 | ||
|
|
84cc2ad0fa | ||
|
|
dc2d3bc7c0 | ||
|
|
64df557423 | ||
|
|
715cc77e76 | ||
|
|
b80d1af3d7 | ||
|
|
f05f534fd2 | ||
|
|
c0837ead0e | ||
|
|
a1f135bd66 | ||
|
|
978f4ecc58 | ||
|
|
46a8d96997 | ||
|
|
c283224000 | ||
|
|
a6ef755139 | ||
|
|
29a257d17a | ||
|
|
368b76a183 | ||
|
|
8bb861124d | ||
|
|
2f884ec778 | ||
|
|
8c561e92c8 | ||
|
|
633b9180d7 | ||
|
|
0e2d0e1b6f | ||
|
|
ea4d65ceee | ||
|
|
d47ac84d2e | ||
|
|
a97759aa35 | ||
|
|
3fcfd4abdd | ||
|
|
6d771da9a9 | ||
|
|
6201247875 | ||
|
|
8c367bcc53 | ||
|
|
8198132ca7 | ||
|
|
cf3b4e9e63 | ||
|
|
987dbf8a92 | ||
|
|
acf8c9bc4a | ||
|
|
7173895d36 | ||
|
|
43530d4a5f | ||
|
|
fefabef9ee | ||
|
|
0dd40a941b | ||
|
|
24b6670bc4 | ||
|
|
76661abbf5 | ||
|
|
e9dc9eff9b | ||
|
|
2f160743bc | ||
|
|
98616e772c | ||
|
|
bc014fec9b | ||
|
|
732598d9d2 | ||
|
|
2979acd5b8 | ||
|
|
fd20cd524e | ||
|
|
7b80ae42e1 | ||
|
|
b7012674c6 | ||
|
|
c76bd39280 | ||
|
|
09cd710f66 | ||
|
|
d9aadf9d98 | ||
|
|
86716b5ffb | ||
|
|
96e3aab3b4 | ||
|
|
72c78fe3ad | ||
|
|
abe746020b | ||
|
|
8e1c15419c | ||
|
|
ee47646cf7 | ||
|
|
32d9acdaa5 | ||
|
|
4eb3bd496b | ||
|
|
3c4f4d27d6 | ||
|
|
2060af8a92 | ||
|
|
21bf74a467 | ||
|
|
677833a277 | ||
|
|
0b5e4f2dd7 | ||
|
|
06a1f30350 | ||
|
|
c1ff241550 | ||
|
|
5717f75eac | ||
|
|
6b3b68a4e5 | ||
|
|
8bda2d0add | ||
|
|
bc02c9573c | ||
|
|
86bb5503ab | ||
|
|
21ce23d27d | ||
|
|
6c75baecb2 | ||
|
|
8167608f04 | ||
|
|
514e31aef9 | ||
|
|
20a31a6d38 | ||
|
|
4f0aa1bc02 | ||
|
|
be0ef6e594 | ||
|
|
93a8dbd31a | ||
|
|
cf931e8ddf | ||
|
|
510bfbf268 | ||
|
|
2f93bb969b | ||
|
|
27365c9f7b | ||
|
|
b1d2e188f5 | ||
|
|
e4f67df2a1 | ||
|
|
e094ea3d2a | ||
|
|
7515b745b5 | ||
|
|
0e902a7e71 | ||
|
|
2dfb443625 | ||
|
|
e6e7747ae1 | ||
|
|
d80ea6c0f5 | ||
|
|
ac6e3988a8 | ||
|
|
bfd98f3767 | ||
|
|
cc8bc1339f | ||
|
|
542d1dc600 | ||
|
|
1c66c88f95 | ||
|
|
dc880c672a | ||
|
|
073f38c68c | ||
|
|
6a6d13b075 | ||
|
|
9bb7e72c69 | ||
|
|
7436e01188 | ||
|
|
3d272d0f10 | ||
|
|
ee66a12dad | ||
|
|
47de85b012 | ||
|
|
f85b63a972 | ||
|
|
e630919ef8 | ||
|
|
2e3fd49b40 | ||
|
|
dd54af2c08 | ||
|
|
737bf411ff | ||
|
|
5070b1a6b5 | ||
|
|
c849da92cf | ||
|
|
6a4e7201fe | ||
|
|
ffa6dea452 | ||
|
|
30c1d31a99 | ||
|
|
6934a2d5c3 | ||
|
|
b9906ced9a | ||
|
|
5500b4fe35 | ||
|
|
2353f12cd6 | ||
|
|
1b8cab0f58 | ||
|
|
869c1d4ea4 | ||
|
|
9b938195a8 | ||
|
|
bb3c52821a | ||
|
|
81c8ae95e2 | ||
|
|
6098570ab7 | ||
|
|
d033c24fe5 | ||
|
|
4995e52dd6 | ||
|
|
c685a31056 | ||
|
|
c32ce3bb7b | ||
|
|
c0d8f904b3 | ||
|
|
8dba0dac9e | ||
|
|
d0bf4a5329 | ||
|
|
7b28ba6078 | ||
|
|
e6466c3c3a | ||
|
|
d96d3064d6 | ||
|
|
d4589ed7e3 | ||
|
|
5cfc52ea18 | ||
|
|
3fcacd8339 | ||
|
|
49fe13f22f | ||
|
|
4d27ba1bda | ||
|
|
b715ac8bf4 | ||
|
|
d96049416f | ||
|
|
1c4df785fd | ||
|
|
8f94c5efeb | ||
|
|
7cffa1ece7 | ||
|
|
1ac18d7b33 | ||
|
|
1111d2518b | ||
|
|
ba7416450e | ||
|
|
3b02d36acb | ||
|
|
c2aa9a5337 | ||
|
|
70fb181b7b | ||
|
|
e64f4e3f39 | ||
|
|
e4d518749f | ||
|
|
7dcca2c907 | ||
|
|
4a027b8a79 | ||
|
|
c2c6e6080e | ||
|
|
4f87ebdf0a | ||
|
|
09abec15b1 | ||
|
|
33d0d12bc8 | ||
|
|
f488869635 | ||
|
|
6382564727 | ||
|
|
7476b4c7db | ||
|
|
daf3e6a47a | ||
|
|
19b6cba398 | ||
|
|
5bd3d12c7b | ||
|
|
c9db74ebca | ||
|
|
f8a88cc1a4 | ||
|
|
4a081bf125 | ||
|
|
8a68a3e861 | ||
|
|
7a9dd9ad9c | ||
|
|
6c01d0f9d8 | ||
|
|
45a53ac168 | ||
|
|
dabb2790c9 | ||
|
|
c66c5ea53c | ||
|
|
0a98ba6985 | ||
|
|
bb8e491856 | ||
|
|
5590d31336 | ||
|
|
dc7e48dc53 | ||
|
|
371d357218 | ||
|
|
f22960ad59 | ||
|
|
34ead436b0 | ||
|
|
808d5a75ae | ||
|
|
55e897faac | ||
|
|
5a5dda21e4 | ||
|
|
f085655daa | ||
|
|
5cf9c07b73 | ||
|
|
9751089807 | ||
|
|
211eeea05d | ||
|
|
b2516117f5 | ||
|
|
2816b3edae | ||
|
|
242398c724 | ||
|
|
289583325d | ||
|
|
0f793ebd65 | ||
|
|
ce014044ea | ||
|
|
1064e531f0 | ||
|
|
dc3128fb3e | ||
|
|
51a3521834 | ||
|
|
d40aa7260f | ||
|
|
fc8c4063f2 | ||
|
|
f204c77ba3 | ||
|
|
7a8545273c | ||
|
|
6a9575e9f4 | ||
|
|
c13e79e9c3 | ||
|
|
62088259ae | ||
|
|
925ebcc06e | ||
|
|
a20eaf852f | ||
|
|
84a6a5235e | ||
|
|
8235b7b96d | ||
|
|
0376e0d711 | ||
|
|
6bd0682e8c | ||
|
|
e24c22f9be | ||
|
|
673a6bbe2c | ||
|
|
cf32a33984 | ||
|
|
f4ca8cd738 | ||
|
|
98c1bc276d | ||
|
|
629536b562 | ||
|
|
422109868d | ||
|
|
bcc7834650 | ||
|
|
1161e4f6c1 | ||
|
|
14435c24ac | ||
|
|
22ede79799 | ||
|
|
6cb3699ee9 | ||
|
|
6c65d3830e | ||
|
|
cdcf39fe82 | ||
|
|
1441042458 | ||
|
|
71403e5acd | ||
|
|
3d70bc722a | ||
|
|
b2f50da322 | ||
|
|
2a50c66df8 | ||
|
|
8de47c0a6e | ||
|
|
023391e22a | ||
|
|
a4ddfd404f | ||
|
|
7307e558cb | ||
|
|
47356f5221 | ||
|
|
c6f8950b64 | ||
|
|
58c8311d56 | ||
|
|
071f4eacde | ||
|
|
f96bdc578e | ||
|
|
e03a0fffa9 | ||
|
|
8e2c12f8d9 | ||
|
|
114420e8fd | ||
|
|
ba49b2c681 | ||
|
|
5391fc962a | ||
|
|
7cec7ae608 | ||
|
|
d6211af5bd | ||
|
|
ef114e31c2 | ||
|
|
fd74a03479 | ||
|
|
428bf634e9 | ||
|
|
c49f722e4f | ||
|
|
d4d95a43b6 | ||
|
|
8789d983ed | ||
|
|
10faa96bcf | ||
|
|
42d31b9ee6 | ||
|
|
c9dc9b4fe9 | ||
|
|
a345089c8b | ||
|
|
67c268e13d | ||
|
|
f13e02a1a9 | ||
|
|
d887ab126b | ||
|
|
1a7868159a | ||
|
|
c6a1c8e8c4 | ||
|
|
fba339f666 | ||
|
|
09d41a9708 | ||
|
|
ce85c8d986 | ||
|
|
4630a162af | ||
|
|
fde157ff50 | ||
|
|
51f875c02d | ||
|
|
f0957c838f | ||
|
|
f5bebef37f | ||
|
|
80a15089b4 | ||
|
|
cb35604ef5 | ||
|
|
61681bb1d6 | ||
|
|
8edf399631 | ||
|
|
d5ffd1432f | ||
|
|
e73bf03615 | ||
|
|
665fe0e01e | ||
|
|
1a226c4dc6 | ||
|
|
a866aa9c18 | ||
|
|
d9089b798c | ||
|
|
d34ebd4d1b | ||
|
|
716aa74004 | ||
|
|
2aae76c9bc | ||
|
|
5fc3ca0e23 | ||
|
|
5bb27109bf | ||
|
|
7406ab6017 | ||
|
|
08fccc4e77 | ||
|
|
c1d50e82e1 | ||
|
|
9777af7cb5 | ||
|
|
fd86035865 | ||
|
|
a8ec032553 | ||
|
|
66ee27c5fa | ||
|
|
17a737ca88 | ||
|
|
f30ff7a2fd | ||
|
|
c102828a99 | ||
|
|
cb0e631b85 | ||
|
|
75e7c0e50d | ||
|
|
62b2adab78 | ||
|
|
fc0cf1ff51 | ||
|
|
0f4d46671f | ||
|
|
048f9c0294 | ||
|
|
0529eed0c9 | ||
|
|
ca77842b5b | ||
|
|
8c169dc82b | ||
|
|
195342f7db | ||
|
|
cfaaef7860 | ||
|
|
e939d5e96e | ||
|
|
6fa8b7f5f1 | ||
|
|
a2d03c14ae | ||
|
|
c667a0e74c | ||
|
|
8123828113 | ||
|
|
72b8dbb45b | ||
|
|
9f4628cf0a | ||
|
|
ec4d24af91 | ||
|
|
7703875740 | ||
|
|
6442bb8a13 | ||
|
|
51373f59e2 | ||
|
|
6cc56879d3 | ||
|
|
f29d7c9252 | ||
|
|
2f7f53ed96 | ||
|
|
da89460830 | ||
|
|
9e006d42bb | ||
|
|
4c02bab4ee | ||
|
|
5800ed41f1 | ||
|
|
18b5b4901f | ||
|
|
368418cf56 | ||
|
|
94031a52a5 | ||
|
|
d67f91e7ed | ||
|
|
3e6cadf3d8 | ||
|
|
f37697c4fb | ||
|
|
0c5a76b391 | ||
|
|
69448c7329 | ||
|
|
8e9815fb91 | ||
|
|
bf1afcfe8a | ||
|
|
2980818f0d | ||
|
|
9da58dbaf0 | ||
|
|
4cdd7978cf | ||
|
|
40d81358f4 | ||
|
|
c7b62aed91 | ||
|
|
55d71659f8 | ||
|
|
c0e7d6d826 | ||
|
|
f809377de8 | ||
|
|
9767bd9697 | ||
|
|
3a55528552 | ||
|
|
56197ffe3a | ||
|
|
0f0d0c046c | ||
|
|
8d5b546763 | ||
|
|
19c9707d62 | ||
|
|
ecc4973645 | ||
|
|
79e004a040 | ||
|
|
3169f93cc2 | ||
|
|
c1a1a73599 | ||
|
|
48308db45b | ||
|
|
3f37e96f78 | ||
|
|
db1b0ccb79 | ||
|
|
df161ce672 | ||
|
|
4e21a5e557 | ||
|
|
72fe30892e | ||
|
|
19fa69811b | ||
|
|
0ddb4c625d | ||
|
|
d373105b32 | ||
|
|
36dc1d2f97 | ||
|
|
11fa2cb35d | ||
|
|
546f07156f | ||
|
|
7e7117632d | ||
|
|
954226da0d | ||
|
|
38a1291c5b | ||
|
|
998bf92ad4 | ||
|
|
974ba40f28 | ||
|
|
e57d8ba0ef | ||
|
|
6b79c6135f | ||
|
|
28b311b7ed | ||
|
|
dcda513901 | ||
|
|
72c400794c | ||
|
|
a747d8c2d5 | ||
|
|
a3aec6b939 | ||
|
|
042409f870 | ||
|
|
5b8f4f4069 | ||
|
|
d132d63c1d | ||
|
|
4374506981 | ||
|
|
ef8b936069 | ||
|
|
36e3bfffb4 | ||
|
|
91a38bdb60 | ||
|
|
f169a68319 | ||
|
|
ee886f98dd | ||
|
|
a3826cc6a7 | ||
|
|
ba33b832ba | ||
|
|
f6c017176b | ||
|
|
7a01b115bb | ||
|
|
1dc021e871 | ||
|
|
c9f916ebab | ||
|
|
ff627fd128 | ||
|
|
bba57f8d2b | ||
|
|
695873d35a | ||
|
|
15da19dcea | ||
|
|
4312a01707 | ||
|
|
ecd8f97d8b | ||
|
|
d5bdc1600b | ||
|
|
dfa077fd5f | ||
|
|
b14a0e0dde | ||
|
|
e982f5076f | ||
|
|
42188b9f49 | ||
|
|
50e2dcbcd5 | ||
|
|
6104bb98f1 |
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/packages/node_modules/** linguist-generated=false
|
||||||
39
.github/ISSUE_TEMPLATE/--bug_report.md
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Reproducable software issues in the core of Node-RED
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
This issue tracker is for problems with the Node-RED runtime, the editor or the core nodes.
|
||||||
|
|
||||||
|
If your issue is:
|
||||||
|
- a general 'how-to' type question,
|
||||||
|
- a feature request or suggestion for a change,
|
||||||
|
- or problems with 3rd party (`node-red-contrib-`) nodes
|
||||||
|
|
||||||
|
please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack).
|
||||||
|
|
||||||
|
You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
|
||||||
|
|
||||||
|
That way the whole Node-RED user community can help, rather than rely on the core development team.
|
||||||
|
|
||||||
|
To help us understand the issue, please fill-in as much of the following information as you can:
|
||||||
|
-->
|
||||||
|
|
||||||
|
### What are the steps to reproduce?
|
||||||
|
|
||||||
|
### What happens?
|
||||||
|
|
||||||
|
### What do you expect to happen?
|
||||||
|
|
||||||
|
### Please tell us about your environment:
|
||||||
|
|
||||||
|
- [ ] Node-RED version:
|
||||||
|
- [ ] node.js version:
|
||||||
|
- [ ] npm version:
|
||||||
|
- [ ] Platform/OS:
|
||||||
|
- [ ] Browser:
|
||||||
14
.github/ISSUE_TEMPLATE/-anything-else.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
name: Anything Else
|
||||||
|
about: Something that is not a bug report
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack).
|
||||||
|
|
||||||
|
You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
|
||||||
|
|
||||||
|
That way the whole Node-RED user community can help, rather than rely on the core development team.
|
||||||
5
.gitignore
vendored
@@ -17,3 +17,8 @@ node_modules
|
|||||||
public
|
public
|
||||||
locales/zz-ZZ
|
locales/zz-ZZ
|
||||||
nodes/core/locales/zz-ZZ
|
nodes/core/locales/zz-ZZ
|
||||||
|
!packages/node_modules
|
||||||
|
packages/node_modules/@node-red/editor-client/public
|
||||||
|
!test/**/node_modules
|
||||||
|
docs
|
||||||
|
!packages/node_modules/**/docs
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/Gruntfile.js
|
/Gruntfile.js
|
||||||
/.git/*
|
/.git/*
|
||||||
/lib/*
|
|
||||||
*.backup
|
*.backup
|
||||||
/public/*
|
/public/*
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
.settings
|
|
||||||
.jshintignore
|
|
||||||
.jshintrc
|
|
||||||
.project
|
|
||||||
.tern-project
|
|
||||||
.travis.yml
|
|
||||||
.git
|
|
||||||
@@ -2,11 +2,12 @@ sudo: false
|
|||||||
language: node_js
|
language: node_js
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- node_js: "12"
|
||||||
- node_js: "10"
|
- node_js: "10"
|
||||||
script:
|
script:
|
||||||
- ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
- ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
||||||
before_script:
|
before_script:
|
||||||
- npm install -g istanbul coveralls
|
- npm install -g istanbul coveralls
|
||||||
- node_js: "8"
|
- node_js: "8"
|
||||||
- node_js: "6"
|
allow_failures:
|
||||||
- node_js: "4"
|
- node_js: "12"
|
||||||
|
|||||||
15
API.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Node-RED Modules
|
||||||
|
---
|
||||||
|
|
||||||
|
Node-RED provides a set of node modules that implement different parts of the
|
||||||
|
application.
|
||||||
|
|
||||||
|
Module | Description
|
||||||
|
-------|-------
|
||||||
|
[node-red](node-red.html) | the main module that pulls together all of the internal modules and provides the executable version of Node-RED
|
||||||
|
[@node-red/editor-api](@node-red_editor-api.html) | an Express application that serves the Node-RED editor and provides the Admin HTTP API
|
||||||
|
[@node-red/runtime](@node-red_runtime.html) | the core runtime of Node-RED
|
||||||
|
[@node-red/util](@node-red_util.html) | common utilities for the Node-RED runtime and editor modules
|
||||||
|
@node-red/registry | the internal node registry
|
||||||
|
@node-red/nodes | the default set of core nodes
|
||||||
|
@node-red/editor-client | the client-side resources of the Node-RED editor application
|
||||||
405
CHANGELOG.md
@@ -1,3 +1,407 @@
|
|||||||
|
#### 1.0.0-beta.1: Beta Release
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
- Update runtime apis to support multiple libraries
|
||||||
|
- Add Node 12 to travis (allow_failures)
|
||||||
|
- Bump all dependencies Fixes #2152
|
||||||
|
|
||||||
|
Editor
|
||||||
|
- [BREAKING] complete overhaul of editor DOM/CSS structure
|
||||||
|
- [BREAKING] Get rid of Bootstrap
|
||||||
|
- Simplify index.mst to a single div to insert the editor
|
||||||
|
- Append node configs to div rather than body
|
||||||
|
- Only redraw node status when it has changed
|
||||||
|
- Minimise work done to calculate node label widths
|
||||||
|
- Allow script tags with src to reference esm modules
|
||||||
|
- Upgrade to jq 3.4.1 / jq-ui 1.12.1
|
||||||
|
- Allow editor language to be chosen in editor settings
|
||||||
|
- Only NLS status text that starts with a letter Fixes #2128
|
||||||
|
- Fix display of link node list within subflow Fixes #2140
|
||||||
|
- Blur the active element when closing edit dialog via action Fixes #2097
|
||||||
|
- Trigger change evnt on typedInput when type changes and options present Fixes #2160
|
||||||
|
- Move library import/export to single dialog
|
||||||
|
- Move type-library dialogs to new style dialog
|
||||||
|
- Fix node drag and drop animation
|
||||||
|
- let status be simple text if wanted
|
||||||
|
- Add workspace statusBar
|
||||||
|
- Complete refresh of German translations
|
||||||
|
- Fix memory leak in Debug sidebar #2163
|
||||||
|
- Introduce toggleButton and move flow-disabled to use it
|
||||||
|
- Allow RED.settings.get/set to use full property desc
|
||||||
|
- Add auto-refresh toggle to context sidebar
|
||||||
|
- Add build-custom-theme script
|
||||||
|
- Add RED.view.selectNodes api for node selection whilst editing
|
||||||
|
- Add node-select to typedInput
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
- http request node: warn user if msg.requestTimeout == 0
|
||||||
|
- hide delay node reset label on deploy
|
||||||
|
- Fix CSV regex to treat strings starting e as text
|
||||||
|
- Add "don't parse numbers" option to csv node
|
||||||
|
- Add expand editor button to Template node
|
||||||
|
- Update catch/status nodes to use selectNodes api and treeList
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### 0.20.5: Maintenance Release
|
||||||
|
|
||||||
|
- Revert error handling in palette manager
|
||||||
|
|
||||||
|
#### 0.20.4: Maintenance Release
|
||||||
|
|
||||||
|
- Switch media-typer to content-type module Fixes #2122 #2123
|
||||||
|
- Use userObj.username and not .name for ssh key lookup Closes #2109
|
||||||
|
- Ensure mqtt message handlers are tidied up properly on partial deploy
|
||||||
|
- Update package dependencies
|
||||||
|
- Fix encoding menu in file node #2125
|
||||||
|
- Update ACE to 1.4.3-src-min-noconflict Fixes #2106
|
||||||
|
- Fix creating missing package.json when existing project imported Fixes #2115
|
||||||
|
- Allow subflow instance to override env var with falsey values Fixes #2113
|
||||||
|
- Prevent wire from normal node to link virtual port Fixes #2114
|
||||||
|
- Add explanation to the help text on the new feature to build query string from msg.payload #2116
|
||||||
|
- Bump bcrypt to latest
|
||||||
|
- Add Korean locales files for nodes #2100
|
||||||
|
- Add error message if catalog is invalid json
|
||||||
|
- Reduce udp out timeout to be less than default inject at start #2127
|
||||||
|
|
||||||
|
#### 0.20.3: Maintenance Release
|
||||||
|
|
||||||
|
- Do not dynamically add/remove upgrade listener in ws nodes
|
||||||
|
- Avoid env var reference loops and support $parent. prefix Fixes #2099
|
||||||
|
- Ensure config.\_flow is non-enumerable so is ignored by JSON.stringify
|
||||||
|
- Block loading ACE from cdn
|
||||||
|
|
||||||
|
#### 0.20.2: Maintenance Release
|
||||||
|
|
||||||
|
- Filter out duplicate nodes when importing a flow
|
||||||
|
- Handle node configs with multiple external scripts properly
|
||||||
|
|
||||||
|
#### 0.20.1: Maintenance Release
|
||||||
|
|
||||||
|
- Ensure all subflow instances are stopped when flow stopping Fixes #2095
|
||||||
|
- modify name of korean locale forders #2091
|
||||||
|
- Ensure node names are sanitized before being presented
|
||||||
|
- Subflow status node must pass status to parent flow Fixes #2087
|
||||||
|
- fix problem on displaying option label on Firefox #2090
|
||||||
|
|
||||||
|
#### 0.20.0: Milestone Release
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
- Pass complete status to Status node and filter to editor
|
||||||
|
- Ensure flows wait for all nodes to close before restarting Fixes #2067
|
||||||
|
- Fix git clone with password protected key
|
||||||
|
- Allow a project to be located below the root of repo
|
||||||
|
- Detect the cloning of an empty git repo properly
|
||||||
|
- Fix use of custom auth strategy plugins
|
||||||
|
- Remove remnants of when library in git/index Fixes #2057
|
||||||
|
- Clear subflow status on close
|
||||||
|
- Add exportGlobalContextKeys to prevent exposing functionGlobalContext keys
|
||||||
|
- Add --no-audit and --no-update-notifier flags to npm commands to reduce workload
|
||||||
|
- Add envVarExcludes setting to block named env vars
|
||||||
|
- Update settings.js docs on userDir to match reality Fixes #2082
|
||||||
|
- Add Korean Language
|
||||||
|
|
||||||
|
|
||||||
|
Editor
|
||||||
|
- Automatic placing of node icon according to input/output counts
|
||||||
|
- Transfer placeholder and type to generated TypedInput field
|
||||||
|
- Hitting enter in Comment node name field clicks markdown button
|
||||||
|
- Shift status text left if no shape specified
|
||||||
|
- Better align node status text to status dot
|
||||||
|
- Handle treeList labels as text not html
|
||||||
|
- Change subflow edit dialog titles
|
||||||
|
- Resize subflow edit dialog properly
|
||||||
|
- Add flow list button to tab bar
|
||||||
|
- Handle node name as unsanitized text in debug sidebar
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- HTTP Request: Add Digest and Bearer Auth modes to http request node (#2061)
|
||||||
|
- HTTP Request: Add multipart/form-data support to http request node (#2076)
|
||||||
|
- TCP: include session/event info in status events
|
||||||
|
- WebSocket: include session/event info in status events
|
||||||
|
- Add i18n support for port label of inject/exec/httprequest/file nodes
|
||||||
|
- Join node: handle merged objects with repeated properties and honour parts
|
||||||
|
- JSON node: handle single booleans and numbers
|
||||||
|
- File node: add encoding support to file in/out node (#2066)
|
||||||
|
|
||||||
|
#### 0.20.0-beta.5: Beta Release
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
|
||||||
|
- Bump dependencies
|
||||||
|
- Allow `$parent` access of flow context
|
||||||
|
- Make Node.\_flow a writeable property
|
||||||
|
- Do not propagate Flow.getNode to parent when called from outside flow
|
||||||
|
- Add support of subflow env var
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- Properly sanitize node names in deploy warning dialogs
|
||||||
|
- Fix XSS issues in library ui code
|
||||||
|
- Add env type to subflow env var types
|
||||||
|
- Display parent subflow properties in edit dialog
|
||||||
|
- Fix direction value of subflow output
|
||||||
|
- Add Status Node to Subflow to allow subflow-specific status Closes #597
|
||||||
|
- Better handling of multiple flow merges Fixes #2039
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- Various translation updates
|
||||||
|
- Catch: Add 'catch uncaught only' mode. Closes #1747
|
||||||
|
- Link: scroll to current flow in node list
|
||||||
|
- HTTPRequest: add option to urlencode cookies
|
||||||
|
- HTTPRequest: option to use msg.payload as query params on GET. #1981
|
||||||
|
- Debug: Add local time display option to numerics in debug window
|
||||||
|
- MQTT: Add parsed JSON output option
|
||||||
|
|
||||||
|
#### 0.20.0-beta.4: Beta Release
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
|
||||||
|
- Bump JSONata to 1.6.4
|
||||||
|
- Add Flow.getSetting for resolving env-var properties
|
||||||
|
- Refactor Subflow logic into own class
|
||||||
|
- Restore RED.auth to node-red module api
|
||||||
|
- Tidy up when usage in Flow and Node
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- German translation
|
||||||
|
- Change default dropdown appearance and sidebar tab menu handling
|
||||||
|
- Handle multiple-select box when nothing selected Fixes #2021
|
||||||
|
- Handle i18n properly when key is a valid sub-identifier Fixes #2028
|
||||||
|
- Avoid duplicate links when missing node type installed Fixes #2032
|
||||||
|
- Add View Tools
|
||||||
|
- Don't collapse version control header when clicking refresh
|
||||||
|
- Add fast entry via keyboard for string of nodes
|
||||||
|
- Check for undeployed change before showing open project dialog
|
||||||
|
- Add placeholder node when in quick-add mode
|
||||||
|
- Move nodes to top-left corner when converting to subflow
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- Debug: Allow debug edit expression to be sent to status
|
||||||
|
- WebSocket: Fix missing translated help
|
||||||
|
|
||||||
|
|
||||||
|
#### 0.20.0-beta.3: Beta Release
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- Update palette manager view properly when module updated
|
||||||
|
- Add TreeList common widget
|
||||||
|
- Fix visual jump when opening Comment editor on Safari Part of #2008
|
||||||
|
- Fix vertical align of markdown editor in Safari Fixes #2008
|
||||||
|
- Avoid marking node as changed if label state is default Fixes #2009
|
||||||
|
- Highlight port on node hover while joining
|
||||||
|
- Support drag-wiring of link nodes
|
||||||
|
- Allow TypeSearch to include a filter option
|
||||||
|
- Improve diff colouring
|
||||||
|
- Allow sections to toggle in 2-element stack
|
||||||
|
- Add support for ${} env var syntax when skipping validation Closes #1980
|
||||||
|
- i18 support for markdown editor tooltip
|
||||||
|
- Add RED.editor.registerTypeEditor for custom type editors
|
||||||
|
- Tidy up markdown toolbar handling across all editors
|
||||||
|
- Added validation while export into library
|
||||||
|
- Reuse notification boxes rather than stack multiple of the same type
|
||||||
|
- Make ssh key dialog accessible when opened from new proj dialog
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
|
||||||
|
- Bump JSONata to 1.6.4 Fixes #2023
|
||||||
|
- Add audit logging to admin api
|
||||||
|
- Fix failure of RED.require #2010
|
||||||
|
- Allow oauth strategy callback method to be customised Closes #1998
|
||||||
|
- Ensure fs context cache is flushed on close Fixes #2001
|
||||||
|
- Fix library Buffer( to Buffer.alloc( for node 10
|
||||||
|
- Catch file-not-found on startup when non-existant flow file specified
|
||||||
|
- Actively expire login sesssions and notify user
|
||||||
|
- Add quotation marks for basic auth challenge #1976
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- Change: remove promises to improve performance
|
||||||
|
- Debug: add ability to apply JSONata expression to message
|
||||||
|
- Join: remove promises to improve performance
|
||||||
|
- JSON: delete msg.schema before sending msg to avoid conflicts
|
||||||
|
- Link: update UI to use common TreeList widget
|
||||||
|
- Switch: remove promises to improve performance
|
||||||
|
|
||||||
|
#### 0.20.0-beta.2: Beta Release
|
||||||
|
|
||||||
|
- Split Node-RED internals into multiple sub-modules
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- Allow the editor to use a custom admin api url root
|
||||||
|
- Improve performance of Flow Diff dialog - @TothiViseo #1989
|
||||||
|
- Add 'open project' option to Projects Welcome dialog
|
||||||
|
- Add 'type already registered' check in palette editor
|
||||||
|
- Handle missing tab.disabled property
|
||||||
|
- Handle missing wires prop and string x/y props on import
|
||||||
|
- Add RED.notifications.hide flag - for UI testing
|
||||||
|
- Improve alignment of node label edit inputs
|
||||||
|
- Show arrow-in node when invalid font-awesome icon name was specified for default icon
|
||||||
|
- Add ability to delete context values from sidebar
|
||||||
|
- Allow copy-to-clipboard copy whole tabs
|
||||||
|
- Make disabled flows more obvious in editor
|
||||||
|
- Allow import/export from file in editor
|
||||||
|
- Allow config nodes to be selected in sidebar and deleted
|
||||||
|
- Show port label of subflow with input port
|
||||||
|
- Support ctrl-click selection of flow tabs
|
||||||
|
- Allow left-hand node button to act as toggle
|
||||||
|
- Support dbl-click in tab bar to add new flow in position
|
||||||
|
- Fix duplicate subflow detection on import
|
||||||
|
- Add import notification with info on what has been imported Closes #1862
|
||||||
|
- Show error details when trying to import invalid json
|
||||||
|
- Show default icon when non-existent font-awesome icon was specified
|
||||||
|
- Add configurable option for showing node label
|
||||||
|
- Avoid http redirects as Safari doesn't reuse Auth header Fixes #1903
|
||||||
|
- Tidy up ace tooltip styling
|
||||||
|
- Add event log to editor
|
||||||
|
- Add tooltips to multiple editor elements
|
||||||
|
- Allow palette to be hidden
|
||||||
|
- Add node module into to sidebar and palette popover
|
||||||
|
- Mark all newly imported nodes as changed
|
||||||
|
- Allow a node label to be hidden
|
||||||
|
- Add markdown formatting toolbar
|
||||||
|
- Add markdown toolbar to various editors
|
||||||
|
- Fix i18n handling for ja-JP locale on Safari/MacOS
|
||||||
|
- Add node body tooltip
|
||||||
|
- Decrease opacity of flow-navigator
|
||||||
|
- Update tooltip style
|
||||||
|
- Update ACE to 1.4.1-src-min-noconflict
|
||||||
|
- Cache node locales by language
|
||||||
|
- Show icon element with either icon image or fa-icon
|
||||||
|
- Added font-awesome icons to user defined icon
|
||||||
|
- Update info side bar with node description section
|
||||||
|
- One-click search of config node users
|
||||||
|
- Redesign node edit dialog to tabbed style
|
||||||
|
- Add 'restart flows' option to deploy menu
|
||||||
|
- Add node description property UI
|
||||||
|
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
|
||||||
|
- Allow a project to be loaded from cmdline
|
||||||
|
- Handle lookup of undefined property in Global context Fixes #1978
|
||||||
|
- Refuse to enable Manage Palette if npm too old
|
||||||
|
- Remove restriction on upgrading non-local modules
|
||||||
|
- Remove deprecated Buffer constructor usage Fixes #1709
|
||||||
|
- Update httpServerOptions doc in settings.js
|
||||||
|
- Exclude non-testable .js files from the unit tests
|
||||||
|
- Add --safe mode flag to allow starting without flows running
|
||||||
|
- Add setting-defined accessToken for automated access to the adminAPI - #1789
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- Move all core node EN help to their own locale files - #1990
|
||||||
|
- CSV: better regex for number detection
|
||||||
|
- Debug: hide button if not configured to send to sidebar
|
||||||
|
- Delay: report queue activity when in by-topic mode
|
||||||
|
- Delay: add msg.flush mode
|
||||||
|
- Exec: Preserve existing properties on msg object
|
||||||
|
- File: remove CR/LF from incoming filename
|
||||||
|
- Function: create custom ace javascript mode to handle ES6 Fixes #1911
|
||||||
|
- Function: add env.get
|
||||||
|
- HTTP Request: Add http-proxy config #1913
|
||||||
|
- HTTP Request: add msg.redirectList to output
|
||||||
|
- HTTP Request: add msg.requestTimeout option for per-message setting - @natcl #1959
|
||||||
|
- MQTT: add auto-detect and base64 output to mqtt node Fixes #1912 - @DurandA
|
||||||
|
- MQTT: only unsubscribe node that is being removed
|
||||||
|
- Sentiment: move to node-red-node-sentiment
|
||||||
|
- Switch: add missing edit dialog icon
|
||||||
|
- Tail: move to node-red-node-tail
|
||||||
|
- TCPGet: clear status if user changes target per message
|
||||||
|
- Template: tidy up edit dialog
|
||||||
|
- UDP: more resilient binding to correct port for udp, give input side priority
|
||||||
|
- Split/Join: add msg.reset to info panel
|
||||||
|
- Split/Join: reset join without sending part array
|
||||||
|
- Watch: add msg.filename so can feed direct to file in node
|
||||||
|
- WebSocket: preserve \_session on msg but don't send as part of wholemsg
|
||||||
|
|
||||||
|
#### 0.19.6: Maintenance Release
|
||||||
|
|
||||||
|
- Fix encoding of file node from binary to utf8 - #2051
|
||||||
|
|
||||||
|
#### 0.19.5: Maintenance Release
|
||||||
|
|
||||||
|
- Recognize pip installs of RPi.GPIO (#1934)
|
||||||
|
- Merge pull request #1941 from node-red-hitachi/master-batch
|
||||||
|
- Merge pull request #1931 from node-red-hitachi/master-typedinput
|
||||||
|
- Set min value of properties and spinners for batch
|
||||||
|
- Fix that unnecessary optionMenu remains
|
||||||
|
- Merge pull request #1894 from node-red-hitachi/fix-overlapping-file-node-execution
|
||||||
|
- Merge pull request #1924 from imZack/patch-1
|
||||||
|
- Add missing comma
|
||||||
|
- Do not disable context sidebar during node edit Fixes #1921
|
||||||
|
- Don't allow virtual links to be spliced Fixes #1920
|
||||||
|
- Merge project package changes to avoid overwritten changes
|
||||||
|
- Handle manually added project deps that are unused Fixes #1908
|
||||||
|
- update close & input handling of File node
|
||||||
|
- make close handler argument only one
|
||||||
|
- Merge pull request #1907 from amilajack/patch-2
|
||||||
|
- Change repo badge to point to master branch
|
||||||
|
- invoke callbacks if async handler is specified
|
||||||
|
- Merge pull request #1891 from camlow325/resolve-example-path-for-windows-support
|
||||||
|
- Merge pull request #1900 from kazuhitoyokoi/master-addtestcases4settings.js
|
||||||
|
- wait closing while pending messages exist
|
||||||
|
- Add test cases for red/api/editor/settings.js
|
||||||
|
- Ensure all palette categories are opened properly Closes #1893
|
||||||
|
- Resolve path when sending example file for Windows support
|
||||||
|
- fix multiple input message processing of file node
|
||||||
|
|
||||||
|
#### 0.19.4: Maintenance Release
|
||||||
|
|
||||||
|
- Fix race condition in non-cache lfs context Fixes #1888
|
||||||
|
- LocalFileSystem Context: Remove extra flush code
|
||||||
|
- Prevent race condition in caching mode of lfs context (#1889)
|
||||||
|
- Allow context store name to be provided in the key
|
||||||
|
- Switch node: only use promises when absolutely necessary
|
||||||
|
- Fix dbl-click handling on webkit-based browsers
|
||||||
|
- Ensure context.flow/global cannot be deleted or enumerated
|
||||||
|
- Handle context.get with multiple levels of unknown key Fixes #1883
|
||||||
|
- Fix global.get("foo.bar") for functionGlobalContext set values
|
||||||
|
- Fix node color bug (#1877)
|
||||||
|
- Merge pull request #1857 from cclauss/patch-1
|
||||||
|
- Define raw_input() in Python 3 & fix time.sleep()
|
||||||
|
|
||||||
|
#### 0.19.3: Maintenance Release
|
||||||
|
|
||||||
|
- Split node - fix complete to send msg for k/v object
|
||||||
|
- Remove unused Join node merged object key typed input
|
||||||
|
- Set the JavaScript editor to full-screen
|
||||||
|
- Filter global modules installed locally
|
||||||
|
- Add svg to permitted icon extension list
|
||||||
|
- Debug node - indicate status all the time if selected to do so
|
||||||
|
- pi nodes - increase test coverage slightly
|
||||||
|
- TCP-request node - only write payload
|
||||||
|
- JSON schema: perform validation when obj -> obj or str -> str
|
||||||
|
- JSON schema: add draft-06 support (via $schema keyword)
|
||||||
|
- Mqtt proxy configuration for websocket connection, #1651.
|
||||||
|
- Allows MQTT Shared Subscriptions for MQTT-In core node
|
||||||
|
- Fix use of HTML tag or CSS class specification as icon of typedInput
|
||||||
|
|
||||||
|
#### 0.19.2: Maintenance Release
|
||||||
|
|
||||||
|
- Ensure node default colour is used if palette.theme has no match
|
||||||
|
- fix lost messages / properties in TCPRequest Node; closes #1863 (#1864)
|
||||||
|
- Fix typo in template.html
|
||||||
|
- Improve error reporting from context plugin loading
|
||||||
|
- Prevent no-op edit of node marking as changed due to icon
|
||||||
|
- Change node must handle empty rule set
|
||||||
|
|
||||||
|
#### 0.19.1: Maintenance Release
|
||||||
|
|
||||||
|
- Pull in latest twitter node
|
||||||
|
- Handle windows paths for context storage
|
||||||
|
- Handle persisting objects with circular refs in context
|
||||||
|
- Ensure js editor can expand to fill available space
|
||||||
|
- Add example localfilesystem contextStorage to settings
|
||||||
|
- Fix template node handling of nested context tags
|
||||||
|
|
||||||
#### 0.19: Milestone Release
|
#### 0.19: Milestone Release
|
||||||
|
|
||||||
Editor
|
Editor
|
||||||
@@ -59,6 +463,7 @@ Runtime
|
|||||||
- Handle loading empty nodesDir
|
- Handle loading empty nodesDir
|
||||||
- Add 'private' property to userDir generated package.json
|
- Add 'private' property to userDir generated package.json
|
||||||
- Add RED.require to allow nodes to access other modules
|
- Add RED.require to allow nodes to access other modules
|
||||||
|
- Ensure add/remove modules are run sequentially
|
||||||
|
|
||||||
#### 0.18.7: Maintenance Release
|
#### 0.18.7: Maintenance Release
|
||||||
|
|
||||||
|
|||||||
382
Gruntfile.js
@@ -15,6 +15,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
|
var fs = require("fs-extra");
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ module.exports = function(grunt) {
|
|||||||
reporter: 'spec'
|
reporter: 'spec'
|
||||||
},
|
},
|
||||||
all: { src: ['test/**/*_spec.js'] },
|
all: { src: ['test/**/*_spec.js'] },
|
||||||
core: { src: ["test/_spec.js","test/red/**/*_spec.js"]},
|
core: { src: ["test/_spec.js","test/unit/**/*_spec.js"]},
|
||||||
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
||||||
},
|
},
|
||||||
webdriver: {
|
webdriver: {
|
||||||
@@ -57,10 +58,11 @@ module.exports = function(grunt) {
|
|||||||
ignoreLeaks: false,
|
ignoreLeaks: false,
|
||||||
ui: 'bdd',
|
ui: 'bdd',
|
||||||
reportFormats: ['lcov','html'],
|
reportFormats: ['lcov','html'],
|
||||||
print: 'both'
|
print: 'both',
|
||||||
|
istanbulOptions: ['--no-default-excludes', '-i','**/packages/node_modules/**']
|
||||||
},
|
},
|
||||||
all: { src: ["test/_spec.js","test/red/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
||||||
core: { src: ["test/_spec.js","test/red/**/*_spec.js"]},
|
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
|
||||||
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
||||||
},
|
},
|
||||||
jshint: {
|
jshint: {
|
||||||
@@ -80,16 +82,14 @@ module.exports = function(grunt) {
|
|||||||
all: [
|
all: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
'red.js',
|
'red.js',
|
||||||
'red/**/*.js',
|
'packages/**/*.js'
|
||||||
'nodes/core/*/*.js',
|
|
||||||
'editor/js/**/*.js'
|
|
||||||
],
|
],
|
||||||
core: {
|
core: {
|
||||||
files: {
|
files: {
|
||||||
src: [
|
src: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
'red.js',
|
'red.js',
|
||||||
'red/**/*.js'
|
'packages/**/*.js',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -120,81 +120,88 @@ module.exports = function(grunt) {
|
|||||||
src: [
|
src: [
|
||||||
// Ensure editor source files are concatenated in
|
// Ensure editor source files are concatenated in
|
||||||
// the right order
|
// the right order
|
||||||
"editor/js/red.js",
|
"packages/node_modules/@node-red/editor-client/src/js/jquery-addons.js",
|
||||||
"editor/js/events.js",
|
"packages/node_modules/@node-red/editor-client/src/js/red.js",
|
||||||
"editor/js/i18n.js",
|
"packages/node_modules/@node-red/editor-client/src/js/events.js",
|
||||||
"editor/js/settings.js",
|
"packages/node_modules/@node-red/editor-client/src/js/i18n.js",
|
||||||
"editor/js/user.js",
|
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
|
||||||
"editor/js/comms.js",
|
"packages/node_modules/@node-red/editor-client/src/js/user.js",
|
||||||
"editor/js/text/bidi.js",
|
"packages/node_modules/@node-red/editor-client/src/js/comms.js",
|
||||||
"editor/js/text/format.js",
|
"packages/node_modules/@node-red/editor-client/src/js/text/bidi.js",
|
||||||
"editor/js/ui/state.js",
|
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
|
||||||
"editor/js/nodes.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
|
||||||
"editor/js/history.js",
|
"packages/node_modules/@node-red/editor-client/src/js/nodes.js",
|
||||||
"editor/js/validators.js",
|
"packages/node_modules/@node-red/editor-client/src/js/font-awesome.js",
|
||||||
"editor/js/ui/utils.js",
|
"packages/node_modules/@node-red/editor-client/src/js/history.js",
|
||||||
"editor/js/ui/common/editableList.js",
|
"packages/node_modules/@node-red/editor-client/src/js/validators.js",
|
||||||
"editor/js/ui/common/checkboxSet.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/utils.js",
|
||||||
"editor/js/ui/common/menu.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js",
|
||||||
"editor/js/ui/common/panels.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js",
|
||||||
"editor/js/ui/common/popover.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/checkboxSet.js",
|
||||||
"editor/js/ui/common/searchBox.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js",
|
||||||
"editor/js/ui/common/tabs.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/panels.js",
|
||||||
"editor/js/ui/common/stack.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/popover.js",
|
||||||
"editor/js/ui/common/typedInput.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js",
|
||||||
"editor/js/ui/actions.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js",
|
||||||
"editor/js/ui/deploy.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/stack.js",
|
||||||
"editor/js/ui/diff.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js",
|
||||||
"editor/js/ui/keyboard.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js",
|
||||||
"editor/js/ui/workspaces.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/actions.js",
|
||||||
"editor/js/ui/view.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js",
|
||||||
"editor/js/ui/view-navigator.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/diff.js",
|
||||||
"editor/js/ui/sidebar.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js",
|
||||||
"editor/js/ui/palette.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
|
||||||
"editor/js/ui/tab-info.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/statusBar.js",
|
||||||
"editor/js/ui/tab-config.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view.js",
|
||||||
"editor/js/ui/tab-context.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view-navigator.js",
|
||||||
"editor/js/ui/palette-editor.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view-tools.js",
|
||||||
"editor/js/ui/editor.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js",
|
||||||
"editor/js/ui/editors/*.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/palette.js",
|
||||||
"editor/js/ui/tray.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js",
|
||||||
"editor/js/ui/clipboard.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js",
|
||||||
"editor/js/ui/library.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js",
|
||||||
"editor/js/ui/notifications.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js",
|
||||||
"editor/js/ui/search.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editor.js",
|
||||||
"editor/js/ui/typeSearch.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/*.js",
|
||||||
"editor/js/ui/subflow.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/event-log.js",
|
||||||
"editor/js/ui/userSettings.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tray.js",
|
||||||
"editor/js/ui/projects/projects.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js",
|
||||||
"editor/js/ui/projects/projectSettings.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
|
||||||
"editor/js/ui/projects/projectUserSettings.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js",
|
||||||
"editor/js/ui/projects/tab-versionControl.js",
|
"packages/node_modules/@node-red/editor-client/src/js/ui/search.js",
|
||||||
"editor/js/ui/touch/radialMenu.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/userSettings.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/js/ui/touch/radialMenu.js"
|
||||||
],
|
],
|
||||||
dest: "public/red/red.js"
|
dest: "packages/node_modules/@node-red/editor-client/public/red/red.js"
|
||||||
},
|
},
|
||||||
vendor: {
|
vendor: {
|
||||||
files: {
|
files: {
|
||||||
"public/vendor/vendor.js": [
|
"packages/node_modules/@node-red/editor-client/public/vendor/vendor.js": [
|
||||||
"editor/vendor/jquery/js/jquery-1.11.3.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-3.4.1.min.js",
|
||||||
"editor/vendor/bootstrap/js/bootstrap.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-migrate-3.0.1.min.js",
|
||||||
"editor/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-ui.min.js",
|
||||||
"editor/vendor/jquery/js/jquery.ui.touch-punch.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js",
|
||||||
"editor/vendor/marked/marked.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/marked/marked.min.js",
|
||||||
"editor/vendor/d3/d3.v3.min.js",
|
"packages/node_modules/@node-red/editor-client/src/vendor/d3/d3.v3.min.js",
|
||||||
"editor/vendor/i18next/i18next.min.js"
|
"packages/node_modules/@node-red/editor-client/src/vendor/i18next/i18next.min.js",
|
||||||
],
|
|
||||||
"public/vendor/vendor.css": [
|
|
||||||
// TODO: resolve relative resource paths in
|
|
||||||
// bootstrap/FA/jquery
|
|
||||||
],
|
|
||||||
"public/vendor/jsonata/jsonata.min.js": [
|
|
||||||
"node_modules/jsonata/jsonata-es5.min.js",
|
"node_modules/jsonata/jsonata-es5.min.js",
|
||||||
"editor/vendor/jsonata/formatter.js"
|
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/formatter.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ace.js",
|
||||||
|
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ext-language_tools.js",
|
||||||
],
|
],
|
||||||
"public/vendor/ace/worker-jsonata.js": [
|
// "packages/node_modules/@node-red/editor-client/public/vendor/vendor.css": [
|
||||||
|
// // TODO: resolve relative resource paths in
|
||||||
|
// // bootstrap/FA/jquery
|
||||||
|
// ],
|
||||||
|
"packages/node_modules/@node-red/editor-client/public/vendor/ace/worker-jsonata.js": [
|
||||||
"node_modules/jsonata/jsonata-es5.min.js",
|
"node_modules/jsonata/jsonata-es5.min.js",
|
||||||
"editor/vendor/jsonata/worker-jsonata.js"
|
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/worker-jsonata.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -202,10 +209,10 @@ module.exports = function(grunt) {
|
|||||||
uglify: {
|
uglify: {
|
||||||
build: {
|
build: {
|
||||||
files: {
|
files: {
|
||||||
'public/red/red.min.js': 'public/red/red.js',
|
'packages/node_modules/@node-red/editor-client/public/red/red.min.js': 'packages/node_modules/@node-red/editor-client/public/red/red.js',
|
||||||
'public/red/main.min.js': 'public/red/main.js',
|
'packages/node_modules/@node-red/editor-client/public/red/main.min.js': 'packages/node_modules/@node-red/editor-client/public/red/main.js',
|
||||||
'public/vendor/ace/mode-jsonata.js': 'editor/vendor/jsonata/mode-jsonata.js',
|
'packages/node_modules/@node-red/editor-client/public/vendor/ace/mode-jsonata.js': 'packages/node_modules/@node-red/editor-client/src/vendor/jsonata/mode-jsonata.js',
|
||||||
'public/vendor/ace/snippets/jsonata.js': 'editor/vendor/jsonata/snippets-jsonata.js'
|
'packages/node_modules/@node-red/editor-client/public/vendor/ace/snippets/jsonata.js': 'packages/node_modules/@node-red/editor-client/src/vendor/jsonata/snippets-jsonata.js'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -215,50 +222,46 @@ module.exports = function(grunt) {
|
|||||||
outputStyle: 'compressed'
|
outputStyle: 'compressed'
|
||||||
},
|
},
|
||||||
files: [{
|
files: [{
|
||||||
dest: 'public/red/style.min.css',
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/style.min.css',
|
||||||
src: 'editor/sass/style.scss'
|
src: 'packages/node_modules/@node-red/editor-client/src/sass/style.scss'
|
||||||
},
|
|
||||||
{
|
|
||||||
dest: 'public/vendor/bootstrap/css/bootstrap.min.css',
|
|
||||||
src: 'editor/vendor/bootstrap/css/bootstrap.css'
|
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
jsonlint: {
|
jsonlint: {
|
||||||
messages: {
|
messages: {
|
||||||
src: [
|
src: [
|
||||||
'nodes/core/locales/en-US/messages.json',
|
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
||||||
'red/api/locales/en-US/editor.json',
|
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
||||||
'red/runtime/locales/en-US/runtime.json'
|
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
keymaps: {
|
keymaps: {
|
||||||
src: [
|
src: [
|
||||||
'editor/js/keymap.json'
|
'packages/node_modules/@node-red/editor-client/src/js/keymap.json'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
attachCopyright: {
|
attachCopyright: {
|
||||||
js: {
|
js: {
|
||||||
src: [
|
src: [
|
||||||
'public/red/red.min.js',
|
'packages/node_modules/@node-red/editor-client/public/red/red.min.js',
|
||||||
'public/red/main.min.js'
|
'packages/node_modules/@node-red/editor-client/public/red/main.min.js'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
src: [
|
src: [
|
||||||
'public/red/style.min.css'
|
'packages/node_modules/@node-red/editor-client/public/red/style.min.css'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clean: {
|
clean: {
|
||||||
build: {
|
build: {
|
||||||
src: [
|
src: [
|
||||||
"public/red",
|
"packages/node_modules/@node-red/editor-client/public/red",
|
||||||
"public/index.html",
|
"packages/node_modules/@node-red/editor-client/public/index.html",
|
||||||
"public/favicon.ico",
|
"packages/node_modules/@node-red/editor-client/public/favicon.ico",
|
||||||
"public/icons",
|
"packages/node_modules/@node-red/editor-client/public/icons",
|
||||||
"public/vendor"
|
"packages/node_modules/@node-red/editor-client/public/vendor"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
@@ -270,27 +273,27 @@ module.exports = function(grunt) {
|
|||||||
watch: {
|
watch: {
|
||||||
js: {
|
js: {
|
||||||
files: [
|
files: [
|
||||||
'editor/js/**/*.js'
|
'packages/node_modules/@node-red/editor-client/src/js/**/*.js'
|
||||||
],
|
],
|
||||||
tasks: ['copy:build','concat','uglify','attachCopyright:js']
|
tasks: ['copy:build','concat','uglify','attachCopyright:js']
|
||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
files: [
|
files: [
|
||||||
'editor/sass/**/*.scss'
|
'packages/node_modules/@node-red/editor-client/src/sass/**/*.scss'
|
||||||
],
|
],
|
||||||
tasks: ['sass','attachCopyright:css']
|
tasks: ['sass','attachCopyright:css']
|
||||||
},
|
},
|
||||||
json: {
|
json: {
|
||||||
files: [
|
files: [
|
||||||
'nodes/core/locales/en-US/messages.json',
|
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
||||||
'red/api/locales/en-US/editor.json',
|
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
||||||
'red/runtime/locales/en-US/runtime.json'
|
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
||||||
],
|
],
|
||||||
tasks: ['jsonlint:messages']
|
tasks: ['jsonlint:messages']
|
||||||
},
|
},
|
||||||
keymaps: {
|
keymaps: {
|
||||||
files: [
|
files: [
|
||||||
'editor/js/keymap.json'
|
'packages/node_modules/@node-red/editor-client/src/js/keymap.json'
|
||||||
],
|
],
|
||||||
tasks: ['jsonlint:keymaps','copy:build']
|
tasks: ['jsonlint:keymaps','copy:build']
|
||||||
},
|
},
|
||||||
@@ -305,12 +308,13 @@ module.exports = function(grunt) {
|
|||||||
nodemon: {
|
nodemon: {
|
||||||
/* uses .nodemonignore */
|
/* uses .nodemonignore */
|
||||||
dev: {
|
dev: {
|
||||||
script: 'red.js',
|
script: 'packages/node_modules/node-red/red.js',
|
||||||
options: {
|
options: {
|
||||||
args: nodemonArgs,
|
args: nodemonArgs,
|
||||||
ext: 'js,html,json',
|
ext: 'js,html,json',
|
||||||
watch: [
|
watch: [
|
||||||
'red','nodes'
|
'packages/node_modules',
|
||||||
|
'!packages/node_modules/@node-red/editor-client'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,69 +333,56 @@ module.exports = function(grunt) {
|
|||||||
build: {
|
build: {
|
||||||
files:[
|
files:[
|
||||||
{
|
{
|
||||||
src: 'editor/js/main.js',
|
src: 'packages/node_modules/@node-red/editor-client/src/js/main.js',
|
||||||
dest: 'public/red/main.js'
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/main.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'editor/js/keymap.json',
|
src: 'packages/node_modules/@node-red/editor-client/src/js/keymap.json',
|
||||||
dest: 'public/red/keymap.json'
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/keymap.json'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cwd: 'editor/images',
|
cwd: 'packages/node_modules/@node-red/editor-client/src/images',
|
||||||
src: '**',
|
src: '**',
|
||||||
expand: true,
|
expand: true,
|
||||||
dest: 'public/red/images/'
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/images/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cwd: 'editor/vendor',
|
cwd: 'packages/node_modules/@node-red/editor-client/src/vendor',
|
||||||
src: [
|
src: [
|
||||||
'ace/**',
|
'ace/**',
|
||||||
//'bootstrap/css/**',
|
'jquery/css/base/**',
|
||||||
'bootstrap/img/**',
|
|
||||||
'jquery/css/**',
|
|
||||||
'font-awesome/**'
|
'font-awesome/**'
|
||||||
],
|
],
|
||||||
expand: true,
|
expand: true,
|
||||||
dest: 'public/vendor/'
|
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cwd: 'editor/icons',
|
cwd: 'packages/node_modules/@node-red/editor-client/src/icons',
|
||||||
src: '**',
|
src: '**',
|
||||||
expand: true,
|
expand: true,
|
||||||
dest: 'public/icons/'
|
dest: 'packages/node_modules/@node-red/editor-client/public/icons/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['editor/index.html','editor/favicon.ico'],
|
src: ['packages/node_modules/@node-red/editor-client/src/index.html','packages/node_modules/@node-red/editor-client/src/favicon.ico'],
|
||||||
dest: 'public/',
|
dest: 'packages/node_modules/@node-red/editor-client/public/',
|
||||||
flatten: true
|
flatten: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'CHANGELOG.md',
|
src: 'CHANGELOG.md',
|
||||||
dest: 'public/red/about'
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/about'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'CHANGELOG.md',
|
||||||
|
dest: 'packages/node_modules/node-red/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
cwd: 'packages/node_modules/@node-red/editor-client/src/ace/bin/',
|
||||||
|
src: '**',
|
||||||
|
expand: true,
|
||||||
|
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/ace/'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
release: {
|
|
||||||
files: [{
|
|
||||||
mode: true,
|
|
||||||
expand: true,
|
|
||||||
src: [
|
|
||||||
'*.md',
|
|
||||||
'LICENSE',
|
|
||||||
'package.json',
|
|
||||||
'settings.js',
|
|
||||||
'red.js',
|
|
||||||
'lib/.gitignore',
|
|
||||||
'nodes/*.demo',
|
|
||||||
'nodes/core/**',
|
|
||||||
'red/**',
|
|
||||||
'public/**',
|
|
||||||
'editor/templates/**',
|
|
||||||
'bin/**'
|
|
||||||
],
|
|
||||||
dest: path.resolve('<%= paths.dist %>/node-red-<%= pkg.version %>')
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
chmod: {
|
chmod: {
|
||||||
@@ -400,37 +391,92 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
src: [
|
src: [
|
||||||
path.resolve('<%= paths.dist %>/node-red-<%= pkg.version %>/nodes/core/hardware/nrgpio*'),
|
"packages/node_modules/@node-red/nodes/core/hardware/nrgpio",
|
||||||
path.resolve('<%= paths.dist %>/node-red-<%= pkg.version %>/red/runtime/storage/localfilesystem/projects/git/node-red-*sh')
|
"packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/node-red-*sh"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'npm-command': {
|
||||||
|
options: {
|
||||||
|
cmd: "pack",
|
||||||
|
cwd: "<%= paths.dist %>/modules"
|
||||||
|
},
|
||||||
|
'node-red': { options: { args: [__dirname+'/packages/node_modules/node-red'] } },
|
||||||
|
'@node-red/editor-api': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-api'] } },
|
||||||
|
'@node-red/editor-client': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-client'] } },
|
||||||
|
'@node-red/nodes': { options: { args: [__dirname+'/packages/node_modules/@node-red/nodes'] } },
|
||||||
|
'@node-red/registry': { options: { args: [__dirname+'/packages/node_modules/@node-red/registry'] } },
|
||||||
|
'@node-red/runtime': { options: { args: [__dirname+'/packages/node_modules/@node-red/runtime'] } },
|
||||||
|
'@node-red/util': { options: { args: [__dirname+'/packages/node_modules/@node-red/util'] } }
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
mkdir: {
|
||||||
|
release: {
|
||||||
|
options: {
|
||||||
|
create: ['<%= paths.dist %>/modules']
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
compress: {
|
compress: {
|
||||||
release: {
|
release: {
|
||||||
options: {
|
options: {
|
||||||
archive: '<%= paths.dist %>/node-red-<%= pkg.version %>.zip'
|
archive: '<%= paths.dist %>/node-red-<%= pkg.version %>.zip'
|
||||||
},
|
},
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: '<%= paths.dist %>/',
|
cwd: 'packages/node_modules/',
|
||||||
src: ['node-red-<%= pkg.version %>/**']
|
src: [
|
||||||
|
'**',
|
||||||
|
'!@node-red/editor-client/src/**'
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
jsdoc : {
|
jsdoc : {
|
||||||
runtimeAPI: {
|
modules: {
|
||||||
src: 'red/runtime-api/*.js',
|
src: [
|
||||||
|
'API.md',
|
||||||
|
'packages/node_modules/node-red/lib/red.js',
|
||||||
|
'packages/node_modules/@node-red/runtime/lib/index.js',
|
||||||
|
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||||
|
'packages/node_modules/@node-red/runtime/lib/events.js',
|
||||||
|
'packages/node_modules/@node-red/util/**/*.js',
|
||||||
|
'packages/node_modules/@node-red/editor-api/lib/index.js',
|
||||||
|
'packages/node_modules/@node-red/editor-api/lib/auth/index.js'
|
||||||
|
],
|
||||||
options: {
|
options: {
|
||||||
destination: 'docs',
|
destination: 'docs',
|
||||||
configure: './jsdoc.json'
|
configure: './jsdoc.json'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
_editor: {
|
||||||
|
src: [
|
||||||
|
'packages/node_modules/@node-red/editor-client/src/js'
|
||||||
|
],
|
||||||
|
options: {
|
||||||
|
destination: 'packages/node_modules/@node-red/editor-client/docs',
|
||||||
|
configure: './jsdoc.json'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
jsdoc2md: {
|
jsdoc2md: {
|
||||||
runtimeAPI: {
|
runtimeAPI: {
|
||||||
options: {
|
options: {
|
||||||
separators: true
|
separators: true
|
||||||
},
|
},
|
||||||
src: 'red/runtime-api/*.js',
|
src: [
|
||||||
dest: 'docs/runtime-api.md'
|
'packages/node_modules/@node-red/runtime/lib/index.js',
|
||||||
|
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||||
|
'packages/node_modules/@node-red/runtime/lib/events.js'
|
||||||
|
],
|
||||||
|
dest: 'packages/node_modules/@node-red/runtime/docs/api.md'
|
||||||
|
},
|
||||||
|
nodeREDUtil: {
|
||||||
|
options: {
|
||||||
|
separators: true
|
||||||
|
},
|
||||||
|
src: 'packages/node_modules/@node-red/util/**/*.js',
|
||||||
|
dest: 'packages/node_modules/@node-red/util/docs/api.md'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -452,6 +498,8 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-webdriver');
|
grunt.loadNpmTasks('grunt-webdriver');
|
||||||
grunt.loadNpmTasks('grunt-jsdoc');
|
grunt.loadNpmTasks('grunt-jsdoc');
|
||||||
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
||||||
|
grunt.loadNpmTasks('grunt-npm-command');
|
||||||
|
grunt.loadNpmTasks('grunt-mkdir');
|
||||||
|
|
||||||
grunt.registerMultiTask('attachCopyright', function() {
|
grunt.registerMultiTask('attachCopyright', function() {
|
||||||
var files = this.data.src;
|
var files = this.data.src;
|
||||||
@@ -493,6 +541,25 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('verifyPackageDependencies', function() {
|
||||||
|
var done = this.async();
|
||||||
|
var verifyDependencies = require("./scripts/verify-package-dependencies.js");
|
||||||
|
verifyDependencies().then(function(failures) {
|
||||||
|
if (failures.length > 0) {
|
||||||
|
failures.forEach(f => grunt.log.error(f));
|
||||||
|
grunt.fail.fatal("Failed to verify package dependencies");
|
||||||
|
}
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('verifyUiTestDependencies', function() {
|
||||||
|
if (!fs.existsSync(path.join("node_modules", "chromedriver"))) {
|
||||||
|
grunt.fail.fatal('You need to run "npm install chromedriver@2" before running UI test.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
grunt.registerTask('setDevEnv',
|
grunt.registerTask('setDevEnv',
|
||||||
'Sets NODE_ENV=development so non-minified assets are used',
|
'Sets NODE_ENV=development so non-minified assets are used',
|
||||||
function () {
|
function () {
|
||||||
@@ -501,7 +568,7 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('default',
|
grunt.registerTask('default',
|
||||||
'Builds editor content then runs code style checks and unit tests on all components',
|
'Builds editor content then runs code style checks and unit tests on all components',
|
||||||
['build','jshint:editor','mocha_istanbul:all']);
|
['build','verifyPackageDependencies','jshint:editor','mocha_istanbul:all']);
|
||||||
|
|
||||||
grunt.registerTask('test-core',
|
grunt.registerTask('test-core',
|
||||||
'Runs code style check and unit tests on core runtime code',
|
'Runs code style check and unit tests on core runtime code',
|
||||||
@@ -513,7 +580,7 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('test-ui',
|
grunt.registerTask('test-ui',
|
||||||
'Builds editor content then runs unit tests on editor ui',
|
'Builds editor content then runs unit tests on editor ui',
|
||||||
['build','jshint:editor','webdriver:all']);
|
['verifyUiTestDependencies','build','jshint:editor','webdriver:all']);
|
||||||
|
|
||||||
grunt.registerTask('test-nodes',
|
grunt.registerTask('test-nodes',
|
||||||
'Runs unit tests on core nodes',
|
'Runs unit tests on core nodes',
|
||||||
@@ -529,7 +596,12 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('release',
|
grunt.registerTask('release',
|
||||||
'Create distribution zip file',
|
'Create distribution zip file',
|
||||||
['build','clean:release','copy:release','chmod:release','compress:release']);
|
['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules']);
|
||||||
|
|
||||||
|
grunt.registerTask('pack-modules',
|
||||||
|
'Create module pack files for release',
|
||||||
|
['mkdir:release','npm-command']);
|
||||||
|
|
||||||
|
|
||||||
grunt.registerTask('coverage',
|
grunt.registerTask('coverage',
|
||||||
'Run Istanbul code test coverage task',
|
'Run Istanbul code test coverage task',
|
||||||
@@ -537,5 +609,5 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('docs',
|
grunt.registerTask('docs',
|
||||||
'Generates API documentation',
|
'Generates API documentation',
|
||||||
['jsdoc','jsdoc2md']);
|
['jsdoc']);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
http://nodered.org
|
http://nodered.org
|
||||||
|
|
||||||
[](https://travis-ci.org/node-red/node-red)
|
[](https://travis-ci.org/node-red/node-red)
|
||||||
[](https://coveralls.io/r/node-red/node-red?branch=master)
|
[](https://coveralls.io/r/node-red/node-red?branch=master)
|
||||||
|
|
||||||
A visual tool for wiring the Internet of Things.
|
A visual tool for wiring the Internet of Things.
|
||||||
@@ -44,9 +44,6 @@ If you want to run the latest code from git, here's how to get started:
|
|||||||
4. Run
|
4. Run
|
||||||
|
|
||||||
npm start
|
npm start
|
||||||
or
|
|
||||||
|
|
||||||
node red.js
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -1,379 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
RED.clipboard = (function() {
|
|
||||||
|
|
||||||
var dialog;
|
|
||||||
var dialogContainer;
|
|
||||||
var exportNodesDialog;
|
|
||||||
var importNodesDialog;
|
|
||||||
var disabled = false;
|
|
||||||
|
|
||||||
function setupDialogs() {
|
|
||||||
dialog = $('<div id="clipboard-dialog" class="hide node-red-dialog"><form class="dialog-form form-horizontal"></form></div>')
|
|
||||||
.appendTo("body")
|
|
||||||
.dialog({
|
|
||||||
modal: true,
|
|
||||||
autoOpen: false,
|
|
||||||
width: 500,
|
|
||||||
resizable: false,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
id: "clipboard-dialog-cancel",
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "clipboard-dialog-close",
|
|
||||||
class: "primary",
|
|
||||||
text: RED._("common.label.close"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "clipboard-dialog-copy",
|
|
||||||
class: "primary",
|
|
||||||
text: RED._("clipboard.export.copy"),
|
|
||||||
click: function() {
|
|
||||||
$("#clipboard-export").select();
|
|
||||||
document.execCommand("copy");
|
|
||||||
document.getSelection().removeAllRanges();
|
|
||||||
RED.notify(RED._("clipboard.nodesExported"));
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "clipboard-dialog-ok",
|
|
||||||
class: "primary",
|
|
||||||
text: RED._("common.label.import"),
|
|
||||||
click: function() {
|
|
||||||
RED.view.importNodes($("#clipboard-import").val(),$("#import-tab > a.selected").attr('id') === 'import-tab-new');
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
open: function(e) {
|
|
||||||
$(this).parent().find(".ui-dialog-titlebar-close").hide();
|
|
||||||
},
|
|
||||||
close: function(e) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dialogContainer = dialog.children(".dialog-form");
|
|
||||||
|
|
||||||
exportNodesDialog =
|
|
||||||
'<div class="form-row">'+
|
|
||||||
'<label style="width:auto;margin-right: 10px;" data-i18n="clipboard.export.copy"></label>'+
|
|
||||||
'<span id="export-range-group" class="button-group">'+
|
|
||||||
'<a id="export-range-selected" class="editor-button toggle" href="#" data-i18n="clipboard.export.selected"></a>'+
|
|
||||||
'<a id="export-range-flow" class="editor-button toggle" href="#" data-i18n="clipboard.export.current"></a>'+
|
|
||||||
'<a id="export-range-full" class="editor-button toggle" href="#" data-i18n="clipboard.export.all"></a>'+
|
|
||||||
'</span>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="form-row">'+
|
|
||||||
'<textarea readonly style="resize: none; width: 100%; border-radius: 4px;font-family: monospace; font-size: 12px; background:#f3f3f3; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-export" rows="5"></textarea>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="form-row" style="text-align: right;">'+
|
|
||||||
'<span id="export-format-group" class="button-group">'+
|
|
||||||
'<a id="export-format-mini" class="editor-button editor-button-small toggle" href="#" data-i18n="clipboard.export.compact"></a>'+
|
|
||||||
'<a id="export-format-full" class="editor-button editor-button-small toggle" href="#" data-i18n="clipboard.export.formatted"></a>'+
|
|
||||||
'</span>'+
|
|
||||||
'</div>';
|
|
||||||
|
|
||||||
importNodesDialog = '<div class="form-row">'+
|
|
||||||
'<textarea style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-import" rows="5" placeholder="'+
|
|
||||||
RED._("clipboard.pasteNodes")+
|
|
||||||
'"></textarea>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="form-row">'+
|
|
||||||
'<label style="width:auto;margin-right: 10px;" data-i18n="clipboard.import.import"></label>'+
|
|
||||||
'<span id="import-tab" class="button-group">'+
|
|
||||||
'<a id="import-tab-current" class="editor-button toggle selected" href="#" data-i18n="clipboard.export.current"></a>'+
|
|
||||||
'<a id="import-tab-new" class="editor-button toggle" href="#" data-i18n="clipboard.import.newFlow"></a>'+
|
|
||||||
'</span>'+
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateImport() {
|
|
||||||
var importInput = $("#clipboard-import");
|
|
||||||
var v = importInput.val();
|
|
||||||
v = v.substring(v.indexOf('['),v.lastIndexOf(']')+1);
|
|
||||||
try {
|
|
||||||
JSON.parse(v);
|
|
||||||
importInput.removeClass("input-error");
|
|
||||||
importInput.val(v);
|
|
||||||
$("#clipboard-dialog-ok").button("enable");
|
|
||||||
} catch(err) {
|
|
||||||
if (v !== "") {
|
|
||||||
importInput.addClass("input-error");
|
|
||||||
}
|
|
||||||
$("#clipboard-dialog-ok").button("disable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function importNodes() {
|
|
||||||
if (disabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dialogContainer.empty();
|
|
||||||
dialogContainer.append($(importNodesDialog));
|
|
||||||
dialogContainer.i18n();
|
|
||||||
|
|
||||||
$("#clipboard-dialog-ok").show();
|
|
||||||
$("#clipboard-dialog-cancel").show();
|
|
||||||
$("#clipboard-dialog-close").hide();
|
|
||||||
$("#clipboard-dialog-copy").hide();
|
|
||||||
$("#clipboard-dialog-ok").button("disable");
|
|
||||||
$("#clipboard-import").keyup(validateImport);
|
|
||||||
$("#clipboard-import").on('paste',function() { setTimeout(validateImport,10)});
|
|
||||||
|
|
||||||
$("#import-tab > a").click(function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
if ($(this).hasClass('disabled') || $(this).hasClass('selected')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(this).parent().children().removeClass('selected');
|
|
||||||
$(this).addClass('selected');
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.dialog("option","title",RED._("clipboard.importNodes")).dialog("open");
|
|
||||||
}
|
|
||||||
|
|
||||||
function exportNodes() {
|
|
||||||
if (disabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dialogContainer.empty();
|
|
||||||
dialogContainer.append($(exportNodesDialog));
|
|
||||||
dialogContainer.i18n();
|
|
||||||
var format = RED.settings.flowFilePretty ? "export-format-full" : "export-format-mini";
|
|
||||||
|
|
||||||
$("#export-format-group > a").click(function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
if ($(this).hasClass('disabled') || $(this).hasClass('selected')) {
|
|
||||||
$("#clipboard-export").focus();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(this).parent().children().removeClass('selected');
|
|
||||||
$(this).addClass('selected');
|
|
||||||
|
|
||||||
var flow = $("#clipboard-export").val();
|
|
||||||
if (flow.length > 0) {
|
|
||||||
var nodes = JSON.parse(flow);
|
|
||||||
|
|
||||||
format = $(this).attr('id');
|
|
||||||
if (format === 'export-format-full') {
|
|
||||||
flow = JSON.stringify(nodes,null,4);
|
|
||||||
} else {
|
|
||||||
flow = JSON.stringify(nodes);
|
|
||||||
}
|
|
||||||
$("#clipboard-export").val(flow);
|
|
||||||
$("#clipboard-export").focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#export-range-group > a").click(function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
if ($(this).hasClass('disabled') || $(this).hasClass('selected')) {
|
|
||||||
$("#clipboard-export").focus();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(this).parent().children().removeClass('selected');
|
|
||||||
$(this).addClass('selected');
|
|
||||||
var type = $(this).attr('id');
|
|
||||||
var flow = "";
|
|
||||||
var nodes = null;
|
|
||||||
if (type === 'export-range-selected') {
|
|
||||||
var selection = RED.view.selection();
|
|
||||||
// Don't include the subflow meta-port nodes in the exported selection
|
|
||||||
nodes = RED.nodes.createExportableNodeSet(selection.nodes.filter(function(n) { return n.type !== 'subflow'}));
|
|
||||||
} else if (type === 'export-range-flow') {
|
|
||||||
var activeWorkspace = RED.workspaces.active();
|
|
||||||
nodes = RED.nodes.filterNodes({z:activeWorkspace});
|
|
||||||
var parentNode = RED.nodes.workspace(activeWorkspace)||RED.nodes.subflow(activeWorkspace);
|
|
||||||
nodes.unshift(parentNode);
|
|
||||||
nodes = RED.nodes.createExportableNodeSet(nodes);
|
|
||||||
} else if (type === 'export-range-full') {
|
|
||||||
nodes = RED.nodes.createCompleteNodeSet(false);
|
|
||||||
}
|
|
||||||
if (nodes !== null) {
|
|
||||||
if (format === "export-format-full") {
|
|
||||||
flow = JSON.stringify(nodes,null,4);
|
|
||||||
} else {
|
|
||||||
flow = JSON.stringify(nodes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (flow.length > 0) {
|
|
||||||
$("#export-copy").removeClass('disabled');
|
|
||||||
} else {
|
|
||||||
$("#export-copy").addClass('disabled');
|
|
||||||
}
|
|
||||||
$("#clipboard-export").val(flow);
|
|
||||||
$("#clipboard-export").focus();
|
|
||||||
})
|
|
||||||
|
|
||||||
$("#clipboard-dialog-ok").hide();
|
|
||||||
$("#clipboard-dialog-cancel").hide();
|
|
||||||
$("#clipboard-dialog-copy").hide();
|
|
||||||
$("#clipboard-dialog-close").hide();
|
|
||||||
var selection = RED.view.selection();
|
|
||||||
if (selection.nodes) {
|
|
||||||
$("#export-range-selected").click();
|
|
||||||
} else {
|
|
||||||
$("#export-range-selected").addClass('disabled').removeClass('selected');
|
|
||||||
$("#export-range-flow").click();
|
|
||||||
}
|
|
||||||
if (format === "export-format-full") {
|
|
||||||
$("#export-format-full").click();
|
|
||||||
} else {
|
|
||||||
$("#export-format-mini").click();
|
|
||||||
}
|
|
||||||
$("#clipboard-export")
|
|
||||||
.focus(function() {
|
|
||||||
var textarea = $(this);
|
|
||||||
textarea.select();
|
|
||||||
textarea.mouseup(function() {
|
|
||||||
textarea.unbind("mouseup");
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
});
|
|
||||||
dialog.dialog("option","title",RED._("clipboard.exportNodes")).dialog( "open" );
|
|
||||||
|
|
||||||
$("#clipboard-export").focus();
|
|
||||||
if (!document.queryCommandSupported("copy")) {
|
|
||||||
$("#clipboard-dialog-cancel").hide();
|
|
||||||
$("#clipboard-dialog-close").show();
|
|
||||||
} else {
|
|
||||||
$("#clipboard-dialog-cancel").show();
|
|
||||||
$("#clipboard-dialog-copy").show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideDropTarget() {
|
|
||||||
$("#dropTarget").hide();
|
|
||||||
RED.keyboard.remove("escape");
|
|
||||||
}
|
|
||||||
function copyText(value,element,msg) {
|
|
||||||
var truncated = false;
|
|
||||||
if (typeof value !== "string" ) {
|
|
||||||
value = JSON.stringify(value, function(key,value) {
|
|
||||||
if (value !== null && typeof value === 'object') {
|
|
||||||
if (value.__enc__) {
|
|
||||||
if (value.hasOwnProperty('data') && value.hasOwnProperty('length')) {
|
|
||||||
truncated = value.data.length !== value.length;
|
|
||||||
return value.data;
|
|
||||||
}
|
|
||||||
if (value.type === 'function' || value.type === 'internal') {
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
if (value.type === 'number') {
|
|
||||||
// Handle NaN and Infinity - they are not permitted
|
|
||||||
// in JSON. We can either substitute with a String
|
|
||||||
// representation or null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (truncated) {
|
|
||||||
msg += "_truncated";
|
|
||||||
}
|
|
||||||
$("#clipboard-hidden").val(value).select();
|
|
||||||
var result = document.execCommand("copy");
|
|
||||||
if (result && element) {
|
|
||||||
var popover = RED.popover.create({
|
|
||||||
target: element,
|
|
||||||
direction: 'left',
|
|
||||||
size: 'small',
|
|
||||||
content: RED._(msg)
|
|
||||||
});
|
|
||||||
setTimeout(function() {
|
|
||||||
popover.close();
|
|
||||||
},1000);
|
|
||||||
popover.open();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
init: function() {
|
|
||||||
setupDialogs();
|
|
||||||
|
|
||||||
$('<input type="text" id="clipboard-hidden">').appendTo("body");
|
|
||||||
|
|
||||||
RED.actions.add("core:show-export-dialog",exportNodes);
|
|
||||||
RED.actions.add("core:show-import-dialog",importNodes);
|
|
||||||
|
|
||||||
|
|
||||||
RED.events.on("editor:open",function() { disabled = true; });
|
|
||||||
RED.events.on("editor:close",function() { disabled = false; });
|
|
||||||
RED.events.on("search:open",function() { disabled = true; });
|
|
||||||
RED.events.on("search:close",function() { disabled = false; });
|
|
||||||
RED.events.on("type-search:open",function() { disabled = true; });
|
|
||||||
RED.events.on("type-search:close",function() { disabled = false; });
|
|
||||||
|
|
||||||
|
|
||||||
$('#chart').on("dragenter",function(event) {
|
|
||||||
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
|
|
||||||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
|
|
||||||
$("#dropTarget").css({display:'table'});
|
|
||||||
RED.keyboard.add("*", "escape" ,hideDropTarget);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#dropTarget').on("dragover",function(event) {
|
|
||||||
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
|
|
||||||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.on("dragleave",function(event) {
|
|
||||||
hideDropTarget();
|
|
||||||
})
|
|
||||||
.on("drop",function(event) {
|
|
||||||
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) {
|
|
||||||
var data = event.originalEvent.dataTransfer.getData("text/plain");
|
|
||||||
data = data.substring(data.indexOf('['),data.lastIndexOf(']')+1);
|
|
||||||
RED.view.importNodes(data);
|
|
||||||
} else if ($.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
|
|
||||||
var files = event.originalEvent.dataTransfer.files;
|
|
||||||
if (files.length === 1) {
|
|
||||||
var file = files[0];
|
|
||||||
var reader = new FileReader();
|
|
||||||
reader.onload = (function(theFile) {
|
|
||||||
return function(e) {
|
|
||||||
RED.view.importNodes(e.target.result);
|
|
||||||
};
|
|
||||||
})(file);
|
|
||||||
reader.readAsText(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hideDropTarget();
|
|
||||||
event.preventDefault();
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
import: importNodes,
|
|
||||||
export: exportNodes,
|
|
||||||
copyText: copyText
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
RED.panels = (function() {
|
|
||||||
|
|
||||||
function createPanel(options) {
|
|
||||||
var container = options.container || $("#"+options.id);
|
|
||||||
var children = container.children();
|
|
||||||
if (children.length !== 2) {
|
|
||||||
throw new Error("Container must have exactly two children");
|
|
||||||
}
|
|
||||||
|
|
||||||
container.addClass("red-ui-panels");
|
|
||||||
var separator = $('<div class="red-ui-panels-separator"></div>').insertAfter(children[0]);
|
|
||||||
var startPosition;
|
|
||||||
var panelHeights = [];
|
|
||||||
var modifiedHeights = false;
|
|
||||||
var panelRatio;
|
|
||||||
|
|
||||||
separator.draggable({
|
|
||||||
axis: "y",
|
|
||||||
containment: container,
|
|
||||||
scroll: false,
|
|
||||||
start:function(event,ui) {
|
|
||||||
var height = container.height();
|
|
||||||
startPosition = ui.position.top;
|
|
||||||
panelHeights = [$(children[0]).height(),$(children[1]).height()];
|
|
||||||
},
|
|
||||||
drag: function(event,ui) {
|
|
||||||
var height = container.height();
|
|
||||||
var delta = ui.position.top-startPosition;
|
|
||||||
var newHeights = [panelHeights[0]+delta,panelHeights[1]-delta];
|
|
||||||
$(children[0]).height(newHeights[0]);
|
|
||||||
$(children[1]).height(newHeights[1]);
|
|
||||||
if (options.resize) {
|
|
||||||
options.resize(newHeights[0],newHeights[1]);
|
|
||||||
}
|
|
||||||
ui.position.top -= delta;
|
|
||||||
panelRatio = newHeights[0]/height;
|
|
||||||
},
|
|
||||||
stop:function(event,ui) {
|
|
||||||
modifiedHeights = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
resize: function(height) {
|
|
||||||
var panelHeights = [$(children[0]).height(),$(children[1]).height()];
|
|
||||||
container.height(height);
|
|
||||||
if (modifiedHeights) {
|
|
||||||
var topPanelHeight = panelRatio*height;
|
|
||||||
var bottomPanelHeight = height - topPanelHeight - 48;
|
|
||||||
panelHeights = [topPanelHeight,bottomPanelHeight];
|
|
||||||
$(children[0]).height(panelHeights[0]);
|
|
||||||
$(children[1]).height(panelHeights[1]);
|
|
||||||
}
|
|
||||||
if (options.resize) {
|
|
||||||
options.resize(panelHeights[0],panelHeights[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
create: createPanel
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
RED.popover = (function() {
|
|
||||||
var deltaSizes = {
|
|
||||||
"default": {
|
|
||||||
top: 10,
|
|
||||||
leftRight: 17,
|
|
||||||
leftLeft: 25,
|
|
||||||
leftBottom: 8,
|
|
||||||
},
|
|
||||||
"small": {
|
|
||||||
top: 5,
|
|
||||||
leftRight: 17,
|
|
||||||
leftLeft: 16,
|
|
||||||
leftBottom: 3,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function createPopover(options) {
|
|
||||||
var target = options.target;
|
|
||||||
var direction = options.direction || "right";
|
|
||||||
var trigger = options.trigger;
|
|
||||||
var content = options.content;
|
|
||||||
var delay = options.delay;
|
|
||||||
var autoClose = options.autoClose;
|
|
||||||
var width = options.width||"auto";
|
|
||||||
var size = options.size||"default";
|
|
||||||
if (!deltaSizes[size]) {
|
|
||||||
throw new Error("Invalid RED.popover size value:",size);
|
|
||||||
}
|
|
||||||
|
|
||||||
var timer = null;
|
|
||||||
var active;
|
|
||||||
var div;
|
|
||||||
|
|
||||||
var openPopup = function(instant) {
|
|
||||||
if (active) {
|
|
||||||
div = $('<div class="red-ui-popover red-ui-popover-'+direction+'"></div>');
|
|
||||||
if (size !== "default") {
|
|
||||||
div.addClass("red-ui-popover-size-"+size);
|
|
||||||
}
|
|
||||||
if (typeof content === 'function') {
|
|
||||||
var result = content.call(res);
|
|
||||||
if (result === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof result === 'string') {
|
|
||||||
div.text(result);
|
|
||||||
} else {
|
|
||||||
div.append(result);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
div.html(content);
|
|
||||||
}
|
|
||||||
if (width !== "auto") {
|
|
||||||
div.width(width);
|
|
||||||
}
|
|
||||||
div.appendTo("body");
|
|
||||||
|
|
||||||
var targetPos = target.offset();
|
|
||||||
var targetWidth = target.outerWidth();
|
|
||||||
var targetHeight = target.outerHeight();
|
|
||||||
var divHeight = div.height();
|
|
||||||
var divWidth = div.width();
|
|
||||||
if (direction === 'right') {
|
|
||||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top,left:targetPos.left+targetWidth+deltaSizes[size].leftRight});
|
|
||||||
} else if (direction === 'left') {
|
|
||||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top,left:targetPos.left-deltaSizes[size].leftLeft-divWidth});
|
|
||||||
} else if (direction === 'bottom') {
|
|
||||||
div.css({top: targetPos.top+targetHeight+deltaSizes[size].top,left:targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftBottom});
|
|
||||||
}
|
|
||||||
if (instant) {
|
|
||||||
div.show();
|
|
||||||
} else {
|
|
||||||
div.fadeIn("fast");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var closePopup = function(instant) {
|
|
||||||
if (!active) {
|
|
||||||
if (div) {
|
|
||||||
if (instant) {
|
|
||||||
$(this).remove();
|
|
||||||
} else {
|
|
||||||
div.fadeOut("fast",function() {
|
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
div = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trigger === 'hover') {
|
|
||||||
target.on('mouseenter',function(e) {
|
|
||||||
clearTimeout(timer);
|
|
||||||
active = true;
|
|
||||||
timer = setTimeout(openPopup,delay.show);
|
|
||||||
});
|
|
||||||
target.on('mouseleave', function(e) {
|
|
||||||
if (timer) {
|
|
||||||
clearTimeout(timer);
|
|
||||||
}
|
|
||||||
active = false;
|
|
||||||
setTimeout(closePopup,delay.hide);
|
|
||||||
});
|
|
||||||
} else if (trigger === 'click') {
|
|
||||||
target.click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
active = !active;
|
|
||||||
if (!active) {
|
|
||||||
closePopup();
|
|
||||||
} else {
|
|
||||||
openPopup();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (autoClose) {
|
|
||||||
setTimeout(function() {
|
|
||||||
active = false;
|
|
||||||
closePopup();
|
|
||||||
},autoClose);
|
|
||||||
}
|
|
||||||
var res = {
|
|
||||||
setContent: function(_content) {
|
|
||||||
content = _content;
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
open: function (instant) {
|
|
||||||
active = true;
|
|
||||||
openPopup(instant);
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
close: function (instant) {
|
|
||||||
active = false;
|
|
||||||
closePopup(instant);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
create: createPopover,
|
|
||||||
tooltip: function(target,content) {
|
|
||||||
RED.popover.create({
|
|
||||||
target:target,
|
|
||||||
trigger: "hover",
|
|
||||||
size: "small",
|
|
||||||
direction: "bottom",
|
|
||||||
content: content,
|
|
||||||
delay: { show: 550, hide: 10 }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -1,501 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
RED.library = (function() {
|
|
||||||
|
|
||||||
var exportToLibraryDialog;
|
|
||||||
var elementPrefix = "node-input-";
|
|
||||||
|
|
||||||
|
|
||||||
var _librarySaveConfirm = '<div id="node-dialog-library-save-confirm" class="hide"><form class="form-horizontal"><div style="text-align: center; padding-top: 30px;" id="node-dialog-library-save-content"></div></form></div>';
|
|
||||||
var _librarySave = '<div id="node-dialog-library-save" class="hide"><form class="form-horizontal"><div class="form-row"><label for="node-dialog-library-save-folder" data-i18n="[append]library.folder"><i class="fa fa-folder-open"></i> </label><input type="text" id="node-dialog-library-save-folder" data-i18n="[placeholder]library.folderPlaceholder"></div><div class="form-row"><label for="node-dialog-library-save-filename" data-i18n="[append]library.filename"><i class="fa fa-file"></i> </label><input type="text" id="node-dialog-library-save-filename" data-i18n="[placeholder]library.filenamePlaceholder"></div></form></div>';
|
|
||||||
var _libraryLookup = '<div id="node-dialog-library-lookup" class="hide"><form class="form-horizontal"><div class="form-row"><ul id="node-dialog-library-breadcrumbs" class="breadcrumb"><li class="active"><a href="#" data-i18n="[append]library.breadcrumb"></a></li></ul></div><div class="form-row"><div style="vertical-align: top; display: inline-block; height: 100%; width: 30%; padding-right: 20px;"><div id="node-select-library" style="border: 1px solid #999; width: 100%; height: 100%; overflow:scroll;"><ul></ul></div></div><div style="vertical-align: top; display: inline-block;width: 65%; height: 100%;"><div style="height: 100%; width: 95%;" class="node-text-editor" id="node-select-library-text" ></div></div></div></form></div>';
|
|
||||||
|
|
||||||
|
|
||||||
function loadFlowLibrary() {
|
|
||||||
$.getJSON("library/flows",function(data) {
|
|
||||||
//console.log(data);
|
|
||||||
|
|
||||||
var buildMenu = function(data,root) {
|
|
||||||
var i;
|
|
||||||
var li;
|
|
||||||
var a;
|
|
||||||
var ul = document.createElement("ul");
|
|
||||||
if (root === "") {
|
|
||||||
ul.id = "menu-item-import-library-submenu";
|
|
||||||
}
|
|
||||||
ul.className = "dropdown-menu";
|
|
||||||
if (data.d) {
|
|
||||||
for (i in data.d) {
|
|
||||||
if (data.d.hasOwnProperty(i)) {
|
|
||||||
li = document.createElement("li");
|
|
||||||
li.className = "dropdown-submenu pull-left";
|
|
||||||
a = document.createElement("a");
|
|
||||||
a.href="#";
|
|
||||||
var label = i.replace(/^@.*\//,"").replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," ");
|
|
||||||
a.innerHTML = label;
|
|
||||||
li.appendChild(a);
|
|
||||||
li.appendChild(buildMenu(data.d[i],root+(root!==""?"/":"")+i));
|
|
||||||
ul.appendChild(li);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (data.f) {
|
|
||||||
for (i in data.f) {
|
|
||||||
if (data.f.hasOwnProperty(i)) {
|
|
||||||
li = document.createElement("li");
|
|
||||||
a = document.createElement("a");
|
|
||||||
a.href="#";
|
|
||||||
a.innerHTML = data.f[i];
|
|
||||||
a.flowName = root+(root!==""?"/":"")+data.f[i];
|
|
||||||
a.onclick = function() {
|
|
||||||
$.get('library/flows/'+this.flowName, function(data) {
|
|
||||||
RED.view.importNodes(data);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
li.appendChild(a);
|
|
||||||
ul.appendChild(li);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ul;
|
|
||||||
};
|
|
||||||
var examples;
|
|
||||||
if (data.d && data.d._examples_) {
|
|
||||||
examples = data.d._examples_;
|
|
||||||
delete data.d._examples_;
|
|
||||||
}
|
|
||||||
var menu = buildMenu(data,"");
|
|
||||||
$("#menu-item-import-examples").remove();
|
|
||||||
if (examples) {
|
|
||||||
RED.menu.addItem("menu-item-import",{id:"menu-item-import-examples",label:RED._("menu.label.examples"),options:[]})
|
|
||||||
$("#menu-item-import-examples-submenu").replaceWith(buildMenu(examples,"_examples_"));
|
|
||||||
}
|
|
||||||
//TODO: need an api in RED.menu for this
|
|
||||||
$("#menu-item-import-library-submenu").replaceWith(menu);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createUI(options) {
|
|
||||||
var libraryData = {};
|
|
||||||
var selectedLibraryItem = null;
|
|
||||||
var libraryEditor = null;
|
|
||||||
elementPrefix = options.elementPrefix || "node-input-";
|
|
||||||
|
|
||||||
// Orion editor has set/getText
|
|
||||||
// ACE editor has set/getValue
|
|
||||||
// normalise to set/getValue
|
|
||||||
if (options.editor.setText) {
|
|
||||||
// Orion doesn't like having pos passed in, so proxy the call to drop it
|
|
||||||
options.editor.setValue = function(text,pos) {
|
|
||||||
options.editor.setText.call(options.editor,text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (options.editor.getText) {
|
|
||||||
options.editor.getValue = options.editor.getText;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildFileListItem(item) {
|
|
||||||
var li = document.createElement("li");
|
|
||||||
li.onmouseover = function(e) { $(this).addClass("list-hover"); };
|
|
||||||
li.onmouseout = function(e) { $(this).removeClass("list-hover"); };
|
|
||||||
return li;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildFileList(root,data) {
|
|
||||||
var ul = document.createElement("ul");
|
|
||||||
var li;
|
|
||||||
for (var i=0; i<data.length; i++) {
|
|
||||||
var v = data[i];
|
|
||||||
if (typeof v === "string") {
|
|
||||||
// directory
|
|
||||||
li = buildFileListItem(v);
|
|
||||||
li.onclick = (function () {
|
|
||||||
var dirName = v;
|
|
||||||
return function(e) {
|
|
||||||
var bcli = $('<li class="active"><span class="divider">/</span> <a href="#">'+dirName+'</a></li>');
|
|
||||||
$("a",bcli).click(function(e) {
|
|
||||||
$(this).parent().nextAll().remove();
|
|
||||||
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
|
||||||
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
|
||||||
});
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
var bc = $("#node-dialog-library-breadcrumbs");
|
|
||||||
$(".active",bc).removeClass("active");
|
|
||||||
bc.append(bcli);
|
|
||||||
$.getJSON("library/"+options.url+root+dirName,function(data) {
|
|
||||||
$("#node-select-library").children().first().replaceWith(buildFileList(root+dirName+"/",data));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
li.innerHTML = '<i class="fa fa-folder"></i> '+v+"</i>";
|
|
||||||
ul.appendChild(li);
|
|
||||||
} else {
|
|
||||||
// file
|
|
||||||
li = buildFileListItem(v);
|
|
||||||
li.innerHTML = v.name;
|
|
||||||
li.onclick = (function() {
|
|
||||||
var item = v;
|
|
||||||
return function(e) {
|
|
||||||
$(".list-selected",ul).removeClass("list-selected");
|
|
||||||
$(this).addClass("list-selected");
|
|
||||||
$.get("library/"+options.url+root+item.fn, function(data) {
|
|
||||||
selectedLibraryItem = item;
|
|
||||||
libraryEditor.setValue(data,-1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
ul.appendChild(li);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ul;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#'+elementPrefix+"name").css("width","calc(100% - 52px)").after(
|
|
||||||
'<div class="btn-group" style="margin-left:5px;">'+
|
|
||||||
'<a id="node-input-'+options.type+'-lookup" class="editor-button" data-toggle="dropdown"><i class="fa fa-book"></i> <i class="fa fa-caret-down"></i></a>'+
|
|
||||||
'<ul class="dropdown-menu pull-right" role="menu">'+
|
|
||||||
'<li><a id="node-input-'+options.type+'-menu-open-library" tabindex="-1" href="#">'+RED._("library.openLibrary")+'</a></li>'+
|
|
||||||
'<li><a id="node-input-'+options.type+'-menu-save-library" tabindex="-1" href="#">'+RED._("library.saveToLibrary")+'</a></li>'+
|
|
||||||
'</ul></div>'
|
|
||||||
);
|
|
||||||
|
|
||||||
$('#node-input-'+options.type+'-menu-open-library').click(function(e) {
|
|
||||||
$("#node-select-library").children().remove();
|
|
||||||
var bc = $("#node-dialog-library-breadcrumbs");
|
|
||||||
bc.children().first().nextAll().remove();
|
|
||||||
libraryEditor.setValue('',-1);
|
|
||||||
|
|
||||||
$.getJSON("library/"+options.url,function(data) {
|
|
||||||
$("#node-select-library").append(buildFileList("/",data));
|
|
||||||
$("#node-dialog-library-breadcrumbs a").click(function(e) {
|
|
||||||
$(this).parent().nextAll().remove();
|
|
||||||
$("#node-select-library").children().first().replaceWith(buildFileList("/",data));
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
$( "#node-dialog-library-lookup" ).dialog( "open" );
|
|
||||||
});
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#node-input-'+options.type+'-menu-save-library').click(function(e) {
|
|
||||||
//var found = false;
|
|
||||||
var name = $("#"+elementPrefix+"name").val().replace(/(^\s*)|(\s*$)/g,"");
|
|
||||||
|
|
||||||
//var buildPathList = function(data,root) {
|
|
||||||
// var paths = [];
|
|
||||||
// if (data.d) {
|
|
||||||
// for (var i in data.d) {
|
|
||||||
// var dn = root+(root==""?"":"/")+i;
|
|
||||||
// var d = {
|
|
||||||
// label:dn,
|
|
||||||
// files:[]
|
|
||||||
// };
|
|
||||||
// for (var f in data.d[i].f) {
|
|
||||||
// d.files.push(data.d[i].f[f].fn.split("/").slice(-1)[0]);
|
|
||||||
// }
|
|
||||||
// paths.push(d);
|
|
||||||
// paths = paths.concat(buildPathList(data.d[i],root+(root==""?"":"/")+i));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return paths;
|
|
||||||
//};
|
|
||||||
$("#node-dialog-library-save-folder").attr("value","");
|
|
||||||
|
|
||||||
var filename = name.replace(/[^\w-]/g,"-");
|
|
||||||
if (filename === "") {
|
|
||||||
filename = "unnamed-"+options.type;
|
|
||||||
}
|
|
||||||
$("#node-dialog-library-save-filename").attr("value",filename+".js");
|
|
||||||
|
|
||||||
//var paths = buildPathList(libraryData,"");
|
|
||||||
//$("#node-dialog-library-save-folder").autocomplete({
|
|
||||||
// minLength: 0,
|
|
||||||
// source: paths,
|
|
||||||
// select: function( event, ui ) {
|
|
||||||
// $("#node-dialog-library-save-filename").autocomplete({
|
|
||||||
// minLength: 0,
|
|
||||||
// source: ui.item.files
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
$( "#node-dialog-library-save" ).dialog( "open" );
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
|
|
||||||
libraryEditor = ace.edit('node-select-library-text');
|
|
||||||
libraryEditor.setTheme("ace/theme/tomorrow");
|
|
||||||
if (options.mode) {
|
|
||||||
libraryEditor.getSession().setMode(options.mode);
|
|
||||||
}
|
|
||||||
libraryEditor.setOptions({
|
|
||||||
readOnly: true,
|
|
||||||
highlightActiveLine: false,
|
|
||||||
highlightGutterLine: false
|
|
||||||
});
|
|
||||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
|
||||||
libraryEditor.$blockScrolling = Infinity;
|
|
||||||
|
|
||||||
$( "#node-dialog-library-lookup" ).dialog({
|
|
||||||
title: RED._("library.typeLibrary", {type:options.type}),
|
|
||||||
modal: true,
|
|
||||||
autoOpen: false,
|
|
||||||
width: 800,
|
|
||||||
height: 450,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: RED._("common.label.load"),
|
|
||||||
class: "primary",
|
|
||||||
click: function() {
|
|
||||||
if (selectedLibraryItem) {
|
|
||||||
for (var i=0; i<options.fields.length; i++) {
|
|
||||||
var field = options.fields[i];
|
|
||||||
$("#"+elementPrefix+field).val(selectedLibraryItem[field]);
|
|
||||||
}
|
|
||||||
options.editor.setValue(libraryEditor.getValue(),-1);
|
|
||||||
}
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
open: function(e) {
|
|
||||||
var form = $("form",this);
|
|
||||||
form.height(form.parent().height()-30);
|
|
||||||
$("#node-select-library-text").height("100%");
|
|
||||||
$(".form-row:last-child",form).children().height(form.height()-60);
|
|
||||||
},
|
|
||||||
resize: function(e) {
|
|
||||||
var form = $("form",this);
|
|
||||||
form.height(form.parent().height()-30);
|
|
||||||
$(".form-row:last-child",form).children().height(form.height()-60);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function saveToLibrary(overwrite) {
|
|
||||||
var name = $("#"+elementPrefix+"name").val().replace(/(^\s*)|(\s*$)/g,"");
|
|
||||||
if (name === "") {
|
|
||||||
name = RED._("library.unnamedType",{type:options.type});
|
|
||||||
}
|
|
||||||
var filename = $("#node-dialog-library-save-filename").val().replace(/(^\s*)|(\s*$)/g,"");
|
|
||||||
var pathname = $("#node-dialog-library-save-folder").val().replace(/(^\s*)|(\s*$)/g,"");
|
|
||||||
if (filename === "" || !/.+\.js$/.test(filename)) {
|
|
||||||
RED.notify(RED._("library.invalidFilename"),"warning");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var fullpath = pathname+(pathname===""?"":"/")+filename;
|
|
||||||
if (!overwrite) {
|
|
||||||
//var pathnameParts = pathname.split("/");
|
|
||||||
//var exists = false;
|
|
||||||
//var ds = libraryData;
|
|
||||||
//for (var pnp in pathnameParts) {
|
|
||||||
// if (ds.d && pathnameParts[pnp] in ds.d) {
|
|
||||||
// ds = ds.d[pathnameParts[pnp]];
|
|
||||||
// } else {
|
|
||||||
// ds = null;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//if (ds && ds.f) {
|
|
||||||
// for (var f in ds.f) {
|
|
||||||
// if (ds.f[f].fn == fullpath) {
|
|
||||||
// exists = true;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//if (exists) {
|
|
||||||
// $("#node-dialog-library-save-content").html(RED._("library.dialogSaveOverwrite",{libraryType:options.type,libraryName:fullpath}));
|
|
||||||
// $("#node-dialog-library-save-confirm").dialog( "open" );
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
var queryArgs = [];
|
|
||||||
var data = {};
|
|
||||||
for (var i=0; i<options.fields.length; i++) {
|
|
||||||
var field = options.fields[i];
|
|
||||||
if (field == "name") {
|
|
||||||
data.name = name;
|
|
||||||
} else {
|
|
||||||
data[field] = $("#"+elementPrefix+field).val();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.text = options.editor.getValue();
|
|
||||||
$.ajax({
|
|
||||||
url:"library/"+options.url+'/'+fullpath,
|
|
||||||
type: "POST",
|
|
||||||
data: JSON.stringify(data),
|
|
||||||
contentType: "application/json; charset=utf-8"
|
|
||||||
}).done(function(data,textStatus,xhr) {
|
|
||||||
RED.notify(RED._("library.savedType", {type:options.type}),"success");
|
|
||||||
}).fail(function(xhr,textStatus,err) {
|
|
||||||
if (xhr.status === 401) {
|
|
||||||
RED.notify(RED._("library.saveFailed",{message:RED._("user.notAuthorized")}),"error");
|
|
||||||
} else {
|
|
||||||
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$( "#node-dialog-library-save-confirm" ).dialog({
|
|
||||||
title: RED._("library.saveToLibrary"),
|
|
||||||
modal: true,
|
|
||||||
autoOpen: false,
|
|
||||||
width: 530,
|
|
||||||
height: 230,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: RED._("common.label.save"),
|
|
||||||
class: "primary",
|
|
||||||
click: function() {
|
|
||||||
saveToLibrary(true);
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
$( "#node-dialog-library-save" ).dialog({
|
|
||||||
title: RED._("library.saveToLibrary"),
|
|
||||||
modal: true,
|
|
||||||
autoOpen: false,
|
|
||||||
width: 530,
|
|
||||||
height: 230,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: RED._("common.label.save"),
|
|
||||||
class: "primary",
|
|
||||||
click: function() {
|
|
||||||
saveToLibrary(false);
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function exportFlow() {
|
|
||||||
//TODO: don't rely on the main dialog
|
|
||||||
var nns = RED.nodes.createExportableNodeSet(RED.view.selection().nodes);
|
|
||||||
$("#node-input-library-filename").attr('nodes',JSON.stringify(nns));
|
|
||||||
exportToLibraryDialog.dialog( "open" );
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: function() {
|
|
||||||
|
|
||||||
|
|
||||||
$(_librarySave).appendTo(document.body);
|
|
||||||
$(_librarySaveConfirm).appendTo(document.body);
|
|
||||||
$(_libraryLookup).appendTo(document.body);
|
|
||||||
|
|
||||||
RED.actions.add("core:library-export",exportFlow);
|
|
||||||
|
|
||||||
RED.events.on("view:selection-changed",function(selection) {
|
|
||||||
if (!selection.nodes) {
|
|
||||||
RED.menu.setDisabled("menu-item-export-library",true);
|
|
||||||
} else {
|
|
||||||
RED.menu.setDisabled("menu-item-export-library",false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (RED.settings.theme("menu.menu-item-import-library") !== false) {
|
|
||||||
loadFlowLibrary();
|
|
||||||
}
|
|
||||||
|
|
||||||
exportToLibraryDialog = $('<div id="library-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
|
|
||||||
.appendTo("body")
|
|
||||||
.dialog({
|
|
||||||
modal: true,
|
|
||||||
autoOpen: false,
|
|
||||||
width: 500,
|
|
||||||
resizable: false,
|
|
||||||
title: RED._("library.exportToLibrary"),
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
id: "library-dialog-cancel",
|
|
||||||
text: RED._("common.label.cancel"),
|
|
||||||
click: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "library-dialog-ok",
|
|
||||||
class: "primary",
|
|
||||||
text: RED._("common.label.export"),
|
|
||||||
click: function() {
|
|
||||||
//TODO: move this to RED.library
|
|
||||||
var flowName = $("#node-input-library-filename").val();
|
|
||||||
if (!/^\s*$/.test(flowName)) {
|
|
||||||
$.ajax({
|
|
||||||
url:'library/flows/'+flowName,
|
|
||||||
type: "POST",
|
|
||||||
data: $("#node-input-library-filename").attr('nodes'),
|
|
||||||
contentType: "application/json; charset=utf-8"
|
|
||||||
}).done(function() {
|
|
||||||
RED.library.loadFlowLibrary();
|
|
||||||
RED.notify(RED._("library.savedNodes"),"success");
|
|
||||||
}).fail(function(xhr,textStatus,err) {
|
|
||||||
if (xhr.status === 401) {
|
|
||||||
RED.notify(RED._("library.saveFailed",{message:RED._("user.notAuthorized")}),"error");
|
|
||||||
} else {
|
|
||||||
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
open: function(e) {
|
|
||||||
$(this).parent().find(".ui-dialog-titlebar-close").hide();
|
|
||||||
},
|
|
||||||
close: function(e) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
exportToLibraryDialog.children(".dialog-form").append($(
|
|
||||||
'<div class="form-row">'+
|
|
||||||
'<label for="node-input-library-filename" data-i18n="[append]editor:library.filename"><i class="fa fa-file"></i> </label>'+
|
|
||||||
'<input type="text" id="node-input-library-filename" data-i18n="[placeholder]editor:library.fullFilenamePlaceholder">'+
|
|
||||||
'<input type="text" style="display: none;" />'+ // Second hidden input to prevent submit on Enter
|
|
||||||
'</div>'
|
|
||||||
));
|
|
||||||
},
|
|
||||||
create: createUI,
|
|
||||||
loadFlowLibrary: loadFlowLibrary,
|
|
||||||
|
|
||||||
export: exportFlow
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,235 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
RED.sidebar = (function() {
|
|
||||||
|
|
||||||
//$('#sidebar').tabs();
|
|
||||||
var sidebar_tabs = RED.tabs.create({
|
|
||||||
id:"sidebar-tabs",
|
|
||||||
onchange:function(tab) {
|
|
||||||
$("#sidebar-content").children().hide();
|
|
||||||
$("#sidebar-footer").children().hide();
|
|
||||||
if (tab.onchange) {
|
|
||||||
tab.onchange.call(tab);
|
|
||||||
}
|
|
||||||
$(tab.wrapper).show();
|
|
||||||
if (tab.toolbar) {
|
|
||||||
$(tab.toolbar).show();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onremove: function(tab) {
|
|
||||||
$(tab.wrapper).hide();
|
|
||||||
if (tab.onremove) {
|
|
||||||
tab.onremove.call(tab);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// minimumActiveTabWidth: 70,
|
|
||||||
collapsible: true
|
|
||||||
// scrollable: true
|
|
||||||
});
|
|
||||||
|
|
||||||
var knownTabs = {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
function addTab(title,content,closeable,visible) {
|
|
||||||
var options;
|
|
||||||
if (typeof title === "string") {
|
|
||||||
// TODO: legacy support in case anyone uses this...
|
|
||||||
options = {
|
|
||||||
id: content.id,
|
|
||||||
label: title,
|
|
||||||
name: title,
|
|
||||||
content: content,
|
|
||||||
closeable: closeable,
|
|
||||||
visible: visible
|
|
||||||
}
|
|
||||||
} else if (typeof title === "object") {
|
|
||||||
options = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete options.closeable;
|
|
||||||
|
|
||||||
options.wrapper = $('<div>',{style:"height:100%"}).appendTo("#sidebar-content")
|
|
||||||
options.wrapper.append(options.content);
|
|
||||||
options.wrapper.hide();
|
|
||||||
|
|
||||||
if (!options.enableOnEdit) {
|
|
||||||
options.shade = $('<div>',{class:"sidebar-shade hide"}).appendTo(options.wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.toolbar) {
|
|
||||||
$("#sidebar-footer").append(options.toolbar);
|
|
||||||
$(options.toolbar).hide();
|
|
||||||
}
|
|
||||||
var id = options.id;
|
|
||||||
|
|
||||||
RED.menu.addItem("menu-item-view-menu",{
|
|
||||||
id:"menu-item-view-menu-"+options.id,
|
|
||||||
label:options.name,
|
|
||||||
onselect:function() {
|
|
||||||
showSidebar(options.id);
|
|
||||||
},
|
|
||||||
group: "sidebar-tabs"
|
|
||||||
});
|
|
||||||
|
|
||||||
options.iconClass = options.iconClass || "fa fa-square-o"
|
|
||||||
|
|
||||||
knownTabs[options.id] = options;
|
|
||||||
|
|
||||||
if (options.visible !== false) {
|
|
||||||
sidebar_tabs.addTab(knownTabs[options.id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeTab(id) {
|
|
||||||
sidebar_tabs.removeTab(id);
|
|
||||||
$(knownTabs[id].wrapper).remove();
|
|
||||||
if (knownTabs[id].footer) {
|
|
||||||
knownTabs[id].footer.remove();
|
|
||||||
}
|
|
||||||
delete knownTabs[id];
|
|
||||||
RED.menu.removeItem("menu-item-view-menu-"+id);
|
|
||||||
}
|
|
||||||
|
|
||||||
var sidebarSeparator = {};
|
|
||||||
$("#sidebar-separator").draggable({
|
|
||||||
axis: "x",
|
|
||||||
start:function(event,ui) {
|
|
||||||
sidebarSeparator.closing = false;
|
|
||||||
sidebarSeparator.opening = false;
|
|
||||||
var winWidth = $(window).width();
|
|
||||||
sidebarSeparator.start = ui.position.left;
|
|
||||||
sidebarSeparator.chartWidth = $("#workspace").width();
|
|
||||||
sidebarSeparator.chartRight = winWidth-$("#workspace").width()-$("#workspace").offset().left-2;
|
|
||||||
|
|
||||||
if (!RED.menu.isSelected("menu-item-sidebar")) {
|
|
||||||
sidebarSeparator.opening = true;
|
|
||||||
var newChartRight = 7;
|
|
||||||
$("#sidebar").addClass("closing");
|
|
||||||
$("#workspace").css("right",newChartRight);
|
|
||||||
$("#editor-stack").css("right",newChartRight+1);
|
|
||||||
$("#sidebar").width(0);
|
|
||||||
RED.menu.setSelected("menu-item-sidebar",true);
|
|
||||||
RED.events.emit("sidebar:resize");
|
|
||||||
}
|
|
||||||
sidebarSeparator.width = $("#sidebar").width();
|
|
||||||
},
|
|
||||||
drag: function(event,ui) {
|
|
||||||
var d = ui.position.left-sidebarSeparator.start;
|
|
||||||
var newSidebarWidth = sidebarSeparator.width-d;
|
|
||||||
if (sidebarSeparator.opening) {
|
|
||||||
newSidebarWidth -= 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newSidebarWidth > 150) {
|
|
||||||
if (sidebarSeparator.chartWidth+d < 200) {
|
|
||||||
ui.position.left = 200+sidebarSeparator.start-sidebarSeparator.chartWidth;
|
|
||||||
d = ui.position.left-sidebarSeparator.start;
|
|
||||||
newSidebarWidth = sidebarSeparator.width-d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newSidebarWidth < 150) {
|
|
||||||
if (!sidebarSeparator.closing) {
|
|
||||||
$("#sidebar").addClass("closing");
|
|
||||||
sidebarSeparator.closing = true;
|
|
||||||
}
|
|
||||||
if (!sidebarSeparator.opening) {
|
|
||||||
newSidebarWidth = 150;
|
|
||||||
ui.position.left = sidebarSeparator.width-(150 - sidebarSeparator.start);
|
|
||||||
d = ui.position.left-sidebarSeparator.start;
|
|
||||||
}
|
|
||||||
} else if (newSidebarWidth > 150 && (sidebarSeparator.closing || sidebarSeparator.opening)) {
|
|
||||||
sidebarSeparator.closing = false;
|
|
||||||
$("#sidebar").removeClass("closing");
|
|
||||||
}
|
|
||||||
|
|
||||||
var newChartRight = sidebarSeparator.chartRight-d;
|
|
||||||
$("#workspace").css("right",newChartRight);
|
|
||||||
$("#editor-stack").css("right",newChartRight+1);
|
|
||||||
$("#sidebar").width(newSidebarWidth);
|
|
||||||
|
|
||||||
sidebar_tabs.resize();
|
|
||||||
RED.events.emit("sidebar:resize");
|
|
||||||
},
|
|
||||||
stop:function(event,ui) {
|
|
||||||
if (sidebarSeparator.closing) {
|
|
||||||
$("#sidebar").removeClass("closing");
|
|
||||||
RED.menu.setSelected("menu-item-sidebar",false);
|
|
||||||
if ($("#sidebar").width() < 180) {
|
|
||||||
$("#sidebar").width(180);
|
|
||||||
$("#workspace").css("right",187);
|
|
||||||
$("#editor-stack").css("right",188);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$("#sidebar-separator").css("left","auto");
|
|
||||||
$("#sidebar-separator").css("right",($("#sidebar").width()+2)+"px");
|
|
||||||
RED.events.emit("sidebar:resize");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function toggleSidebar(state) {
|
|
||||||
if (!state) {
|
|
||||||
$("#main-container").addClass("sidebar-closed");
|
|
||||||
} else {
|
|
||||||
$("#main-container").removeClass("sidebar-closed");
|
|
||||||
sidebar_tabs.resize();
|
|
||||||
}
|
|
||||||
RED.events.emit("sidebar:resize");
|
|
||||||
}
|
|
||||||
|
|
||||||
function showSidebar(id) {
|
|
||||||
if (id) {
|
|
||||||
if (!containsTab(id)) {
|
|
||||||
sidebar_tabs.addTab(knownTabs[id]);
|
|
||||||
}
|
|
||||||
sidebar_tabs.activateTab(id);
|
|
||||||
if (!RED.menu.isSelected("menu-item-sidebar")) {
|
|
||||||
RED.menu.setSelected("menu-item-sidebar",true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function containsTab(id) {
|
|
||||||
return sidebar_tabs.contains(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
function init () {
|
|
||||||
RED.actions.add("core:toggle-sidebar",function(state){
|
|
||||||
if (state === undefined) {
|
|
||||||
RED.menu.toggleSelected("menu-item-sidebar");
|
|
||||||
} else {
|
|
||||||
toggleSidebar(state);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
showSidebar();
|
|
||||||
RED.sidebar.info.init();
|
|
||||||
RED.sidebar.config.init();
|
|
||||||
RED.sidebar.context.init();
|
|
||||||
// hide info bar at start if screen rather narrow...
|
|
||||||
if ($(window).width() < 600) { RED.menu.setSelected("menu-item-sidebar",false); }
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: init,
|
|
||||||
addTab: addTab,
|
|
||||||
removeTab: removeTab,
|
|
||||||
show: showSidebar,
|
|
||||||
containsTab: containsTab,
|
|
||||||
toggleSidebar: toggleSidebar,
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
RED.sidebar.context = (function() {
|
|
||||||
|
|
||||||
var content;
|
|
||||||
var sections;
|
|
||||||
|
|
||||||
var localCache = {};
|
|
||||||
|
|
||||||
|
|
||||||
var nodeSection;
|
|
||||||
// var subflowSection;
|
|
||||||
var flowSection;
|
|
||||||
var globalSection;
|
|
||||||
|
|
||||||
var currentNode;
|
|
||||||
var currentFlow;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
|
|
||||||
content = $("<div>").css({"position":"relative","height":"100%"});
|
|
||||||
content.className = "sidebar-context"
|
|
||||||
// var toolbar = $('<div class="sidebar-header">'+
|
|
||||||
// '</div>').appendTo(content);
|
|
||||||
|
|
||||||
var footerToolbar = $('<div>'+
|
|
||||||
// '<span class="button-group"><a class="sidebar-footer-button" href="#" data-i18n="[title]node-red:debug.sidebar.openWindow"><i class="fa fa-desktop"></i></a></span> ' +
|
|
||||||
'</div>');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var stackContainer = $("<div>",{class:"sidebar-context-stack"}).appendTo(content);
|
|
||||||
sections = RED.stack.create({
|
|
||||||
container: stackContainer
|
|
||||||
});
|
|
||||||
|
|
||||||
nodeSection = sections.add({
|
|
||||||
title: RED._("sidebar.context.node"),
|
|
||||||
collapsible: true,
|
|
||||||
// onexpand: function() {
|
|
||||||
// updateNode(currentNode,true);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
nodeSection.expand();
|
|
||||||
nodeSection.content.css({height:"100%"});
|
|
||||||
nodeSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(nodeSection.content);
|
|
||||||
var table = $('<table class="node-info"></table>').appendTo(nodeSection.content);
|
|
||||||
nodeSection.table = $('<tbody>').appendTo(table);
|
|
||||||
var bg = $('<div style="float: right"></div>').appendTo(nodeSection.header);
|
|
||||||
$('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
|
||||||
.appendTo(bg)
|
|
||||||
.click(function(evt) {
|
|
||||||
evt.stopPropagation();
|
|
||||||
evt.preventDefault();
|
|
||||||
updateNode(currentNode, true);
|
|
||||||
})
|
|
||||||
|
|
||||||
// subflowSection = sections.add({
|
|
||||||
// title: "Subflow",
|
|
||||||
// collapsible: true
|
|
||||||
// });
|
|
||||||
// subflowSection.expand();
|
|
||||||
// subflowSection.content.css({height:"100%"});
|
|
||||||
// bg = $('<div style="float: right"></div>').appendTo(subflowSection.header);
|
|
||||||
// $('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
|
||||||
// .appendTo(bg)
|
|
||||||
// .click(function(evt) {
|
|
||||||
// evt.stopPropagation();
|
|
||||||
// evt.preventDefault();
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// subflowSection.container.hide();
|
|
||||||
|
|
||||||
flowSection = sections.add({
|
|
||||||
title: RED._("sidebar.context.flow"),
|
|
||||||
collapsible: true
|
|
||||||
});
|
|
||||||
flowSection.expand();
|
|
||||||
flowSection.content.css({height:"100%"});
|
|
||||||
flowSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(flowSection.content);
|
|
||||||
var table = $('<table class="node-info"></table>').appendTo(flowSection.content);
|
|
||||||
flowSection.table = $('<tbody>').appendTo(table);
|
|
||||||
bg = $('<div style="float: right"></div>').appendTo(flowSection.header);
|
|
||||||
$('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
|
||||||
.appendTo(bg)
|
|
||||||
.click(function(evt) {
|
|
||||||
evt.stopPropagation();
|
|
||||||
evt.preventDefault();
|
|
||||||
updateFlow(currentFlow);
|
|
||||||
})
|
|
||||||
|
|
||||||
globalSection = sections.add({
|
|
||||||
title: RED._("sidebar.context.global"),
|
|
||||||
collapsible: true
|
|
||||||
});
|
|
||||||
globalSection.expand();
|
|
||||||
globalSection.content.css({height:"100%"});
|
|
||||||
globalSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(globalSection.content);
|
|
||||||
var table = $('<table class="node-info"></table>').appendTo(globalSection.content);
|
|
||||||
globalSection.table = $('<tbody>').appendTo(table);
|
|
||||||
|
|
||||||
bg = $('<div style="float: right"></div>').appendTo(globalSection.header);
|
|
||||||
$('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
|
||||||
.appendTo(bg)
|
|
||||||
.click(function(evt) {
|
|
||||||
evt.stopPropagation();
|
|
||||||
evt.preventDefault();
|
|
||||||
updateEntry(globalSection,"context/global","global");
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
RED.actions.add("core:show-context-tab",show);
|
|
||||||
|
|
||||||
RED.sidebar.addTab({
|
|
||||||
id: "context",
|
|
||||||
label: RED._("sidebar.context.label"),
|
|
||||||
name: RED._("sidebar.context.name"),
|
|
||||||
iconClass: "fa fa-database",
|
|
||||||
content: content,
|
|
||||||
toolbar: footerToolbar,
|
|
||||||
// pinned: true,
|
|
||||||
enableOnEdit: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// var toggleLiveButton = $("#sidebar-context-toggle-live");
|
|
||||||
// toggleLiveButton.click(function(evt) {
|
|
||||||
// evt.preventDefault();
|
|
||||||
// if ($(this).hasClass("selected")) {
|
|
||||||
// $(this).removeClass("selected");
|
|
||||||
// $(this).find("i").removeClass("fa-pause");
|
|
||||||
// $(this).find("i").addClass("fa-play");
|
|
||||||
// } else {
|
|
||||||
// $(this).addClass("selected");
|
|
||||||
// $(this).find("i").removeClass("fa-play");
|
|
||||||
// $(this).find("i").addClass("fa-pause");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// RED.popover.tooltip(toggleLiveButton, function() {
|
|
||||||
// if (toggleLiveButton.hasClass("selected")) {
|
|
||||||
// return "Pause live updates"
|
|
||||||
// } else {
|
|
||||||
// return "Start live updates"
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
RED.events.on("view:selection-changed", function(event) {
|
|
||||||
var selectedNode = event.nodes && event.nodes.length === 1 && event.nodes[0];
|
|
||||||
updateNode(selectedNode);
|
|
||||||
})
|
|
||||||
|
|
||||||
RED.events.on("workspace:change", function(event) {
|
|
||||||
updateFlow(RED.nodes.workspace(event.workspace));
|
|
||||||
})
|
|
||||||
|
|
||||||
updateEntry(globalSection,"context/global","global");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateNode(node,force) {
|
|
||||||
currentNode = node;
|
|
||||||
if (force) {
|
|
||||||
if (node) {
|
|
||||||
updateEntry(nodeSection,"context/node/"+node.id,node.id);
|
|
||||||
// if (/^subflow:/.test(node.type)) {
|
|
||||||
// subflowSection.container.show();
|
|
||||||
// updateEntry(subflowSection,"context/flow/"+node.id,node.id);
|
|
||||||
// } else {
|
|
||||||
// subflowSection.container.hide();
|
|
||||||
// }
|
|
||||||
} else {
|
|
||||||
// subflowSection.container.hide();
|
|
||||||
updateEntry(nodeSection)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$(nodeSection.table).empty();
|
|
||||||
if (node) {
|
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.refresh"></td></tr>').appendTo(nodeSection.table).i18n();
|
|
||||||
} else {
|
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.none"></td></tr>').appendTo(nodeSection.table).i18n();
|
|
||||||
}
|
|
||||||
nodeSection.timestamp.html(" ");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function updateFlow(flow) {
|
|
||||||
currentFlow = flow;
|
|
||||||
if (flow) {
|
|
||||||
updateEntry(flowSection,"context/flow/"+flow.id,flow.id);
|
|
||||||
} else {
|
|
||||||
updateEntry(flowSection)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshEntry(section,baseUrl,id) {
|
|
||||||
|
|
||||||
var contextStores = RED.settings.context.stores;
|
|
||||||
var container = section.table;
|
|
||||||
|
|
||||||
$.getJSON(baseUrl, function(data) {
|
|
||||||
$(container).empty();
|
|
||||||
var sortedData = {};
|
|
||||||
for (var store in data) {
|
|
||||||
if (data.hasOwnProperty(store)) {
|
|
||||||
for (var key in data[store]) {
|
|
||||||
if (data[store].hasOwnProperty(key)) {
|
|
||||||
if (!sortedData.hasOwnProperty(key)) {
|
|
||||||
sortedData[key] = [];
|
|
||||||
}
|
|
||||||
data[store][key].store = store;
|
|
||||||
sortedData[key].push(data[store][key])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var keys = Object.keys(sortedData);
|
|
||||||
keys.sort();
|
|
||||||
var l = keys.length;
|
|
||||||
for (var i = 0; i < l; i++) {
|
|
||||||
sortedData[keys[i]].forEach(function(v) {
|
|
||||||
var k = keys[i];
|
|
||||||
var l2 = sortedData[k].length;
|
|
||||||
var propRow = $('<tr class="node-info-node-row"><td class="sidebar-context-property"></td><td></td></tr>').appendTo(container);
|
|
||||||
var obj = $(propRow.children()[0]);
|
|
||||||
obj.text(k);
|
|
||||||
var tools = $('<span class="debug-message-tools button-group"></span>').appendTo(obj);
|
|
||||||
var refreshItem = $('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>').appendTo(tools).click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
$.getJSON(baseUrl+"/"+k+"?store="+v.store, function(data) {
|
|
||||||
$(propRow.children()[1]).empty();
|
|
||||||
var payload = data.msg;
|
|
||||||
var format = data.format;
|
|
||||||
payload = RED.utils.decodeObject(payload,format);
|
|
||||||
RED.utils.createObjectElement(payload, {
|
|
||||||
typeHint: data.format,
|
|
||||||
sourceId: id+"."+k
|
|
||||||
}).appendTo(propRow.children()[1]);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var payload = v.msg;
|
|
||||||
var format = v.format;
|
|
||||||
payload = RED.utils.decodeObject(payload,format);
|
|
||||||
RED.utils.createObjectElement(payload, {
|
|
||||||
typeHint: v.format,
|
|
||||||
sourceId: id+"."+k
|
|
||||||
}).appendTo(propRow.children()[1]);
|
|
||||||
if (contextStores.length > 1) {
|
|
||||||
$("<span>",{class:"sidebar-context-property-storename"}).text(v.store).appendTo($(propRow.children()[0]))
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (l === 0) {
|
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.empty"></td></tr>').appendTo(container).i18n();
|
|
||||||
}
|
|
||||||
$(section.timestamp).text(new Date().toLocaleString());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function updateEntry(section,baseUrl,id) {
|
|
||||||
var container = section.table;
|
|
||||||
if (id) {
|
|
||||||
refreshEntry(section,baseUrl,id);
|
|
||||||
} else {
|
|
||||||
$(container).empty();
|
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.none"></td></tr>').appendTo(container).i18n();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
RED.sidebar.show("context");
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
init: init
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
.ace_gutter {
|
|
||||||
border-top-left-radius: 4px;
|
|
||||||
border-bottom-left-radius: 4px;
|
|
||||||
}
|
|
||||||
.ace_scroller {
|
|
||||||
border-top-right-radius: 4px;
|
|
||||||
border-bottom-right-radius: 4px;
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
$background-color: #f3f3f3;
|
|
||||||
|
|
||||||
$form-placeholder-color: #bbbbbb;
|
|
||||||
$form-text-color: #444;
|
|
||||||
$form-input-focus-color: rgba(85,150,230,0.8);
|
|
||||||
$form-input-border-color: #ccc;
|
|
||||||
$form-input-border-selected-color: #aaa;
|
|
||||||
|
|
||||||
|
|
||||||
$node-selected-color: #ff7f0e;
|
|
||||||
$port-selected-color: #ff7f0e;
|
|
||||||
$link-color: #888;
|
|
||||||
$link-link-color: #ccc;
|
|
||||||
$link-link-active-color: #ff7f0e;
|
|
||||||
$link-subflow-color: #bbb;
|
|
||||||
$link-unknown-color: #f00;
|
|
||||||
|
|
||||||
$primary-border-color: #bbbbbb;
|
|
||||||
$secondary-border-color: #dddddd;
|
|
||||||
|
|
||||||
$tab-background-active: #fff;
|
|
||||||
$tab-background-inactive: #f0f0f0;
|
|
||||||
$tab-background-hover: #ddd;
|
|
||||||
|
|
||||||
$palette-header-background: #f3f3f3;
|
|
||||||
|
|
||||||
$workspace-button-background: #fff;
|
|
||||||
$workspace-button-background-hover: #ddd;
|
|
||||||
$workspace-button-background-active: #efefef;
|
|
||||||
$workspace-button-color: #888;
|
|
||||||
$workspace-button-color-disabled: #ccc;
|
|
||||||
$workspace-button-color-focus: #999;
|
|
||||||
$workspace-button-color-hover: #666;
|
|
||||||
$workspace-button-color-active: #666;
|
|
||||||
$workspace-button-color-selected: #AAA;
|
|
||||||
|
|
||||||
$workspace-button-toggle-color: #999;
|
|
||||||
$workspace-button-toggle-color-selected: #888;
|
|
||||||
$workspace-button-toggle-color-disabled: #ddd;
|
|
||||||
|
|
||||||
$workspace-button-color-focus-outline: rgba(85,150,230,0.2);
|
|
||||||
|
|
||||||
$typedInput-button-background: #efefef;
|
|
||||||
$typedInput-button-background-hover: #ddd;
|
|
||||||
$typedInput-button-background-active: #ddd;
|
|
||||||
|
|
||||||
$editor-button-color-primary: #eee;
|
|
||||||
$editor-button-background-primary: #AD1625;
|
|
||||||
$editor-button-background-primary-hover: #6E0A1E;
|
|
||||||
$editor-button-color: #999;
|
|
||||||
$editor-button-background: #fff;
|
|
||||||
|
|
||||||
$shade-color: rgba(160,160,160,0.5);
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
.debug-window {
|
|
||||||
padding:0;
|
|
||||||
margin:0;
|
|
||||||
background: #fff;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
.debug-window .debug-message-payload {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.debug-content {
|
|
||||||
position: absolute;
|
|
||||||
top: 43px;
|
|
||||||
bottom: 0px;
|
|
||||||
left:0px;
|
|
||||||
right: 0px;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
.debug-filter-box {
|
|
||||||
position:absolute;
|
|
||||||
top: 42px;
|
|
||||||
left: 0px;
|
|
||||||
right: 0px;
|
|
||||||
z-index: 20;
|
|
||||||
background: #f9f9f9;
|
|
||||||
padding: 10px;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
.debug-filter-row {
|
|
||||||
.red-ui-nodeList {
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.debug-message {
|
|
||||||
position: relative;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
border-left: 8px solid #eee;
|
|
||||||
border-right: 8px solid #eee;
|
|
||||||
padding: 2px;
|
|
||||||
&>.debug-message-meta .debug-message-tools {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.debug-message-hover {
|
|
||||||
border-right-color: #999;
|
|
||||||
&>.debug-message-meta .debug-message-tools {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.debug-message-row {
|
|
||||||
.debug-message-tools-pin {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
&.debug-message-row-pinned .debug-message-tools-pin {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
background: #f3f3f3;
|
|
||||||
&>.debug-message-tools {
|
|
||||||
.debug-message-tools-copy {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.debug-message-tools-pin {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.debug-message-meta .debug-message-tools {
|
|
||||||
.editor-button-small {
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.debug-message-tools {
|
|
||||||
.button-group:not(:last-child) {
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
.editor-button-small {
|
|
||||||
height: 16px;
|
|
||||||
line-height: 14px;
|
|
||||||
font-size: 8px;
|
|
||||||
border-radius: 1px;
|
|
||||||
padding: 0 3px;
|
|
||||||
min-width: 18px;
|
|
||||||
i.fa-terminal {
|
|
||||||
// terminal icon is a bit thin, so darken its color for better contrast
|
|
||||||
color: darken($editor-button-color, 30%) !important;
|
|
||||||
}
|
|
||||||
&.selected {
|
|
||||||
color: darken($workspace-button-color-selected, 10%) !important;
|
|
||||||
background: darken($workspace-button-background-active,10%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.debug-message-meta {
|
|
||||||
background: #fff;
|
|
||||||
font-size: 11px;
|
|
||||||
color: #707070;
|
|
||||||
}
|
|
||||||
.debug-message-date {
|
|
||||||
padding: 1px 5px 1px 1px;
|
|
||||||
}
|
|
||||||
.debug-message-topic {
|
|
||||||
display: block;
|
|
||||||
color: #a66;
|
|
||||||
}
|
|
||||||
.debug-message-name {
|
|
||||||
padding: 1px 5px;
|
|
||||||
color: #707070;
|
|
||||||
}
|
|
||||||
.debug-message-tools {
|
|
||||||
position: absolute;
|
|
||||||
top: 3px;
|
|
||||||
right: 1px;
|
|
||||||
.debug-message-tools-copy {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.debug-message-payload {
|
|
||||||
display: block;
|
|
||||||
padding: 2px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.debug-message-level-log {
|
|
||||||
border-left-color: #eee;
|
|
||||||
border-right-color: #eee;
|
|
||||||
}
|
|
||||||
.debug-message-level-30 {
|
|
||||||
border-left-color: #ffdf9d;
|
|
||||||
border-right-color: #ffdf9d;
|
|
||||||
}
|
|
||||||
.debug-message-level-20 {
|
|
||||||
border-left-color: #f99;
|
|
||||||
border-right-color: #f99;
|
|
||||||
}
|
|
||||||
.debug-message-object-entry {
|
|
||||||
position: relative;
|
|
||||||
padding-left: 15px;
|
|
||||||
}
|
|
||||||
.debug-message-element {
|
|
||||||
color: #333;
|
|
||||||
font-family: Menlo, monospace;
|
|
||||||
font-size: 13px !important;
|
|
||||||
line-height: 1.3em;
|
|
||||||
}
|
|
||||||
.debug-message-object-key {
|
|
||||||
color: #792e90;
|
|
||||||
}
|
|
||||||
.debug-message-object-value {
|
|
||||||
|
|
||||||
}
|
|
||||||
.debug-message-object-handle {
|
|
||||||
color: #666;
|
|
||||||
font-size: 1em;
|
|
||||||
width: 1em;
|
|
||||||
text-align: center;
|
|
||||||
transition: transform 0.1s ease-in-out;
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
.debug-message-element:not(.debug-message-top-level)>.debug-message-expandable>.debug-message-object-handle {
|
|
||||||
margin-left: -1em;
|
|
||||||
}
|
|
||||||
.debug-message-object-entry>.debug-message-expandable>.debug-message-object-handle {
|
|
||||||
margin-left: -1em;
|
|
||||||
}
|
|
||||||
.debug-message-object-entry.collapsed>span>.debug-message-object-handle {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
.debug-message-element.collapsed>span>.debug-message-object-handle {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
.debug-message-object-entry.collapsed > .debug-message-object-entry {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.debug-message-element.collapsed .debug-message-object-entry {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.debug-message-element:not(.collapsed)>.debug-message-expandable>.debug-message-object-value>.debug-message-object-header {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.debug-message-element.collapsed .debug-message-buffer-opts {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.debug-message-element.collapsed .debug-message-object-type-header {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.debug-message-object-entry pre {
|
|
||||||
font-family: Menlo, monospace;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.2em;
|
|
||||||
margin: 0 0 0 -1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.debug-message-type-other { color: #2033d6; }
|
|
||||||
.debug-message-type-string { color: #b72828; }
|
|
||||||
.debug-message-type-null { color: #666; font-style: italic;}
|
|
||||||
.debug-message-type-meta { color: #666; font-style: italic;}
|
|
||||||
.debug-message-type-number { color: #2033d6; };
|
|
||||||
.debug-message-type-number-toggle { cursor: pointer;}
|
|
||||||
|
|
||||||
.debug-message-row {
|
|
||||||
display: block;
|
|
||||||
padding: 4px 2px 2px;
|
|
||||||
position: relative;
|
|
||||||
&.debug-message-row-pinned {
|
|
||||||
background: #f6f6f6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.debug-message-expandable {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.debug-message-expandable:hover .debug-message-object-handle {
|
|
||||||
color: #b72828 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.debug-message-buffer-opts a {
|
|
||||||
font-size: 9px;
|
|
||||||
color: #bbb;
|
|
||||||
border: 1px solid #bbb;
|
|
||||||
border-radius: 2px;
|
|
||||||
padding: 2px 5px;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
.debug-message-buffer-opts a:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #999;
|
|
||||||
border: 1px solid #999;
|
|
||||||
background: #f3f3f3;
|
|
||||||
}
|
|
||||||
.debug-message-buffer-raw > .debug-message-string-rows {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.debug-message-buffer-string > .debug-message-array-rows {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.debug-message-type-string-swatch {
|
|
||||||
display: inline-block;
|
|
||||||
width: 1.1em;
|
|
||||||
height: 0.9em;
|
|
||||||
vertical-align: middle;
|
|
||||||
border-radius: 3px;
|
|
||||||
margin: 0 4px;
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus, .dropdown-submenu:hover>a, .dropdown-submenu:focus>a {
|
|
||||||
background: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-menu * .fa-check-square {
|
|
||||||
display: none;
|
|
||||||
color: #e0e0e0;
|
|
||||||
margin-left: -25px;
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
.dropdown-menu * a.active > .fa-check-square {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.dropdown-menu * .fa-square {
|
|
||||||
display: inline-block;
|
|
||||||
color: #e0e0e0;
|
|
||||||
margin-left: -25px;
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
.dropdown-menu * a.active > .fa-square {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.dropdown-menu>li.disabled>a:hover>[class^="icon-"] {
|
|
||||||
background-image: url("vendor/bootstrap/img/glyphicons-halflings.png") !important;
|
|
||||||
}
|
|
||||||
/** Fix for unreachable dropdown menu **/
|
|
||||||
.dropdown-menu {
|
|
||||||
border-radius: 0;
|
|
||||||
width: 200px !important;
|
|
||||||
margin-left: 0px !important;
|
|
||||||
}
|
|
||||||
.dropdown-menu > li > a > i {
|
|
||||||
width: 10px;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: -8px;
|
|
||||||
}
|
|
||||||
.dropdown-menu > li > a {
|
|
||||||
padding-left: 38px ;
|
|
||||||
text-indent: -8px ;
|
|
||||||
white-space: normal !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-submenu>a:after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.dropdown-submenu>a:before {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-left: -30px;
|
|
||||||
border-color: transparent;
|
|
||||||
border-right-color: #e0e0e0;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 5px 5px 5px 0;
|
|
||||||
content: " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-submenu.disabled > a:before {
|
|
||||||
border-right-color: #444;
|
|
||||||
}
|
|
||||||
.dropdown-submenu.pull-left>.dropdown-menu {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lasso {
|
|
||||||
stroke-width: 1px;
|
|
||||||
stroke: #ff7f0e;
|
|
||||||
fill: rgba(20,125,255,0.1);
|
|
||||||
stroke-dasharray: 10 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.group-box {
|
|
||||||
stroke-width: 1px;
|
|
||||||
stroke: #aaaaaa;
|
|
||||||
fill: rgba(208, 211, 238, 0.1);
|
|
||||||
stroke-dasharray: 3 3;
|
|
||||||
}
|
|
||||||
.group-box-active {
|
|
||||||
fill: #fff;
|
|
||||||
stroke: #ff7f0e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.group_label {
|
|
||||||
stroke-width: 0;
|
|
||||||
fill: #999;
|
|
||||||
font-size: 11px;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pull-right {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_label_italic {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.node_label_unknown {
|
|
||||||
font-style: italic;
|
|
||||||
fill: #e00 !important;
|
|
||||||
}
|
|
||||||
.node_label_white {
|
|
||||||
fill: #eee !important;
|
|
||||||
}
|
|
||||||
.node_label {
|
|
||||||
stroke-width: 0;
|
|
||||||
fill: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
.port_label {
|
|
||||||
stroke-width: 0;
|
|
||||||
fill: #888;
|
|
||||||
font-size: 16px;
|
|
||||||
alignment-baseline: middle;
|
|
||||||
text-anchor: middle;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.function_label {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.node {
|
|
||||||
stroke: #999;
|
|
||||||
cursor: move;
|
|
||||||
stroke-width: 1;
|
|
||||||
}
|
|
||||||
.node_unknown {
|
|
||||||
stroke-dasharray:10,4;
|
|
||||||
stroke: #f33;
|
|
||||||
}
|
|
||||||
.tool_arrow {
|
|
||||||
stroke-width: 1;
|
|
||||||
stroke: #999;
|
|
||||||
fill: #999;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.node_tools {
|
|
||||||
fill: #ddd;
|
|
||||||
stroke: #999;
|
|
||||||
cursor: move;
|
|
||||||
stroke-width: 1;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.node_tools_hovered {
|
|
||||||
stroke: #ff7f0e;
|
|
||||||
fill: #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_button {
|
|
||||||
fill: inherit;
|
|
||||||
|
|
||||||
}
|
|
||||||
.port {
|
|
||||||
stroke: #999;
|
|
||||||
stroke-width: 1;
|
|
||||||
fill: #ddd;
|
|
||||||
cursor: crosshair;
|
|
||||||
}
|
|
||||||
|
|
||||||
.port_highlight {
|
|
||||||
stroke: #6DA332;
|
|
||||||
stroke-width: 3;
|
|
||||||
fill: #fff;
|
|
||||||
pointer-events:none;
|
|
||||||
fill-opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_error {
|
|
||||||
stroke: #ff0000;
|
|
||||||
stroke-width: 2;
|
|
||||||
fill: #ff7f0e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_badge {
|
|
||||||
stroke: rgb(93, 114, 145);
|
|
||||||
stroke-width: 1;
|
|
||||||
fill: rgb(190, 209, 255);
|
|
||||||
}
|
|
||||||
.node_badge_label {
|
|
||||||
stroke-width:0;
|
|
||||||
fill: #fff;
|
|
||||||
font-size: 11px;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
@include disable-selection;
|
|
||||||
|
|
||||||
}
|
|
||||||
.node_invalid {
|
|
||||||
stroke: #ff0000;
|
|
||||||
}
|
|
||||||
.node_selected {
|
|
||||||
stroke-width: 2;
|
|
||||||
stroke: $node-selected-color !important;
|
|
||||||
}
|
|
||||||
.node_highlighted {
|
|
||||||
border-color: #dd1616 !important;
|
|
||||||
border-style: dashed !important;
|
|
||||||
stroke: #dd1616;
|
|
||||||
stroke-width: 2;
|
|
||||||
stroke-dasharray: 10, 4;
|
|
||||||
}
|
|
||||||
.node_hovered {
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_subflow .node {
|
|
||||||
stroke-dasharray:8, 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.node_quickadd * {
|
|
||||||
stroke-dasharray: 12,3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node_status_label {
|
|
||||||
@include disable-selection;
|
|
||||||
stroke-width: 0;
|
|
||||||
fill: #888;
|
|
||||||
font-size:9pt;
|
|
||||||
stroke:#000;
|
|
||||||
text-anchor:start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.port_hovered {
|
|
||||||
stroke: $port-selected-color;
|
|
||||||
fill: $port-selected-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.port_quick_link {
|
|
||||||
stroke: $port-selected-color;
|
|
||||||
fill: $port-selected-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.subflowport {
|
|
||||||
stroke-dasharray: 5,5;
|
|
||||||
fill: #eee;
|
|
||||||
stroke: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drag_line {
|
|
||||||
stroke: $node-selected-color;
|
|
||||||
stroke-width: 3;
|
|
||||||
fill: none;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drag_line_hidden {
|
|
||||||
stroke: $node-selected-color;
|
|
||||||
stroke-width: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
fill: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link_line {
|
|
||||||
stroke: $link-color;
|
|
||||||
stroke-width: 3;
|
|
||||||
fill: none;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.link_link {
|
|
||||||
stroke-width: 2;
|
|
||||||
stroke-dasharray: 10,5;
|
|
||||||
stroke: $link-link-color;
|
|
||||||
fill: none;
|
|
||||||
stroke-dasharray: 15,2;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.link_port {
|
|
||||||
fill: #fff;
|
|
||||||
stroke: $link-link-color;
|
|
||||||
stroke-width: 1;
|
|
||||||
}
|
|
||||||
.link_group_active .link_port {
|
|
||||||
stroke: $link-link-active-color;
|
|
||||||
}
|
|
||||||
.link_group:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.link_subflow {
|
|
||||||
stroke: $link-subflow-color;
|
|
||||||
stroke-dasharray: 10,5;
|
|
||||||
stroke-width: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link_outline {
|
|
||||||
stroke: #fff;
|
|
||||||
stroke-width: 5;
|
|
||||||
cursor: crosshair;
|
|
||||||
fill: none;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.link_background {
|
|
||||||
stroke: #fff;
|
|
||||||
opacity: 0;
|
|
||||||
stroke-width: 20;
|
|
||||||
cursor: crosshair;
|
|
||||||
fill: none;
|
|
||||||
}
|
|
||||||
.link_splice > .link_line {
|
|
||||||
stroke-dasharray: 15,8;
|
|
||||||
}
|
|
||||||
|
|
||||||
g.link_selected path.link_line {
|
|
||||||
stroke: $node-selected-color;
|
|
||||||
}
|
|
||||||
g.link_unknown path.link_line {
|
|
||||||
stroke: $link-unknown-color;
|
|
||||||
stroke-width: 2;
|
|
||||||
stroke-dasharray: 10, 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes port_tooltip_fadeIn { from { opacity:0; } to { opacity:1; } }
|
|
||||||
|
|
||||||
.port_tooltip {
|
|
||||||
opacity:0;
|
|
||||||
animation: 0.1s ease-in 0s 1 normal forwards port_tooltip_fadeIn;
|
|
||||||
pointer-events: none;
|
|
||||||
|
|
||||||
path {
|
|
||||||
fill: white;
|
|
||||||
stroke: #999;
|
|
||||||
stroke-width: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.port_tooltip_label {
|
|
||||||
stroke-width: 0;
|
|
||||||
fill: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
pointer-events: none;
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
@@ -1,291 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
$activeButton: #121212;
|
|
||||||
|
|
||||||
$deployButton: #8C101C;
|
|
||||||
$deployButtonHover: #6E0A1E;
|
|
||||||
$deployButtonActive: #4C0A17;
|
|
||||||
|
|
||||||
$deployDisabledButton: #444;
|
|
||||||
$deployDisabledButtonHover: #555;
|
|
||||||
$deployDisabledButtonActive: #444;
|
|
||||||
|
|
||||||
$headerMenuBackground: #121212;
|
|
||||||
$headerMenuItemHover: #323232;
|
|
||||||
$headerMenuItemDivider: #464646;
|
|
||||||
|
|
||||||
#header {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
background: #000;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0px 0px 0px 20px;
|
|
||||||
color: #C7C7C7;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.logo {
|
|
||||||
float: left;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
span {
|
|
||||||
vertical-align: middle;
|
|
||||||
font-size: 16px !important;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: inherit;
|
|
||||||
&:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-toolbar {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
list-style: none;
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
> li {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header .button {
|
|
||||||
min-width: 20px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 40px;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 20px;
|
|
||||||
padding: 0px 12px;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #C7C7C7;
|
|
||||||
margin: auto 5px;
|
|
||||||
vertical-align: middle;
|
|
||||||
border-left: 2px solid #000;
|
|
||||||
border-right: 2px solid #000;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: $headerMenuItemHover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#header .button-group {
|
|
||||||
display: inline-block;
|
|
||||||
margin: auto 15px;
|
|
||||||
vertical-align: middle;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
#header .button-group > a {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
float: left;
|
|
||||||
line-height: 22px;
|
|
||||||
font-size: 14px;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 4px 8px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deploy-button {
|
|
||||||
background: $deployButton;
|
|
||||||
color: #eee !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: $deployButtonHover;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background: $deployButtonActive;
|
|
||||||
color: #ccc !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.deploy-button-spinner {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0.8;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#btn-deploy {
|
|
||||||
|
|
||||||
padding: 4px 12px;
|
|
||||||
|
|
||||||
&.disabled {
|
|
||||||
cursor: default;
|
|
||||||
background: $deployDisabledButton;
|
|
||||||
color: #999 !important;
|
|
||||||
|
|
||||||
.deploy-button-content>img {
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
&+ #btn-deploy-options {
|
|
||||||
background: $deployDisabledButton;
|
|
||||||
color: #ddd;
|
|
||||||
}
|
|
||||||
&+ #btn-deploy-options:hover {
|
|
||||||
background: $deployDisabledButtonHover;
|
|
||||||
}
|
|
||||||
&+ #btn-deploy-options:active {
|
|
||||||
background: $deployDisabledButton;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.deploy-button-content>img {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.deploy-button-group.open {
|
|
||||||
#btn-deploy-options {
|
|
||||||
background: $activeButton !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#header .button {
|
|
||||||
&:active, &.active {
|
|
||||||
background: $activeButton;
|
|
||||||
}
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#header li.open .button {
|
|
||||||
background: $activeButton;
|
|
||||||
border-color: $activeButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#header ul.dropdown-menu {
|
|
||||||
background: $headerMenuBackground;
|
|
||||||
width: 250px !important;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu li a {
|
|
||||||
color: #C7C7C7;
|
|
||||||
padding: 3px 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu li a img {
|
|
||||||
margin-right: 10px;
|
|
||||||
padding: 4px;
|
|
||||||
border: 3px solid rgba(0,0,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu li a.active img {
|
|
||||||
border: 3px solid #777677;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu li a span.menu-label-container {
|
|
||||||
width: 180px;
|
|
||||||
vertical-align: top;
|
|
||||||
display: inline-block;
|
|
||||||
text-indent: 0px;
|
|
||||||
}
|
|
||||||
#header ul.dropdown-menu li a span.menu-label {
|
|
||||||
font-size: 14px;
|
|
||||||
display: inline-block;
|
|
||||||
text-indent: 0px;
|
|
||||||
}
|
|
||||||
#header ul.dropdown-menu li a span.menu-sublabel {
|
|
||||||
color: #aeaeae;
|
|
||||||
font-size: 13px;
|
|
||||||
display: inline-block;
|
|
||||||
text-indent: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu > li:hover > a,
|
|
||||||
#header ul.dropdown-menu > li:focus > a {
|
|
||||||
background: $headerMenuItemHover !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu li.divider {
|
|
||||||
background: $headerMenuItemDivider;
|
|
||||||
border-bottom-color: $headerMenuItemHover;
|
|
||||||
}
|
|
||||||
#header ul.dropdown-menu li.disabled a {
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header ul.dropdown-menu > li.disabled:hover > a,
|
|
||||||
#header ul.dropdown-menu > li.disabled:focus > a {
|
|
||||||
background: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Deploy menu customisations */
|
|
||||||
#header ul#btn-deploy-options-submenu {
|
|
||||||
width: 300px !important;
|
|
||||||
}
|
|
||||||
#header ul#btn-deploy-options-submenu li a span.menu-label {
|
|
||||||
font-size: 16px;
|
|
||||||
display: inline-block;
|
|
||||||
text-indent: 0px;
|
|
||||||
}
|
|
||||||
#header ul#btn-deploy-options-submenu li a {
|
|
||||||
padding: 10px 30px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
#header ul#btn-deploy-options-submenu li a > i.fa {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* User menu customisations */
|
|
||||||
#header ul#btn-usermenu-submenu li a#btn-username > .menu-label {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#btn-usermenu .user-profile {
|
|
||||||
background-position: center center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: contain;
|
|
||||||
display: inline-block;
|
|
||||||
width: 40px;
|
|
||||||
height: 35px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
#keyboard-help-dialog {
|
|
||||||
font-size: 0.9em;
|
|
||||||
padding-top: 10px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#user-settings-tab-keyboard .red-ui-editableList-container {
|
|
||||||
border-radius: 0;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.keyboard-shortcut-entry.keyboard-shortcut-list-header {
|
|
||||||
padding:0 5px 0 5px;
|
|
||||||
div {
|
|
||||||
color: #666 !important;
|
|
||||||
}
|
|
||||||
.red-ui-searchBox-container {
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-scope {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.keyboard-shortcut-list-header {
|
|
||||||
border-bottom: 1px solid $primary-border-color;
|
|
||||||
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-list {
|
|
||||||
position: absolute;
|
|
||||||
top:30px;
|
|
||||||
left:10px;
|
|
||||||
right:10px;
|
|
||||||
bottom:10px;
|
|
||||||
li {
|
|
||||||
padding: 0;
|
|
||||||
.red-ui-editableList-item-content {
|
|
||||||
padding: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
li:hover {
|
|
||||||
background: #f6f6f6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry {
|
|
||||||
div {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
// white-space: nowrap;
|
|
||||||
|
|
||||||
select {
|
|
||||||
margin: 0;
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-key {
|
|
||||||
width:160px;
|
|
||||||
vertical-align: middle;
|
|
||||||
input {
|
|
||||||
margin:0;
|
|
||||||
width: calc(100% - 5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-text {
|
|
||||||
vertical-align: middle;
|
|
||||||
width: calc(100% - 160px - 100px - 10px);
|
|
||||||
overflow: hidden;
|
|
||||||
i {
|
|
||||||
color: #ccc;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-scope {
|
|
||||||
width:100px;
|
|
||||||
color: #999;
|
|
||||||
vertical-align: middle;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry:not(.keyboard-shortcut-list-header) {
|
|
||||||
.keyboard-shortcut-entry-scope {
|
|
||||||
font-size: 0.8em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-unassigned {
|
|
||||||
color: #999;
|
|
||||||
.keyboard-shortcut-entry-key {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-expanded {
|
|
||||||
.keyboard-shortcut-entry-key {
|
|
||||||
width: 150px;
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-text {
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-entry-scope {
|
|
||||||
width: 110px;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keyboard-shortcut-edit {
|
|
||||||
}
|
|
||||||
.help-key {
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
padding: 4px;
|
|
||||||
border-radius: 3px;
|
|
||||||
background: #f6f6f6;
|
|
||||||
font-family: Courier, monospace;
|
|
||||||
box-shadow: #999 1px 1px 1px;
|
|
||||||
}
|
|
||||||
.help-key-block {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
#notifications {
|
|
||||||
z-index: 100;
|
|
||||||
width: 500px;
|
|
||||||
margin-left: -250px;
|
|
||||||
left: 50%;
|
|
||||||
position: absolute;
|
|
||||||
top: 1px;
|
|
||||||
}
|
|
||||||
.notification {
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: relative;
|
|
||||||
padding: 14px 18px;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
box-shadow: 0 1px 1px 1px rgba(0,0,0, 0.15);
|
|
||||||
background-color: #fff;
|
|
||||||
color: #666;
|
|
||||||
border: 1px solid #325C80;
|
|
||||||
border-left-width: 16px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.notification p:first-child {
|
|
||||||
font-size: 1.1em;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
.notification a {
|
|
||||||
text-decoration: none;
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-success {
|
|
||||||
border-color: #4B8400;
|
|
||||||
}
|
|
||||||
.notification-warning {
|
|
||||||
border-color: #D74108;
|
|
||||||
}
|
|
||||||
.notification-error {
|
|
||||||
border-color: #AD1625;
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
.red-ui-popover {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
width: auto;
|
|
||||||
padding: 10px;
|
|
||||||
height: auto;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
z-index: 1000;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.4em;
|
|
||||||
@include component-shadow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-ui-popover:after, .red-ui-popover:before {
|
|
||||||
border: solid transparent;
|
|
||||||
content: " ";
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
position: absolute;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.red-ui-popover.red-ui-popover-right:after, .red-ui-popover.red-ui-popover-right:before {
|
|
||||||
top: 50%;
|
|
||||||
right: 100%;
|
|
||||||
}
|
|
||||||
.red-ui-popover.red-ui-popover-left:after, .red-ui-popover.red-ui-popover-left:before {
|
|
||||||
top: 50%;
|
|
||||||
left: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-ui-popover.red-ui-popover-bottom:after, .red-ui-popover.red-ui-popover-bottom:before {
|
|
||||||
bottom: 100%;
|
|
||||||
left: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-ui-popover.red-ui-popover-right:after {
|
|
||||||
border-color: rgba(136, 183, 213, 0);
|
|
||||||
border-right-color: #fff;
|
|
||||||
border-width: 10px;
|
|
||||||
margin-top: -10px;
|
|
||||||
}
|
|
||||||
.red-ui-popover.red-ui-popover-right:before {
|
|
||||||
border-color: rgba(194, 225, 245, 0);
|
|
||||||
border-right-color: $primary-border-color;
|
|
||||||
border-width: 11px;
|
|
||||||
margin-top: -11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.red-ui-popover.red-ui-popover-left:after {
|
|
||||||
border-color: rgba(136, 183, 213, 0);
|
|
||||||
border-left-color: #fff;
|
|
||||||
border-width: 10px;
|
|
||||||
margin-top: -10px;
|
|
||||||
}
|
|
||||||
.red-ui-popover.red-ui-popover-left:before {
|
|
||||||
border-color: rgba(194, 225, 245, 0);
|
|
||||||
border-left-color: $primary-border-color;
|
|
||||||
border-width: 11px;
|
|
||||||
margin-top: -11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.red-ui-popover.red-ui-popover-bottom:after {
|
|
||||||
border-color: rgba(136, 183, 213, 0);
|
|
||||||
border-bottom-color: #fff;
|
|
||||||
border-width: 10px;
|
|
||||||
margin-left: -10px;
|
|
||||||
}
|
|
||||||
.red-ui-popover.red-ui-popover-bottom:before {
|
|
||||||
border-color: rgba(194, 225, 245, 0);
|
|
||||||
border-bottom-color: $primary-border-color;
|
|
||||||
border-width: 11px;
|
|
||||||
margin-left: -11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.red-ui-popover-size-small {
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 5px;
|
|
||||||
|
|
||||||
&.red-ui-popover-right:after {
|
|
||||||
border-width: 5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
}
|
|
||||||
&.red-ui-popover-right:before {
|
|
||||||
border-width: 6px;
|
|
||||||
margin-top: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.red-ui-popover-left:after {
|
|
||||||
border-width: 5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
}
|
|
||||||
&.red-ui-popover-left:before {
|
|
||||||
border-width: 6px;
|
|
||||||
margin-top: -6px;
|
|
||||||
}
|
|
||||||
&.red-ui-popover-bottom:after {
|
|
||||||
border-width: 5px;
|
|
||||||
margin-left: -5px;
|
|
||||||
}
|
|
||||||
&.red-ui-popover-bottom:before {
|
|
||||||
border-width: 6px;
|
|
||||||
margin-left: -6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
#sidebar {
|
|
||||||
position: absolute;
|
|
||||||
top: 0px;
|
|
||||||
right: 0px;
|
|
||||||
bottom: 0px;
|
|
||||||
width: 315px;
|
|
||||||
background: #fff;
|
|
||||||
box-sizing: border-box;
|
|
||||||
z-index: 10;
|
|
||||||
@include component-border;
|
|
||||||
}
|
|
||||||
|
|
||||||
#sidebar.closing {
|
|
||||||
background: #eee;
|
|
||||||
border-color: #900;
|
|
||||||
border-style: dashed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#sidebar-content {
|
|
||||||
position: absolute;
|
|
||||||
top: 35px;
|
|
||||||
right: 0;
|
|
||||||
bottom: 25px;
|
|
||||||
left: 0px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#sidebar-separator {
|
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
right: 315px;
|
|
||||||
bottom:10px;
|
|
||||||
width: 7px;
|
|
||||||
z-index: 11;
|
|
||||||
background: $background-color url(images/grip.png) no-repeat 50% 50%;
|
|
||||||
cursor: col-resize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-closed > #sidebar { display: none; }
|
|
||||||
.sidebar-closed > #sidebar-separator { right: 0px !important; }
|
|
||||||
.sidebar-closed > #workspace { right: 7px !important; }
|
|
||||||
.sidebar-closed > #editor-stack { right: 8px !important; }
|
|
||||||
|
|
||||||
#sidebar .button {
|
|
||||||
@include workspace-button;
|
|
||||||
line-height: 18px;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-right: 5px;
|
|
||||||
padding: 2px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-header {
|
|
||||||
color: #666;
|
|
||||||
text-align: right;
|
|
||||||
padding: 8px 10px;
|
|
||||||
background: #f3f3f3;
|
|
||||||
border-bottom: 1px solid $secondary-border-color;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
#sidebar-footer {
|
|
||||||
@include component-footer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-footer-button {
|
|
||||||
@include component-footer-button;
|
|
||||||
}
|
|
||||||
.sidebar-footer-button-toggle {
|
|
||||||
@include component-footer-button-toggle;
|
|
||||||
}
|
|
||||||
.sidebar-header-button {
|
|
||||||
@include workspace-button;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 13px;
|
|
||||||
padding: 5px 8px;
|
|
||||||
}
|
|
||||||
.sidebar-header-button-toggle {
|
|
||||||
@include workspace-button-toggle;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 13px;
|
|
||||||
padding: 5px 8px;
|
|
||||||
}
|
|
||||||
.sidebar-header-button:not(:first-child) {
|
|
||||||
border-left: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-shade {
|
|
||||||
@include shade;
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
@import "colors";
|
|
||||||
@import "mixins";
|
|
||||||
|
|
||||||
@import "forms";
|
|
||||||
|
|
||||||
@import "jquery";
|
|
||||||
@import "bootstrap";
|
|
||||||
@import "ace";
|
|
||||||
|
|
||||||
@import "dropdownMenu";
|
|
||||||
|
|
||||||
@import "header";
|
|
||||||
@import "palette";
|
|
||||||
@import "sidebar";
|
|
||||||
@import "workspace";
|
|
||||||
@import "workspaceToolbar";
|
|
||||||
|
|
||||||
@import "notifications";
|
|
||||||
|
|
||||||
@import "editor";
|
|
||||||
@import "library";
|
|
||||||
@import "search";
|
|
||||||
|
|
||||||
@import "panels";
|
|
||||||
@import "tabs";
|
|
||||||
@import "tab-config";
|
|
||||||
@import "tab-context";
|
|
||||||
@import "tab-info";
|
|
||||||
@import "popover";
|
|
||||||
@import "flow";
|
|
||||||
@import "palette-editor";
|
|
||||||
@import "diff";
|
|
||||||
|
|
||||||
@import "userSettings";
|
|
||||||
|
|
||||||
@import "projects";
|
|
||||||
|
|
||||||
|
|
||||||
@import "ui/common/editableList";
|
|
||||||
@import "ui/common/searchBox";
|
|
||||||
@import "ui/common/typedInput";
|
|
||||||
@import "ui/common/nodeList";
|
|
||||||
@import "ui/common/checkboxSet";
|
|
||||||
@import "ui/common/stack";
|
|
||||||
|
|
||||||
@import "dragdrop";
|
|
||||||
|
|
||||||
@import "keyboard";
|
|
||||||
|
|
||||||
@import "debug";
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-size: 14px;
|
|
||||||
font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
||||||
padding-top: 100px;
|
|
||||||
background: $background-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
#main-container {
|
|
||||||
position: absolute;
|
|
||||||
top:40px; left:0; bottom: 0; right:0;
|
|
||||||
overflow:hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
i.spinner {
|
|
||||||
display: inline-block;
|
|
||||||
width: 14px;
|
|
||||||
height: 14px;
|
|
||||||
line-height: 14px;
|
|
||||||
vertical-align: text-top;
|
|
||||||
margin-top: 0px;
|
|
||||||
background: url(images/spin.svg) no-repeat 50% 50%;
|
|
||||||
background-size: contain
|
|
||||||
}
|
|
||||||
|
|
||||||
code, pre {
|
|
||||||
padding: 0 3px 2px;
|
|
||||||
font-family: monospace;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333333;
|
|
||||||
border-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
padding: 0px 3px 2px 3px;
|
|
||||||
margin: 1px;
|
|
||||||
color: #AD1625;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: #f7f7f9;
|
|
||||||
border: 1px solid #e1e1e8;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
display: block;
|
|
||||||
padding: 9.5px;
|
|
||||||
margin: 0 0 10px;
|
|
||||||
line-height: 20px;
|
|
||||||
word-break: break-all;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: pre;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre code {
|
|
||||||
padding: 0;
|
|
||||||
color: inherit;
|
|
||||||
white-space: pre;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hide {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
.sidebar-node-config {
|
|
||||||
position: relative;
|
|
||||||
background: #f3f3f3;
|
|
||||||
height: 100%;
|
|
||||||
overflow-y:auto;
|
|
||||||
@include disable-selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
.config-node-list {
|
|
||||||
margin: 0;
|
|
||||||
list-style-type: none;
|
|
||||||
|
|
||||||
.palette_label {
|
|
||||||
margin-left: 8px;
|
|
||||||
line-height: 24px;
|
|
||||||
text-align: left;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
.palette_icon_container {
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 30px;
|
|
||||||
background-color: #e8e8e8;
|
|
||||||
border-top-right-radius: 4px;
|
|
||||||
border-bottom-right-radius: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.config_node {
|
|
||||||
width: 160px;
|
|
||||||
height: 30px;
|
|
||||||
background: #f3f3f3;
|
|
||||||
color: #666;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.config_node_type {
|
|
||||||
color: #999;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 3px;
|
|
||||||
&:not(:first-child) {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.config_node_none {
|
|
||||||
color: #ddd;
|
|
||||||
text-align:right;
|
|
||||||
padding-right: 3px;
|
|
||||||
}
|
|
||||||
.config_node_unused {
|
|
||||||
border-color: #aaa;
|
|
||||||
background: #f9f9f9;
|
|
||||||
border-style: dashed;
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
.config-node-filter-info {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right:0;
|
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
padding: 0 8px;
|
|
||||||
background: $palette-header-background;
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: #999;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
#chart {
|
|
||||||
overflow: auto;
|
|
||||||
background: #e3e3e3;
|
|
||||||
position: absolute;
|
|
||||||
bottom:25px;
|
|
||||||
top: 35px;
|
|
||||||
left:0px;
|
|
||||||
right:0px;
|
|
||||||
box-sizing:border-box;
|
|
||||||
transition: right 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
#chart:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspace {
|
|
||||||
position: absolute;
|
|
||||||
margin: 0;
|
|
||||||
top:0px;
|
|
||||||
left:179px;
|
|
||||||
bottom: 0px;
|
|
||||||
right: 322px;
|
|
||||||
overflow: hidden;
|
|
||||||
@include component-border;
|
|
||||||
transition: left 0.2s ease-in-out;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspace-footer-button {
|
|
||||||
@include component-footer-button;
|
|
||||||
}
|
|
||||||
.workspace-footer-button-toggle {
|
|
||||||
@include component-footer-button-toggle;
|
|
||||||
}
|
|
||||||
#workspace-footer {
|
|
||||||
@include component-footer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspace-tabs:not(.workspace-focussed) {
|
|
||||||
opacity:0.8;
|
|
||||||
li.red-ui-tab.active a {
|
|
||||||
color:#666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.workspace-disabled-icon {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.workspace-disabled {
|
|
||||||
&.red-ui-tab {
|
|
||||||
border-top-style: dashed;
|
|
||||||
border-left-style: dashed;
|
|
||||||
border-right-style: dashed;
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-style: italic;
|
|
||||||
color: #aaa !important;
|
|
||||||
}
|
|
||||||
&.active a {
|
|
||||||
font-weight: normal;
|
|
||||||
color: #999 !important;
|
|
||||||
}
|
|
||||||
.workspace-disabled-icon {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
|
||||||
<!--
|
|
||||||
Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<head>
|
|
||||||
<title>{{ page.title }}</title>
|
|
||||||
<link rel="icon" type="image/png" href="{{ page.favicon }}">
|
|
||||||
<link rel="mask-icon" href="{{ page.tabicon }}" color="#8f0000">
|
|
||||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
|
||||||
<link href="vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" media="screen">
|
|
||||||
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="vendor/vendor.css">
|
|
||||||
<link rel="stylesheet" href="red/style.min.css">
|
|
||||||
{{#page.css}}
|
|
||||||
<link rel="stylesheet" href="{{.}}">
|
|
||||||
{{/page.css}}
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body spellcheck="false">
|
|
||||||
<div id="header">
|
|
||||||
<span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
|
|
||||||
<ul class="header-toolbar hide">
|
|
||||||
<li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li>
|
|
||||||
</ul>
|
|
||||||
<div id="header-shade" class="hide"></div>
|
|
||||||
</div>
|
|
||||||
<div id="main-container" class="sidebar-closed hide">
|
|
||||||
<div id="workspace">
|
|
||||||
<ul id="workspace-tabs"></ul>
|
|
||||||
<div id="chart" tabindex="1"></div>
|
|
||||||
<div id="workspace-toolbar"></div>
|
|
||||||
<div id="workspace-footer">
|
|
||||||
<a class="workspace-footer-button" id="btn-zoom-out" href="#"><i class="fa fa-minus"></i></a>
|
|
||||||
<a class="workspace-footer-button" id="btn-zoom-zero" href="#"><i class="fa fa-circle-o"></i></a>
|
|
||||||
<a class="workspace-footer-button" id="btn-zoom-in" href="#"><i class="fa fa-plus"></i></a>
|
|
||||||
<a class="workspace-footer-button-toggle single" id="btn-navigate" href="#"><i class="fa fa-map-o"></i></a>
|
|
||||||
</div>
|
|
||||||
<div id="editor-shade" class="hide"></div>
|
|
||||||
</div>
|
|
||||||
<div id="editor-stack"></div>
|
|
||||||
<div id="palette">
|
|
||||||
<img src="red/images/spin.svg" class="palette-spinner hide"/>
|
|
||||||
<div id="palette-search" class="palette-search hide">
|
|
||||||
<input type="text" data-i18n="[placeholder]palette.filter"></input>
|
|
||||||
</div>
|
|
||||||
<div id="palette-container" class="palette-scroll hide"></div>
|
|
||||||
<div id="palette-footer">
|
|
||||||
<a class="palette-button" id="palette-collapse-all" href="#"><i class="fa fa-angle-double-up"></i></a>
|
|
||||||
<a class="palette-button" id="palette-expand-all" href="#"><i class="fa fa-angle-double-down"></i></a>
|
|
||||||
</div>
|
|
||||||
<div id="palette-shade" class="hide"></div>
|
|
||||||
</div><!-- /palette -->
|
|
||||||
<div id="sidebar">
|
|
||||||
<ul id="sidebar-tabs"></ul>
|
|
||||||
<div id="sidebar-content"></div>
|
|
||||||
<div id="sidebar-footer"></div>
|
|
||||||
<div id="sidebar-shade" class="hide"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar-separator"></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="full-shade" class="hide"></div>
|
|
||||||
|
|
||||||
<div id="notifications"></div>
|
|
||||||
<div id="dropTarget"><div data-i18n="[append]workspace.dropFlowHere"><br/><i class="fa fa-download"></i></div></div>
|
|
||||||
|
|
||||||
<script src="vendor/vendor.js"></script>
|
|
||||||
<script src="vendor/jsonata/jsonata.min.js"></script>
|
|
||||||
<script src="vendor/ace/ace.js"></script>
|
|
||||||
<script src="vendor/ace/ext-language_tools.js"></script>
|
|
||||||
<script src="{{ asset.red }}"></script>
|
|
||||||
<script src="{{ asset.main }}"></script>
|
|
||||||
{{# page.scripts }}
|
|
||||||
<script src="{{.}}"></script>
|
|
||||||
{{/ page.scripts }}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
14
editor/vendor/ace/ace.js
vendored
5
editor/vendor/ace/ext-language_tools.js
vendored
5
editor/vendor/ace/ext-searchbox.js
vendored
1
editor/vendor/ace/mode-css.js
vendored
1
editor/vendor/ace/mode-handlebars.js
vendored
1
editor/vendor/ace/mode-html.js
vendored
1
editor/vendor/ace/mode-javascript.js
vendored
1
editor/vendor/ace/mode-markdown.js
vendored
1
editor/vendor/ace/mode-python.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield|async|await",t="True|False|None|NotImplemented|Ellipsis|__debug__",n="abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern",r=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":n,"constant.language":t,keyword:e},"identifier"),i="(?:r|u|ur|R|U|UR|Ur|uR)?",s="(?:(?:[1-9]\\d*)|(?:0))",o="(?:0[oO]?[0-7]+)",u="(?:0[xX][\\dA-Fa-f]+)",a="(?:0[bB][01]+)",f="(?:"+s+"|"+o+"|"+u+"|"+a+")",l="(?:[eE][+-]?\\d+)",c="(?:\\.\\d+)",h="(?:\\d+)",p="(?:(?:"+h+"?"+c+")|(?:"+h+"\\.))",d="(?:(?:"+p+"|"+h+")"+l+")",v="(?:"+d+"|"+p+")",m="\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:i+'"{3}',next:"qqstring3"},{token:"string",regex:i+'"(?=.)',next:"qqstring"},{token:"string",regex:i+"'{3}",next:"qstring3"},{token:"string",regex:i+"'(?=.)",next:"qstring"},{token:"constant.numeric",regex:"(?:"+v+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:v},{token:"constant.numeric",regex:f+"[lL]\\b"},{token:"constant.numeric",regex:f+"\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring3:[{token:"constant.language.escape",regex:m},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:m},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:m},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:m},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]}};r.inherits(s,i),t.PythonHighlightRules=s}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+e+")(?:\\s*)(?:#.*)?$")};r.inherits(s,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i)return i[1]?this.openingBracketBlock(e,i[1],n,i.index):i[2]?this.indentationBlock(e,n,i.index+i[2].length):this.indentationBlock(e,n)}}.call(s.prototype)}),ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./python_highlight_rules").PythonHighlightRules,o=e("./folding/pythonic").FoldMode,u=e("../range").Range,a=function(){this.HighlightRules=s,this.foldingRules=new o("\\:"),this.$behaviour=this.$defaultBehaviour};r.inherits(a,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new u(n,r.length-i.length,n,r.length))},this.$id="ace/mode/python"}.call(a.prototype),t.Mode=a})
|
|
||||||
1
editor/vendor/ace/mode-sql.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant",t="true|false",n="avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",r="int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer",i=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t,"storage.type":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.SqlHighlightRules=s}),ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./sql_highlight_rules").SqlHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="--",this.$id="ace/mode/sql"}.call(o.prototype),t.Mode=o})
|
|
||||||
1
editor/vendor/ace/mode-swift.js
vendored
1
editor/vendor/ace/snippets/handlebars.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/handlebars",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="handlebars"})
|
|
||||||
1
editor/vendor/ace/snippets/json.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/json",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="json"})
|
|
||||||
1
editor/vendor/ace/snippets/properties.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/properties",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="properties"})
|
|
||||||
1
editor/vendor/ace/snippets/swift.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/swift",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="swift"})
|
|
||||||
1
editor/vendor/ace/snippets/text.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/text",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="text"})
|
|
||||||
1
editor/vendor/ace/snippets/yaml.js
vendored
@@ -1 +0,0 @@
|
|||||||
ace.define("ace/snippets/yaml",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="yaml"})
|
|
||||||
1
editor/vendor/ace/worker-html.js
vendored
1
editor/vendor/ace/worker-javascript.js
vendored
1
editor/vendor/ace/worker-json.js
vendored
5038
editor/vendor/bootstrap/css/bootstrap.css
vendored
|
Before Width: | Height: | Size: 8.6 KiB |
BIN
editor/vendor/bootstrap/img/glyphicons-halflings.png
vendored
|
Before Width: | Height: | Size: 12 KiB |
6
editor/vendor/bootstrap/js/bootstrap.min.js
vendored
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
5
editor/vendor/jquery/js/jquery-1.11.3.min.js
vendored
15
jsdoc.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"opts": {
|
"opts": {
|
||||||
"template": "./node_modules/ink-docstrap/template",
|
"template": "./node_modules/jsdoc-nr-template",
|
||||||
"destination": "./docs",
|
"destination": "./docs",
|
||||||
"recurse": true
|
"recurse": true
|
||||||
},
|
},
|
||||||
@@ -9,14 +9,17 @@
|
|||||||
"dictionaries": ["jsdoc"]
|
"dictionaries": ["jsdoc"]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"include": [
|
"_include": [
|
||||||
"./red/runtime-api"
|
"./packages/node_modules/@node-red/runtime/lib/api"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
"systemName": "Node-RED Runtime API",
|
"systemName": "Node-RED Runtime API",
|
||||||
"theme":"yeti",
|
|
||||||
"footer": "",
|
"footer": "",
|
||||||
"copyright": "Released under the Apache License v2.0"
|
"copyright": "Released under the Apache License v2.0",
|
||||||
}
|
"default": {
|
||||||
|
"outputSourceFiles": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": ["plugins/markdown"]
|
||||||
}
|
}
|
||||||
|
|||||||
1
lib/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
*
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="sentiment">
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span></label>
|
|
||||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="sentiment">
|
|
||||||
<p>Analyses the chosen property, default <code>payload</code>, and adds a <code>sentiment</code> object.</p>
|
|
||||||
<h3>Outputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>sentiment <span class="property-type">object</span></dt>
|
|
||||||
<dd>contains the resulting AFINN-111 sentiment.</dd>
|
|
||||||
<dt>sentiment.score <span class="property-type">number</span></dt>
|
|
||||||
<dd>the sentiment score.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Inputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>overrides <span class="property-type">object</span></dt>
|
|
||||||
<dd>an object of word score overrides can be supplied - <code>{ word:score,... }</code>.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>A score greater than zero is positive and less than zero is negative.</p>
|
|
||||||
<p>The score typically ranges from -5 to +5, but can go higher and lower.</p>
|
|
||||||
<p>See <a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_blank">the Sentiment docs here</a>.</p>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
RED.nodes.registerType('sentiment',{
|
|
||||||
category: 'analysis-function',
|
|
||||||
color:"#E6E0F8",
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
property: {value:"payload",required:true}
|
|
||||||
},
|
|
||||||
inputs:1,
|
|
||||||
outputs:1,
|
|
||||||
icon: "arrow-in.png",
|
|
||||||
label: function() {
|
|
||||||
return this.name||"sentiment";
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
if (this.property === undefined) {
|
|
||||||
$("#node-input-property").val("payload");
|
|
||||||
}
|
|
||||||
$("#node-input-property").typedInput({default:'msg',types:['msg']});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
|
|
||||||
module.exports = function(RED) {
|
|
||||||
"use strict";
|
|
||||||
var sentiment = require('sentiment');
|
|
||||||
|
|
||||||
function SentimentNode(n) {
|
|
||||||
RED.nodes.createNode(this,n);
|
|
||||||
this.property = n.property||"payload";
|
|
||||||
var node = this;
|
|
||||||
|
|
||||||
this.on("input", function(msg) {
|
|
||||||
var value = RED.util.getMessageProperty(msg,node.property);
|
|
||||||
if (value !== undefined) {
|
|
||||||
sentiment(value, msg.overrides || null, function (err, result) {
|
|
||||||
msg.sentiment = result;
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else { node.send(msg); } // If no matching property - just pass it on.
|
|
||||||
});
|
|
||||||
}
|
|
||||||
RED.nodes.registerType("sentiment",SentimentNode);
|
|
||||||
}
|
|
||||||
@@ -1,267 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="catch">
|
|
||||||
<div class="form-row">
|
|
||||||
<label style="width: auto" for="node-input-scope" data-i18n="catch.label.source"></label>
|
|
||||||
<select id="node-input-scope-select">
|
|
||||||
<option value="all" data-i18n="catch.scope.all"></option>
|
|
||||||
<option value="target" data-i18n="catch.scope.selected"></options>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-row node-input-target-row" style="display: none;">
|
|
||||||
<div id="node-input-catch-target-container-div" style="min-height: 100px;position: relative; box-sizing: border-box; border-radius: 2px; height: 180px; border: 1px solid #ccc;overflow:hidden; ">
|
|
||||||
<div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">
|
|
||||||
<input type="checkbox" data-i18n="[title]catch.label.selectAll" id="node-input-target-node-checkbox-all" style="width: 30px; margin: 0 2px 1px 2px;">
|
|
||||||
<div style="display: inline-block;"><a id="node-input-target-sort-label" href="#" data-i18n="[title]catch.label.sortByLabel"><span data-i18n="catch.label.node"></span> <i class="node-input-catch-sort-label-a fa fa-caret-down"></i><i class="node-input-catch-sort-label-d fa fa-caret-up"></i></a></div>
|
|
||||||
<div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-target-sort-type" href="#" data-i18n="[title]catch.label.sortByType"><i class="node-input-catch-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-catch-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="catch.label.type"></span></a></div>
|
|
||||||
</div>
|
|
||||||
<div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">
|
|
||||||
<ul id="node-input-catch-target-container" style=" list-style-type:none; margin: 0;"></ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
<script type="text/x-red" data-help-name="catch">
|
|
||||||
<p>Catch errors thrown by nodes on the same tab.</p>
|
|
||||||
<h3>Outputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>error.message <span class="property-type">string</span></dt>
|
|
||||||
<dd>the error message.</dd>
|
|
||||||
<dt>error.source.id <span class="property-type">string</span></dt>
|
|
||||||
<dd>the id of the node that threw the error.</dd>
|
|
||||||
<dt>error.source.type <span class="property-type">string</span></dt>
|
|
||||||
<dd>the type of the node that threw the error.</dd>
|
|
||||||
<dt>error.source.name <span class="property-type">string</span></dt>
|
|
||||||
<dd>the name, if set, of the node that threw the error.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>If a node throws an error whilst handling a message, the flow will typically
|
|
||||||
halt. This node can be used to catch those errors and handle them with a
|
|
||||||
dedicated flow.</p>
|
|
||||||
<p>By default, the node will catch errors thrown by any node on the same tab. Alternatively
|
|
||||||
it can be targetted at specific nodes.</p>
|
|
||||||
<p>When an error is thrown, all matching catch nodes will receive the message.</p>
|
|
||||||
<p>If an error is thrown within a subflow, the error will get handled by any
|
|
||||||
catch nodes within the subflow. If none exists, the error will be propagated
|
|
||||||
up to the tab the subflow instance is on.</p>
|
|
||||||
<p>If the message already has a <code>error</code> property, it is copied to <code>_error</code>.</p>
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
#node-input-catch-target-container {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#node-input-catch-target-container li {
|
|
||||||
padding: 2px 5px;
|
|
||||||
background: none;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin:0;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
#node-input-catch-target-container li label {
|
|
||||||
margin-bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#node-input-catch-target-container li label input {
|
|
||||||
vertical-align: top;
|
|
||||||
width:15px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
#node-input-catch-target-container li:hover,
|
|
||||||
#node-input-catch-target-container li:hover .node-input-target-node-sublabel {
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
.node-input-target-node-sublabel {
|
|
||||||
position:absolute;
|
|
||||||
right: 0px;
|
|
||||||
padding-right: 10px;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-size: 0.8em;
|
|
||||||
background: #fbfbfb;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript">
|
|
||||||
RED.nodes.registerType('catch',{
|
|
||||||
category: 'input',
|
|
||||||
color:"#e49191",
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
scope: {value:null}
|
|
||||||
},
|
|
||||||
inputs:0,
|
|
||||||
outputs:1,
|
|
||||||
icon: "alert.png",
|
|
||||||
label: function() {
|
|
||||||
return this.name||(this.scope?this._("catch.catchNodes",{number:this.scope.length}):this._("catch.catch"));
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
var nodeList = $("#node-input-catch-target-container");
|
|
||||||
var node = this;
|
|
||||||
this.resize = function() {
|
|
||||||
var rows = $("#dialog-form>div:not(.node-input-target-row)");
|
|
||||||
var height = $("#dialog-form").height();
|
|
||||||
for (var i=0;i<rows.size();i++) {
|
|
||||||
height -= $(rows[i]).outerHeight(true);
|
|
||||||
}
|
|
||||||
var editorRow = $("#dialog-form>div.node-input-target-row");
|
|
||||||
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
|
||||||
$("#node-input-catch-target-container-div").css("height",height+"px");
|
|
||||||
};
|
|
||||||
|
|
||||||
function createNodeList() {
|
|
||||||
var scope = node.scope || [];
|
|
||||||
nodeList.empty();
|
|
||||||
|
|
||||||
var candidateNodes = RED.nodes.filterNodes({z:node.z});
|
|
||||||
var allChecked = true;
|
|
||||||
|
|
||||||
candidateNodes.forEach(function(n) {
|
|
||||||
if (n.id === node.id) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var isChecked = scope.indexOf(n.id) !== -1;
|
|
||||||
|
|
||||||
allChecked = allChecked && isChecked;
|
|
||||||
|
|
||||||
var container = $('<li/>',{class:"node-input-target-node"});
|
|
||||||
var row = $('<label/>',{for:"node-input-target-node-"+n.id}).appendTo(container);
|
|
||||||
$('<input>',{type:"checkbox",class:"node-input-target-node-checkbox",id:"node-input-target-node-"+n.id})
|
|
||||||
.data('node-id',n.id)
|
|
||||||
.prop('checked', isChecked)
|
|
||||||
.appendTo(row);
|
|
||||||
container.on('mouseover',function(e) {
|
|
||||||
n.highlighted = true;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
container.on('mouseout',function(e) {
|
|
||||||
n.highlighted = false;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
var labelSpan = $('<span>');
|
|
||||||
var nodeDef = RED.nodes.getType(n.type);
|
|
||||||
var label;
|
|
||||||
var sublabel;
|
|
||||||
if (nodeDef) {
|
|
||||||
var l = nodeDef.label;
|
|
||||||
label = (typeof l === "function" ? l.call(n) : l)||"";
|
|
||||||
sublabel = n.type;
|
|
||||||
if (sublabel.indexOf("subflow:") === 0) {
|
|
||||||
var subflowId = sublabel.substring(8);
|
|
||||||
var subflow = RED.nodes.subflow(subflowId);
|
|
||||||
sublabel = "subflow : "+subflow.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!nodeDef || !label) {
|
|
||||||
label = n.type;
|
|
||||||
}
|
|
||||||
$('<span>',{class:"node-input-target-node-label",style:"white-space:nowrap"}).text(label).appendTo(row);
|
|
||||||
if (sublabel) {
|
|
||||||
$('<span>',{class:"node-input-target-node-sublabel"}).text(sublabel).appendTo(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
container.appendTo(nodeList);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".node-input-target-node-checkbox").change(function() {
|
|
||||||
if (!this.checked) {
|
|
||||||
$("#node-input-target-node-checkbox-all").prop('checked',false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-target-node-checkbox-all").prop('checked',allChecked);
|
|
||||||
|
|
||||||
sortNodeList('label');
|
|
||||||
}
|
|
||||||
|
|
||||||
function sortNodeList(sortOn) {
|
|
||||||
var currentSort = nodeList.data('currentSort');
|
|
||||||
var currentSortOrder = nodeList.data('currentSortOrder');
|
|
||||||
|
|
||||||
if (!currentSort) {
|
|
||||||
currentSort = sortOn;
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
} else {
|
|
||||||
if (currentSort === sortOn) {
|
|
||||||
currentSortOrder = (currentSortOrder === 'a'?'d':'a');
|
|
||||||
} else {
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
}
|
|
||||||
currentSort = sortOn;
|
|
||||||
}
|
|
||||||
nodeList.data('currentSort',currentSort);
|
|
||||||
nodeList.data('currentSortOrder',currentSortOrder);
|
|
||||||
|
|
||||||
$("#node-input-catch-target-container-div .fa").hide();
|
|
||||||
$(".node-input-catch-sort-"+currentSort+"-"+currentSortOrder).show();
|
|
||||||
|
|
||||||
|
|
||||||
var items = nodeList.find("li").get();
|
|
||||||
items.sort(function(a,b) {
|
|
||||||
var labelA = $(a).find(".node-input-target-node-"+currentSort).text().toLowerCase();
|
|
||||||
var labelB = $(b).find(".node-input-target-node-"+currentSort).text().toLowerCase();
|
|
||||||
if (labelA < labelB) { return currentSortOrder==='a'?-1:1; }
|
|
||||||
if (labelA > labelB) { return currentSortOrder==='a'?1:-1; }
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
$.each(items, function(i, li){
|
|
||||||
nodeList.append(li);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$("#node-input-target-sort-label").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList('label');
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-target-sort-type").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList('sublabel');
|
|
||||||
});
|
|
||||||
$("#node-input-target-node-checkbox-all").change(function() {
|
|
||||||
$(".node-input-target-node-checkbox").prop('checked',this.checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#node-input-scope-select").change(function(e) {
|
|
||||||
var scope = $(this).val();
|
|
||||||
if (scope === "target") {
|
|
||||||
createNodeList();
|
|
||||||
$(".node-input-target-row").show();
|
|
||||||
} else {
|
|
||||||
$(".node-input-target-row").hide();
|
|
||||||
}
|
|
||||||
node.resize();
|
|
||||||
});
|
|
||||||
if (this.scope === null) {
|
|
||||||
$("#node-input-scope-select").val("all");
|
|
||||||
} else {
|
|
||||||
$("#node-input-scope-select").val("target");
|
|
||||||
}
|
|
||||||
$("#node-input-scope-select").change();
|
|
||||||
},
|
|
||||||
oneditsave: function() {
|
|
||||||
var scope = $("#node-input-scope-select").val();
|
|
||||||
if (scope === 'all') {
|
|
||||||
this.scope = null;
|
|
||||||
} else {
|
|
||||||
var node = this;
|
|
||||||
node.scope = [];
|
|
||||||
$(".node-input-target-node-checkbox").each(function(n) {
|
|
||||||
if ($(this).prop("checked")) {
|
|
||||||
node.scope.push($(this).data('node-id'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
oneditresize: function(size) {
|
|
||||||
this.resize();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="status">
|
|
||||||
<div class="form-row">
|
|
||||||
<label style="width: auto" for="node-input-scope" data-i18n="status.label.source"></label>
|
|
||||||
<select id="node-input-scope-select">
|
|
||||||
<option value="all" data-i18n="status.scope.all"></option>
|
|
||||||
<option value="target" data-i18n="status.scope.selected"></options>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-row node-input-target-row" style="display: none;">
|
|
||||||
<div id="node-input-status-target-container-div" style=" min-height: 100px;position: relative; box-sizing: border-box; border-radius: 2px; height: 180px; border: 1px solid #ccc;overflow:hidden; ">
|
|
||||||
<div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">
|
|
||||||
<input type="checkbox" data-i18n="[title]status.label.selectAll" id="node-input-target-node-checkbox-all" style="width: 30px; margin: 0 2px 1px 2px;">
|
|
||||||
<div style="display: inline-block;"><a id="node-input-target-sort-label" href="#" data-i18n="[title]status.label.sortByLabel"><span data-i18n="status.label.node"></span> <i class="node-input-status-sort-label-a fa fa-caret-down"></i><i class="node-input-status-sort-label-d fa fa-caret-up"></i></a></div>
|
|
||||||
<div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-target-sort-type" href="#" data-i18n="[title]status.label.sortByType"><i class="node-input-status-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-status-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="status.label.type"></span></a></div>
|
|
||||||
</div>
|
|
||||||
<div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">
|
|
||||||
<ul id="node-input-status-target-container" style=" list-style-type:none; margin: 0;"></ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
<script type="text/x-red" data-help-name="status">
|
|
||||||
<p>Report status messages from other nodes on the same tab.</p>
|
|
||||||
<h3>Outputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>status.text <span class="property-type">string</span></dt>
|
|
||||||
<dd>the status text.</dd>
|
|
||||||
<dt>status.source.type <span class="property-type">string</span></dt>
|
|
||||||
<dd>the type of the node that reported status.</dd>
|
|
||||||
<dt>status.source.id <span class="property-type">string</span></dt>
|
|
||||||
<dd>the id of the node that reported status.</dd>
|
|
||||||
<dt>status.source.name <span class="property-type">string</span></dt>
|
|
||||||
<dd>the name, if set, of the node that reported status.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>This node does not produce a <code>payload</code>.</p>
|
|
||||||
<p>By default the node reports status for all nodes on the same workspace tab.
|
|
||||||
It can be configured to selectively report status for individual nodes.</p>
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
#node-input-status-target-container {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#node-input-status-target-container li {
|
|
||||||
padding: 2px 5px;
|
|
||||||
background: none;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin:0;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
#node-input-status-target-container li label {
|
|
||||||
margin-bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#node-input-status-target-container li label input {
|
|
||||||
vertical-align: top;
|
|
||||||
width:15px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
#node-input-status-target-container li:hover,
|
|
||||||
#node-input-status-target-container li:hover .node-input-target-node-sublabel {
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
.node-input-target-node-sublabel {
|
|
||||||
position:absolute;
|
|
||||||
right: 0px;
|
|
||||||
padding-right: 10px;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-size: 0.8em;
|
|
||||||
background: #fbfbfb;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript">
|
|
||||||
RED.nodes.registerType('status',{
|
|
||||||
category: 'input',
|
|
||||||
color:"#c0edc0",
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
scope: {value:null}
|
|
||||||
},
|
|
||||||
inputs:0,
|
|
||||||
outputs:1,
|
|
||||||
icon: "alert.png",
|
|
||||||
label: function() {
|
|
||||||
return this.name||(this.scope?this._("status.statusNodes",{number:this.scope.length}):this._("status.status"));
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
var nodeList = $("#node-input-status-target-container");
|
|
||||||
var node = this;
|
|
||||||
this.resize = function() {
|
|
||||||
var rows = $("#dialog-form>div:not(.node-input-target-row)");
|
|
||||||
var height = $("#dialog-form").height();
|
|
||||||
for (var i=0;i<rows.size();i++) {
|
|
||||||
height -= $(rows[i]).outerHeight(true);
|
|
||||||
}
|
|
||||||
var editorRow = $("#dialog-form>div.node-input-target-row");
|
|
||||||
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
|
||||||
$("#node-input-status-target-container-div").css("height",height+"px");
|
|
||||||
};
|
|
||||||
|
|
||||||
function createNodeList() {
|
|
||||||
var scope = node.scope || [];
|
|
||||||
nodeList.empty();
|
|
||||||
|
|
||||||
var candidateNodes = RED.nodes.filterNodes({z:node.z});
|
|
||||||
var allChecked = true;
|
|
||||||
|
|
||||||
candidateNodes.forEach(function(n) {
|
|
||||||
if (n.id === node.id) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var isChecked = scope.indexOf(n.id) !== -1;
|
|
||||||
|
|
||||||
allChecked = allChecked && isChecked;
|
|
||||||
|
|
||||||
var container = $('<li/>',{class:"node-input-target-node"});
|
|
||||||
var row = $('<label/>',{for:"node-input-target-node-"+n.id}).appendTo(container);
|
|
||||||
$('<input>',{type:"checkbox",class:"node-input-target-node-checkbox",id:"node-input-target-node-"+n.id})
|
|
||||||
.data('node-id',n.id)
|
|
||||||
.prop('checked', isChecked)
|
|
||||||
.appendTo(row);
|
|
||||||
container.on('mouseover',function(e) {
|
|
||||||
n.highlighted = true;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
container.on('mouseout',function(e) {
|
|
||||||
n.highlighted = false;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
var labelSpan = $('<span>');
|
|
||||||
var nodeDef = RED.nodes.getType(n.type);
|
|
||||||
var label;
|
|
||||||
var sublabel;
|
|
||||||
if (nodeDef) {
|
|
||||||
var l = nodeDef.label;
|
|
||||||
label = (typeof l === "function" ? l.call(n) : l)||"";
|
|
||||||
sublabel = n.type;
|
|
||||||
if (sublabel.indexOf("subflow:") === 0) {
|
|
||||||
var subflowId = sublabel.substring(8);
|
|
||||||
var subflow = RED.nodes.subflow(subflowId);
|
|
||||||
sublabel = "subflow : "+subflow.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!nodeDef || !label) {
|
|
||||||
label = n.type;
|
|
||||||
}
|
|
||||||
$('<span>',{class:"node-input-target-node-label",style:"white-space:nowrap"}).text(label).appendTo(row);
|
|
||||||
if (sublabel) {
|
|
||||||
$('<span>',{class:"node-input-target-node-sublabel"}).text(sublabel).appendTo(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
container.appendTo(nodeList);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".node-input-target-node-checkbox").change(function() {
|
|
||||||
if (!this.checked) {
|
|
||||||
$("#node-input-target-node-checkbox-all").prop('checked',false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-target-node-checkbox-all").prop('checked',allChecked);
|
|
||||||
|
|
||||||
sortNodeList('label');
|
|
||||||
}
|
|
||||||
|
|
||||||
function sortNodeList(sortOn) {
|
|
||||||
var currentSort = nodeList.data('currentSort');
|
|
||||||
var currentSortOrder = nodeList.data('currentSortOrder');
|
|
||||||
|
|
||||||
if (!currentSort) {
|
|
||||||
currentSort = sortOn;
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
} else {
|
|
||||||
if (currentSort === sortOn) {
|
|
||||||
currentSortOrder = (currentSortOrder === 'a'?'d':'a');
|
|
||||||
} else {
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
}
|
|
||||||
currentSort = sortOn;
|
|
||||||
}
|
|
||||||
nodeList.data('currentSort',currentSort);
|
|
||||||
nodeList.data('currentSortOrder',currentSortOrder);
|
|
||||||
|
|
||||||
$("#node-input-status-target-container-div .fa").hide();
|
|
||||||
$(".node-input-status-sort-"+currentSort+"-"+currentSortOrder).show();
|
|
||||||
|
|
||||||
|
|
||||||
var items = nodeList.find("li").get();
|
|
||||||
items.sort(function(a,b) {
|
|
||||||
var labelA = $(a).find(".node-input-target-node-"+currentSort).text().toLowerCase();
|
|
||||||
var labelB = $(b).find(".node-input-target-node-"+currentSort).text().toLowerCase();
|
|
||||||
if (labelA < labelB) { return currentSortOrder==='a'?-1:1; }
|
|
||||||
if (labelA > labelB) { return currentSortOrder==='a'?1:-1; }
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
$.each(items, function(i, li) {
|
|
||||||
nodeList.append(li);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$("#node-input-target-sort-label").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList('label');
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-target-sort-type").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList('sublabel');
|
|
||||||
});
|
|
||||||
$("#node-input-target-node-checkbox-all").change(function() {
|
|
||||||
$(".node-input-target-node-checkbox").prop('checked',this.checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-scope-select").change(function(e) {
|
|
||||||
var scope = $(this).val();
|
|
||||||
if (scope === "target") {
|
|
||||||
createNodeList();
|
|
||||||
$(".node-input-target-row").show();
|
|
||||||
} else {
|
|
||||||
$(".node-input-target-row").hide();
|
|
||||||
}
|
|
||||||
node.resize();
|
|
||||||
});
|
|
||||||
if (this.scope === null) {
|
|
||||||
$("#node-input-scope-select").val("all");
|
|
||||||
} else {
|
|
||||||
$("#node-input-scope-select").val("target");
|
|
||||||
}
|
|
||||||
$("#node-input-scope-select").change();
|
|
||||||
},
|
|
||||||
oneditsave: function() {
|
|
||||||
var scope = $("#node-input-scope-select").val();
|
|
||||||
if (scope === 'all') {
|
|
||||||
this.scope = null;
|
|
||||||
} else {
|
|
||||||
var node = this;
|
|
||||||
node.scope = [];
|
|
||||||
$(".node-input-target-node-checkbox").each(function(n) {
|
|
||||||
if ($(this).prop("checked")) {
|
|
||||||
node.scope.push($(this).data('node-id'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
oneditresize: function(size) {
|
|
||||||
this.resize();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,319 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="link in">
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
<div class="form-row node-input-link-row"></div>
|
|
||||||
</script>
|
|
||||||
<script type="text/x-red" data-template-name="link out">
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
<div class="form-row node-input-link-row"></div>
|
|
||||||
</script>
|
|
||||||
<script type="text/x-red" data-help-name="link in">
|
|
||||||
<p>Create virtual wires between flows.</p>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>The node can be connected to any <code>link out</code> node that exists on any tab.
|
|
||||||
Once connected, they behave as if they were wired together.</p>
|
|
||||||
<p>The wires between link nodes are only displayed when a link node is selected.
|
|
||||||
If there are any wires to other tabs, a virtual node is shown that can be clicked
|
|
||||||
on to jump to the appropriate tab.</p>
|
|
||||||
<p><b>Note: </b>Links cannot be created going into, or out of, a subflow.</p>
|
|
||||||
</script>
|
|
||||||
<script type="text/x-red" data-help-name="link out">
|
|
||||||
<p>Create virtual wires between flows.</p>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>The node can be connected to any <code>link in</code> node that exists on any tab.
|
|
||||||
Once connected, they behave as if they were wired together.</p>
|
|
||||||
<p>The wires between link nodes are only displayed when a link node is selected.
|
|
||||||
If there are any wires to other tabs, a virtual node is show that can be clicked
|
|
||||||
on to jump to the appropriate tab.</p>
|
|
||||||
<p><b>Note: </b>Links cannot be created going into, or out of, a subflow.</p>
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
#node-input-link-container {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#node-input-link-container li {
|
|
||||||
padding: 2px 5px;
|
|
||||||
background: none;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin:0;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
#node-input-link-container li label {
|
|
||||||
margin-bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#node-input-link-container li label input {
|
|
||||||
vertical-align: top;
|
|
||||||
width:15px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
#node-input-link-container li:hover,
|
|
||||||
#node-input-link-container li:hover .node-input-target-node-sublabel {
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
.node-input-link-node-sublabel {
|
|
||||||
position:absolute;
|
|
||||||
right: 0px;
|
|
||||||
padding-right: 10px;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-size: 0.8em;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
function sortNodeList(nodeList,sortOn,sortOnSecond) {
|
|
||||||
var currentSort = nodeList.data('currentSort');
|
|
||||||
var currentSortOrder = nodeList.data('currentSortOrder');
|
|
||||||
|
|
||||||
if (!currentSort) {
|
|
||||||
currentSort = sortOn;
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
} else {
|
|
||||||
if (currentSort === sortOn) {
|
|
||||||
currentSortOrder = (currentSortOrder === 'a'?'d':'a');
|
|
||||||
} else {
|
|
||||||
currentSortOrder = 'a';
|
|
||||||
}
|
|
||||||
currentSort = sortOn;
|
|
||||||
}
|
|
||||||
nodeList.data('currentSort',currentSort);
|
|
||||||
nodeList.data('currentSortOrder',currentSortOrder);
|
|
||||||
|
|
||||||
$("#node-input-link-container-div .fa").hide();
|
|
||||||
$(".node-input-link-sort-"+currentSort+"-"+currentSortOrder).show();
|
|
||||||
|
|
||||||
|
|
||||||
var items = nodeList.find("li").get();
|
|
||||||
items.sort(function(a,b) {
|
|
||||||
var labelA = $(a).find(".node-input-link-node-"+currentSort).text().toLowerCase();
|
|
||||||
var labelB = $(b).find(".node-input-link-node-"+currentSort).text().toLowerCase();
|
|
||||||
if (labelA < labelB) { return currentSortOrder==='a'?-1:1; }
|
|
||||||
if (labelA > labelB) { return currentSortOrder==='a'?1:-1; }
|
|
||||||
|
|
||||||
if (sortOnSecond) {
|
|
||||||
labelA = $(a).find(".node-input-link-node-"+sortOnSecond).text().toLowerCase();
|
|
||||||
labelB = $(b).find(".node-input-link-node-"+sortOnSecond).text().toLowerCase();
|
|
||||||
if (labelA < labelB) { return currentSortOrder==='a'?-1:1; }
|
|
||||||
if (labelA > labelB) { return currentSortOrder==='a'?1:-1; }
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
$.each(items, function(i, li) {
|
|
||||||
nodeList.append(li);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function onEditPrepare(node,targetType) {
|
|
||||||
if (!node.links) {
|
|
||||||
node.links = [];
|
|
||||||
}
|
|
||||||
node.oldLinks = [];
|
|
||||||
|
|
||||||
$('<div id="node-input-link-container-div" style="min-height: 100px;position: relative; box-sizing: border-box; border-radius: 2px; height: 180px; border: 1px solid #ccc;overflow:hidden; ">'+
|
|
||||||
' <div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">'+
|
|
||||||
' <div style="display: inline-block;margin-left: 5px;"><a id="node-input-link-sort-label" href="#" data-i18n="[title]node-red:link.label.sortByLabel"><span data-i18n="node-red:link.label.node">name</span> <i class="node-input-link-sort-label-a fa fa-caret-down"></i><i class="node-input-link-sort-label-d fa fa-caret-up"></i></a></div>'+
|
|
||||||
' <div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-link-sort-type" href="#" data-i18n="[title]node-red:link.label.sortByFlow"><i class="node-input-link-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-link-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="node-red:link.label.type">flow</span></a></div>'+
|
|
||||||
' </div>'+
|
|
||||||
' <div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">'+
|
|
||||||
' <ul id="node-input-link-container" style=" list-style-type:none; margin: 0;"></ul>'+
|
|
||||||
' </div>'+
|
|
||||||
'</div>').appendTo('.node-input-link-row');
|
|
||||||
|
|
||||||
var nodeList = $("#node-input-link-container");
|
|
||||||
var candidateNodes = RED.nodes.filterNodes({type:targetType});
|
|
||||||
var inSubflow = !!RED.nodes.subflow(node.z);
|
|
||||||
candidateNodes.forEach(function(n) {
|
|
||||||
if (inSubflow) {
|
|
||||||
if (n.z !== node.z) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!!RED.nodes.subflow(n.z)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var isChecked = false;
|
|
||||||
|
|
||||||
isChecked = (node.links.indexOf(n.id) !== -1) || (n.links||[]).indexOf(node.id) !== -1;
|
|
||||||
|
|
||||||
if (isChecked) {
|
|
||||||
node.oldLinks.push(n.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
var container = $('<li/>',{class:"node-input-link-node"});
|
|
||||||
var row = $('<label/>',{for:"node-input-link-node-"+n.id}).appendTo(container);
|
|
||||||
$('<input>',{type:"checkbox",class:"node-input-link-node-checkbox",id:"node-input-link-node-"+n.id})
|
|
||||||
.data('node-id',n.id)
|
|
||||||
.prop('checked', isChecked)
|
|
||||||
.appendTo(row);
|
|
||||||
container.on('mouseover',function(e) {
|
|
||||||
n.highlighted = true;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
container.on('mouseout',function(e) {
|
|
||||||
n.highlighted = false;
|
|
||||||
n.dirty = true;
|
|
||||||
RED.view.redraw();
|
|
||||||
});
|
|
||||||
var labelSpan = $('<span>');
|
|
||||||
var label = n.name||n.id;
|
|
||||||
var sublabel;
|
|
||||||
var tab = RED.nodes.workspace(n.z);
|
|
||||||
if (tab) {
|
|
||||||
sublabel = tab.label||tab.id;
|
|
||||||
} else {
|
|
||||||
tab = RED.nodes.subflow(n.z);
|
|
||||||
sublabel = "subflow : "+tab.name;
|
|
||||||
}
|
|
||||||
$('<span>',{class:"node-input-link-node-label",style:"white-space:nowrap"}).text(label).appendTo(row);
|
|
||||||
if (sublabel) {
|
|
||||||
$('<span>',{class:"node-input-link-node-sublabel"}).text(sublabel).appendTo(row);
|
|
||||||
}
|
|
||||||
container.appendTo(nodeList);
|
|
||||||
});
|
|
||||||
|
|
||||||
sortNodeList(nodeList,'sublabel','label');
|
|
||||||
|
|
||||||
$("#node-input-link-sort-label").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList(nodeList,'label');
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#node-input-link-sort-type").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
sortNodeList(nodeList,'sublabel');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function resizeNodeList() {
|
|
||||||
var rows = $("#dialog-form>div:not(.node-input-link-row)");
|
|
||||||
var height = $("#dialog-form").height();
|
|
||||||
for (var i=0;i<rows.size();i++) {
|
|
||||||
height -= $(rows[i]).outerHeight(true);
|
|
||||||
}
|
|
||||||
var editorRow = $("#dialog-form>div.node-input-link-row");
|
|
||||||
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
|
||||||
$("#node-input-link-container-div").css("height",height+"px");
|
|
||||||
}
|
|
||||||
|
|
||||||
function onEditSave(node) {
|
|
||||||
node.links = [];
|
|
||||||
$(".node-input-link-node-checkbox").each(function(n) {
|
|
||||||
if ($(this).prop("checked")) {
|
|
||||||
node.links.push($(this).data('node-id'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
node.oldLinks.sort();
|
|
||||||
node.links.sort();
|
|
||||||
var nodeMap = {};
|
|
||||||
var length = Math.max(node.oldLinks.length,node.links.length);
|
|
||||||
for (var i=0;i<length;i++) {
|
|
||||||
if (i<node.oldLinks.length) {
|
|
||||||
nodeMap[node.oldLinks[i]] = nodeMap[node.oldLinks[i]]||{};
|
|
||||||
nodeMap[node.oldLinks[i]].old = true;
|
|
||||||
}
|
|
||||||
if (i<node.links.length) {
|
|
||||||
nodeMap[node.links[i]] = nodeMap[node.links[i]]||{};
|
|
||||||
nodeMap[node.links[i]].new = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var n;
|
|
||||||
for (var id in nodeMap) {
|
|
||||||
if (nodeMap.hasOwnProperty(id)) {
|
|
||||||
n = RED.nodes.node(id);
|
|
||||||
if (n) {
|
|
||||||
if (nodeMap[id].old && !nodeMap[id].new) {
|
|
||||||
// Removed id
|
|
||||||
i = n.links.indexOf(node.id);
|
|
||||||
if (i > -1) {
|
|
||||||
n.links.splice(i,1);
|
|
||||||
}
|
|
||||||
} else if (!nodeMap[id].old && nodeMap[id].new) {
|
|
||||||
// Added id
|
|
||||||
i = n.links.indexOf(id);
|
|
||||||
if (i === -1) {
|
|
||||||
n.links.push(node.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onAdd() {
|
|
||||||
for (var i=0;i<this.links.length;i++) {
|
|
||||||
var n = RED.nodes.node(this.links[i]);
|
|
||||||
if (n && n.links.indexOf(this.id) === -1) {
|
|
||||||
n.links.push(this.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RED.nodes.registerType('link in',{
|
|
||||||
category: 'input',
|
|
||||||
color:"#ddd",//"#87D8CF",
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
links: { value: [] }
|
|
||||||
},
|
|
||||||
inputs:0,
|
|
||||||
outputs:1,
|
|
||||||
icon: "link-out.png",
|
|
||||||
outputLabels: function(i) {
|
|
||||||
return this.name||this._("link.linkIn");
|
|
||||||
},
|
|
||||||
label: function() {
|
|
||||||
return this.name||this._("link.linkIn");
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
onEditPrepare(this,"link out");
|
|
||||||
},
|
|
||||||
oneditsave: function() {
|
|
||||||
onEditSave(this);
|
|
||||||
},
|
|
||||||
onadd: onAdd,
|
|
||||||
oneditresize: resizeNodeList
|
|
||||||
});
|
|
||||||
|
|
||||||
RED.nodes.registerType('link out',{
|
|
||||||
category: 'output',
|
|
||||||
color:"#ddd",//"#87D8CF",
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
links: { value: []}
|
|
||||||
},
|
|
||||||
align:"right",
|
|
||||||
inputs:1,
|
|
||||||
outputs:0,
|
|
||||||
icon: "link-out.png",
|
|
||||||
inputLabels: function(i) {
|
|
||||||
return this.name||this._("link.linkOut");
|
|
||||||
},
|
|
||||||
label: function() {
|
|
||||||
return this.name||this._("link.linkOut");
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
onEditPrepare(this,"link in");
|
|
||||||
},
|
|
||||||
oneditsave: function() {
|
|
||||||
onEditSave(this);
|
|
||||||
},
|
|
||||||
onadd: onAdd,
|
|
||||||
oneditresize: resizeNodeList
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
var util = require("util");
|
|
||||||
var mqtt = require("./mqtt");
|
|
||||||
var settings = require(process.env.NODE_RED_HOME+"/red/red").settings;
|
|
||||||
|
|
||||||
util.log("[warn] nodes/core/io/lib/mqttConnectionPool.js is deprecated and will be removed in a future release of Node-RED. Please report this usage to the Node-RED mailing list.");
|
|
||||||
|
|
||||||
var connections = {};
|
|
||||||
|
|
||||||
function matchTopic(ts,t) {
|
|
||||||
if (ts == "#") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var re = new RegExp("^"+ts.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
|
|
||||||
return re.test(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
get: function(broker,port,clientid,username,password,will) {
|
|
||||||
var id = "["+(username||"")+":"+(password||"")+"]["+(clientid||"")+"]@"+broker+":"+port;
|
|
||||||
if (!connections[id]) {
|
|
||||||
connections[id] = function() {
|
|
||||||
var uid = (1+Math.random()*4294967295).toString(16);
|
|
||||||
var client = mqtt.createClient(port,broker);
|
|
||||||
client.uid = uid;
|
|
||||||
client.setMaxListeners(0);
|
|
||||||
var options = {keepalive:15};
|
|
||||||
options.clientId = clientid || 'mqtt_' + (1+Math.random()*4294967295).toString(16);
|
|
||||||
options.username = username;
|
|
||||||
options.password = password;
|
|
||||||
options.will = will;
|
|
||||||
var queue = [];
|
|
||||||
var subscriptions = {};
|
|
||||||
var connecting = false;
|
|
||||||
var obj = {
|
|
||||||
_instances: 0,
|
|
||||||
publish: function(msg) {
|
|
||||||
if (client.isConnected()) {
|
|
||||||
client.publish(msg.topic,msg.payload,msg.qos,msg.retain);
|
|
||||||
} else {
|
|
||||||
if (!connecting) {
|
|
||||||
connecting = true;
|
|
||||||
client.connect(options);
|
|
||||||
}
|
|
||||||
queue.push(msg);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
subscribe: function(topic,qos,callback,ref) {
|
|
||||||
ref = ref||0;
|
|
||||||
subscriptions[topic] = subscriptions[topic]||{};
|
|
||||||
|
|
||||||
var sub = {
|
|
||||||
topic:topic,
|
|
||||||
qos:qos,
|
|
||||||
handler:function(mtopic,mpayload,mqos,mretain) {
|
|
||||||
if (matchTopic(topic,mtopic)) {
|
|
||||||
callback(mtopic,mpayload,mqos,mretain);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ref: ref
|
|
||||||
};
|
|
||||||
subscriptions[topic][ref] = sub;
|
|
||||||
client.on('message',sub.handler);
|
|
||||||
if (client.isConnected()) {
|
|
||||||
client.subscribe(topic,qos);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
unsubscribe: function(topic,ref) {
|
|
||||||
ref = ref||0;
|
|
||||||
var sub = subscriptions[topic];
|
|
||||||
if (sub) {
|
|
||||||
if (sub[ref]) {
|
|
||||||
client.removeListener('message',sub[ref].handler);
|
|
||||||
delete sub[ref];
|
|
||||||
}
|
|
||||||
if (Object.keys(sub).length == 0) {
|
|
||||||
delete subscriptions[topic];
|
|
||||||
client.unsubscribe(topic);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on: function(a,b){
|
|
||||||
client.on(a,b);
|
|
||||||
},
|
|
||||||
once: function(a,b){
|
|
||||||
client.once(a,b);
|
|
||||||
},
|
|
||||||
connect: function() {
|
|
||||||
if (client && !client.isConnected() && !connecting) {
|
|
||||||
connecting = true;
|
|
||||||
client.connect(options);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
disconnect: function(ref) {
|
|
||||||
|
|
||||||
this._instances -= 1;
|
|
||||||
if (this._instances == 0) {
|
|
||||||
client.disconnect();
|
|
||||||
client = null;
|
|
||||||
delete connections[id];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isConnected: function() {
|
|
||||||
return client.isConnected();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
client.on('connect',function() {
|
|
||||||
if (client) {
|
|
||||||
util.log('[mqtt] ['+uid+'] connected to broker tcp://'+broker+':'+port);
|
|
||||||
connecting = false;
|
|
||||||
for (var s in subscriptions) {
|
|
||||||
var topic = s;
|
|
||||||
var qos = 0;
|
|
||||||
for (var r in subscriptions[s]) {
|
|
||||||
qos = Math.max(qos,subscriptions[s][r].qos);
|
|
||||||
}
|
|
||||||
client.subscribe(topic,qos);
|
|
||||||
}
|
|
||||||
//console.log("connected - publishing",queue.length,"messages");
|
|
||||||
while(queue.length) {
|
|
||||||
var msg = queue.shift();
|
|
||||||
//console.log(msg);
|
|
||||||
client.publish(msg.topic,msg.payload,msg.qos,msg.retain);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
client.on('connectionlost', function(err) {
|
|
||||||
util.log('[mqtt] ['+uid+'] connection lost to broker tcp://'+broker+':'+port);
|
|
||||||
connecting = false;
|
|
||||||
setTimeout(function() {
|
|
||||||
obj.connect();
|
|
||||||
}, settings.mqttReconnectTime||5000);
|
|
||||||
});
|
|
||||||
client.on('disconnect', function() {
|
|
||||||
connecting = false;
|
|
||||||
util.log('[mqtt] ['+uid+'] disconnected from broker tcp://'+broker+':'+port);
|
|
||||||
});
|
|
||||||
|
|
||||||
return obj
|
|
||||||
}();
|
|
||||||
}
|
|
||||||
connections[id]._instances += 1;
|
|
||||||
return connections[id];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<!--
|
|
||||||
Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="sentiment">
|
|
||||||
<p>指定したプロパティ(デフォルトは<code>payload</code>)を分析し、<code>sentiment</code>オブジェクトを追加します。</p>
|
|
||||||
<h3>出力</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>sentiment <span class="property-type">オブジェクト</span></dt>
|
|
||||||
<dd>AFINN-111による感情分析の結果</dd>
|
|
||||||
<dt>sentiment.score <span class="property-type">数値</span></dt>
|
|
||||||
<dd>感情分析スコア</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>入力</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>overrides <span class="property-type">オブジェクト</span></dt>
|
|
||||||
<dd>単語スコアの上書きをするためのオブジェクト - <code>{ word:score,... }</code></dd>
|
|
||||||
</dl>
|
|
||||||
<h3>詳細</h3>
|
|
||||||
<p>ゼロ以上のスコアはポジティブ、ゼロ以下はネガティブを意味します。</p>
|
|
||||||
<p>スコアの範囲は通常-5から+5ですが、より大きかったり小さかったりすることもあります。</p>
|
|
||||||
<p>詳細は<a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_blank">the Sentiment docs here</a>を参照してください。</p>
|
|
||||||
</script>
|
|
||||||
@@ -1,327 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
module.exports = function(RED) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function ChangeNode(n) {
|
|
||||||
RED.nodes.createNode(this, n);
|
|
||||||
var node = this;
|
|
||||||
|
|
||||||
this.rules = n.rules;
|
|
||||||
var rule;
|
|
||||||
if (!this.rules) {
|
|
||||||
rule = {
|
|
||||||
t:(n.action=="replace"?"set":n.action),
|
|
||||||
p:n.property||""
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((rule.t === "set")||(rule.t === "move")) {
|
|
||||||
rule.to = n.to||"";
|
|
||||||
} else if (rule.t === "change") {
|
|
||||||
rule.from = n.from||"";
|
|
||||||
rule.to = n.to||"";
|
|
||||||
rule.re = (n.reg===null||n.reg);
|
|
||||||
}
|
|
||||||
this.rules = [rule];
|
|
||||||
}
|
|
||||||
|
|
||||||
var valid = true;
|
|
||||||
for (var i=0;i<this.rules.length;i++) {
|
|
||||||
rule = this.rules[i];
|
|
||||||
// Migrate to type-aware rules
|
|
||||||
if (!rule.pt) {
|
|
||||||
rule.pt = "msg";
|
|
||||||
}
|
|
||||||
if (rule.t === "change" && rule.re) {
|
|
||||||
rule.fromt = 're';
|
|
||||||
delete rule.re;
|
|
||||||
}
|
|
||||||
if (rule.t === "set" && !rule.tot) {
|
|
||||||
if (rule.to.indexOf("msg.") === 0 && !rule.tot) {
|
|
||||||
rule.to = rule.to.substring(4);
|
|
||||||
rule.tot = "msg";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!rule.tot) {
|
|
||||||
rule.tot = "str";
|
|
||||||
}
|
|
||||||
if (!rule.fromt) {
|
|
||||||
rule.fromt = "str";
|
|
||||||
}
|
|
||||||
if (rule.t === "change" && rule.fromt !== 'msg' && rule.fromt !== 'flow' && rule.fromt !== 'global') {
|
|
||||||
rule.fromRE = rule.from;
|
|
||||||
if (rule.fromt !== 're') {
|
|
||||||
rule.fromRE = rule.fromRE.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
rule.fromRE = new RegExp(rule.fromRE, "g");
|
|
||||||
} catch (e) {
|
|
||||||
valid = false;
|
|
||||||
this.error(RED._("change.errors.invalid-from",{error:e.message}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rule.tot === 'num') {
|
|
||||||
rule.to = Number(rule.to);
|
|
||||||
} else if (rule.tot === 'json' || rule.tot === 'bin') {
|
|
||||||
try {
|
|
||||||
// check this is parsable JSON
|
|
||||||
JSON.parse(rule.to);
|
|
||||||
} catch(e2) {
|
|
||||||
valid = false;
|
|
||||||
this.error(RED._("change.errors.invalid-json"));
|
|
||||||
}
|
|
||||||
} else if (rule.tot === 'bool') {
|
|
||||||
rule.to = /^true$/i.test(rule.to);
|
|
||||||
} else if (rule.tot === 'jsonata') {
|
|
||||||
try {
|
|
||||||
rule.to = RED.util.prepareJSONataExpression(rule.to,this);
|
|
||||||
} catch(e) {
|
|
||||||
valid = false;
|
|
||||||
this.error(RED._("change.errors.invalid-expr",{error:e.message}));
|
|
||||||
}
|
|
||||||
} else if (rule.tot === 'env') {
|
|
||||||
rule.to = RED.util.evaluateNodeProperty(rule.to,'env');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getToValue(msg,rule) {
|
|
||||||
var value = rule.to;
|
|
||||||
if (rule.tot === 'json') {
|
|
||||||
value = JSON.parse(rule.to);
|
|
||||||
} else if (rule.tot === 'bin') {
|
|
||||||
value = Buffer.from(JSON.parse(rule.to))
|
|
||||||
}
|
|
||||||
if (rule.tot === "msg") {
|
|
||||||
value = RED.util.getMessageProperty(msg,rule.to);
|
|
||||||
} else if ((rule.tot === 'flow') ||
|
|
||||||
(rule.tot === 'global')) {
|
|
||||||
return new Promise((resolve,reject) => {
|
|
||||||
RED.util.evaluateNodeProperty(rule.to, rule.tot, node, msg, (err,value) => {
|
|
||||||
if (err) {
|
|
||||||
resolve(undefined);
|
|
||||||
} else {
|
|
||||||
resolve(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if (rule.tot === 'date') {
|
|
||||||
value = Date.now();
|
|
||||||
} else if (rule.tot === 'jsonata') {
|
|
||||||
return new Promise((resolve,reject) => {
|
|
||||||
RED.util.evaluateJSONataExpression(rule.to,msg, (err, value) => {
|
|
||||||
if (err) {
|
|
||||||
reject(RED._("change.errors.invalid-expr",{error:err.message}))
|
|
||||||
} else {
|
|
||||||
resolve(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.resolve(value);
|
|
||||||
}
|
|
||||||
function getFromValue(msg,rule) {
|
|
||||||
var fromValue;
|
|
||||||
var fromType;
|
|
||||||
var fromRE;
|
|
||||||
if (rule.t === 'change') {
|
|
||||||
if (rule.fromt === 'msg' || rule.fromt === 'flow' || rule.fromt === 'global') {
|
|
||||||
return new Promise((resolve,reject) => {
|
|
||||||
if (rule.fromt === "msg") {
|
|
||||||
resolve(RED.util.getMessageProperty(msg,rule.from));
|
|
||||||
} else if (rule.fromt === 'flow' || rule.fromt === 'global') {
|
|
||||||
var contextKey = RED.util.parseContextStore(rule.from);
|
|
||||||
node.context()[rule.fromt].get(contextKey.key, contextKey.store, (err,fromValue) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(fromValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).then(fromValue => {
|
|
||||||
if (typeof fromValue === 'number' || fromValue instanceof Number) {
|
|
||||||
fromType = 'num';
|
|
||||||
} else if (typeof fromValue === 'boolean') {
|
|
||||||
fromType = 'bool'
|
|
||||||
} else if (fromValue instanceof RegExp) {
|
|
||||||
fromType = 're';
|
|
||||||
fromRE = fromValue;
|
|
||||||
} else if (typeof fromValue === 'string') {
|
|
||||||
fromType = 'str';
|
|
||||||
fromRE = fromValue.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
||||||
try {
|
|
||||||
fromRE = new RegExp(fromRE, "g");
|
|
||||||
} catch (e) {
|
|
||||||
return Promise.reject(new Error(RED._("change.errors.invalid-from",{error:e.message})));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Promise.reject(new Error(RED._("change.errors.invalid-from",{error:"unsupported type: "+(typeof fromValue)})));
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
fromType,
|
|
||||||
fromValue,
|
|
||||||
fromRE
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
fromType = rule.fromt;
|
|
||||||
fromValue = rule.from;
|
|
||||||
fromRE = rule.fromRE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.resolve({
|
|
||||||
fromType,
|
|
||||||
fromValue,
|
|
||||||
fromRE
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function applyRule(msg,rule) {
|
|
||||||
var property = rule.p;
|
|
||||||
var current;
|
|
||||||
var fromValue;
|
|
||||||
var fromType;
|
|
||||||
var fromRE;
|
|
||||||
try {
|
|
||||||
return getToValue(msg,rule).then(value => {
|
|
||||||
return getFromValue(msg,rule).then(fromParts => {
|
|
||||||
fromValue = fromParts.fromValue;
|
|
||||||
fromType = fromParts.fromType;
|
|
||||||
fromRE = fromParts.fromRE;
|
|
||||||
if (rule.pt === 'msg') {
|
|
||||||
try {
|
|
||||||
if (rule.t === 'delete') {
|
|
||||||
RED.util.setMessageProperty(msg,property,undefined);
|
|
||||||
} else if (rule.t === 'set') {
|
|
||||||
RED.util.setMessageProperty(msg,property,value);
|
|
||||||
} else if (rule.t === 'change') {
|
|
||||||
current = RED.util.getMessageProperty(msg,property);
|
|
||||||
if (typeof current === 'string') {
|
|
||||||
if ((fromType === 'num' || fromType === 'bool' || fromType === 'str') && current === fromValue) {
|
|
||||||
// str representation of exact from number/boolean
|
|
||||||
// only replace if they match exactly
|
|
||||||
RED.util.setMessageProperty(msg,property,value);
|
|
||||||
} else {
|
|
||||||
current = current.replace(fromRE,value);
|
|
||||||
RED.util.setMessageProperty(msg,property,current);
|
|
||||||
}
|
|
||||||
} else if ((typeof current === 'number' || current instanceof Number) && fromType === 'num') {
|
|
||||||
if (current == Number(fromValue)) {
|
|
||||||
RED.util.setMessageProperty(msg,property,value);
|
|
||||||
}
|
|
||||||
} else if (typeof current === 'boolean' && fromType === 'bool') {
|
|
||||||
if (current.toString() === fromValue) {
|
|
||||||
RED.util.setMessageProperty(msg,property,value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch(err) {}
|
|
||||||
return msg;
|
|
||||||
} else if (rule.pt === 'flow' || rule.pt === 'global') {
|
|
||||||
var contextKey = RED.util.parseContextStore(property);
|
|
||||||
return new Promise((resolve,reject) => {
|
|
||||||
var target = node.context()[rule.pt];
|
|
||||||
var callback = err => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rule.t === 'delete') {
|
|
||||||
target.set(contextKey.key,undefined,contextKey.store,callback);
|
|
||||||
} else if (rule.t === 'set') {
|
|
||||||
target.set(contextKey.key,value,contextKey.store,callback);
|
|
||||||
} else if (rule.t === 'change') {
|
|
||||||
target.get(contextKey.key,contextKey.store,(err,current) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof current === 'string') {
|
|
||||||
if ((fromType === 'num' || fromType === 'bool' || fromType === 'str') && current === fromValue) {
|
|
||||||
// str representation of exact from number/boolean
|
|
||||||
// only replace if they match exactly
|
|
||||||
target.set(contextKey.key,value,contextKey.store,callback);
|
|
||||||
} else {
|
|
||||||
current = current.replace(fromRE,value);
|
|
||||||
target.set(contextKey.key,current,contextKey.store,callback);
|
|
||||||
}
|
|
||||||
} else if ((typeof current === 'number' || current instanceof Number) && fromType === 'num') {
|
|
||||||
if (current == Number(fromValue)) {
|
|
||||||
target.set(contextKey.key,value,contextKey.store,callback);
|
|
||||||
}
|
|
||||||
} else if (typeof current === 'boolean' && fromType === 'bool') {
|
|
||||||
if (current.toString() === fromValue) {
|
|
||||||
target.set(contextKey.key,value,contextKey.store,callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
|
||||||
node.error(err, msg);
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
} catch(err) {
|
|
||||||
return Promise.resolve(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function applyRules(msg, currentRule) {
|
|
||||||
var r = node.rules[currentRule];
|
|
||||||
var rulePromise;
|
|
||||||
if (r.t === "move") {
|
|
||||||
if ((r.tot !== r.pt) || (r.p.indexOf(r.to) !== -1)) {
|
|
||||||
rulePromise = applyRule(msg,{t:"set", p:r.to, pt:r.tot, to:r.p, tot:r.pt}).then(
|
|
||||||
msg => applyRule(msg,{t:"delete", p:r.p, pt:r.pt})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else { // 2 step move if we are moving from a child
|
|
||||||
rulePromise = applyRule(msg,{t:"set", p:"_temp_move", pt:r.tot, to:r.p, tot:r.pt}).then(
|
|
||||||
msg => applyRule(msg,{t:"delete", p:r.p, pt:r.pt})
|
|
||||||
).then(
|
|
||||||
msg => applyRule(msg,{t:"set", p:r.to, pt:r.tot, to:"_temp_move", tot:r.pt})
|
|
||||||
).then(
|
|
||||||
msg => applyRule(msg,{t:"delete", p:"_temp_move", pt:r.pt})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rulePromise = applyRule(msg,r);
|
|
||||||
}
|
|
||||||
return rulePromise.then(
|
|
||||||
msg => {
|
|
||||||
if (!msg) {
|
|
||||||
return
|
|
||||||
} else if (currentRule === node.rules.length - 1) {
|
|
||||||
return msg;
|
|
||||||
} else {
|
|
||||||
return applyRules(msg, currentRule+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (valid) {
|
|
||||||
this.on('input', function(msg) {
|
|
||||||
applyRules(msg, 0)
|
|
||||||
.then( msg => { if (msg) { node.send(msg) }} )
|
|
||||||
.catch( err => node.error(err, msg))
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RED.nodes.registerType("change", ChangeNode);
|
|
||||||
};
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="tail">
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="tail.label.filename"></span></label>
|
|
||||||
<input id="node-input-filename" type="text">
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-filetype"><i class="fa fa-file-text-o"></i> <span data-i18n="tail.label.type"></span></label>
|
|
||||||
<select type="text" id="node-input-filetype">
|
|
||||||
<option value="text" data-i18n="tail.action.text"></option>
|
|
||||||
<option value="binary" data-i18n="tail.action.binary"></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-row" id="node-tail-split">
|
|
||||||
<label> </label>
|
|
||||||
<input type="checkbox" id="node-input-split" placeholder="Name" style="display: inline-block; width: auto; vertical-align: top;">
|
|
||||||
<label for="node-input-split" style="width: 70%;"><span data-i18n="tail.label.splitlines"></span></label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="tail">
|
|
||||||
<p>Tails (watches for things to be added) to the configured file. (Linux/Mac ONLY)</p>
|
|
||||||
<p>This will not work on Windows filesystems, as it relies on the <b>tail -F</b> command.</p>
|
|
||||||
<h3>Outputs</h3>
|
|
||||||
<ul>
|
|
||||||
<li>Text (UTF-8) files will be returned as strings.</li>
|
|
||||||
<li>Binary files will be returned as Buffer objects.</li>
|
|
||||||
</ul>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
RED.nodes.registerType('tail',{
|
|
||||||
category: 'storage-input',
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
filetype: {value:"text"},
|
|
||||||
split: {value:false},
|
|
||||||
filename: {value:"",required:true}
|
|
||||||
},
|
|
||||||
color:"BurlyWood",
|
|
||||||
inputs:0,
|
|
||||||
outputs:1,
|
|
||||||
icon: "file.png",
|
|
||||||
label: function() {
|
|
||||||
return this.name||this.filename||this._("tail.tail");
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
$("#node-input-filetype").on("change",function() {
|
|
||||||
if (this.value === "text") { $("#node-tail-split").show(); }
|
|
||||||
else { $("#node-tail-split").hide(); }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
**/
|
|
||||||
|
|
||||||
module.exports = function(RED) {
|
|
||||||
"use strict";
|
|
||||||
var spawn = require('child_process').spawn;
|
|
||||||
var plat = require('os').platform();
|
|
||||||
|
|
||||||
if (plat.match(/^win/)) {
|
|
||||||
throw RED._("tail.errors.windowsnotsupport");
|
|
||||||
}
|
|
||||||
|
|
||||||
function TailNode(n) {
|
|
||||||
RED.nodes.createNode(this,n);
|
|
||||||
|
|
||||||
this.filename = n.filename;
|
|
||||||
this.filetype = n.filetype || "text";
|
|
||||||
this.split = n.split || false;
|
|
||||||
var node = this;
|
|
||||||
|
|
||||||
var err = "";
|
|
||||||
// TODO: rewrite to use node-tail
|
|
||||||
var tail = spawn("tail", ["-F", "-n", "0", this.filename]);
|
|
||||||
tail.stdout.on("data", function (data) {
|
|
||||||
var msg = { topic:node.filename };
|
|
||||||
if (node.filetype === "text") {
|
|
||||||
if (node.split) {
|
|
||||||
// TODO: allow customisation of the line break - as we do elsewhere
|
|
||||||
var strings = data.toString().split("\n");
|
|
||||||
for (var s in strings) {
|
|
||||||
//TODO: should we really filter blanks? Is that expected?
|
|
||||||
if (strings[s] !== "") {
|
|
||||||
node.send({
|
|
||||||
topic: node.filename,
|
|
||||||
payload: strings[s]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
msg.payload = data.toString();
|
|
||||||
node.send(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
msg.payload = data;
|
|
||||||
node.send(msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
tail.stderr.on("data", function(data) {
|
|
||||||
node.error(data.toString());
|
|
||||||
});
|
|
||||||
|
|
||||||
this.on("close", function() {
|
|
||||||
/* istanbul ignore else */
|
|
||||||
if (tail) { tail.kill(); }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
RED.nodes.registerType("tail",TailNode);
|
|
||||||
}
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
|
|
||||||
<script type="text/x-red" data-template-name="file">
|
|
||||||
<div class="form-row node-input-filename">
|
|
||||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="file.label.filename"></span></label>
|
|
||||||
<input id="node-input-filename" type="text">
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-overwriteFile"><i class="fa fa-random"></i> <span data-i18n="file.label.action"></span></label>
|
|
||||||
<select type="text" id="node-input-overwriteFile" style="width: 250px;">
|
|
||||||
<option value="false" data-i18n="file.action.append"></option>
|
|
||||||
<option value="true" data-i18n="file.action.overwrite"></option>
|
|
||||||
<option value="delete" data-i18n="file.action.delete"></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-row form-row-file-write-options">
|
|
||||||
<label> </label>
|
|
||||||
<input type="checkbox" id="node-input-appendNewline" style="display: inline-block; width: auto; vertical-align: top;">
|
|
||||||
<label for="node-input-appendNewline" style="width: 70%;"><span data-i18n="file.label.addnewline"></span></label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row form-row-file-write-options">
|
|
||||||
<label> </label>
|
|
||||||
<input type="checkbox" id="node-input-createDir" style="display: inline-block; width: auto; vertical-align: top;">
|
|
||||||
<label for="node-input-createDir" style="width: 70%;"><span data-i18n="file.label.createdir"></span></label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
<div class="form-tips"><span data-i18n="file.tip"></span></div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="file">
|
|
||||||
<p>Writes <code>msg.payload</code> to a file, either adding to the end or replacing the existing content.
|
|
||||||
Alternatively, it can delete the file.</p>
|
|
||||||
<h3>Inputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt class="optional">filename <span class="property-type">string</span></dt>
|
|
||||||
<dd>If not configured in the node, this optional property sets the name of the file to be updated.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Output</h3>
|
|
||||||
<p>On completion of write, input message is sent to output port.</p>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>Each message payload will be added to the end of the file, optionally appending
|
|
||||||
a newline (\n) character between each one.</p>
|
|
||||||
<p>If <code>msg.filename</code> is used the file will be closed after every write.
|
|
||||||
For best performance use a fixed filename.</p>
|
|
||||||
<p>It can be configured to overwrite the entire file rather than append. For example,
|
|
||||||
when writing binary data to a file, such as an image, this option should be used
|
|
||||||
and the option to append a newline should be disabled.</p>
|
|
||||||
<p>Alternatively, this node can be configured to delete the file.</p>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/x-red" data-template-name="file in">
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="file.label.filename"></span></label>
|
|
||||||
<input id="node-input-filename" type="text" data-i18n="[placeholder]file.label.filename">
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-format"><i class="fa fa-sign-out"></i> <span data-i18n="file.label.outputas"></span></label>
|
|
||||||
<select id="node-input-format">
|
|
||||||
<option value="utf8" data-i18n="file.output.utf8"></option>
|
|
||||||
<option value="lines" data-i18n="file.output.lines"></option>
|
|
||||||
<option value="" data-i18n="file.output.buffer"></option>
|
|
||||||
<option value="stream" data-i18n="file.output.stream"></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label></label>
|
|
||||||
<input type="checkbox" id="node-input-sendError" style="width:auto">
|
|
||||||
<label style="width:auto; margin-bottom:0; vertical-align: middle;" for="node-input-sendError" data-i18n="file.label.sendError"></label>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
||||||
</div>
|
|
||||||
<div class="form-tips"><span data-i18n="file.tip"></span></div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="file in">
|
|
||||||
<p>Reads the contents of a file as either a string or binary buffer.</p>
|
|
||||||
<h3>Inputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt class="optional">filename <span class="property-type">string</span></dt>
|
|
||||||
<dd>if not set in the node configuration, this property sets the filename to read.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Outputs</h3>
|
|
||||||
<dl class="message-properties">
|
|
||||||
<dt>payload <span class="property-type">string | buffer</span></dt>
|
|
||||||
<dd>The contents of the file as either a string or binary buffer.</dd>
|
|
||||||
<dt class="optional">filename <span class="property-type">string</span></dt>
|
|
||||||
<dd>If not configured in the node, this optional property sets the name of the file to be read.</dd>
|
|
||||||
<dt class="optional">error <span class="property-type">object</span></dt>
|
|
||||||
<dd><i>deprecated</i>: If enabled in the node, when the node hits an error
|
|
||||||
reading the file, it will send a message with no <code>payload</code>
|
|
||||||
and this <code>error</code> property set to the error details. This
|
|
||||||
mode of behaviour is deprecated and not enabled by default for new
|
|
||||||
instances of the node. See below for more information.</dd>
|
|
||||||
</dl>
|
|
||||||
<h3>Details</h3>
|
|
||||||
<p>The filename should be an absolute path, otherwise it will be relative to
|
|
||||||
the working directory of the Node-RED process.</p>
|
|
||||||
<p>On Windows, path separators may need to be escaped, for example: <code>\\Users\\myUser</code>.</p>
|
|
||||||
<p>Optionally, a text file can be split into lines, outputting one message per line, or a binary file
|
|
||||||
split into smaller buffer chunks - the chunk size being operating system dependant, but typically 64k (Linux/Mac) or 41k (Windows).</p>
|
|
||||||
<p>When split into multiple messages, each message will have a <code>parts</code>
|
|
||||||
property set, forming a complete message sequence.</p>
|
|
||||||
<h4>Legacy error handling</h4>
|
|
||||||
<p>Before Node-RED 0.17, if this node hit an error whilst reading the file, it would
|
|
||||||
send a message with no <code>msg.payload</code> and <code>msg.error</code> set to the
|
|
||||||
details of the error. This is a deprecated mode of behaviour for the node that new
|
|
||||||
instances will not do. If required, this mode can be re-enabled within the node
|
|
||||||
configuration.</p>
|
|
||||||
<p>Errors should be caught and handled using a Catch node.</p>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
RED.nodes.registerType('file',{
|
|
||||||
category: 'storage-output',
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
filename: {value:""},
|
|
||||||
appendNewline: {value:true},
|
|
||||||
createDir: {value:false},
|
|
||||||
overwriteFile: {value:"false"}
|
|
||||||
},
|
|
||||||
color:"BurlyWood",
|
|
||||||
inputs:1,
|
|
||||||
outputs:1,
|
|
||||||
icon: "file-out.png",
|
|
||||||
label: function() {
|
|
||||||
if (this.overwriteFile === "delete") {
|
|
||||||
return this.name||this._("file.label.deletelabel",{file:this.filename});
|
|
||||||
} else {
|
|
||||||
return this.name||this.filename||this._("file.label.filelabel");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
$("#node-input-overwriteFile").on("change",function() {
|
|
||||||
if (this.value === "delete") { $(".form-row-file-write-options").hide(); }
|
|
||||||
else { $(".form-row-file-write-options").show(); }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
RED.nodes.registerType('file in',{
|
|
||||||
category: 'storage-input',
|
|
||||||
defaults: {
|
|
||||||
name: {value:""},
|
|
||||||
filename: {value:""},
|
|
||||||
format: {value:"utf8"},
|
|
||||||
chunk: {value:false},
|
|
||||||
sendError: {value: false}
|
|
||||||
},
|
|
||||||
color:"BurlyWood",
|
|
||||||
inputs:1,
|
|
||||||
outputs:1,
|
|
||||||
outputLabels: function(i) {
|
|
||||||
return (this.format === "utf8") ? "UTF8 string" : "binary buffer";
|
|
||||||
},
|
|
||||||
icon: "file-in.png",
|
|
||||||
label: function() {
|
|
||||||
return this.name||this.filename||this._("file.label.filelabel");
|
|
||||||
},
|
|
||||||
labelStyle: function() {
|
|
||||||
return this.name?"node_label_italic":"";
|
|
||||||
},
|
|
||||||
oneditprepare: function() {
|
|
||||||
if (this.sendError === undefined) {
|
|
||||||
$("#node-input-sendError").prop("checked",true);
|
|
||||||
}
|
|
||||||
$("#node-input-format").on("change",function() {
|
|
||||||
if ($("#node-input-format").val() === "utf8") {
|
|
||||||
$("#buffer-input-type").hide();
|
|
||||||
$("#line-input-type").show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#buffer-input-type").show();
|
|
||||||
$("#line-input-type").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
110
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "0.18.7",
|
"version": "1.0.0-beta.1",
|
||||||
"description": "A visual tool for wiring the Internet of Things",
|
"description": "A visual tool for wiring the Internet of Things",
|
||||||
"homepage": "http://nodered.org",
|
"homepage": "http://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -8,17 +8,13 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/node-red/node-red.git"
|
"url": "https://github.com/node-red/node-red.git"
|
||||||
},
|
},
|
||||||
"main": "red/red.js",
|
"private": "true",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node red.js",
|
"start": "node packages/node_modules/node-red/red.js",
|
||||||
"test": "grunt",
|
"test": "grunt",
|
||||||
"build": "grunt build",
|
"build": "grunt build",
|
||||||
"docs": "grunt docs"
|
"docs": "grunt docs"
|
||||||
},
|
},
|
||||||
"bin": {
|
|
||||||
"node-red": "./red.js",
|
|
||||||
"node-red-pi": "bin/node-red-pi"
|
|
||||||
},
|
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Nick O'Leary"
|
"name": "Nick O'Leary"
|
||||||
@@ -27,98 +23,98 @@
|
|||||||
"name": "Dave Conway-Jones"
|
"name": "Dave Conway-Jones"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"keywords": [
|
|
||||||
"editor",
|
|
||||||
"messaging",
|
|
||||||
"iot",
|
|
||||||
"flow"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "6.5.2",
|
"ajv": "6.10.0",
|
||||||
"basic-auth": "2.0.0",
|
"basic-auth": "2.0.1",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.18.3",
|
"body-parser": "1.19.0",
|
||||||
"cheerio": "0.22.0",
|
"cheerio": "0.22.0",
|
||||||
"clone": "2.1.1",
|
"clone": "2.1.2",
|
||||||
"cookie": "0.3.1",
|
"content-type": "1.0.4",
|
||||||
"cookie-parser": "1.4.3",
|
"cookie": "0.4.0",
|
||||||
"cors": "2.8.4",
|
"cookie-parser": "1.4.4",
|
||||||
"cron": "1.3.0",
|
"cors": "2.8.5",
|
||||||
"denque": "1.3.0",
|
"cron": "1.7.1",
|
||||||
"express": "4.16.3",
|
"denque": "1.4.1",
|
||||||
"express-session": "1.15.6",
|
"express": "4.17.0",
|
||||||
"fs-extra": "5.0.0",
|
"express-session": "1.16.1",
|
||||||
|
"fs-extra": "8.0.1",
|
||||||
"fs.notify": "0.0.4",
|
"fs.notify": "0.0.4",
|
||||||
"hash-sum": "1.0.2",
|
"hash-sum": "1.0.2",
|
||||||
"i18next": "^11.4.0",
|
"https-proxy-agent": "2.2.1",
|
||||||
|
"i18next": "15.1.2",
|
||||||
|
"iconv-lite": "0.4.24",
|
||||||
"is-utf8": "0.2.1",
|
"is-utf8": "0.2.1",
|
||||||
"js-yaml": "3.12.0",
|
"js-yaml": "3.13.1",
|
||||||
"json-stringify-safe": "5.0.1",
|
"json-stringify-safe": "5.0.1",
|
||||||
"jsonata": "1.5.4",
|
"jsonata": "1.6.4",
|
||||||
"media-typer": "0.3.0",
|
"memorystore": "1.6.1",
|
||||||
"memorystore": "1.6.0",
|
"mime": "2.4.3",
|
||||||
"mime": "1.4.1",
|
"mqtt": "2.18.8",
|
||||||
"mqtt": "2.18.3",
|
"multer": "1.4.1",
|
||||||
"multer": "1.3.1",
|
"mustache": "3.0.1",
|
||||||
"mustache": "2.3.0",
|
"node-red-node-email": "^1.4.0",
|
||||||
"node-red-node-email": "0.1.*",
|
"node-red-node-feedparser": "^0.1.14",
|
||||||
"node-red-node-feedparser": "^0.1.12",
|
"node-red-node-rbe": "^0.2.4",
|
||||||
"node-red-node-rbe": "0.2.*",
|
"node-red-node-sentiment": "^0.1.3",
|
||||||
"node-red-node-twitter": "*",
|
"node-red-node-tail": "^0.0.2",
|
||||||
|
"node-red-node-twitter": "^1.1.4",
|
||||||
"nopt": "4.0.1",
|
"nopt": "4.0.1",
|
||||||
"oauth2orize": "1.11.0",
|
"oauth2orize": "1.11.0",
|
||||||
"on-headers": "1.0.1",
|
"on-headers": "1.0.2",
|
||||||
"passport": "0.4.0",
|
"passport": "0.4.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.3.3",
|
"raw-body": "2.4.0",
|
||||||
"request": "2.87.0",
|
"request": "2.88.0",
|
||||||
"semver": "5.5.0",
|
"semver": "6.0.0",
|
||||||
"sentiment": "2.1.0",
|
"uglify-js": "3.5.15",
|
||||||
"uglify-js": "3.4.5",
|
|
||||||
"when": "3.7.8",
|
"when": "3.7.8",
|
||||||
"ws": "1.1.5",
|
"ws": "6.2.1",
|
||||||
"xml2js": "0.4.19"
|
"xml2js": "0.4.19"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"bcrypt": "~2.0.0"
|
"bcrypt": "3.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chromedriver": "^2.40.0",
|
|
||||||
"grunt": "~1.0.3",
|
"grunt": "~1.0.3",
|
||||||
"grunt-chmod": "~1.1.1",
|
"grunt-chmod": "~1.1.1",
|
||||||
"grunt-cli": "~1.2.0",
|
"grunt-cli": "~1.3.2",
|
||||||
"grunt-concurrent": "~2.3.1",
|
"grunt-concurrent": "~2.3.1",
|
||||||
"grunt-contrib-clean": "~1.1.0",
|
"grunt-contrib-clean": "~1.1.0",
|
||||||
"grunt-contrib-compress": "~1.4.0",
|
"grunt-contrib-compress": "~1.4.0",
|
||||||
"grunt-contrib-concat": "~1.0.1",
|
"grunt-contrib-concat": "~1.0.1",
|
||||||
"grunt-contrib-copy": "~1.0.0",
|
"grunt-contrib-copy": "~1.0.0",
|
||||||
"grunt-contrib-jshint": "~1.1.0",
|
"grunt-contrib-jshint": "~1.1.0",
|
||||||
"grunt-contrib-uglify": "~3.3.0",
|
"grunt-contrib-uglify": "~3.4.0",
|
||||||
"grunt-contrib-watch": "~1.1.0",
|
"grunt-contrib-watch": "~1.1.0",
|
||||||
"grunt-jsdoc": "^2.2.1",
|
"grunt-jsdoc": "^2.2.1",
|
||||||
"grunt-jsdoc-to-markdown": "^4.0.0",
|
"grunt-jsdoc-to-markdown": "^4.0.0",
|
||||||
"grunt-jsonlint": "~1.1.0",
|
"grunt-jsonlint": "~1.1.0",
|
||||||
|
"grunt-mkdir": "~1.0.0",
|
||||||
"grunt-mocha-istanbul": "5.0.2",
|
"grunt-mocha-istanbul": "5.0.2",
|
||||||
"grunt-nodemon": "~0.4.2",
|
"grunt-nodemon": "~0.4.2",
|
||||||
|
"grunt-npm-command": "~0.1.2",
|
||||||
"grunt-sass": "~2.0.0",
|
"grunt-sass": "~2.0.0",
|
||||||
"grunt-simple-mocha": "~0.4.1",
|
"grunt-simple-mocha": "~0.4.1",
|
||||||
"grunt-webdriver": "^2.0.3",
|
"grunt-webdriver": "^2.0.3",
|
||||||
"http-proxy": "^1.16.2",
|
"http-proxy": "^1.16.2",
|
||||||
"ink-docstrap": "^1.3.2",
|
|
||||||
"istanbul": "0.4.5",
|
"istanbul": "0.4.5",
|
||||||
|
"minami": "1.2.3",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
"mosca": "^2.8.3",
|
||||||
"should": "^8.4.0",
|
"should": "^8.4.0",
|
||||||
"sinon": "1.17.7",
|
"sinon": "1.17.7",
|
||||||
"stoppable": "^1.0.6",
|
"stoppable": "^1.1.0",
|
||||||
"supertest": "3.1.0",
|
"supertest": "3.4.2",
|
||||||
"wdio-chromedriver-service": "^0.1.3",
|
"wdio-chromedriver-service": "^0.1.5",
|
||||||
"wdio-mocha-framework": "^0.6.2",
|
"wdio-mocha-framework": "^0.6.4",
|
||||||
"wdio-spec-reporter": "^0.1.5",
|
"wdio-spec-reporter": "^0.1.5",
|
||||||
"webdriverio": "^4.13.1",
|
"webdriverio": "^4.14.1",
|
||||||
"node-red-node-test-helper": "^0.1.7"
|
"node-red-node-test-helper": "^0.2.2",
|
||||||
|
"jsdoc-nr-template": "node-red/jsdoc-nr-template"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
packages/node_modules/@node-red/editor-api/.npmignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
src
|
||||||
|
docs
|
||||||
178
packages/node_modules/@node-red/editor-api/LICENSE
vendored
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
Copyright JS Foundation and other contributors, http://js.foundation
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
12
packages/node_modules/@node-red/editor-api/README.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
@node-red/editor-api
|
||||||
|
====================
|
||||||
|
|
||||||
|
Node-RED editor api module.
|
||||||
|
|
||||||
|
This provides an Express application that can be used to serve the Node-RED
|
||||||
|
editor.
|
||||||
|
|
||||||
|
|
||||||
|
### Source
|
||||||
|
|
||||||
|
The main Node-RED modules are maintained as a monorepo on [GitHub](https://github.com/node-red/node-red).
|
||||||
@@ -37,5 +37,20 @@ module.exports = {
|
|||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
apiUtils.rejectHandler(req,res,err);
|
apiUtils.rejectHandler(req,res,err);
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
delete: function(req,res) {
|
||||||
|
var opts = {
|
||||||
|
user: req.user,
|
||||||
|
scope: req.params.scope,
|
||||||
|
id: req.params.id,
|
||||||
|
key: req.params[0],
|
||||||
|
store: req.query['store']
|
||||||
|
}
|
||||||
|
runtimeAPI.context.delete(opts).then(function(result) {
|
||||||
|
res.status(204).end();
|
||||||
|
}).catch(function(err) {
|
||||||
|
apiUtils.rejectHandler(req,res,err);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,6 +62,11 @@ module.exports = {
|
|||||||
adminApp.get("/context/:scope(node|flow)/:id",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
adminApp.get("/context/:scope(node|flow)/:id",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
||||||
adminApp.get("/context/:scope(node|flow)/:id/*",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
adminApp.get("/context/:scope(node|flow)/:id/*",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
||||||
|
|
||||||
|
// adminApp.delete("/context/:scope(global)",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||||
|
adminApp.delete("/context/:scope(global)/*",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||||
|
// adminApp.delete("/context/:scope(node|flow)/:id",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||||
|
adminApp.delete("/context/:scope(node|flow)/:id/*",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||||
|
|
||||||
return adminApp;
|
return adminApp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin @node-red/editor-api_auth
|
||||||
|
*/
|
||||||
|
|
||||||
var passport = require("passport");
|
var passport = require("passport");
|
||||||
var oauth2orize = require("oauth2orize");
|
var oauth2orize = require("oauth2orize");
|
||||||
|
|
||||||
@@ -25,7 +30,7 @@ var permissions = require("./permissions");
|
|||||||
var theme = require("../editor/theme");
|
var theme = require("../editor/theme");
|
||||||
|
|
||||||
var settings = null;
|
var settings = null;
|
||||||
var log = require("../../util").log; // TODO: separate module
|
var log = require("@node-red/util").log; // TODO: separate module
|
||||||
|
|
||||||
|
|
||||||
passport.use(strategies.bearerStrategy.BearerStrategy);
|
passport.use(strategies.bearerStrategy.BearerStrategy);
|
||||||
@@ -39,11 +44,19 @@ server.exchange(oauth2orize.exchange.password(strategies.passwordTokenExchange))
|
|||||||
function init(_settings,storage) {
|
function init(_settings,storage) {
|
||||||
settings = _settings;
|
settings = _settings;
|
||||||
if (settings.adminAuth) {
|
if (settings.adminAuth) {
|
||||||
Users.init(settings.adminAuth);
|
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
|
||||||
Tokens.init(settings.adminAuth,storage);
|
Users.init(mergedAdminAuth);
|
||||||
|
Tokens.init(mergedAdminAuth,storage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Returns an Express middleware function that ensures the user making a request
|
||||||
|
* has the necessary permission.
|
||||||
|
*
|
||||||
|
* @param {String} permission - the permission required for the request, such as `flows.write`
|
||||||
|
* @return {Function} - an Express middleware
|
||||||
|
* @memberof @node-red/editor-api_auth
|
||||||
|
*/
|
||||||
function needsPermission(permission) {
|
function needsPermission(permission) {
|
||||||
return function(req,res,next) {
|
return function(req,res,next) {
|
||||||
if (settings && settings.adminAuth) {
|
if (settings && settings.adminAuth) {
|
||||||
@@ -79,23 +92,24 @@ function getToken(req,res,next) {
|
|||||||
function login(req,res) {
|
function login(req,res) {
|
||||||
var response = {};
|
var response = {};
|
||||||
if (settings.adminAuth) {
|
if (settings.adminAuth) {
|
||||||
if (settings.adminAuth.type === "credentials") {
|
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
|
||||||
|
if (mergedAdminAuth.type === "credentials") {
|
||||||
response = {
|
response = {
|
||||||
"type":"credentials",
|
"type":"credentials",
|
||||||
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
|
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
|
||||||
}
|
}
|
||||||
} else if (settings.adminAuth.type === "strategy") {
|
} else if (mergedAdminAuth.type === "strategy") {
|
||||||
|
|
||||||
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
|
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
|
||||||
response = {
|
response = {
|
||||||
"type":"strategy",
|
"type":"strategy",
|
||||||
"prompts":[{type:"button",label:settings.adminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
||||||
}
|
}
|
||||||
if (settings.adminAuth.strategy.icon) {
|
if (mergedAdminAuth.strategy.icon) {
|
||||||
response.prompts[0].icon = settings.adminAuth.strategy.icon;
|
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
|
||||||
}
|
}
|
||||||
if (settings.adminAuth.strategy.image) {
|
if (mergedAdminAuth.strategy.image) {
|
||||||
response.prompts[0].image = theme.serveFile('/login/',settings.adminAuth.strategy.image);
|
response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (theme.context().login && theme.context().login.image) {
|
if (theme.context().login && theme.context().login.image) {
|
||||||
@@ -180,7 +194,12 @@ function genericStrategy(adminApp,strategy) {
|
|||||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||||
completeGenerateStrategyAuth
|
completeGenerateStrategyAuth
|
||||||
);
|
);
|
||||||
adminApp.get('/auth/strategy/callback',
|
|
||||||
|
var callbackMethodFunc = adminApp.get;
|
||||||
|
if (/^post$/i.test(options.callbackMethod)) {
|
||||||
|
callbackMethodFunc = adminApp.post;
|
||||||
|
}
|
||||||
|
callbackMethodFunc.call(adminApp,'/auth/strategy/callback',
|
||||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||||
completeGenerateStrategyAuth
|
completeGenerateStrategyAuth
|
||||||
);
|
);
|
||||||
@@ -26,7 +26,7 @@ var Users = require("./users");
|
|||||||
var Clients = require("./clients");
|
var Clients = require("./clients");
|
||||||
var permissions = require("./permissions");
|
var permissions = require("./permissions");
|
||||||
|
|
||||||
var log = require("../../util").log; // TODO: separate module
|
var log = require("@node-red/util").log; // TODO: separate module
|
||||||
|
|
||||||
var bearerStrategy = function (accessToken, done) {
|
var bearerStrategy = function (accessToken, done) {
|
||||||
// is this a valid token?
|
// is this a valid token?
|
||||||