Compare commits

..

1086 Commits

Author SHA1 Message Date
Nick O'Leary
90d1bb0ae4 Merge branch 'master' into dev 2023-02-03 09:11:46 +00:00
Nick O'Leary
adfc5b3e98 Merge pull request #4043 from node-red-hitachi/fix-group-undo-position
fix group position after undo
2023-02-03 09:11:20 +00:00
Hiroyasu Nishiyama
f3d7016ab2 fix group position after undo 2023-02-03 17:25:58 +09:00
Nick O'Leary
ae776547ce Merge pull request #4042 from kazuhitoyokoi/dev-jpn
Add Japanese translations for welcome tour of 3.1.0 beta.1
2023-02-02 15:19:09 +00:00
Kazuhito Yokoi
da6885be62 Add Japanese translations for welcome tour of 3.1.0 beta.1 2023-02-03 00:08:50 +09:00
Nick O'Leary
c0fa4a077f Merge pull request #4041 from node-red/310-tour
Add welcome tour for 3.1.0 beta.1
2023-02-02 14:53:06 +00:00
Nick O'Leary
df19e54555 Fix lint issue 2023-02-02 14:36:04 +00:00
Nick O'Leary
19139a4dce Merge pull request #4040 from kazuhitoyokoi/dev-jpn
Add Japanese translations for locking flow
2023-02-02 13:42:22 +00:00
Kazuhito Yokoi
7d1c3133b3 Fix i18n of tooltips for locking flow 2023-02-02 22:37:00 +09:00
Kazuhito Yokoi
da9c0af854 Add Japanese translations for locking flow 2023-02-02 22:35:07 +09:00
Nick O'Leary
6d717a21cf Add 310 tour 2023-02-02 13:34:01 +00:00
Nick O'Leary
fc251d005e Merge pull request #4039 from node-red/tab-context-menu
Locking Flows
2023-02-02 11:35:54 +00:00
Nick O'Leary
4624e28675 Merge branch 'dev' into tab-context-menu 2023-02-02 11:33:06 +00:00
Nick O'Leary
3a1cc38aaf Update for 3.1.0-beta.1 2023-02-02 11:09:55 +00:00
Nick O'Leary
68bb38b8d7 Merge branch 'master' into dev 2023-02-02 10:40:33 +00:00
Nick O'Leary
2ca3b3e99d Merge pull request #4007 from node-red-hitachi/add-markdown-mermaid-diagram
Add support for mermaid diagram to markdown editor
2023-02-02 10:35:32 +00:00
Nick O'Leary
67c8354f76 Merge branch 'pr_4006' into dev 2023-02-02 10:29:39 +00:00
Nick O'Leary
384377782a Remove package-lock from git history 2023-02-02 10:25:57 +00:00
Nick O'Leary
8382665bbb Merge pull request #3999 from node-red/fix-plugin-async
Fix async loading of modules containing both nodes and plugins
2023-02-02 10:23:42 +00:00
Nick O'Leary
e799cfc16a Merge pull request #4004 from dirkjanfaber/patch-1
Comment node: Clarify where the text will appear
2023-02-02 10:23:22 +00:00
Nick O'Leary
055d0081e1 Merge pull request #4021 from node-red/inject-async-context
Allow Inject node to work with async context stores
2023-02-02 10:22:59 +00:00
Nick O'Leary
9035de32c8 Merge pull request #4023 from node-red/trigger-hide-nul-option
Hide trigger node repeat send  option if sending nothing
2023-02-02 10:22:40 +00:00
Nick O'Leary
af62a520d3 Merge pull request #4028 from node-red/Add-count-to-join-and-batch-node-labels
Add count to join and batch node labels
2023-02-02 10:21:57 +00:00
Nick O'Leary
1824108d09 Merge pull request #4035 from xiaobinqt/dev
fix .red-ui-notification class
2023-02-02 10:20:54 +00:00
Nick O'Leary
149e8ce9b0 Merge pull request #4036 from kazuhitoyokoi/master-usemain
Use main branch as default in project feature
2023-02-02 10:20:24 +00:00
Nick O'Leary
f4661eec75 Merge pull request #4038 from bonanitech/function-node-setup-tab
Fix border radius on Modules list header
2023-02-02 10:19:54 +00:00
Mauricio Bonani
0f7a1a42e4 Fix border radius on Modules list header 2023-02-01 17:50:05 -05:00
Kazuhito Yokoi
5bda221f9d Use main branch as default in project feature 2023-01-31 00:36:18 +09:00
weibin
fd42becbdc fix .red-ui-notification
if flows stopped due to missing too much node types manage-project-dep button display none.
2023-01-30 23:02:42 +08:00
Nick O'Leary
2759c1616c Merge branch 'dev' into pr_4031 2023-01-30 09:52:31 +00:00
Nick O'Leary
55ac98c989 Merge pull request #4033 from node-red-hitachi/fix-hide-subflow-tooltip
fix hide subflow tooltip
2023-01-30 09:48:20 +00:00
Nick O'Leary
c42c6a7b08 Merge pull request #4030 from node-red-hitachi/disable-delete-tab-menu-when-single-tab-exists
Disable delete tab menu when single tab exists
2023-01-30 09:38:16 +00:00
Nick O'Leary
b99bd38649 Merge pull request #4029 from node-red-hitachi/fix-tab-menu-error
fix workspace reference error in case of empty tabs
2023-01-30 09:34:05 +00:00
Hiroyasu Nishiyama
013ee2f1f4 fix hide subflow tooltip 2023-01-30 16:24:52 +09:00
Hiroyasu Nishiyama
7b79d79f84 remove useless console output 2023-01-30 14:09:01 +09:00
Hiroyasu Nishiyama
66f9686e48 disable hide all menu if all tabs hidden 2023-01-30 11:42:53 +09:00
Hiroyasu Nishiyama
9b1b7437b3 disable delete tab menu when single tab exists 2023-01-30 10:59:34 +09:00
Hiroyasu Nishiyama
720d44d53e fix workspace reference error in case of empty tabs 2023-01-30 10:30:06 +09:00
Nick O'Leary
7dca148349 Merge pull request #4027 from kazuhitoyokoi/master-fixmenu4project
Fix disabled menu items in project feature
2023-01-27 10:29:10 +00:00
Dave Conway-Jones
47bacaf58a Add count to join and batch node labels 2023-01-26 22:13:17 +00:00
Kazuhito Yokoi
ffff8aeb91 Fix disabled menu in project feature 2023-01-26 02:11:34 +09:00
Dave Conway-Jones
9a856f50d7 Hide repeat send option if sending nothing
to address https://discourse.nodered.org/t/trigger-node-how-to-delay-and-repeat-message/74117/5
2023-01-25 10:59:04 +00:00
Hiroyasu Nishiyama
e7540de85d remove useless variable 2023-01-25 16:40:12 +09:00
Hiroyasu Nishiyama
ba9ddefbee removed endpoint 2023-01-25 16:06:37 +09:00
Hiroyasu Nishiyama
f1801f9662 fix to prevent uploging unexpected file type 2023-01-25 13:38:12 +09:00
Nick O'Leary
ae92ea9476 Merge pull request #4020 from node-red/rename-package-var
Rename package var to avoid strict mode error
2023-01-23 20:44:29 +00:00
Nick O'Leary
c7017ee84b Allow Inject node to work with async context stores
Fixes #4014
2023-01-23 20:42:25 +00:00
Nick O'Leary
0346294c59 Rename package var 2023-01-23 17:50:50 +00:00
Nick O'Leary
8d240ca797 Rename package var to avoid strict more error
Fixes #4017
2023-01-23 17:44:03 +00:00
Nick O'Leary
a607ee90e0 Merge pull request #4009 from node-red/TCP-node-replaceall-fix
TCP Node: ensure newline substitution applies to whole message
2023-01-23 17:23:28 +00:00
Nick O'Leary
7dbbafec1b Merge pull request #4000 from node-red/fix-split-stream
Split node: avoid duplicate done call for buffer split
2023-01-23 17:04:31 +00:00
Nick O'Leary
428132ea3b Merge pull request #3997 from kazuhitoyokoi/dev-jpn
Add Japanese translation for v3.1.0-beta.0
2023-01-23 17:04:16 +00:00
Nick O'Leary
c49330f9d1 Merge pull request #4012 from kazuhitoyokoi/master-addjpn
Add Japanese translations for v3.0.3
2023-01-23 16:58:34 +00:00
Nick O'Leary
937c5fe893 Merge pull request #4019 from node-red/force-ipv4-lookup-over-ipv6
if possible - force ipv4 name resolution to have priority
2023-01-23 16:58:21 +00:00
Dave Conway-Jones
d2c9f12c3a if possible - force ipv4 name resolution to have priority
to fix Issue #4010
and others (eg) email node server connect fails, and some reported on SO
2023-01-23 13:02:58 +00:00
Robin Schneider
10324d8260 Fix typos in settings.js (#4013)
* chore: Remove trailing whitespace in settings.js

* chore: Fix typos in settings.js

* chore: Use consistent terminology in settings.js
2023-01-19 09:28:46 +00:00
Kazuhito Yokoi
8f27dae7ea Add Japanese translations for v3.0.3 2023-01-16 00:56:39 +09:00
Dave Conway-Jones
94ae511a6d fix tcp to replace all in newline substitution
to close #3989
2023-01-09 09:26:24 +00:00
Hiroyasu Nishiyama
038f75e48f add support for mermaid diagram to markdown editor 2023-01-05 17:25:16 +09:00
Hiroyasu Nishiyama
b9fe4c5cd3 merge upstream/dev 2023-01-05 10:29:45 +09:00
Hiroyasu Nishiyama
7e8b7602b4 add support for inline image drag and drop to markdown editor 2023-01-05 10:28:48 +09:00
Dirk-Jan Faber
7c306a8430 Comment node: Clarify where the text will appear
The text will appear in the information tab of the side panel and not in the help tab of the side panel.
2023-01-03 13:41:31 +01:00
Nick O'Leary
dd2bc44c2d Merge branch 'dev' into dev-jpn 2023-01-01 22:38:20 +00:00
Nick O'Leary
74794fea09 Split node: avoid duplicate done call for buffer split
Fixes #3982
2023-01-01 22:21:49 +00:00
Nick O'Leary
1efd1a52a7 Ensure modules containing plugins and nodes are loaded properly
Fixes #3523
2023-01-01 19:36:49 +00:00
Nick O'Leary
928131cf08 Merge pull request #3941 from node-red-hitachi/global-env-var
add global environment variable feature
2023-01-01 14:10:15 +00:00
Nick O'Leary
4d202a7a37 Merge pull request #3971 from node-red/fix-cred-on-global
Ensure credentials object is removed before returning node in getFlow request
2023-01-01 14:09:54 +00:00
Nick O'Leary
e0d71abdc6 Merge pull request #3992 from node-red/fix-mqtt-reconnect
Fix mqtt nodes not reconnecting on modified-flows deploy
2023-01-01 14:09:33 +00:00
Nick O'Leary
550eb6ee2f Merge pull request #3995 from bonanitech/radialMenu
Let themes change radialMenu text colors
2023-01-01 14:06:00 +00:00
Kazuhito Yokoi
a661bc1d23 Add Japanese translation for v3.1.0-beta.0 2022-12-31 00:41:35 +09:00
Mauricio Bonani
f737162697 Let themes change radialMenu text colors 2022-12-29 09:47:05 -05:00
Nick O'Leary
ce57ba80eb Fix mqtt nodes not reconnected on modified-flows deploy 2022-12-27 14:56:32 +00:00
Hiroyasu Nishiyama
99bd957ea0 Resolve merge conflict 2022-12-27 23:45:25 +09:00
Nick O'Leary
270eb56718 Merge pull request #3916 from kazuhitoyokoi/dev
Add Japanese translation for v3.1.0-beta.0
2022-12-27 14:16:02 +00:00
Nick O'Leary
b3ce0c0079 Merge pull request #3987 from kazuhitoyokoi/master-fixproject
Ignore commit error in project feature
2022-12-27 14:15:47 +00:00
Nick O'Leary
e6cee58e0d Merge pull request #3974 from Steve-Mcl/remember-export-format
Remember compact/pretty flow export user choice
2022-12-27 14:09:47 +00:00
Nick O'Leary
4adc6b269c Merge pull request #3980 from kazuhitoyokoi/master-fixpalette
Hide subflow category after deleting subflow
2022-12-27 13:47:58 +00:00
Nick O'Leary
920b0178ec Merge pull request #3981 from kazuhitoyokoi/master-fixtypo
Fix typo in 25-status.html
2022-12-27 13:43:35 +00:00
Nick O'Leary
3583b40e02 Merge pull request #3990 from node-red/csv-change-to-replaceAll
Csv change replace to replaceAll
2022-12-27 13:43:12 +00:00
Nick O'Leary
7870830367 Merge pull request #3991 from hardillb/http-request-form-array
Support form-data arrays
2022-12-27 13:42:33 +00:00
Ben Hardill
4c1d7ad2d2 Merge branch 'master' into http-request-form-array 2022-12-24 20:37:33 +00:00
Ben Hardill
661b07c856 Add tests 2022-12-24 20:35:51 +00:00
Ben Hardill
5670bd8265 Support form-data arrays 2022-12-24 19:32:33 +00:00
Dave Conway-Jones
93a1911232 CSV - Add note about msg.reset to info page
to close #3976
2022-12-19 21:26:20 +00:00
Dave Conway-Jones
2429191838 CSV - swap to regex replace for node14 support 2022-12-19 13:48:21 +00:00
Dave Conway-Jones
f6901cd19f CSV node replace replace with replaceAll just in case
mentioned in Issue #3989
2022-12-19 09:50:29 +00:00
Kazuhito Yokoi
156c3984a7 Ignore commit error in project feature 2022-12-12 01:23:00 +09:00
Kazuhito Yokoi
f91af2153a Fix typo in 25-status.html 2022-12-10 00:33:40 +09:00
Kazuhito Yokoi
805f8a5ee7 Hide subflow category after deleting subflow 2022-12-08 23:43:47 +09:00
Hiroyasu Nishiyama
2ab8121a4a add description to global-config settings 2022-12-06 21:12:52 +09:00
Hiroyasu Nishiyama
601a4ec70d Add hasUsers to global-config 2022-12-06 10:33:10 +09:00
Hiroyasu Nishiyama
707b831c30 Update packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 10:25:38 +09:00
Hiroyasu Nishiyama
72ae375e44 Update packages/node_modules/@node-red/nodes/core/common/91-global-config.html
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 10:25:25 +09:00
Hiroyasu Nishiyama
3c1ddb5c9d Update packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 09:32:04 +09:00
Hiroyasu Nishiyama
817db23146 Update packages/node_modules/@node-red/nodes/locales/en-US/messages.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 09:29:51 +09:00
Hiroyasu Nishiyama
a8c820f558 Update packages/node_modules/@node-red/nodes/locales/ja/messages.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 09:29:45 +09:00
Hiroyasu Nishiyama
6d09c81f11 Update packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 09:27:17 +09:00
Hiroyasu Nishiyama
192e537e5d Update packages/node_modules/@node-red/editor-client/locales/ja/editor.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-06 09:27:02 +09:00
Steve-Mcl
7b52ef34be Remember compact/pretty flow export user choice
closes #3849
2022-12-05 22:17:05 +00:00
Kazuhito Yokoi
7117472e73 Add Japanese translation for range node 2022-12-05 23:13:50 +09:00
Kazuhito Yokoi
c24b123917 Add Japanese translation for editor actions 2022-12-05 23:11:56 +09:00
Hiroyasu Nishiyama
9eb8cf121c Update Japanese message reflecting English message update 2022-12-05 11:29:37 +09:00
Hiroyasu Nishiyama
41ef9ae010 Update test/nodes/core/common/91-global-config_spec.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:17:29 +09:00
Hiroyasu Nishiyama
1674bbbde9 Update packages/node_modules/@node-red/nodes/locales/ja/messages.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:17:20 +09:00
Hiroyasu Nishiyama
0fb739f7cd Update packages/node_modules/@node-red/nodes/locales/ja/common/91-global-config.html
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:17:04 +09:00
Hiroyasu Nishiyama
169fa940e4 Update packages/node_modules/@node-red/nodes/locales/en-US/messages.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:16:53 +09:00
Hiroyasu Nishiyama
c9664cc425 Update packages/node_modules/@node-red/nodes/locales/en-US/common/91-global-config.html
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:16:35 +09:00
Hiroyasu Nishiyama
e61cdff655 Update packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:15:43 +09:00
Hiroyasu Nishiyama
a479b8a5d7 Update packages/node_modules/@node-red/nodes/core/common/91-global-config.html
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-12-05 11:15:32 +09:00
Kazuhito Yokoi
26462e684b Merge branch 'node-red:dev' into dev 2022-12-05 01:08:45 +09:00
Nick O'Leary
113d42ef35 Merge pull request #3970 from node-red/prevent-text-selection
Prevent dbl-click opening node edit dialog with text selected
2022-12-03 23:34:57 +00:00
Nick O'Leary
c18018f017 Ensure credentials object is removed before returning node in getFlow request
Fixes #3953
2022-12-03 23:33:33 +00:00
Nick O'Leary
e804addf0a Prevent dbl-click opening node edit dialog with text selected
Fixes #3958
2022-12-03 23:13:44 +00:00
Nick O'Leary
04cea003b9 Merge pull request #3938 from node-red/locking-flows
Locking flows
2022-12-03 23:01:58 +00:00
Nick O'Leary
65fcc56a56 Merge pull request #3968 from node-red/context-menu-updates
Context menu updates
2022-12-03 23:01:37 +00:00
Nick O'Leary
c065d253e9 Merge pull request #3969 from node-red/bump-deps
Update dependencies
2022-12-03 23:01:10 +00:00
Nick O'Leary
4bb2b91ee6 Merge pull request #3966 from Steve-Mcl/fix-mqtt-single-subscription
fix single subscription mqtt node status
2022-12-03 22:47:42 +00:00
Nick O'Leary
b3f761776d Update dependencies 2022-12-03 22:43:03 +00:00
Nick O'Leary
dce1cccbde Allow subflow to be edited if instance exists on locked flow 2022-12-03 22:30:35 +00:00
Nick O'Leary
3630056ed8 Fix RED.nodes.clear() when handling locked flows 2022-12-03 21:44:33 +00:00
Nick O'Leary
2d6e1d7089 NLS updates for context menu 2022-12-03 21:29:27 +00:00
Nick O'Leary
71db79ba53 More context menu options 2022-12-03 21:16:57 +00:00
Steve-Mcl
5bb66ed7d4 fix single subscription mqtt node status 2022-12-01 13:08:48 +00:00
Nick O'Leary
14e74afb07 Merge pull request #3909 from node-red/warn-invalid-msg
Add check that node sends object rather than primitive type
2022-11-30 22:28:09 +00:00
Nick O'Leary
c4e216f839 Merge pull request #3912 from node-red/handle_username_spaces
Ensure key_path is quoted in GIT_SSH_COMMAND in case of spaces in pathname
2022-11-30 22:18:24 +00:00
Nick O'Leary
752fdfedf2 Merge pull request #3935 from node-red/Add-drop-mode-to-range-node
Add drop mode to range node
2022-11-30 22:17:02 +00:00
Nick O'Leary
2a49e7c8ef Merge pull request #3908 from node-red/add-httpheaders
Ensure msg.req.headers is enumerable
2022-11-30 22:15:23 +00:00
Nick O'Leary
02af01d2ca Merge pull request #3867 from Steve-Mcl/improve-nodesdir-scan
Fix nodesDir scan when node package has js/html in sub dir to package.json
2022-11-30 22:15:00 +00:00
Nick O'Leary
07c05c1f2a Merge pull request #3930 from node-red/tab-context-menu
Improve UX around hiding flows via context menu
2022-11-30 22:13:54 +00:00
Nick O'Leary
ee4af4c7bf Merge pull request #3920 from node-red/CSV-header-props-with-quotes
CSV node check header properties for ' and "
2022-11-30 22:10:40 +00:00
Nick O'Leary
3d565e74a5 Merge pull request #3917 from kazuhitoyokoi/master-fixpermission
Fix file permissions
2022-11-30 22:10:03 +00:00
Nick O'Leary
3cb84222f8 Merge pull request #3921 from node-red/fix-group-unknown
Handle replacing unknown node inside group or subflow
2022-11-30 22:09:35 +00:00
Nick O'Leary
1b013bb73b Merge pull request #3949 from Steveorevo/master
Fix #3939, red border red-ui-typedInput-container
2022-11-30 22:07:04 +00:00
Nick O'Leary
fd54e625d5 Merge pull request #3965 from we11adam/master
fix: fix typo in catch.html
2022-11-30 21:40:34 +00:00
Adam Lau
77f6412d3b fix: fix typo in catch.html 2022-11-30 17:51:13 +08:00
Stephen J. Carnam
c81cd5450f Support for PHP syntax highlight 2022-11-09 16:45:32 -08:00
Steveorevo
0b663abe50 Fix #3939, red border red-ui-typedInput-container 2022-11-09 10:33:05 -08:00
Nick O'Leary
3b27fb2aa7 Merge branch 'dev' into dev 2022-11-07 23:16:14 +00:00
Nick O'Leary
6bd67ae68c Merge pull request #3944 from node-red-hitachi/fix-deploy-locked-flow
fix deployment of locked flow
2022-11-07 23:13:03 +00:00
Nick O'Leary
14c362d4ba Merge pull request #3942 from node-red-hitachi/fix-watch-test
fix watch node test on MacOS/ARM
2022-11-07 21:12:55 +00:00
Nick O'Leary
f28bc1bff7 Remove jshint warning 2022-11-07 21:11:58 +00:00
Nick O'Leary
de8a5ea262 Merge pull request #3945 from node-red-hitachi/fix-jshint-es-version
fix to allow es11 for jshint check
2022-11-07 21:10:26 +00:00
Nick O'Leary
339013434b Merge pull request #3946 from node-red-hitachi/i18n-item-url-copy-notification
i18n item URL copy notification & add Japanese message
2022-11-07 21:07:57 +00:00
Nick O'Leary
8a3ad331d2 Merge pull request #3947 from node-red-hitachi/add-item-url-Japanese-action-message
add Japanese message for item url copy actions
2022-11-07 21:07:38 +00:00
Hiroyasu Nishiyama
e3892dc26d add Japanese message for item url copy actions 2022-11-07 16:07:46 +09:00
Hiroyasu Nishiyama
b95df6d883 i18n item URL copy notification & add Japanese message 2022-11-07 15:47:19 +09:00
Hiroyasu Nishiyama
11ad03b21e fix to allow es11 for jshint check 2022-11-07 10:42:07 +09:00
Hiroyasu Nishiyama
9cb474ea9c fix deployment of locked flow 2022-11-07 09:40:36 +09:00
Hiroyasu Nishiyama
fce43b4e1d fix condition for platform check 2022-11-05 14:50:14 +09:00
Hiroyasu Nishiyama
1d547500e8 fix watch node test on MacOS/ARM 2022-11-05 14:30:32 +09:00
Hiroyasu Nishiyama
f23d0480e4 add global environment variable feature 2022-11-04 18:42:51 +09:00
Nick O'Leary
fe9c630572 Prevent deleting subflow if instance on locked tab 2022-11-01 11:42:40 +00:00
Nick O'Leary
ce94226c3c Disable subflow/flow menu options if active is locked 2022-11-01 11:29:23 +00:00
Nick O'Leary
f12d36b5ed Locking flows fixes and context menu options 2022-11-01 10:48:48 +00:00
Nick O'Leary
3cb5259494 Initial locking flows UX 2022-11-01 10:37:18 +00:00
Nick O'Leary
a351cd9d9f Add move-to-start/end and better subflow menu options 2022-11-01 10:35:57 +00:00
Nick O'Leary
d8e01584f3 Remove add-flow-to-right option if clicked in tab bar 2022-10-31 20:20:05 +00:00
Kazuhito Yokoi
dd76840568 Fix uncleared translations in change node 2022-11-01 01:09:06 +09:00
Dave Conway-Jones
94690fad7a Merge branch 'CSV-header-props-with-quotes' of https://github.com/node-red/node-red into CSV-header-props-with-quotes 2022-10-29 17:36:17 +01:00
Dave Conway-Jones
d693af9615 CSV node check header properties for ' and "
and add test
to close #3919
2022-10-29 17:35:45 +01:00
Dave Conway-Jones
4cc18c25fe Add drop mode to range node
and include tests
2022-10-29 17:34:29 +01:00
Kazuhito Yokoi
8b398f49c0 Merge branch 'node-red:master' into master-fixpermission 2022-10-29 23:51:05 +09:00
Nick O'Leary
902ce68164 Merge branch 'master' into fix-group-unknown 2022-10-26 00:52:34 +01:00
Nick O'Leary
cd0474ce7b Update packages/node_modules/@node-red/editor-client/src/js/nodes.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
2022-10-26 00:51:41 +01:00
Nick O'Leary
946def022f Merge pull request #3922 from node-red/fix-httpreq-tests
Fix httprequest tests to be more lenient on error message
2022-10-26 00:40:47 +01:00
Nick O'Leary
fb499be979 Add context menu to tab bar 2022-10-25 23:44:59 +01:00
Nick O'Leary
c62a101635 Fix httprequest tests to be more lenient on error message 2022-10-16 23:10:57 +01:00
Nick O'Leary
69a575097d Remove debug 2022-10-16 22:47:34 +01:00
Nick O'Leary
b40551a8fa Handle replacing unknown node inside group or subflow 2022-10-16 22:38:11 +01:00
Dave Conway-Jones
5b27bcd781 CSV node check header properties for ' and "
and add test
to close #3919
2022-10-16 18:05:21 +01:00
Kazuhito Yokoi
75725a38df Fix file permission 2022-10-12 23:50:33 +09:00
Kazuhito Yokoi
c4e277853c Add Japanese translation for button of node URL 2022-10-12 23:24:21 +09:00
Nick O'Leary
24b055b1b8 Ensure key_path is quoted in GIT_SSH_COMMAND in case of spaces in pathname 2022-10-04 15:44:29 +01:00
Nick O'Leary
7da3773f7f Merge pull request #3898 from node-red/delay-flush-reset
let delay node handle both flush then reset
2022-10-04 15:39:05 +01:00
Nick O'Leary
32999ffa84 Merge pull request #3906 from node-red/Fix-for-csv-undefined-property
Fix for CSV undefined property
2022-10-04 15:38:37 +01:00
Nick O'Leary
f06c53f1f1 Merge pull request #3905 from node-red/mqtt-followups
Fix birth topic handling in MQTT node
2022-10-04 15:36:49 +01:00
Nick O'Leary
a9eec28360 Merge pull request #3884 from node-red/fix-auto-complete
Fix autocomplete entry for responseUrl
2022-10-04 15:35:10 +01:00
Nick O'Leary
5cda972872 Merge pull request #3890 from kazuhitoyokoi/master-fixmqttproperty
Fix pull-down menus of MQTT configuration node
2022-10-04 15:34:50 +01:00
Nick O'Leary
087946876b Merge pull request #3907 from boahc077/github_actions_token_permission
ci: add minimum GitHub token permissions for workflows
2022-10-04 15:32:47 +01:00
Nick O'Leary
318f0f1b7e Merge pull request #3899 from node-red/fix-change-self-overwrite
Fix change node overwriting msg with itself
2022-10-04 15:29:23 +01:00
Stephen McLaughlin
6d1a12af4b remove debug/test code 2022-10-04 13:36:23 +01:00
Nick O'Leary
a40e5dbcd4 Add check that node sends object rather than primitive type
Fixes #3876
2022-10-04 11:49:49 +01:00
Nick O'Leary
7c79ca7878 Ensure msg.req.headers is enumerable
Fixes #3878
2022-10-04 11:28:26 +01:00
Nick O'Leary
93c1600980 Merge pull request #3886 from kazuhitoyokoi/master2
Limit number of ports in function node
2022-10-04 11:00:18 +01:00
Nick O'Leary
c3d1e6181f Merge pull request #3894 from hardillb/http-response-status-number
Ensure statusCode is a number
2022-10-04 10:28:04 +01:00
Ashish Kurmi
87e7f3a61c ci: add minimum GitHub token permissions for workflows
Signed-off-by: Ashish Kurmi <akurmi@stepsecurity.io>
2022-10-02 11:16:13 -07:00
Dave Conway-Jones
e724f216bf Fix for CSV undefined property
to close #3900 main issue
and add tests
(other fix is commented out but no tests)
2022-09-30 13:48:48 +01:00
Steve-Mcl
e6b379358a better logging of set with no types 2022-09-29 21:28:13 +01:00
Steve-Mcl
b0abba15a6 remove dud code instead of commenting 2022-09-29 19:08:46 +01:00
Steve-Mcl
81b4874a7c fix new test and fix bug found in previous PR 2022-09-29 19:05:53 +01:00
Steve-Mcl
f11b9c1e18 add test bad birth topic
part of #3865
2022-09-29 13:12:15 +01:00
Steve-Mcl
e15ecc00ce remove old unused code (5y+ not used) 2022-09-29 13:11:25 +01:00
Dave Conway-Jones
3e4c45ac6a Fix change node overwriting msg with itself
and add test
to close #3891
2022-09-22 20:22:11 +01:00
Dave Conway-Jones
fc657ecc71 let delay node handle both flush then reset
and add tests
2022-09-22 10:51:48 +01:00
Ben Hardill
4115c13a65 Ensure statusCode is a number
Fixes #3893

Used parseInt instead of the suggested fix so that we don't end up
with statusCode = 200.5
2022-09-19 19:43:06 +01:00
Kazuhito Yokoi
f872e2ab80 Add icon to typedInput in MQTT node 2022-09-18 19:11:33 +09:00
Kazuhito Yokoi
a81b1aa0cb Support i18n in MQTT node property 2022-09-18 17:10:19 +09:00
Kazuhito Yokoi
efc0f1ab91 Fix default values for MQTT retain settings 2022-09-18 16:24:25 +09:00
Kazuhito Yokoi
ce31edc803 Fix handling of max and min values in function outputs 2022-09-18 02:22:52 +09:00
Kazuhito Yokoi
199caccbc3 Change the maximum number of ports to 500 2022-09-17 00:25:46 +09:00
Nick O'Leary
313bab37e2 Merge pull request #3870 from node-red/uri-fragments
Support uri fragments for nodes and groups including edit support
2022-09-15 21:25:50 +01:00
Nick O'Leary
f060309002 Merge pull request #3872 from node-red-hitachi/fix-Japanese-editor-message-for-JSONata
Fix Japanese translation for JSONata editor
2022-09-15 21:25:30 +01:00
Nick O'Leary
fc3d86e6ff Merge pull request #3882 from kazuhitoyokoi/master-addenvinfo2template
Add information about environment variable to template node
2022-09-15 21:24:32 +01:00
Nick O'Leary
9fd4989142 Fix autocomplete entry for responseUrl
Fixes #3883
2022-09-15 21:22:55 +01:00
Kazuhito Yokoi
7507a7b459 Limit number of ports in function node 2022-09-16 02:10:14 +09:00
Kazuhito Yokoi
d657817211 Add information about environment variable to template node 2022-09-13 22:08:22 +09:00
Hiroyasu Nishiyama
954649007c merge master 2022-09-13 10:52:48 +09:00
Nick O'Leary
0caa308757 Add core:copy-item-link action and expose in info sidebar 2022-09-12 20:53:46 +01:00
Nick O'Leary
b0d9903fe2 Merge pull request #3873 from node-red-hitachi/fix-describe-arg
Remove done from describe
2022-09-12 19:29:14 +01:00
Nick O'Leary
6375f3c445 Merge pull request #3841 from Steve-Mcl/fix-search-type-with-spaces
Fix search type with spaces
2022-09-12 19:27:09 +01:00
Nick O'Leary
2328f418be Merge pull request #3871 from node-red-hitachi/fix-extended-function-error-handling-of-jsonata-editor
Fix error hanndling of JSONata expression editor for extended functions
2022-09-12 19:26:15 +01:00
Nick O'Leary
22b6564847 Merge pull request #3880 from kazuhitoyokoi/master-replacedot4function
Remove dot from variable name for external module in function node
2022-09-12 19:25:39 +01:00
Nick O'Leary
25c8bfefe2 Merge pull request #3868 from Steve-Mcl/func-types-monaco-util-promisify
add function node monaco types util and promisify
2022-09-12 19:25:07 +01:00
Nick O'Leary
30f4524821 Merge pull request #3866 from kazuhitoyokoi/master-fixbutton4addsshkey
Add button type to the adding SSH key button
2022-09-12 19:18:49 +01:00
Nick O'Leary
9e4c3a7200 Merge pull request #3879 from kazuhitoyokoi/master-fixradiobutton4project
Check radio button as default in project dialog
2022-09-12 19:18:15 +01:00
Nick O'Leary
5b7e84c1b0 Merge pull request #3869 from Steve-Mcl/fix-mqtt-birth-bad-topic-crash
Prevent invalid mqtt birth topic crashing node-red
2022-09-12 19:17:43 +01:00
Nick O'Leary
e6097e4968 Merge pull request #3874 from node-red-hitachi/support-clone-in-monaco
Add $clone as supported function
2022-09-12 19:16:18 +01:00
Kazuhito Yokoi
0f2829097b Remove dot from variable name for external module in function node 2022-09-10 12:17:18 +09:00
Kazuhito Yokoi
e2a9f940e2 Check radio button as default in project dialog 2022-09-09 01:05:53 +09:00
Hiroyasu Nishiyama
3eb2b2ac5d add $clone as supported function 2022-09-06 18:52:13 +09:00
Hiroyasu Nishiyama
ce7b0a3b5e remove done from describe 2022-09-06 18:05:50 +09:00
Hiroyasu Nishiyama
7bd7c99dd4 Fix Japanese translation for JSONata editor 2022-09-06 16:53:38 +09:00
Hiroyasu Nishiyama
b0d12c4125 Fix error hanndling of JSONata expression editor for extennded functions 2022-09-06 15:38:49 +09:00
Nick O'Leary
1fa8f30550 Support uri fragments for nodes and groups including edit support 2022-09-05 21:08:36 +01:00
Kazuhito Yokoi
745607b5bc Add button type to buttons on node properties 2022-09-04 23:21:34 +09:00
Kazuhito Yokoi
cc5a770b16 Add button type to buttons on projects dialog 2022-09-04 21:58:02 +09:00
Steve-Mcl
fbde0091de fix node-red crash with invalid mqtt birth topic
fixes #3865
2022-09-04 11:08:41 +01:00
Steve-Mcl
a533943a40 add function node monaco types util and promisify
fixes #3851
2022-09-04 01:50:54 +01:00
Stephen McLaughlin
e11f17672c Update packages/node_modules/@node-red/editor-client/src/js/ui/palette.js 2022-09-03 22:01:54 +01:00
Stephen McLaughlin
c038c99f9d Update packages/node_modules/@node-red/editor-client/src/js/ui/search.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-09-03 21:54:41 +01:00
Stephen McLaughlin
5f159c1fbd Update packages/node_modules/@node-red/editor-client/src/js/ui/search.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-09-03 21:54:21 +01:00
Steve-Mcl
6a19d8246c add test for specific arrangement of node package 2022-09-03 21:37:27 +01:00
Steve-Mcl
d6bb3a558f fix loading node package in nodesDir on linux
fixes #3861
2022-09-03 21:23:38 +01:00
Kazuhito Yokoi
cd8ca8981b Add button type to the adding SSH key button 2022-09-03 21:03:08 +09:00
Nick O'Leary
44300dbb34 Merge pull request #3807 from node-red-hitachi/env-var-jsonata
Env var jsonata
2022-09-02 20:47:30 +01:00
Nick O'Leary
a5d7f7acce Merge pull request #3842 from hardillb/fix-broken-headers-tests
Add missing property to node object HTTPRequest
2022-09-02 20:46:22 +01:00
Nick O'Leary
a032c2e326 Merge pull request #3840 from Steve-Mcl/fix-mqtt-session-time
ensure sessionExpiry(Interval) is applied
2022-09-02 20:45:41 +01:00
Nick O'Leary
9d770ed436 Merge pull request #3857 from kazuhitoyokoi/master-fixeditablelist4httprequest
Support sortable list on property UI of http request and http response nodes
2022-09-02 20:45:08 +01:00
Nick O'Leary
ae753940f3 Merge pull request #3852 from kazuhitoyokoi/master-addjpn
Add Japanese translation for v3.0.2
2022-09-02 20:44:45 +01:00
Kazuhito Yokoi
d0d22c333c Add Japanese translation for v3.0.2 2022-08-28 02:04:13 +09:00
Kazuhito Yokoi
266ba17ebb Use sortable list in http response node and proxy setting 2022-08-18 11:52:56 +09:00
Kazuhito Yokoi
0d0d5bafb0 Make pre-defined header list sortable in http request node 2022-08-18 01:29:07 +09:00
Ben Hardill
58b951e134 Make port number dynamic in test 2022-08-14 15:09:48 +01:00
Ben Hardill
30956b5441 Add missing property to node object HTTPRequest
Also add tests for broken headers
2022-08-14 15:02:39 +01:00
Steve-Mcl
9540cfe749 fix flags search without val 2022-08-13 18:09:11 +01:00
Steve-Mcl
31b17faa2a fix MQTT test fail due to birth sent before connection done 2022-08-12 18:23:07 +01:00
Steve-Mcl
5c6b8e9e50 opportunistic tidy up MQTT tests 2022-08-12 18:21:36 +01:00
Steve-Mcl
5a36e8fb11 add tests for MQTT v5 (sessionExpiry property) 2022-08-12 18:20:11 +01:00
Steve-Mcl
7d4c857a43 ensure sessionExpiry(Interval) is applied 2022-08-12 15:47:15 +01:00
Steve-Mcl
598bcf675f fix searching by type when type name has a space 2022-08-12 15:45:12 +01:00
Nick O'Leary
5365786386 Merge pull request #3830 from node-red/release-302
Bump for 3.0.2
2022-08-04 14:13:26 +01:00
Nick O'Leary
c9b0a7c2dd Bump for 3.0.2 2022-08-04 13:50:31 +01:00
Nick O'Leary
371d8042d6 Merge pull request #3776 from hardillb/relaxed-http-req-headers
Allow HTTP Headers not in spec
2022-08-04 13:36:24 +01:00
Nick O'Leary
be343cb21e Merge pull request #3812 from bonanitech/workspace-chart-bottom
Fix workspace chart bottom property
2022-08-04 13:12:21 +01:00
Nick O'Leary
e9eabd6881 Merge pull request #3802 from Dennis14e/patch-de-2
Update german translation
2022-08-04 13:10:52 +01:00
Nick O'Leary
abccdc7f21 Update packages/node_modules/@node-red/nodes/locales/en-US/messages.json 2022-08-04 13:10:05 +01:00
Nick O'Leary
4ae914f729 Merge pull request #3801 from kazuhitoyokoi/master-subflowcolor
Support color reset to the default in subflow and group
2022-08-04 13:02:04 +01:00
Nick O'Leary
86ac955b79 Merge pull request #3817 from node-red/fix-regex-name-handle
Allow generateNodeNames to handle names containing regex control chars
2022-08-04 12:58:06 +01:00
Nick O'Leary
9734691cac Merge pull request #3808 from bonanitech/overflow-auto
Hide scrollbars until they're needed
2022-08-04 12:57:53 +01:00
Nick O'Leary
d94f3a477d Merge pull request #3818 from node-red/fix-subflow-module-node-lookup
Register subflow module instance node with parent flow
2022-08-04 12:57:21 +01:00
Nick O'Leary
d53cd209f7 Merge pull request #3816 from node-red/import-junction-fix
Include junctions/groups when exporting subflows plus related fixes
2022-08-04 12:57:06 +01:00
Nick O'Leary
65cacb39d2 Merge pull request #3820 from node-red/remove-console-log-subflow-js
remove console.log
2022-08-04 12:56:48 +01:00
Stephen McLaughlin
b008a6a2aa remove console.log
fixes #3819
2022-08-04 11:05:27 +01:00
Nick O'Leary
5c29feec63 Register subflow module instance node with parent flow
Fixes #3798
2022-08-02 00:05:21 +01:00
Nick O'Leary
d8e350d603 Allow generateNodeNames to handle names containing regex control characters
Fixes #3813
2022-08-01 21:05:52 +01:00
Nick O'Leary
14a3366850 Include junctins/groups when exporting subflows plus related fixes
Fixes #3805
2022-08-01 20:54:05 +01:00
Mauricio Bonani
5ea0c6fca1 Fix workspace chart bottom property 2022-07-29 09:49:59 -04:00
Mauricio Bonani
f454c29b8c Hide scrollbars until they're needed 2022-07-28 10:56:38 -04:00
Hiroyasu Nishiyama
1ddbeaa50f add test cases 2022-07-27 20:25:43 +09:00
Dennis Neufeld
fe5132be1d Update german translation 2 2022-07-24 16:31:01 +02:00
Dennis Neufeld
b50ba3e0e4 Update german translation 2022-07-23 18:53:39 +02:00
Kazuhito Yokoi
4fb40f9077 Support color reset to the default in subflow 2022-07-23 21:39:07 +09:00
Nick O'Leary
dc7fef6395 Merge pull request #3797 from node-red/301
Update changelog and bump for 3.0.1
2022-07-22 10:27:46 +01:00
Nick O'Leary
da65bf7292 Update changelog and bump for 3.0.1 2022-07-22 09:50:37 +01:00
Nick O'Leary
17d9c2577e Merge pull request #3794 from Steve-Mcl/fix-code-editor-theme-from-theme
Allow codeEditor theme to be set even if `codeEditor` is not set in settings.js
2022-07-21 16:27:41 +01:00
Steve-Mcl
bc7852c1cc Allow codeEditor theme to be set missing from settings.js 2022-07-21 14:44:29 +01:00
Nick O'Leary
51d8792f62 Merge pull request #3793 from Steve-Mcl/sys-info-amendments
Sys info (diagnostics report) amendments
2022-07-21 11:39:50 +01:00
Nick O'Leary
bfdbeb0964 Merge pull request #3791 from Steve-Mcl/allow-editor-create-no-title-no-mode
Allow `mode` and `title` to be omitted in `options` argument for `createEditor`
2022-07-21 11:39:02 +01:00
Nick O'Leary
ede82ad0d5 Merge pull request #3789 from Steve-Mcl/fix-focus-issues
Fix focus issues
2022-07-21 11:38:38 +01:00
Nick O'Leary
f50dcb9e40 Merge pull request #3788 from node-red/fix-typedinput-submit
Ensure all typedInput buttons have button type set
2022-07-21 11:37:52 +01:00
Nick O'Leary
676c5e5df5 Merge pull request #3787 from node-red/fix-search-unused
Do not flag hasUsers=false nodes as unused in search
2022-07-21 11:37:39 +01:00
Nick O'Leary
d52be76c8a Merge pull request #3786 from node-red/fix-quick-add-pos
Properly position quick-add dialog in all cases
2022-07-21 11:37:26 +01:00
Nick O'Leary
c6a517c88c Merge pull request #3785 from node-red/ts-pos
Ensure quick-add dialog does not obscure ghost node when shifted
2022-07-21 11:37:10 +01:00
Nick O'Leary
96eb8719b8 Merge pull request #3784 from node-red/remove-hasown
Remove use of Object.hasOwn
2022-07-21 11:36:56 +01:00
Steve-Mcl
bcd31610f6 update tests for sys info diagnostics ammendments 2022-07-21 10:07:40 +01:00
Steve-Mcl
a4d66622a5 add a handful of missing settings to basic report 2022-07-21 09:30:49 +01:00
Steve-Mcl
af4f07cb26 include flows stop/start state 2022-07-21 09:29:51 +01:00
Steve-Mcl
f7120b32f5 Allow mode and title to be empty
fixes #3774
2022-07-20 13:58:03 +01:00
Steve-Mcl
273404e24d focus search input when opened via context menu 2022-07-20 12:30:52 +01:00
Steve-Mcl
1b53b5b927 focus stack when re-showing nested editor 2022-07-20 12:30:15 +01:00
Steve-Mcl
7c5413e568 ensure red-ui-editor-stack is focusable 2022-07-20 12:29:16 +01:00
Nick O'Leary
39b2fe45a5 Ensure all typedInput buttons have button type set
Fixes #3780

Otherwise they act as type="submit" and the browser will click on them
when enter is pressed in an input
2022-07-20 11:11:44 +01:00
Nick O'Leary
8d3c5d09f6 Do not flag hasUsers=false nodes as unused in search
Fixes #3777
2022-07-20 10:47:57 +01:00
Nick O'Leary
5944fdb5dc Properly position quick-add dialog in all cases
Fixes #3781
2022-07-20 10:40:20 +01:00
Nick O'Leary
e120bad779 Ensure quick-add dialog does not obscure ghost node when shifted 2022-07-20 10:37:40 +01:00
Nick O'Leary
d546a4a15b Remove use of Object.hasOwn
Fixes #3778
2022-07-20 10:14:06 +01:00
Hiroyasu Nishiyama
93a88a83a8 add JSONata support for env var definition 2022-07-20 10:13:13 +09:00
Ben Hardill
660a2e0ed6 Allow HTTP Headers not in spec
potential fix for #3772
2022-07-16 19:51:35 +01:00
Nick O'Leary
30ea300f65 Merge pull request #3769 from node-red/310
Bump dev to 3.1.0-beta.0
2022-07-14 21:16:38 +01:00
Nick O'Leary
04f4d5274d Bump dev to 3.1.0-beta.0 2022-07-14 20:58:25 +01:00
Nick O'Leary
1f9695abd7 Merge pull request #3768 from node-red/master
Get `dev` branch up to date with `master`
2022-07-14 20:56:42 +01:00
Nick O'Leary
1b94cc3ac0 Merge pull request #3764 from node-red/300
Node-RED 3.0 release
2022-07-14 09:49:05 +01:00
Nick O'Leary
4698d5d2fc Update dependencies 2022-07-14 09:31:10 +01:00
Nick O'Leary
92bc9d81c5 Update changelog 2022-07-14 09:27:57 +01:00
Nick O'Leary
952cfaec14 Merge pull request #3766 from Steve-Mcl/fix-split-with
Fix "split with" on virtual links
2022-07-14 09:26:05 +01:00
Nick O'Leary
637c44aa59 Merge pull request #3767 from Steve-Mcl/use-theme-page-and-header-values
Use theme page and header values if settings.js values are not present
2022-07-14 09:20:44 +01:00
Steve-Mcl
6e5fc29dca show add junction when nodes are selected 2022-07-13 22:34:22 +01:00
Steve-Mcl
8bd02d0c36 update header url if set in theme and not settings 2022-07-13 20:36:27 +01:00
Steve-Mcl
c6cfbb8755 use page&theme settings in a theme plugin 2022-07-13 20:16:34 +01:00
Steve-Mcl
75d3444391 Ensure added junc(s) are selected
Feature parity with insert node, insert links etc
2022-07-13 12:43:58 +01:00
Steve-Mcl
c648e1e8d6 fix context menu insert junc/links enabled state 2022-07-13 12:42:55 +01:00
Steve-Mcl
e2f42fddb5 Ensire only wire links are split with junctions/links 2022-07-13 12:19:05 +01:00
Nick O'Leary
f93fe684c0 Update changelog 2022-07-12 21:26:16 +01:00
Nick O'Leary
ee378ea0c4 Update version to 3.0 2022-07-12 21:18:49 +01:00
Nick O'Leary
613d34e6e6 Update tourGuide for 3.0 2022-07-12 21:12:31 +01:00
Nick O'Leary
4c784af55d Update dependencies 2022-07-12 21:12:00 +01:00
Nick O'Leary
b28595c814 Merge pull request #3759 from kazuhitoyokoi/master-fixundo
Focus editor for undo after some actions in menu
2022-07-12 13:18:55 +01:00
Nick O'Leary
fca7beec01 Merge pull request #3763 from node-red/pr_3756
Ensure node icon shade has properly rounded corners
2022-07-12 13:18:22 +01:00
Stephen McLaughlin
f813f03a46 Merge pull request #3762 from node-red/sf-creds-fix
Fix storing subflow credential type when input has multiple types
2022-07-12 10:21:20 +01:00
Nick O'Leary
6ff2232df3 Ensure node icon shade has properly rounded corners 2022-07-12 09:27:45 +01:00
Nick O'Leary
e3b1f058cd Merge pull request #3752 from Steve-Mcl/fix-global-path-popover
Ensure global-config and flow-config have info in the hierarchy popover
2022-07-11 20:28:58 +01:00
Nick O'Leary
542e9cacc2 Merge pull request #3751 from Steve-Mcl/fix-linkcall-registry
Fix linkcall registry bugs
2022-07-11 20:27:08 +01:00
Nick O'Leary
0a0a7ca39b Fix storing subflow credential type when input has multiple types
Fixes #3749
2022-07-11 20:19:48 +01:00
Kazuhito Yokoi
cee287da99 Focus editor for undo after some actions in menu 2022-07-12 02:09:20 +09:00
Stephen McLaughlin
c8e4df94f9 Merge pull request #3754 from braincube-io/fix-change-context
Fix change node, not handling from field properly when using context
2022-07-11 17:26:30 +01:00
Kazuhito Yokoi
c86e4f52a0 Fix shade for node icon to be rounded rectangle 2022-07-12 00:10:51 +09:00
Steve-Mcl
44216310ca Ensure global/config and flow/config have info
fixes #3750
2022-07-11 13:09:49 +01:00
Steve-Mcl
5c69599e78 Apply linting suggestions to the registry enclosure 2022-07-11 10:28:31 +01:00
Steve-Mcl
e4098d3991 fix undecalred variable access 2022-07-11 10:28:17 +01:00
Steve-Mcl
55a94d659b fix const reassignment 2022-07-11 10:27:30 +01:00
Franck Mourre
7a048d5b32 Fix change node, not handling from field properly when using context 2022-07-11 10:51:31 +02:00
Nick O'Leary
e14dd06a94 Merge pull request #3748 from Steve-Mcl/fix-add-junc-undo
include dirty state in history event
2022-07-08 17:07:27 +01:00
Nick O'Leary
62332a2b56 Merge pull request #3746 from node-red/pr_3744
Fix display direction of context sub-menu
2022-07-08 17:07:03 +01:00
Steve-Mcl
639030924f include dirty state in history event 2022-07-08 14:09:54 +01:00
Nick O'Leary
241b47fe19 Merge branch 'master' into pr_3744 2022-07-08 13:08:26 +01:00
Nick O'Leary
69beecf334 Fix menu padding for pull-left submenus 2022-07-08 13:06:05 +01:00
Nick O'Leary
e308e02f9d Merge pull request #3745 from node-red-hitachi/fix-debug-path-menu
Fix clear pinned paths of debug sidebar menu
2022-07-08 08:53:24 +01:00
Nick O'Leary
87258e485a Merge pull request #3742 from Steve-Mcl/fix-tooltip-exception
prevent exception generating tooltip for deleted nodes
2022-07-08 08:23:56 +01:00
Nick O'Leary
0682c346ea Merge pull request #3741 from Steve-Mcl/fix-context-menu
Fix context menu issues ready for v3 beta.5
2022-07-08 08:23:02 +01:00
Hiroyasu Nishiyama
5ae566952b do not show clear pinned if not available 2022-07-08 13:10:21 +09:00
Hiroyasu Nishiyama
18f9ab0cda make left sub-menu caret fit within context menu 2022-07-07 20:23:27 +09:00
Hiroyasu Nishiyama
bd4a5ac844 fixed menu width and window width 2022-07-07 19:39:28 +09:00
Hiroyasu Nishiyama
257b1f89f3 fix display direction of context sub-menu 2022-07-07 16:49:13 +09:00
Steve-Mcl
962672564e prevent exception generating tooltip for deleted nodes 2022-07-06 15:17:58 +01:00
Steve-Mcl
7216c6d62a code linting and remove excessive new lines 2022-07-06 13:08:56 +01:00
Steve-Mcl
21d3261eec Allow editor events to close context menu 2022-07-06 13:05:57 +01:00
Steve-Mcl
03f758720c Allow escape key to close context menu 2022-07-06 13:05:18 +01:00
Steve-Mcl
eaa85ae8d5 Fix insert=>link nodes enable/disable state 2022-07-06 12:54:22 +01:00
Stephen McLaughlin
8cb212d897 Merge pull request #3729 from node-red/cut-vs-copy
Do not generate new node-ids when pasting a cut flow
2022-07-06 10:36:14 +01:00
Stephen McLaughlin
a38d3981df Merge pull request #3731 from node-red-hitachi/fix-node-move
Fix to prevent node from moving out of workspace
2022-07-06 10:35:54 +01:00
Stephen McLaughlin
af08c077d2 Merge pull request #3736 from bonanitech/disabled-config-node-background
Don't let themes change disabled config node background color
2022-07-06 10:34:20 +01:00
Stephen McLaughlin
84e2489585 Merge pull request #3737 from bonanitech/pr3692-leftovers
Move colors left behind in #3692 to CSS variables
2022-07-06 10:33:59 +01:00
Mauricio Bonani
744375bd5d Don't let themes change config node label colors 2022-07-05 07:33:31 -04:00
Hiroyasu Nishiyama
6c1f63bfbb introduce RED.view.dimensions for workspace dimensions 2022-07-05 09:02:21 +09:00
Mauricio Bonani
7d0267c924 Move colors left behind in #3692 to CSS variables 2022-07-04 18:38:45 -04:00
Mauricio Bonani
daa9cb65e5 Change disabled config node background color variable 2022-07-04 17:17:40 -04:00
Nick O'Leary
7072265225 Merge pull request #3734 from node-red-hitachi/fix-close-websocket
Fix close timeout of websocket node
2022-07-04 21:02:20 +01:00
Nick O'Leary
8daade0021 Merge pull request #3733 from node-red-hitachi/fix-debug-message-handling
fix handling of global debug message
2022-07-04 21:01:35 +01:00
Nick O'Leary
b4d30b462f Merge pull request #3730 from ralphwetzel/master
Fix label overflow @ config-node palette
2022-07-04 20:52:04 +01:00
Nick O'Leary
18acd67b4f Merge pull request #3728 from node-red/fix-credential-clear
Do not remove unknown credentials of Subflow Modules
2022-07-04 20:47:04 +01:00
Nick O'Leary
78ed53f4fb Ensure a second paste of cut nodes is treated as a copy-paste 2022-07-04 20:46:21 +01:00
Nick O'Leary
d95314c754 Update packages/node_modules/@node-red/runtime/lib/nodes/credentials.js 2022-07-04 20:21:25 +01:00
Hiroyasu Nishiyama
277cc19ec3 call done after close handler 2022-07-04 11:23:47 +09:00
Hiroyasu Nishiyama
67f4553213 fix handling of global debug message 2022-07-04 10:45:20 +09:00
Nick O'Leary
b2bb656d30 Merge pull request #3732 from node-red/fix-monaco-default
Fix defaulting to monaco if settings does not contain codeEditor
2022-07-03 20:55:16 +01:00
Nick O'Leary
ca20f41d0e Update theme tests to ensure monaco is loaded 2022-07-03 20:37:55 +01:00
Nick O'Leary
13e8aeae4e Fix defaulting to monaco if settings does not contain codeEditor 2022-07-03 20:22:19 +01:00
Hiroyasu Nishiyama
02308f9e2f prevennt node from moving out of workspace 2022-07-03 20:39:54 +09:00
ralphwetzel
0fdcbb4611 Fix label overflow @ config-node palette 2022-07-02 09:52:14 +02:00
Nick O'Leary
829ccc3466 Do not generate new node-ids when pasting a cut flow
Fixes #3629
2022-07-01 17:48:14 +01:00
Nick O'Leary
9ac83cf62e Do not remove unknown credentials of Subflow Modules
Fixes #3641
2022-07-01 17:34:16 +01:00
Nick O'Leary
f760354e82 Merge pull request #3700 from ralphwetzel/master
Disable keyboard shortcut mapping when showing Edit[..]Dialog
2022-07-01 12:23:49 +01:00
Nick O'Leary
e91e35d508 Merge pull request #3721 from node-red/update-changlog
Add missing entries from beta.4 changelog
2022-07-01 12:22:09 +01:00
Nick O'Leary
db7e196bf8 Merge pull request #3727 from node-red/rh-click-link-actions
Update add-junction menu to work in more cases
2022-07-01 12:22:00 +01:00
Nick O'Leary
f5fe4f99f1 Merge pull request #3723 from Steve-Mcl/fix-import
Ensure importMap is not null when using import UI
2022-07-01 12:21:37 +01:00
Nick O'Leary
e2bff36395 Merge pull request #3724 from kazuhitoyokoi/master-addjpn
Add Japanese translations for v3.0-beta.4
2022-07-01 10:40:26 +01:00
Nick O'Leary
0a5d7c2100 Update add-junction menu to work in more cases 2022-07-01 10:31:50 +01:00
ralphwetzel
4d42f8ec58 Global variable definition in for loop: Fixed 2022-06-30 22:08:58 +02:00
ralphwetzel
81e7b052da Merge branch 'master' of https://github.com/ralphwetzel/node-red 2022-06-30 21:55:25 +02:00
ralphwetzel
be44b7e2c7 Merge branch 'node-red:master' into master 2022-06-30 21:54:18 +02:00
ralphwetzel
d8a781632c Re-order shortcut keymap 2022-06-30 21:52:52 +02:00
ralphwetzel
3726d6fe3b Finetune keyboard shortcut management 2022-06-30 21:52:16 +02:00
ralphwetzel
6090a5b274 Revert disable/enable logic proposed before 2022-06-30 21:51:51 +02:00
Kazuhito Yokoi
d4fdf6be67 Add Japanese translations for v3.0-beta.4 2022-07-01 01:09:06 +09:00
Steve-Mcl
1b6cbe5c23 Ensure importMap is not null when using import UI
fixes #3722
2022-06-30 15:17:49 +01:00
Nick O'Leary
1d130a7857 Add missing entries from beta.4 changelog 2022-06-30 10:14:51 +01:00
Nick O'Leary
f041159aa7 Merge pull request #3720 from node-red/300-b4
Update for 3 beta 4
2022-06-30 09:40:56 +01:00
Nick O'Leary
f438cbf633 Update for 3 beta 4 2022-06-29 21:04:28 +01:00
Nick O'Leary
51684d18cf Merge pull request #3719 from node-red/pr_3642
Allow flows to be stopped and started manually
2022-06-29 20:54:45 +01:00
Nick O'Leary
c13d2ac044 Merge pull request #3692 from bonanitech/use-css-variables
Move all colours to CSS variables
2022-06-29 20:54:25 +01:00
Nick O'Leary
6dd1adda2e Merge pull request #3703 from node-red-hitachi/fix-subflow-credential-input
Fix credential type input item of subflow template
2022-06-29 20:24:24 +01:00
Nick O'Leary
5d0d7391e7 Merge pull request #3709 from node-red/Fix-delay-rate-limit-timing-when-empty
Fix delay rate limit last timing when empty
2022-06-29 20:23:33 +01:00
Nick O'Leary
d37da58e87 Merge pull request #3718 from Steve-Mcl/fix-async-node-type-reg
Add option flag `reimport` to `importNodes`
2022-06-29 20:22:48 +01:00
Nick O'Leary
1839c1972e Update packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
2022-06-29 20:21:27 +01:00
Stephen McLaughlin
b7bdcc4e57 Update packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
Remove unused i18n entries (these are safe to remove - were added in the original PR)
2022-06-29 18:37:53 +01:00
Nick O'Leary
b59a3b15f3 Fix flow unit tests 2022-06-29 11:41:19 +01:00
Nick O'Leary
7580f7491a Update flow state tests to match changes in api 2022-06-29 10:45:06 +01:00
Nick O'Leary
f33848e16b Rework start/stop api to use runtime-event notification message 2022-06-29 10:27:44 +01:00
Mauricio Bonani
9b4d3ad6bf Merge branch 'master' into use-css-variables 2022-06-28 16:25:40 -04:00
Mauricio Bonani
7b06d4273a Use the correct variable for alpha values 2022-06-28 16:22:31 -04:00
Nick O'Leary
95f7ea9fc0 Merge pull request #3691 from Dennis14e/patch-1-de
Update german translation
2022-06-28 20:56:50 +01:00
Nick O'Leary
12b64d1906 Merge pull request #3695 from node-red/fix-dynamic-link-call
Ensure link-call cache is updated when link-in is modified
2022-06-28 20:56:33 +01:00
Nick O'Leary
52db4b3321 Merge pull request #3716 from node-red/CSV-fix-n-handling-inside-text-fields
Fix CSV node to handle \n when outputting text fields
2022-06-28 20:55:29 +01:00
Nick O'Leary
388c1b4ce4 Merge pull request #3717 from node-red/tour-help
List welcome tours in help sidebar
2022-06-28 20:54:44 +01:00
Nick O'Leary
b134cdb90d Merge pull request #3715 from node-red/fix-hide-flows-count
Ensure 'hidden flow' count doesn't include subflows
2022-06-28 20:54:29 +01:00
Steve-Mcl
c120dffbf0 Add option flag reimport to importNodes
fixes #3699
2022-06-28 16:22:24 +01:00
Hiroyasu Nishiyama
3578f1b254 remove line break to prevent jshint error 2022-06-28 20:35:39 +09:00
Nick O'Leary
a7e3548f22 List welcome tours in help sidebar under node-red section 2022-06-28 11:54:51 +01:00
Nick O'Leary
272e5380c2 Merge pull request #3706 from hotlong/patch-1
fix chinese translate: 登陆 -> 登录
2022-06-28 11:46:05 +01:00
Dave Conway-Jones
b60fd36c6e Fix CSV node to handle \n when outputting text fields
and add tests
2022-06-28 10:14:12 +01:00
Dennis Neufeld
5301798654 Update german translation based on PR review 2022-06-28 08:06:16 +02:00
Hiroyasu Nishiyama
f7e6d7d143 fix type selector of subflow environment variable 2022-06-28 09:16:30 +09:00
Mauricio Bonani
b9649aed32 Fix typo 2022-06-27 16:59:56 -04:00
Nick O'Leary
4467c0df31 Merge pull request #3714 from kazuhitoyokoi/master-fixdefaulticonbutton
Fix use default button for node icon
2022-06-27 20:36:05 +01:00
Nick O'Leary
7af3acde9e Ensure 'hidden flow' count doesn't include subflows
Fixes #3707
2022-06-27 20:30:14 +01:00
Stephen McLaughlin
68c1e49f62 Delete view_copy.js
Remove file that slipped through the net
2022-06-27 18:12:45 +01:00
Steve-Mcl
1e57190b8c Merge remote-tracking branch 'upstream/master' into stop-start-flows 2022-06-27 18:07:49 +01:00
Steve-Mcl
1b8a4577d5 improve UI, i18n and layout of stop/start feature 2022-06-27 18:07:22 +01:00
Steve-Mcl
51baed4932 default stop/start feature to enabled:false 2022-06-27 18:06:53 +01:00
Steve-Mcl
2f1f587c50 Use HTTP body instead of header for setting flows run state 2022-06-27 18:03:14 +01:00
Kazuhito Yokoi
ab1e38dde8 Fix use default button for node icon 2022-06-27 23:56:24 +09:00
Nick O'Leary
dd0d1e700e Merge pull request #3669 from dschmidt/patch-1
Import default export if node is a transpiled es module
2022-06-27 14:31:43 +01:00
Nick O'Leary
51ebb2579f Merge pull request #3670 from node-red/join-reduce-keep-msg
Join node in reduce mode doesn't keep existing msg properties
2022-06-27 14:29:41 +01:00
Nick O'Leary
d1d3b805f6 Merge pull request #3690 from cow0w/env_evalulating_in_template
Add support for evalulating {{env.<var>}} within a template node
2022-06-27 14:28:17 +01:00
Nick O'Leary
a6e247326b Merge pull request #3698 from bonanitech/fix-select-box-alignment
Fix select boxes vertical alignment
2022-06-27 14:18:34 +01:00
Nick O'Leary
823b7e2989 Merge pull request #3704 from bonanitech/monaco-default-theme
Leave Monaco theme commented out by default
2022-06-27 14:16:49 +01:00
Nick O'Leary
5f40dc37a2 Merge pull request #3708 from Steve-Mcl/fix-undo-drop-still-dirty
Ensure workspace clean after undoing dropped node
2022-06-27 14:12:50 +01:00
Nick O'Leary
5e5c05f0c6 Merge pull request #3710 from Steve-Mcl/fix-config-node-text-underflow
Use solid colour as config node icon background to hide text overflow
2022-06-27 14:11:09 +01:00
Nick O'Leary
ab1340d213 Merge pull request #3711 from Steve-Mcl/quick-add-height
Increase quick-add height to reveal 2 most recent entries
2022-06-27 14:09:38 +01:00
Steve-Mcl
6b6004ee70 Merge remote-tracking branch 'upstream/stop-start-flows' into stop-start-flows 2022-06-27 13:05:39 +01:00
Steve-Mcl
3cef2bb7e0 Merge remote-tracking branch 'upstream/master' into stop-start-flows 2022-06-27 13:03:52 +01:00
Stephen McLaughlin
cc5a0a436c Merge pull request #3702 from node-red/default-monaco
Set default editor to monaco in absence of user preference
2022-06-27 09:43:07 +01:00
Dave Conway-Jones
495a81768d Delay node - add example for simple queue with release 2022-06-26 16:27:11 +01:00
Steve-Mcl
125b37e98f increase quick-add height to reveal 2 most recent
fixes #3568
2022-06-26 12:16:39 +01:00
Steve-Mcl
f8ad75329d use $node-port-background as config node icon background
Makse sense since it contrasts the $node-port-label-color used for icon text
Also, only show pointer if node icon has count
2022-06-26 11:52:55 +01:00
Dave Conway-Jones
cb2efb14f7 Fix delay rate limit last timing when empty 2022-06-26 10:17:16 +01:00
Steve-Mcl
78327716a4 ensure workspace clean after undoing dropped node 2022-06-26 09:08:26 +01:00
庄建国
cd71b3daf3 fix chinese translate: 登陆 -> 登录 2022-06-26 13:02:16 +08:00
Mauricio Bonani
5393fa81b9 Leave Monaco theme commented out by default 2022-06-25 20:27:32 -04:00
Dennis Neufeld
d1efd2137a Add german contextMenu translation 2022-06-25 16:24:28 +02:00
Dennis Neufeld
fce8c3a8a0 Merge commit '1f5588b803c7e2f216f2bfa31df7ac2cfa874480' into patch-1-de 2022-06-25 16:19:07 +02:00
Hiroyasu Nishiyama
4bd71da056 fix credential type input item of subflow template 2022-06-23 16:52:43 +09:00
Nick O'Leary
d2e84925f7 Set default editor to monaco in absence of user preference 2022-06-22 21:43:25 +01:00
ralphwetzel
d81523370e Merge branch 'node-red:master' into master 2022-06-22 19:58:49 +02:00
ralphwetzel
6939546f22 Disable keyboard shortcut mapping when showing Edit[..]Dialog 2022-06-22 19:58:02 +02:00
Mauricio Bonani
2ea10206fa Fix select box alignment 2022-06-21 11:43:02 -04:00
Mauricio Bonani
8aa922c55f Fix indentation 2022-06-21 11:02:56 -04:00
Mauricio Bonani
d66def5530 Add fix from flowforge-nr-theme
https://github.com/flowforge/flowforge-nr-theme/blob/main/common/forge-common.css#L92-L98
2022-06-21 10:56:18 -04:00
Hiroyasu Nishiyama
42ecf54df6 add i18n support adn English and Japanese message 2022-06-21 22:39:22 +09:00
Hiroyasu Nishiyama
10835968fb add access to previous tours 2022-06-21 21:47:57 +09:00
Nick O'Leary
1f5588b803 Merge pull request #3696 from node-red/right-click-menu-fix
Fix clicking on node in workspace to hide context menu
2022-06-21 09:04:55 +01:00
Nick O'Leary
202102ebf7 Fix clicking on node in workspace to hide context menu 2022-06-20 20:51:31 +01:00
Steve-Mcl
9729c89f5d ensure link-call cache is updated when link-in is modified
fixes #3694
depends on node-red-node-test-helper@0.3.0
2022-06-20 18:25:41 +01:00
Nick O'Leary
71714733ad Merge pull request #3688 from kazuhitoyokoi/master-addjpn
Add Japanese translations for v3.0-beta.3
2022-06-20 16:30:12 +01:00
Dennis Neufeld
3fbbfce17c Fix typo in german translation 2022-06-20 13:28:10 +02:00
Kazuhito Yokoi
ad0a08ea0e Add Japanese translations in action list for project feature 2022-06-20 00:44:20 +09:00
Mauricio Bonani
3a2fa4073a Move all colours to CSS variables 2022-06-18 16:05:25 -04:00
Dennis Neufeld
6c2297c365 Update german translation 2022-06-18 19:46:38 +02:00
Kazuhito Yokoi
5e592427e9 Add Japanese translation in action list for junction 2022-06-19 01:56:59 +09:00
Kazuhito Yokoi
643541eebd Remove unnecessary spaces 2022-06-19 01:37:55 +09:00
Kazuhito Yokoi
13885493ac Update Japanese translations in welcome tour 2022-06-19 01:26:48 +09:00
Kazuhito Yokoi
75c9353cbd Fix keys to insert junction 2022-06-19 01:23:28 +09:00
cow0w
01d9affe61 Add support for evalulating {{env.<var>}} within a template node 2022-06-17 22:18:14 +03:00
Kazuhito Yokoi
3ad95bec3c Add Japanese translation for file nodes 2022-06-18 00:57:30 +09:00
Kazuhito Yokoi
418b3ee7d6 Fix Japanese translations to be same as others 2022-06-18 00:56:34 +09:00
Kazuhito Yokoi
0000f2a34d Support i18n in context menu 2022-06-18 00:51:05 +09:00
Nick O'Leary
fc5a5f1b73 Merge pull request #3687 from node-red/space-in-strings
Fix handling of spacebar inside JSON visual editor
2022-06-17 10:05:12 +01:00
Nick O'Leary
226ab406b2 Merge pull request #3686 from node-red/fix-menu-padding
Fix menu padding to handle both icons and submenus
2022-06-17 10:05:01 +01:00
Nick O'Leary
9eaf5d82b6 Merge pull request #3685 from node-red/quick-add-offset
Include scroll offset when positioning quick-add dialog
2022-06-16 23:31:38 +01:00
Nick O'Leary
e3d6d242ac Fix handling of spacebar inside JSON visual editor
Fixes #3682

The treeList keyboard handling was consuming the event - used
to select the item in the list.

The fix here adds a 'selectable' flag on the treeList that can
be used to disabled (=false) the keyboard selection of items.
2022-06-16 23:29:46 +01:00
Nick O'Leary
53184715bc Fix menu padding to handle both icons and submenus
Fixes #3683
2022-06-16 23:18:02 +01:00
Nick O'Leary
1844633ff1 Include scroll offset when positioning quick-add dialog
Fixes #3684
2022-06-16 22:57:23 +01:00
Nick O'Leary
7d7682b34e Merge pull request #3681 from node-red/30-release
3.0.0-beta.3 release
2022-06-16 17:23:01 +01:00
Nick O'Leary
83655a749c Update changelog 2022-06-16 17:01:11 +01:00
Nick O'Leary
b9444e8197 Merge pull request #3679 from node-red/update-deps
Update dependencies
2022-06-16 16:03:37 +01:00
Nick O'Leary
5ff70b2a36 Merge pull request #3680 from node-red/300-tour
Update tour for 3.0-beta.3
2022-06-16 16:03:18 +01:00
Nick O'Leary
4ed559af95 Update changelog and version for 3-beta.3 2022-06-16 15:44:51 +01:00
Nick O'Leary
ce529a9b9f Update module dependencies 2022-06-16 15:39:42 +01:00
Nick O'Leary
31e472145c Merge pull request #3678 from node-red/right-click-menu
Right click menu
2022-06-16 15:38:58 +01:00
Nick O'Leary
1664428429 Update tour for 3.0-beta.3 2022-06-16 15:37:07 +01:00
Nick O'Leary
1780cb9b91 Update dependencies 2022-06-16 14:47:11 +01:00
Nick O'Leary
ad32677263 Fix lint errors in contextMenu 2022-06-16 14:37:48 +01:00
Nick O'Leary
0eba4bdd61 Add right-click context menu to workspace 2022-06-16 13:59:14 +01:00
Nick O'Leary
28238eb5a7 Allow typeSearch to list actions
A proof-of-concept which needs a bit more UI polish, but capturing the
current code for the future. We do not add actions to the list, so the code
is unused.
2022-06-16 13:57:50 +01:00
Nick O'Leary
cce4f6f7f7 Add onpre/postselect, direction opts to menu and make id optional 2022-06-16 13:50:05 +01:00
Nick O'Leary
6bea3dabbb Allow popover position to be set via absolute pos rather than relative 2022-06-16 13:49:25 +01:00
Nick O'Leary
ea46947054 Add RED.actions.getLabel to retrieve action i18n label 2022-06-16 13:48:36 +01:00
Nick O'Leary
22879f8c23 Merge pull request #3677 from Steve-Mcl/file-node-filename-ux
Further simplify file node filename entry UX (v3)
2022-06-16 13:13:43 +01:00
Nick O'Leary
77c4423059 Merge pull request #3676 from Steve-Mcl/nodesdir-feature-parity
Scanning of `nodesdir` to be more aligned (feature wise) with `coreNodeDir` and `userDir`
2022-06-16 13:11:36 +01:00
Steve-Mcl
62a2a4a9f5 Further simplify file node filename entry UX (v3)
fixes #3668
2022-06-16 11:38:19 +01:00
Nick O'Leary
59690328e2 Merge pull request #3674 from node-red-hitachi/fix-cursor-position-function-node
Fix initial cursor position of init/finalize tab of function node
2022-06-16 11:21:49 +01:00
Nick O'Leary
e50ecd613f Merge pull request #3671 from node-red-hitachi/fix-disable-junction
Fix disable junction
2022-06-16 11:20:18 +01:00
Nick O'Leary
d873a6138a Merge pull request #3672 from kazuhitoyokoi/v2.x-addjpn
Add Japanese translations for v2.2.3
2022-06-16 11:17:22 +01:00
Nick O'Leary
8093ae8570 Merge pull request #3643 from node-red/fix-drag-hidden
Reset mouse state when switching tabs
2022-06-16 11:09:29 +01:00
Steve-Mcl
98ebb02763 improve tests for nodeDir
Adds new resources (loose files, non NR pkgs, NR modules, NR Plugins)
Adds new tests
#getNodeFiles - new tests below
  √ Finds nodes and icons only in nodesDir with files, icons and valid node-red packages
  √ Should not find node-red node in nodesDir with files, icons and valid node-red packages
  √ Should not find node-red node in nodesDir when regular package and valid node-red packages
#getModuleFiles - new tests below
  √ gets a nodes module files
  √ Finds only 1 node-red node in nodesDir amongst legacy nodes and regular nodes
  √ Finds a node-red node in nodesDir with a sub dir containing valid node-red package
  √ Finds 2 node-red node and 1 plugin in nodesDir (in root of dir)
  √ Finds 2 node-red node and 1 plugin in nodesDir pointing to a node_modules dir
2022-06-16 11:00:31 +01:00
Steve-Mcl
ba22b07dce align functionality of nodesDir with coreNodesDir and userDir 2022-06-16 10:57:29 +01:00
Hiroyasu Nishiyama
d1312703c5 fix initial cursor position of init/finalize 2022-06-16 14:16:40 +09:00
Kazuhito Yokoi
8d99a42307 Add Japanese translations (Backport #3576 to v2.x) 2022-06-16 00:32:20 +09:00
Hiroyasu Nishiyama
3ab93ecdd4 fix disable junction 2022-06-16 00:00:02 +09:00
Dave Conway-Jones
6c0d6c5425 Join-reduce keep existing msg properties
see https://discourse.nodered.org/t/no-response-object-after-split-join/63919
2022-06-15 10:16:12 +01:00
Dominik Schmidt
326f346936 Import default export if node is a transpiled es module 2022-06-14 22:54:00 +02:00
Stephen McLaughlin
8762d0e164 Merge pull request #3666 from node-red-hitachi/fix-junction-to-subflow-2
Fix uncorrect fix of junction to subflow conversion
2022-06-14 09:34:56 +01:00
Hiroyasu Nishiyama
2b91edeb74 fix uncorrect fix of junction to subflow conversion 2022-06-14 16:49:14 +09:00
Nick O'Leary
6c49d1aa3f Merge pull request #3653 from node-red-hitachi/fix-undo-junction-to-subflow
Fix undoing junction to subflow
2022-06-13 21:09:20 +01:00
Nick O'Leary
f07f086d62 Merge pull request #3652 from node-red-hitachi/fix-junction-to-subflow
Fix conversion of junction to subflow
2022-06-13 21:09:11 +01:00
Nick O'Leary
c28862f8c7 Merge pull request #3650 from node-red-hitachi/fix-export-junction
Fix to include junction to exported nodes
2022-06-13 21:06:33 +01:00
Nick O'Leary
9cfaf567be Merge pull request #3649 from kazuhitoyokoi/master-fixshade4palette
Fix z-index value for shade to cover nodes in palette
2022-06-13 21:04:52 +01:00
Nick O'Leary
53f453bf34 Merge pull request #3647 from node-red-hitachi/fix-subflow-category-name
Fix to extend escaped subflow category characters
2022-06-13 21:04:13 +01:00
Nick O'Leary
a16032a8ed Track mouse release outside workspace so current action completes 2022-06-13 21:01:34 +01:00
Nick O'Leary
8cec0d8fcd Merge pull request #3645 from node-red/fix-esm
Fix ESM module loading in Function node
2022-06-13 08:10:28 -05:00
Hiroyasu Nishiyama
6f6f67829b fix undoing junction to subflow 2022-06-13 14:12:04 +09:00
Hiroyasu Nishiyama
94471b6d07 fix conversion of junction to subflow 2022-06-13 08:47:41 +09:00
Hiroyasu Nishiyama
7eed9c0584 include junction to exported nodes 2022-06-12 10:08:13 +09:00
Kazuhito Yokoi
3e717862a4 Fix z-index value for shade to cover nodes in palette 2022-06-11 20:52:58 +09:00
Hiroyasu Nishiyama
30d88bbe7e extend escaped subflow category characters 2022-06-11 09:50:28 +09:00
Nick O'Leary
551e73adef Merge pull request #3646 from node-red-hitachi/fix-tab-name-sanitize
Fix to sanitize tab name
2022-06-10 06:56:40 -05:00
Hiroyasu Nishiyama
99d32c4758 sanitize tab name 2022-06-10 20:22:09 +09:00
Nick O'Leary
9e52c15829 Merge pull request #3644 from bonanitech/fix-selector-placement
Fix selector placement
2022-06-09 22:14:09 -05:00
Nick O'Leary
71a272f0a6 Fix ESM module loading in Function node
Fixes #3627
2022-06-09 22:11:48 -05:00
Mauricio Bonani
64061c3440 Fix selector placement 2022-06-09 17:44:11 -04:00
Steve-Mcl
1b4f2b9c53 fix formatting (resolve merge conflict) 2022-06-09 22:29:28 +01:00
Stephen McLaughlin
d83516584d Merge branch 'master' into stop-start-flows 2022-06-09 22:29:09 +01:00
Nick O'Leary
3e34d0badb Merge pull request #3622 from kazuhitoyokoi/master-addjpn
Add Japanese translations for v3.0-beta.2
2022-06-09 16:03:43 -05:00
Nick O'Leary
b2e8474df3 Merge pull request #3624 from node-red-hitachi/fix-buffer-parse-error
fix buffer parse error message of evaluateNodeProperty
2022-06-09 16:02:48 -05:00
Nick O'Leary
73ff7e2de4 Merge pull request #3632 from node-red-hitachi/fix-inject-of-JSONata
Fix JSONata evaluation of inject button
2022-06-09 16:00:23 -05:00
Nick O'Leary
b5d8d34718 Merge pull request #3633 from node-red-hitachi/fix-new-folder-save-to-library
Fix new folder menu of save to library dialog
2022-06-09 15:59:34 -05:00
Nick O'Leary
ac44d22cee Merge pull request #3638 from node-red-hitachi/fix-palette-node-layer
Fix layer of palette node
2022-06-09 15:55:46 -05:00
Nick O'Leary
6e8fa12172 Merge pull request #3637 from node-red-hitachi/fix-node-placement
Fix to place a node dragged from palette within the workspace
2022-06-09 15:54:32 -05:00
Nick O'Leary
deb9c4ecc0 Reset mouse state when switching tabs
Fixes #3639
2022-06-09 15:47:16 -05:00
Steve-Mcl
d4e6136b09 re-enable tests i had temporarily disabled 2022-06-09 15:27:50 +01:00
Steve-Mcl
68331fc40c implement flows runtime stop/start API and UI 2022-06-08 21:56:17 +01:00
Hiroyasu Nishiyama
3046798ec5 fix layer of palette node 2022-06-08 14:50:14 +09:00
Hiroyasu Nishiyama
c4332658ba place node dragged from palette within workspace 2022-06-08 09:36:32 +09:00
Hiroyasu Nishiyama
50e3da0849 fix new folder menu of save to library dialog 2022-05-28 20:16:53 +09:00
Stephen McLaughlin
62cd3b2061 Merge pull request #3630 from Steve-Mcl/fix-tcp-sockets-crash
Dont delete TCP socket twice
2022-05-27 07:37:28 +01:00
Hiroyasu Nishiyama
7e6dfa7b92 update test for inject node 2022-05-27 12:11:53 +09:00
Hiroyasu Nishiyama
7fbebbf361 fix JSONata evaluation of inject button 2022-05-27 11:44:56 +09:00
Kazuhito Yokoi
121372802f Use built-in type in typedInput 2022-05-26 22:50:52 +09:00
Nick O'Leary
7924907384 Merge pull request #3626 from node-red/noproxy-not-defined
MQTT Node: define noproxy variable
2022-05-26 10:43:39 +01:00
Stephen McLaughlin
51d429f9ae Dont delete TCP socket twice 2022-05-26 10:18:34 +01:00
Stephen McLaughlin
267aebb9cb Merge pull request #3628 from bonanitech/patch-1
Fix typo in CSS
2022-05-25 16:44:26 +01:00
Mauricio Bonani
3f9ebb588e Fix typo 2022-05-25 11:15:29 -04:00
Kazuhito Yokoi
f424f07e54 Fix typos in message catalog 2022-05-25 22:56:58 +09:00
Kazuhito Yokoi
e5a21a3261 Merge branch 'node-red:master' into master-addjpn 2022-05-25 19:07:57 +09:00
Stephen McLaughlin
6f0de7c80e define noproxy variable 2022-05-24 20:43:29 +01:00
Stephen McLaughlin
3ace7eeafd Merge pull request #3623 from node-red-hitachi/i18n-debug-sidebar-node-label
i18n debug sidebar node label
2022-05-24 07:03:14 +01:00
Stephen McLaughlin
eb9f15e4e4 Merge pull request #3615 from bonanitech/ace-editor-gutter-color
Use the correct variable for the gutter text color
2022-05-23 17:33:51 +01:00
Hiroyasu Nishiyama
bc80569fe9 fix buffer parse error message of evaluateNodeProperty 2022-05-22 17:59:27 +09:00
Hiroyasu Nishiyama
a147458120 i18n debug sidebar node label 2022-05-22 16:28:11 +09:00
Kazuhito Yokoi
6182e22d18 Add string label to typedInput in file nodes 2022-05-22 11:56:21 +09:00
Kazuhito Yokoi
dda84c5cd5 Fix indents in other code except message catalog 2022-05-22 11:18:40 +09:00
Kazuhito Yokoi
6c15fb6978 Fix indents in message catalog 2022-05-22 10:51:35 +09:00
Kazuhito Yokoi
b17b68c44b Add Japanese translations for v3.0-beta.2 2022-05-22 10:37:22 +09:00
Mauricio Bonani
afdb15dc58 Use the correct variable for the gutter text color 2022-05-18 10:28:36 -04:00
Nick O'Leary
98b4b0dce0 Merge pull request #3612 from node-red/3beta2
Update for 3.0.0-beta.2
2022-05-16 11:47:07 +01:00
Nick O'Leary
70f26e0bea Update for 3.0.0-beta.2 2022-05-16 11:10:31 +01:00
Nick O'Leary
b6ad396a6c Merge pull request #3611 from node-red/fix-ace-worker-opts
Ensure ACE worker options are set
2022-05-16 10:59:59 +01:00
Nick O'Leary
e44bb57b0e Merge pull request #3609 from Steve-Mcl/slicing-button
Change slicing / slice-junction operations over to mouse button 0 (Left Mouse Button)
2022-05-16 09:59:41 +01:00
Stephen McLaughlin
5c10b16b65 Ensure ACE worker options are set
fixes #3610
2022-05-15 13:19:28 +01:00
Steve-Mcl
7ec1d42808 Change slicing op to mouse button 0
fixes #3582
2022-05-13 16:43:27 +01:00
Stephen McLaughlin
03e9e89558 Merge pull request #3608 from node-red/filter-virtual-on-slice
Do not slice-junction link node wires
2022-05-13 11:13:14 +01:00
Nick O'Leary
3057035dec Do not slice-junction link node wires 2022-05-12 14:57:16 +01:00
Nick O'Leary
4af72cc7ba Merge pull request #3607 from node-red/junction-rework
Rework Junctions to be more node like in their event handling
2022-05-12 10:12:38 +01:00
Nick O'Leary
f6aee81651 Hide junction ports whilst dragging nodes 2022-05-12 10:02:35 +01:00
Nick O'Leary
a22f569ca0 Rework Junctions to be more node like in their event handling 2022-05-11 23:13:12 +01:00
Nick O'Leary
8043f5d865 Merge pull request #3606 from node-red/dev
Merge minor dev branch fixes and "Search flow:active" V3 item into master
2022-05-10 11:19:03 +01:00
Stephen McLaughlin
2ef50ab71f Merge pull request #3604 from node-red/fix-many-to-one-junction-slice
Handle many-to-one slicing of wires
2022-05-10 08:09:00 +01:00
Stephen McLaughlin
192a4f5e7f Merge pull request #3605 from node-red/fix-ungroup-history
Remove duplicate history add of ungroup event
2022-05-10 08:08:45 +01:00
Stephen McLaughlin
1af56a7f00 Merge pull request #3590 from Steve-Mcl/search-current-flow
Add ability to search in current flow
2022-05-10 08:08:28 +01:00
Nick O'Leary
d2fab7fddd Remove duplicate history add of ungroup event
Fixes #3581
2022-05-09 20:51:17 +01:00
Nick O'Leary
1818b0281d Handle many-to-one slicing of wires 2022-05-09 20:39:34 +01:00
Stephen McLaughlin
09973ba8cf Update packages/node_modules/@node-red/editor-client/src/js/ui/search.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-05-09 17:41:41 +01:00
Stephen McLaughlin
dd3174c40f Update packages/node_modules/@node-red/editor-client/src/js/ui/search.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-05-09 17:41:33 +01:00
Stephen McLaughlin
f0293b8f52 Update packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-05-09 17:41:24 +01:00
Nick O'Leary
d549a9ad92 Merge pull request #3603 from node-red-hitachi/fix-select-width-of-switch-node-rule
use text width instead of number of characters for deciding select fi…
2022-05-09 17:18:49 +01:00
Stephen McLaughlin
0385c72a8f Merge pull request #3594 from PhilDay-CT/issue-3593
Handle removal of event handlers to allow mqtt client.end() to work
2022-05-09 16:50:48 +01:00
Stephen McLaughlin
e223b20cbd Remove unnecessary call to clientRemoveListeners
Also, merge the non JSDOC comment into the JSDOC comment
2022-05-09 16:37:25 +01:00
Phil Day
a0f7e92e40 call client.end with force=true on timeout 2022-05-09 16:29:39 +01:00
Phil Day
c87ff3ca26 Update packages/node_modules/@node-red/nodes/core/network/10-mqtt.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
2022-05-09 16:22:50 +01:00
Phil Day
82672a825d Update packages/node_modules/@node-red/nodes/core/network/10-mqtt.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
2022-05-09 16:20:44 +01:00
Phil Day
98d524e82d Update packages/node_modules/@node-red/nodes/core/network/10-mqtt.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
2022-05-09 16:20:27 +01:00
Phil Day
3d3090a8f2 Updated to cover the removal of individual event handlers 2022-05-09 15:39:12 +01:00
Steve-Mcl
5561e89201 remove unused var 2022-05-08 14:48:57 +01:00
Stephen McLaughlin
9ed96de237 Merge pull request #3602 from node-red-hitachi/i18n-switch-rule-selector
I18n switch rule selector
2022-05-08 14:28:36 +01:00
Steve-Mcl
0f2420576a improve flashing of node
sometimes node highlight get stuck
2022-05-08 14:24:30 +01:00
Steve-Mcl
d1b74675d9 change search term is:thisflow to flow:active
this also permits flow:<flow-id>
2022-05-08 14:23:47 +01:00
Hiroyasu Nishiyama
abb81a0bac use text width instead of number of characters for deciding select field width of switch node rule 2022-05-08 12:32:07 +09:00
Hiroyasu Nishiyama
05eb055b8c add Japanese translation of switch rules 2022-05-08 08:59:07 +09:00
Hiroyasu Nishiyama
e8ddd6d16d i18n switch group label & add Japanese message 2022-05-08 08:44:35 +09:00
Stephen McLaughlin
8706998c8c Merge pull request #3600 from node-red-hitachi/fix-link-call-info-jp
update Japanese info of link call node reflecting update of English info
2022-05-07 14:28:05 +01:00
Hiroyasu Nishiyama
06e0869767 update Japanese info of link call node reflecting update of English info 2022-05-07 22:09:54 +09:00
Nick O'Leary
7841fc6d3e Merge pull request #3580 from bonanitech/typedinput-label
Fix typedInput label not visible on themes
2022-05-06 19:25:54 +01:00
Nick O'Leary
1f7311deeb Merge pull request #3597 from node-red-hitachi/fix-link-call-info
update link-call node info according to current behavior
2022-05-06 19:25:10 +01:00
Hiroyasu Nishiyama
07a9e69e7b update link-call node info according to current behavior 2022-05-06 23:38:58 +09:00
Phil Day
9bc8adc715 Revent change of grunt version 2022-05-06 15:34:25 +01:00
Phil Day
7845ebffc5 Track which event handlers we add to the mqtt client so we can removed them cleanly 2022-05-06 15:29:42 +01:00
Nick O'Leary
b985de6df2 Merge pull request #3595 from Steve-Mcl/fix-project-switching
Fix project switching when junctions are present
2022-05-05 20:48:54 +01:00
Steve-Mcl
11f6491889 fix project switching when junctions are present
fixes #3588
2022-05-05 16:56:28 +01:00
Phil Day
b2ec040a8d Add Force parameter mqtt client.end() when called in disconnect 2022-05-05 16:12:28 +01:00
Stephen McLaughlin
424a53da4e Merge pull request #3576 from kazuhitoyokoi/master-addjpn
Add Japanese translations for v3.0-beta.1
2022-05-05 15:16:36 +01:00
Stephen McLaughlin
963c289af7 Merge pull request #3592 from kazuhitoyokoi/master-fixiconpath
Fix image paths where `red/image/typedInput/XXXX.png` should be `red/image/typedInput/XXXX.svg`
2022-05-05 14:57:49 +01:00
Kazuhito Yokoi
c5af71e0a2 Change icon path from png to svg 2022-05-05 20:38:55 +09:00
Nick O'Leary
329008bf6d Merge pull request #3591 from Steve-Mcl/fix-back-link-to-junc
Fix junction: when wiring from a regular nodes INPUT, backwards to a junction
2022-05-05 10:27:48 +01:00
Steve-Mcl
531dbc5f83 Fix junction: ensure sourcePort is not undefined
fixes #3587
2022-05-05 09:37:32 +01:00
Stephen McLaughlin
851a925956 Merge pull request #3585 from Steve-Mcl/fix-flow-prop-tab
fix error initialising flow tab editor
2022-05-05 08:25:15 +01:00
Stephen McLaughlin
5d4e01eea6 Merge pull request #3589 from node-red-hitachi/fix-system-info
fix error on system-info action
2022-05-05 08:24:24 +01:00
Stephen McLaughlin
7484dc5b4c Merge pull request #3584 from Steve-Mcl/fix-search-err
Fix browser console error Uncaught TypeError when searching certain terms
2022-05-05 08:14:26 +01:00
Stephen McLaughlin
e04f5cb277 Merge pull request #3575 from ralphwetzel/patch-1
remove debugging remnants
2022-05-05 08:10:38 +01:00
Hiroyasu Nishiyama
c513cff843 fix error on system-info action 2022-05-05 10:10:52 +09:00
ralphwetzel
a4603a4396 Update 60-link.html
Remove development debug message.
Fixes #3574 ... courtesy of @Steve-Mcl
2022-05-04 20:15:24 +02:00
Kazuhito Yokoi
bc5eafce66 Update translations in file and http request nodes 2022-05-05 01:28:42 +09:00
Kazuhito Yokoi
5fb811eb4c Change icon path from png to svg in typedInput 2022-05-05 01:20:41 +09:00
Kazuhito Yokoi
84a3884ffc Fix i18n in typedInput of header area 2022-05-04 23:54:23 +09:00
Kazuhito Yokoi
50ae29a08c Add Japanese translations for v3.0-beta.1 2022-05-04 23:29:40 +09:00
Steve-Mcl
bf8bfa582a fix error initialising flow tab editor
fixes #3577
2022-05-04 15:16:35 +01:00
Steve-Mcl
492d1ef30e declare undeclared loop var 2022-05-04 15:10:02 +01:00
Steve-Mcl
bd19c203e1 Prevent error when uses search term is used
fixes #3578
2022-05-04 15:08:52 +01:00
Steve-Mcl
1141f9de86 Add ability to search in current flow
fixes #3419
2022-05-04 14:42:47 +01:00
Mauricio Bonani
7955a17a17 Fix typedInput label not visible 2022-05-04 06:37:52 -04:00
Kazuhito Yokoi
58085e39d1 Add Japanese translations for welcome tour in 3.0-beta.1 2022-05-04 11:39:34 +09:00
ralphwetzel
bbc32c4cd0 Update 21-debug.html
Tidy up a leftover development debug message ... with a smile!
2022-05-03 22:17:00 +02:00
Nick O'Leary
3841039728 Update gen publish script for 3.x 2022-05-03 14:29:25 +01:00
Nick O'Leary
f04d954882 Drop node 12 from test runs 2022-05-03 14:25:27 +01:00
Nick O'Leary
39602ff5f2 Update changelog 2022-05-03 13:58:02 +01:00
Nick O'Leary
55ecc7a92c Merge pull request #3573 from node-red/3-0
Update changelog and tourguide for 3.0
2022-05-03 13:41:06 +01:00
Nick O'Leary
1148960d43 Update changelog and tour guide 2022-05-03 13:40:27 +01:00
Nick O'Leary
415107fbf0 Bump engines to 14 2022-05-03 13:40:02 +01:00
Nick O'Leary
437cc20198 Add moment dependency to resolve vuln in moment-timezone 2022-05-03 13:39:30 +01:00
Nick O'Leary
32f78a99fd Update dependencies 2022-05-03 09:48:13 +01:00
Nick O'Leary
65c7855afd Merge pull request #3571 from node-red/master
Pull master into dev
2022-05-03 09:36:32 +01:00
Stephen McLaughlin
7f68e341da Merge branch 'dev' into master 2022-05-03 09:35:32 +01:00
Nick O'Leary
a2f750ed1a Merge pull request #3567 from Steve-Mcl/notification-buttons
Add "search for" buttons to notifications
2022-05-03 09:23:21 +01:00
Nick O'Leary
b74a42cdf5 Merge pull request #3569 from node-red/watch-fix
Fix Watch node handling of recursive directories
2022-05-03 09:22:31 +01:00
Nick O'Leary
95b35be541 Merge pull request #3570 from node-red/validate-tooltip-fix
Ensure node validation tooltip is closed when field becomes valid
2022-05-03 09:22:24 +01:00
Nick O'Leary
ea747a3d58 Merge pull request #3563 from Steve-Mcl/mqtt-topic-val
Add client and Runtime MQTT topic validation and fix subsequent connection lockup (that arises due to bad birth/will topic)
2022-05-03 09:22:11 +01:00
Stephen McLaughlin
9b644e3c47 Use new validation option to return better label
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-05-02 21:28:04 +01:00
Steve-Mcl
3f776397d1 close parent notification on "search for..." click 2022-05-02 21:24:46 +01:00
Steve-Mcl
1ec75035ba declare missing var notification 2022-05-02 21:23:36 +01:00
Steve-Mcl
97b7b7b968 ensure space after search terms 2022-05-02 21:22:45 +01:00
Steve-Mcl
135427dcc8 fix i18n for unknownNodesButton 2022-05-02 21:21:09 +01:00
Nick O'Leary
a2de514c05 Merge pull request #3540 from hardillb/no-home-dir
Don't start if user has no home directory
2022-05-02 21:12:57 +01:00
Nick O'Leary
f1bada7fd8 Ensure node validation tooltip is closed when field becomes valid 2022-05-02 20:56:01 +01:00
Nick O'Leary
ea5d25c794 Merge pull request #3564 from bonanitech/config-nodes-colors
Don't let themes change node config colors
2022-05-02 20:19:40 +01:00
Nick O'Leary
193e420eb3 Fix Watch node handling of recursive directories
Fixes #3566
2022-05-02 20:11:04 +01:00
Steve-Mcl
8a972ee543 Add "search for" buttons to notifications 2022-05-01 16:48:04 +01:00
Mauricio Bonani
b51eb7326f Change node config SASS variables 2022-04-29 18:40:34 -04:00
Steve-Mcl
be3b5b7fe2 MQTT topic validation and lockup fix
closes #3557
2022-04-29 19:56:37 +01:00
Stephen McLaughlin
3a7a606f6a Merge pull request #3562 from Steve-Mcl/mqttv5-userprops
MQTT Node - save and restore v5 config user props
2022-04-29 12:09:38 +01:00
Stephen McLaughlin
294fc6b62f Ensure userProps makes it through to runtime 2022-04-29 11:25:19 +01:00
Stephen McLaughlin
662a44fccf save and restore v5 config user props 2022-04-29 10:44:19 +01:00
Nick O'Leary
b0a5d4fb6f Merge pull request #3560 from bonanitech/border-radius-gap
Fix gap between typedInput containers borders
2022-04-28 16:32:41 +01:00
Stephen McLaughlin
4fb8292618 Merge pull request #3559 from node-red/watch-node-update
Update Watch node to use node-watch module
2022-04-28 14:32:39 +01:00
Nick O'Leary
539e5899e3 Bump version for 3.0.0-beta.1 2022-04-28 14:30:45 +01:00
Nick O'Leary
bee9e20827 Update Watch node to use node-watch module 2022-04-28 14:07:13 +01:00
Nick O'Leary
12f527a120 Merge pull request #3558 from node-red/deps-update
Dependencies update
2022-04-28 11:55:32 +01:00
Nick O'Leary
bd626899df Fix linting error from merge 2022-04-28 11:17:32 +01:00
Nick O'Leary
54d036715f Bump node-red-admin to 3.0 2022-04-28 11:15:17 +01:00
Nick O'Leary
54c87f81a6 Update dependencies 2022-04-28 11:04:06 +01:00
Nick O'Leary
5de078dc61 Merge pull request #3511 from Steve-Mcl/diagnostics
Diagnostics
2022-04-27 22:30:24 +01:00
Nick O'Leary
ff57de0753 Merge branch 'dev' into diagnostics 2022-04-27 22:30:13 +01:00
Nick O'Leary
9565aee3c5 Merge pull request #3533 from Steve-Mcl/filename-typedinput
Feature: Change basic Filename field to a typedInput
2022-04-27 22:28:12 +01:00
Steve-Mcl
f63da0c58b Default to msg.filename as per v2 condition 2022-04-27 20:44:41 +01:00
Mauricio Bonani
205dbc1a25 Increase typedInput container border-radius
Fixes #3548
2022-04-27 15:00:29 -04:00
Stephen McLaughlin
12c309fd50 Merge pull request #3556 from Steve-Mcl/fixlintsm
fix linting errors introduced in #3553
2022-04-27 17:13:38 +01:00
Stephen McLaughlin
f04e3d5338 fix linting errors introduced in #3553 2022-04-27 15:31:14 +01:00
Nick O'Leary
dc03d0b300 Merge pull request #3553 from Steve-Mcl/code-edit-ux-improvements
Code editor ux improvements around remembering state of each code editor in a flow
2022-04-27 14:35:43 +01:00
Steve-Mcl
3e16cc4912 Add i18n for json editor title when readonly 2022-04-27 12:52:41 +01:00
Steve-Mcl
fcdf252f03 rename jsonButtons to toolbarButtons 2022-04-27 12:52:01 +01:00
Steve-Mcl
b23fea9cb5 group json editor toolbar buttons 2022-04-27 12:50:45 +01:00
Stephen McLaughlin
e714ff35c4 Merge branch 'dev' into diagnostics 2022-04-27 12:08:32 +01:00
Steve-Mcl
4054d0eca7 adjust settings comments to more like existing std 2022-04-27 12:05:51 +01:00
Steve-Mcl
367f9b6232 i18n 2022-04-27 12:05:20 +01:00
Steve-Mcl
194eb4e266 code editor ux improvements
* Save and restore editor selection(s), cursor(s), scroll pos etc
* Improve focusing of editor at appropriate times
* Works with both ace and monaco
* Backwards compatible and (almost) fully functional with existing nodes
2022-04-27 11:23:13 +01:00
Stephen McLaughlin
f717eb7388 Merge pull request #3552 from Steve-Mcl/fix-mqtt-status
Fix incorrect MQTT status
2022-04-26 23:57:55 +01:00
Nick O'Leary
e8f20285af Merge pull request #3551 from node-red/pr_3544
Add message count option to Debug status
2022-04-26 16:25:01 +01:00
Nick O'Leary
0fec9c7c55 Apply i18n messages to diagnostics dialog 2022-04-26 16:24:13 +01:00
Nick O'Leary
f8d0ed7ca6 Merge pull request #3515 from bonanitech/svg-icons
Make it easier to apply themes on SVG icons
2022-04-26 16:22:47 +01:00
Stephen McLaughlin
020eaef5ba Fix incorrect MQTT status
fixes #3550
2022-04-26 16:12:54 +01:00
Nick O'Leary
973b31521e Tidy up debug message status count 2022-04-26 16:04:09 +01:00
Stephen McLaughlin
59e513f130 Remove pointless placeholders 2022-04-26 15:30:20 +01:00
Nick O'Leary
62e730b621 Merge pull request #3549 from node-red/pr_3438
Add support of property validation message
2022-04-26 13:53:50 +01:00
Nick O'Leary
f4bb62adbc Merge branch 'dev' into pr_3438 2022-04-26 13:53:35 +01:00
Nick O'Leary
48a528a4b8 Ensure property validation is backwards compatible 2022-04-26 13:45:14 +01:00
Nick O'Leary
5aba66ea78 Merge branch 'master' into dev 2022-04-26 09:14:51 +01:00
Nick O'Leary
c5efdf5ae3 Merge pull request #3547 from node-red/fix-wire-history
Fix recording removed links in edit history
2022-04-26 09:14:33 +01:00
Nick O'Leary
15958cd4a3 Fix recording removed links in edit history
Fixes #3546
2022-04-26 09:13:38 +01:00
Nick O'Leary
edcdc6c97c Update packages/node_modules/node-red/lib/red.js 2022-04-25 20:56:03 +01:00
Stephen McLaughlin
143b807e9b Merge pull request #3538 from node-red/fix-name-generator
Fix name auto-generator to leave blank names alone on copy/paste
2022-04-25 20:33:55 +01:00
Nick O'Leary
861379c227 Merge pull request #3541 from node-red/fix-import-node-library
Fix importing external module from node-red module
2022-04-25 20:33:25 +01:00
Nick O'Leary
2fb9f62d0b Merge branch 'dev' into fix-name-generator 2022-04-25 20:31:33 +01:00
Nick O'Leary
84e02fc144 Remove name generation from link call and add to Function 2022-04-25 20:30:05 +01:00
Nick O'Leary
57ac90f837 Merge pull request #3542 from Steve-Mcl/httpstatic-improvements
Add support for multiple static paths with optional static root
2022-04-25 20:21:54 +01:00
Nick O'Leary
10a45ece76 Merge pull request #3543 from Steve-Mcl/monaco-default
Set monaco as default code editor as of v3.x
2022-04-25 20:06:50 +01:00
Nick O'Leary
c88a177cb2 Merge pull request #3530 from Steve-Mcl/mqtt-payload-auto-parsing
MQTT payload auto parsing improvements
2022-04-25 11:40:59 +01:00
Rafael Muynarsk
a63dfc4650 Added condition that.statusType === "counter" in the debug.html file 2022-04-24 17:13:53 -03:00
Rafael Muynarsk
8924ac2783 implementing message count on the debug node 2022-04-23 20:18:51 -03:00
Steve-Mcl
4fffa2d0ba restore "input" help info for msg.filename 2022-04-23 11:23:44 +01:00
Steve-Mcl
856d2ab266 remove unecessary ${ENV_VAR} test 2022-04-23 11:20:21 +01:00
Steve-Mcl
750d2c76f5 set monaco as default from v3 2022-04-23 10:04:09 +01:00
Steve-Mcl
47157049c0 remove unused comment from settings file 2022-04-22 17:39:19 +01:00
Steve-Mcl
22000f10df Add support for multiple static paths with root
closes #3510
2022-04-22 17:06:40 +01:00
Nick O'Leary
d802ce1484 Merge pull request #3460 from ArFe/feature-add-store-external-token-when-authenticate
Feature add: Store external token when authenticate if provided
2022-04-22 09:51:20 +01:00
Steve-Mcl
4b10b9ffc3 update tests 2022-04-21 21:32:24 +01:00
Steve-Mcl
552408f488 Make new Auto Output mode optional
- adds entry to output data type
- adds depreciation tip
2022-04-21 21:20:41 +01:00
Nick O'Leary
4884938036 Merge branch 'master' into dev 2022-04-21 16:05:54 +01:00
Ben Hardill
cdcc8cc59a Update packages/node_modules/node-red/red.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-04-21 15:47:40 +01:00
Nick O'Leary
f7bd600715 Fix importing external module from node-red module 2022-04-21 15:06:08 +01:00
Ben Hardill
0014fec63f Remove test that exits if no userDir defined
With the storage plugins it is possible to not need a userDir, just a
settings.js
2022-04-21 13:52:38 +01:00
Ben Hardill
812efde342 Also check if there is a useDir defined 2022-04-21 12:00:10 +01:00
Ben Hardill
889f0e1569 Don't start if user has no home directory
If the user doesn't have a defined home dir (env var `HOME`,
`USERPROFILE` or `HOMEPATH`) and the `userDir` is not passed on the
command line then we shouldn't start as we don't know where to copy the
default `settings.js` file to or where to store flows

fixes #3539
2022-04-21 11:40:12 +01:00
Nick O'Leary
3a26c5cd65 Merge pull request #3498 from sammachin/sammachin_credentials
Error on invalid encrypted credentials
2022-04-21 10:59:43 +01:00
Nick O'Leary
12a25c37aa Merge branch 'master' into dev 2022-04-20 10:56:55 +01:00
Nick O'Leary
4706e20a1d Merge pull request #3526 from node-red-hitachi/fix-status-reference-in-debug-node
fix reference error of msg.status in debug node
2022-04-20 10:56:25 +01:00
Nick O'Leary
14c23051ee Merge pull request #3388 from mw75/strategy_in_verify
OAuth/OpenID logout with Keycloak - Forum 57492
2022-04-20 10:24:58 +01:00
Nick O'Leary
330ddfa3ad Merge pull request #3528 from Steve-Mcl/link-list-in-subflow
Display link targets of nodes in a regular flow, for Link Call nodes inside a subflow
2022-04-20 09:47:35 +01:00
Nick O'Leary
a1e9a14ef3 Merge pull request #3465 from node-red/tcp-node-better-split
TCP node better split
2022-04-20 09:34:36 +01:00
Nick O'Leary
958f57085f Merge branch 'dev' into tcp-node-better-split 2022-04-20 09:34:16 +01:00
Nick O'Leary
646a786b75 Merge pull request #3519 from node-red/auto-login
Allow adminAuth to auto-login users when using passport strategy
2022-04-20 09:30:58 +01:00
Nick O'Leary
c8516bc5f4 Merge pull request #3522 from Steve-Mcl/monaco-0-33-0
Update Monaco to V0.33.0
2022-04-20 09:30:30 +01:00
Nick O'Leary
58e87b3ddf Merge pull request #3536 from bonanitech/unused-sass-vars
Remove unused SASS vars
2022-04-20 09:30:13 +01:00
Nick O'Leary
ea0abb70a2 Merge pull request #3537 from bonanitech/jquery-borders
Add custom style for jQuery widgets borders
2022-04-20 09:29:52 +01:00
Nick O'Leary
908f9562f6 Fix name auto-generator to leave blank names alone on copy/paste 2022-04-19 19:17:41 +01:00
Steve-Mcl
8131d9a640 remove theme 2022-04-19 15:28:11 +01:00
Stephen McLaughlin
e092f41074 Merge #3531 websocket status improvements
call done after ws disconnects
2022-04-19 14:40:59 +01:00
Mauricio Bonani
79a90dc476 Add custom style for jQuery widgets borders
Fixes #3518
2022-04-19 08:53:39 -04:00
Mauricio Bonani
25962dbf39 Remove unused SASS vars
Fixes #3534
2022-04-19 08:00:01 -04:00
Steve-Mcl
8df53e441d remove unused vars 2022-04-19 10:42:00 +01:00
Stephen McLaughlin
6f89efa40b remove unused if block
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-04-19 10:30:08 +01:00
Stephen McLaughlin
d6a1b4e71f Merge pull request #3535 from node-red-hitachi/fix-unknown-config-error
fix out of scope reference of `hasUnusedConfig` variable
2022-04-18 08:52:34 +01:00
Hiroyasu Nishiyama
a2c0e53f87 fix out of scope reference of hasUnusedConfig variable 2022-04-18 08:36:19 +09:00
Steve-Mcl
013af7619e add tests
- fix 2 issues found when developing tests :)
2022-04-16 17:13:54 +01:00
Steve-Mcl
aa302ecc32 Ensure filename is at least an empty string! 2022-04-16 14:42:03 +01:00
Steve-Mcl
99b049fe2d final updates to file node filename typedInput
- ensure node settings are auto updated to correct typedInput type/value
- improve label
- ensure str and env are considered "static" (keep stream open)
2022-04-16 14:25:37 +01:00
Steve-Mcl
dbdd1b8671 Merge branch 'mqtt-payload-auto-parsing' of https://github.com/Steve-Mcl/node-red into mqtt-payload-auto-parsing 2022-04-15 18:22:39 +01:00
Steve-Mcl
8ba6a7436e Add tests for MQTT v5 auto parsing hints 2022-04-15 18:21:36 +01:00
Steve-Mcl
6e35a9f682 use typedInput for filename on file nodes 2022-04-14 23:55:57 +01:00
Stephen McLaughlin
78f456911a auto mode to auto parse string to JS Object 2022-04-14 22:47:18 +01:00
Steve-Mcl
8f5d3dc49c Use v5 properties to aid auto parsing payload
- closes #3421
- fixes bug in `function setBoolProp()`
2022-04-14 22:47:18 +01:00
Steve-Mcl
97678577fb call done after ws disconnects
fixes #3527
2022-04-14 22:07:52 +01:00
Stephen McLaughlin
ce67737cc9 auto mode to auto parse string to JS Object 2022-04-14 16:39:35 +01:00
Steve-Mcl
b9919b0a9c Show link targets for link call in subflow
fixes #3248
2022-04-12 22:11:34 +01:00
Hiroyasu Nishiyama
226f45d8d5 fix reference error of msg.status in debug node 2022-04-12 11:33:02 +09:00
Hiroyasu Nishiyama
accbf6ecfc update validator arguments not to use optional object 2022-04-12 08:09:46 +09:00
Stephen McLaughlin
0aa80d82d9 Merge pull request #3524 from Steve-Mcl/hadnle-status-typo
correct "non string" check parenthesis
2022-04-11 16:50:55 +01:00
Hiroyasu Nishiyama
ace5f81a17 fix validation function argument check & eliminate option of standard validation function 2022-04-11 23:06:26 +09:00
Steve-Mcl
21a0b33645 correct "non string" check parenthesis
fixes #3493
2022-04-11 13:57:26 +01:00
Steve-Mcl
8b991e11a2 undo regression on types
- updates made directly in node-red were not in node-red/nr-monaco-build
2022-04-10 10:40:49 +01:00
Steve-Mcl
8f013776df fix model markers
- monaco depreciated model.getModeId() replaced with model._languageId
2022-04-10 09:13:41 +01:00
Steve-Mcl
c30aedd309 Update monaco to v0.33.0 2022-04-10 01:18:16 +01:00
Steve-Mcl
39f303fcd6 add unit tests 2022-04-06 15:11:37 +01:00
Steve-Mcl
76c0e140cf fix up report - remove duplicate entries 2022-04-06 15:11:28 +01:00
Steve-Mcl
ccb3c991a6 improve rejection message 2022-04-06 15:11:03 +01:00
Stephen McLaughlin
a7932da207 Merge pull request #3488 from Steve-Mcl/httpreq-headers-ui
Add UI for Http Request node headers
2022-04-06 08:35:32 +01:00
Stephen McLaughlin
5fda20c330 Improve built in help
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-04-06 07:01:01 +01:00
Nick O'Leary
1be6e4565f Merge pull request #3521 from Steve-Mcl/autocomplete-improvements
autocomplete improvements...
2022-04-05 23:44:13 +01:00
Nick O'Leary
e606d0b1de Merge pull request #3385 from node-red/allow-inject-on-start
let inject optionally fire at start in only at time mode.
2022-04-05 23:34:20 +01:00
Nick O'Leary
b4bcb7ace2 Merge pull request #3503 from node-red/debug-tooltip
Add a tooltip to debug sidebar messages to reveal full path to node
2022-04-05 23:33:14 +01:00
Nick O'Leary
a63fee1223 Merge pull request #3507 from Steve-Mcl/fix-down-arrow-in-search
Fix down arrow triggering menu in search box
2022-04-05 23:32:59 +01:00
Nick O'Leary
ae76ff0aaf Merge pull request #3516 from Steve-Mcl/status-i18n
Ensure i18n of scoped package name
2022-04-05 23:32:08 +01:00
Nick O'Leary
bba819ba84 Merge pull request #3517 from Steve-Mcl/no-deploy-when-shaded
Prevent shortcut deploy when deploy button shaded
2022-04-05 23:31:45 +01:00
Nick O'Leary
d0d0da6cb7 Merge pull request #3512 from node-red-hitachi/dev-addjpn
Add Japanese translations for v3.0
2022-04-05 23:30:49 +01:00
Steve-Mcl
475113838a autocomplete improvements...
* add minInput - fixes #3479
* Add missing entries for catch, status, tcp, udp, websocket
* corrections for http request
* match visibility improvements (mono font + match color)
* match to variable source as well as variable name
2022-04-05 14:00:14 +01:00
Nick O'Leary
b8435efc97 Allow adminAuth to auto-login users when using passport strategy
Fixes #3467
2022-04-04 21:23:39 +01:00
Steve-Mcl
780e41d6a6 Prevent shortcut deploy when deploy button shaded
fixes #3509
2022-04-04 17:06:29 +01:00
Steve-Mcl
6d0b55f753 Ensure i18n of scoped package name
fixes #3452
2022-04-04 16:20:44 +01:00
Mauricio Bonani
c9fa5c7284 Make typedInput themeable 2022-04-03 18:11:24 -04:00
Mauricio Bonani
e97f4c4054 Make tab icon themeable 2022-04-03 18:09:08 -04:00
Mauricio Bonani
96d15b7505 Make spinner themeable 2022-04-03 18:06:16 -04:00
Mauricio Bonani
2f77596034 Make icons flow themeable 2022-04-03 18:04:15 -04:00
Mauricio Bonani
5619c105aa Make separator grip themeable 2022-04-03 18:00:08 -04:00
Mauricio Bonani
9a6ee023b3 Use SVG for separator grip 2022-04-03 17:47:07 -04:00
Dave Conway-Jones
77e2e44abc Fix markdown editor to mark up orderedlists correctly
to close #3513
2022-03-31 13:45:07 +01:00
Kazuhito Yokoi
32bddfdd47 Add Japanese translations for flow editor 2022-03-30 15:34:44 +09:00
Kazuhito Yokoi
c9aa654ef0 Fix incorrect variable name for i18n of the flow editor 2022-03-30 15:34:07 +09:00
Kazuhito Yokoi
5e501857aa Add Japanese translations for link node 2022-03-30 15:31:48 +09:00
Kazuhito Yokoi
6b00aba039 Adjust indents in the documentation of the link node 2022-03-30 15:30:30 +09:00
Kazuhito Yokoi
14fa9cfa4b Change indents from tabs to 4 spaces 2022-03-30 15:20:39 +09:00
Steve-Mcl
5633c5224e Add system info UI 2022-03-29 20:59:35 +01:00
Steve-Mcl
03763a1423 Update diagnostics as per Issue discussion 2022-03-29 20:48:29 +01:00
Steve-Mcl
cf6df1556c Ensure UTC time is UTC 2022-03-29 08:35:09 +01:00
Steve-Mcl
cdc8a42393 Add diagnosticsOptions to settings.js 2022-03-28 18:50:12 +01:00
Steve-Mcl
a2fd705153 Improve diagnostics content 2022-03-28 18:49:56 +01:00
Steve-Mcl
3388f699a0 Add diagnostics endpoint
fixes #3430
2022-03-24 16:00:45 +00:00
Steve-Mcl
5e197713ff Fix down arrow triggering menu in search box
fixes #3491
2022-03-24 11:28:24 +00:00
Sam Machin
50718495da fix test mock 2022-03-24 08:39:31 +00:00
Sam Machin
b7b604aed4 Update packages/node_modules/@node-red/runtime/lib/nodes/credentials.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-03-24 08:37:51 +00:00
Sam Machin
a1f5cabbba Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-03-24 08:37:46 +00:00
Sam Machin
c2aae6ddf6 Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-03-24 08:37:35 +00:00
Dave Conway-Jones
8a40622815 tcp node - undo trim if we re-add split chars
and fix tests
2022-03-23 22:07:43 +00:00
Nick O'Leary
cb88409102 Merge pull request #3504 from Steve-Mcl/merge-master-dev
Merge-master-dev
2022-03-23 11:59:55 +00:00
Steve-Mcl
b918b75414 Merge remote-tracking branch 'upstream/master' into dev 2022-03-23 11:16:18 +00:00
Nick O'Leary
37f0e36c98 Merge pull request #3463 from Steve-Mcl/dynamic-link-call
Dynamic link call
2022-03-23 10:14:48 +00:00
Stephen McLaughlin
c8dc2327a3 Merge pull request #3497 from Steve-Mcl/mqtt-unit-tests
Add unit tests for MQTT nodes
2022-03-23 10:10:57 +00:00
Stephen McLaughlin
f660973168 Dont run MQTT tests by default on local
- update skip message to inform use of how to enable test
2022-03-23 10:00:36 +00:00
Stephen McLaughlin
cf2e7744f3 remove copyright header
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-03-23 09:15:57 +00:00
Sam Machin
855d799b21 Update credentials.js 2022-03-22 21:18:11 +00:00
Sam Machin
97dd1d0f4f typo 2022-03-22 07:34:18 +00:00
Nick O'Leary
5b5553b9a3 Add debug message path info tooltip
Fixes #3477
2022-03-21 20:44:36 +00:00
Stephen McLaughlin
702545e0b2 Merge pull request #3500 from ralphwetzel/master
Fix: Sidebar "Configuration" filter button tooltip
2022-03-21 20:10:55 +00:00
Stephen McLaughlin
fa2787eb5d Merge pull request #3499 from bonanitech/diff-colors
Add the ability to customize diff colors even more
2022-03-21 20:09:21 +00:00
Nick O'Leary
0f37b326a0 Merge pull request #3502 from Steve-Mcl/fix-mqtt-will-props
fix typo of will properties (properies)
2022-03-21 19:29:23 +00:00
Steve-Mcl
7f9f551cfe fix typo of will properties (properies)
Fixes #3501
2022-03-21 15:24:23 +00:00
Steve-Mcl
ecf1847dd2 use CI flag to skip MQTT tests 2022-03-21 14:59:10 +00:00
Steve-Mcl
40a9dce869 try broker.emqx.io 2022-03-21 13:51:20 +00:00
Steve-Mcl
a6696733fa tidy up code 2022-03-21 13:50:24 +00:00
Sam Machin
d9bd736159 change error to warn for moving from unencrypted to encrypted 2022-03-21 09:29:41 +00:00
ralphwetzel
4f5f5d31a3 Merge pull request #1 from ralphwetzel/ralphwetzel-sidebar-filter-button-tooltip
Fix: Sidebar "Configuration" filter button tooltip
2022-03-21 00:06:02 +01:00
ralphwetzel
fad1325427 Fix: Sidebar "Configuration" filter button tooltip
"Configuration" sidebar shows wrong tooltip for filter button "All". Fixed.
2022-03-20 23:59:24 +01:00
Mauricio Bonani
8b6678a453 Add the ability to customize diff colors even more 2022-03-20 15:40:52 -04:00
Sam Machin
c7f48a83c0 add test 2022-03-19 17:57:30 +00:00
Sam Machin
af0f02d63e add locale warning 2022-03-19 17:44:21 +00:00
Steve-Mcl
497d63e67e Add unit tests for MQTT nodes 2022-03-19 17:29:31 +00:00
Sam Machin
4d048af384 Check for missing encrypted credentials 2022-03-19 13:34:46 +00:00
Nick O'Leary
3649f10600 Merge pull request #3478 from node-red/auto-gen-name
Allow node name to be auto-generated when added
2022-03-14 19:35:58 +00:00
Nick O'Leary
49e69a54bd Merge pull request #3481 from Steve-Mcl/fix-node-val-changed
do JSON comparison of old value/new value
2022-03-14 18:52:25 +00:00
Nick O'Leary
a0acc89fcb Merge pull request #3405 from Steve-Mcl/continuous-search
Add feature: Continuous search tools (search previous, search next)
2022-03-14 18:38:04 +00:00
Nick O'Leary
64d1a82920 Merge pull request #3462 from node-red/junctions
Add Junctions
2022-03-14 18:34:09 +00:00
Nick O'Leary
2396e28479 Add 'juntion' to quick-add type search 2022-03-14 18:31:23 +00:00
Nick O'Leary
db1ad0df63 Add Junctions 2022-03-14 18:16:24 +00:00
Steve-Mcl
c5de18caae fix: node save broken
- Revert last minute code tidy that changed too many `this` to `node`
2022-03-12 16:10:36 +00:00
Steve-Mcl
e57774e121 fix UI change events
- use `this` not `node` in UI change events
2022-03-12 15:02:25 +00:00
Steve-Mcl
b7ee46d400 revise header options
- remove Accept-Charset
- Use camel case by default
- additional encodings
2022-03-12 15:00:48 +00:00
Steve-Mcl
6007132640 rearange UI (name to bottom) 2022-03-12 14:59:15 +00:00
Steve-Mcl
31b3a4c342 Add UI for common headers/values
- Wrap HTML node script in IFFE (isolate module level vars & functions)
- Add UI elements for setting headers in http req node edit form
- Update built in help
- Add tests
2022-03-12 13:47:29 +00:00
Stephen McLaughlin
73ff852648 backward compatible equality testing of immutables
- make non object equality tests non strict
- this aligns with prior condition
2022-03-10 11:22:59 +00:00
Nick O'Leary
6d50eb5737 Merge pull request #3484 from zettca/node-wires-array
fix nodes losing their wires when in an iframe
2022-03-09 11:42:10 +00:00
Nick O'Leary
3c0b74005b Add core:generate-node-names action 2022-03-09 11:32:37 +00:00
Nick O'Leary
93ff667df1 Add RED.utils.getPaletteLabel 2022-03-09 11:29:51 +00:00
Bruno Henriques
a8579fa68a fix nodes losing their wires when in an iframe 2022-03-09 10:39:47 +00:00
Stephen McLaughlin
10f77fdf1a permit non strict comparison of string or number 2022-03-08 23:13:41 +00:00
Steve-Mcl
99d824a999 Merge 2022-03-08 16:19:28 +00:00
Steve-Mcl
97d2b5df15 close search toolbar on escape 2022-03-08 16:09:05 +00:00
Steve-Mcl
84a9cf7adf handle errors by circ refs, undefined, BigInt etc 2022-03-08 14:20:12 +00:00
Steve-Mcl
a49927f173 do JSON comparison of old value/new value
fixes #3475
2022-03-08 14:07:03 +00:00
Nick O'Leary
6a5c50ff77 Merge pull request #3476 from Steve-Mcl/fix-calculateGridSnapOffsets
fix PR 'split wire with link nodes' #3416
2022-03-07 21:10:46 +00:00
Steve-Mcl
c948573c2d fix PR 'split wire with link nodes' #3416 2022-03-07 20:23:06 +00:00
Stephen McLaughlin
5233bc501c Merge branch 'dev' into continuous-search 2022-03-07 20:04:59 +00:00
Steve-Mcl
ad96c6f838 fix search counter glitch 2022-03-07 20:01:24 +00:00
Nick O'Leary
0e92f68b4a Merge pull request #3399 from Steve-Mcl/split-wire-to-links
Add feature: split-wire-to-links
2022-03-07 12:57:49 +00:00
Nick O'Leary
ac97e8c613 Merge pull request #3468 from Steve-Mcl/scroll-into-view-calcs
Improve scroll into view
2022-03-07 12:47:54 +00:00
Nick O'Leary
95fe717ca7 Merge pull request #3472 from Steve-Mcl/fix-mqtt-setboolprop
fix: ensure mqtt v5 props can be set false
2022-03-07 12:47:01 +00:00
Steve-Mcl
10b18de3e0 fix: ensure mqtt v5 props can be set false
fixes #3471
2022-03-05 11:24:25 +00:00
Steve-Mcl
08295eb807 Remove RED.nodes.createNode 2022-03-05 11:08:36 +00:00
Steve-Mcl
fce4f0c116 resolve PR issues...
- change default keymap to `ALT-L L`
- Move `RED.nodes.createNode` to `RED.view.createNode`
- replace `selectedLinks` with `selection().links`
2022-03-05 11:06:13 +00:00
Steve-Mcl
cf1424976f Improve scroll into view
- if a node is behind scrollbar, it is not scrolled into view
- jQuery `.width()` & `.width()` actually includes the scroll bar.
- using native `clientWidth` and `clientHeight` fixes this
2022-03-04 16:08:29 +00:00
Steve-Mcl
94e8fce40a improve contineous search
- rename action core:search-prev for  core:search-previous
- Ensure search counter in toolbar is i18n ready
- remember (and display in toolbar) the search term
- recall the search term when magnifier clicked
- esnure currently flashing node is cancelled before flashing next node
- Add "flash" for flow tabs revealed by a search
- Fix "flash" for config nodes revealed by a search
2022-03-04 16:00:02 +00:00
Steve-Mcl
ea671bf395 Use v5 properties to aid auto parsing payload
- closes #3421
- fixes bug in `function setBoolProp()`
2022-03-04 08:44:21 +00:00
Nick O'Leary
fdb868516f Merge pull request #3464 from Steve-Mcl/dont-show-hidden-tab
Dont show 1st tab if hidden when loading
2022-03-03 23:15:07 +00:00
Nick O'Leary
c75bebfc90 Merge pull request #3390 from node-red/copy-node-props
Copy node props
2022-03-03 21:57:00 +00:00
Nick O'Leary
3e102ef760 Merge pull request #3395 from Steve-Mcl/search-options
Add info-tab search options dropdown to the regular search
2022-03-03 21:53:21 +00:00
Nick O'Leary
c07eddbd97 Merge branch 'dev' into search-options 2022-03-03 21:52:52 +00:00
Stephen McLaughlin
e85b925f40 Ensure linkType is a valid value (2nd attempt) 2022-03-01 16:48:31 +00:00
Steve-Mcl
27761ba6f2 Update built in docs 2022-02-28 19:01:15 +00:00
Steve-Mcl
b665698e78 Ensure linkType is a valid value 2022-02-28 19:00:58 +00:00
Steve-Mcl
97ebe33d68 Dont show 1st tab if hidden when loading
fixes #3455
2022-02-28 18:15:13 +00:00
Steve-Mcl
249f7e45fb Link Call should not call into subflow...
- includes missing jsdoc
- improves speed (no searching, only lookups)
- code formatting consistency
- improve tests
2022-02-28 13:57:22 +00:00
Dave Conway-Jones
c0612e6193 Merge branch 'master' of https://github.com/node-red/node-red 2022-02-28 09:59:35 +00:00
Ariel Ferreira
79a789c557 add test to check if in the case user contains token, Node-RED uses it instead of generating a new Token 2022-02-26 17:24:59 -05:00
Ariel Ferreira
450888f542 check if user contains token and use it instead of generating a new Token 2022-02-26 16:35:46 -05:00
萧十一郎
380a08242a fix html label mistake (#3459) 2022-02-26 10:10:17 +00:00
Steve-Mcl
e653a933f1 fix subflow calls 2022-02-25 18:39:48 +00:00
Dave Conway-Jones
bda5dffa34 Add tests 2022-02-25 16:19:20 +00:00
Steve-Mcl
29df7e84a1 add tests 2022-02-25 16:13:48 +00:00
Steve-Mcl
19cf43a10e Re-write link call targeting...
- Remove msg.target by object
- Remove :: scoping
- Always try to locate matching link-in on same flow first
  - If not found, look on all flows
    - if 1 found, call it
    - If more than 1 link target found, raise error
2022-02-25 16:13:39 +00:00
Dave Conway-Jones
0398ef3b90 undo regression in tcp-in node (missed one)
and add test
2022-02-25 16:06:44 +00:00
Dave Conway-Jones
8c19daf949 TCP nodes- Add optional reattach delimiter to streaming strings 2022-02-25 15:56:13 +00:00
Steve-Mcl
e4f0688a02 dynamic link target 1st draft 2022-02-24 19:46:21 +00:00
Dave Conway-Jones
25f4fbf2bb undo regression to tcp-in node
To fix #3454
2022-02-21 20:03:25 +00:00
Nick O'Leary
0533c08438 Merge branch 'master' into dev 2022-02-18 22:02:30 +00:00
Nick O'Leary
5f0ea85f47 Bump for 2.2.2 2022-02-18 14:46:01 +00:00
Nick O'Leary
6c7c1202ed Merge pull request #3451 from Steve-Mcl/fix-mqtt-close-timeout
Fix "close timed out" error when performing full deploy or modifying broker node.
2022-02-18 14:43:34 +00:00
Steve-Mcl
669aa769c2 Fix close timeout on MQTT nodes
fixes #2934
2022-02-17 10:18:46 +00:00
Nick O'Leary
fcf2994015 Bump for 2.2.1 2022-02-15 13:41:53 +00:00
Nick O'Leary
bee21ddc9e Update dependencies 2022-02-15 13:36:05 +00:00
Nick O'Leary
263e68e677 Merge pull request #3447 from Steve-Mcl/fix-hook-module-location
Improve module location parsing (of stack info) when adding hook
2022-02-15 13:18:25 +00:00
Steve-Mcl
2b958f5724 Improve module location parsing when adding hook
- fixes #3401
- handles brackets and no brackets in stack line
- handles short stack
2022-02-15 12:40:34 +00:00
Nick O'Leary
95f7177ef4 Merge pull request #3445 from node-red-hitachi/fix-path-substitution
Fix substitution of NR_NODE_PATH
2022-02-15 11:26:19 +00:00
Nick O'Leary
006324b78e Merge pull request #3446 from Steve-Mcl/better-bad-node-err-log
improve "Unexpected Node Error" logging
2022-02-15 11:26:08 +00:00
Steve-Mcl
efd8c1229d improve "Unexpected Node Error" logging
- fixes #3389
- adds additional info to aid sourcing the issue
- removes lots of undefined info when node type is incorrect
- stores and reports original stack before internal try/catch exception
- ensure this._flow is something before attempting to call `handleError`
2022-02-15 10:51:18 +00:00
Hiroyasu Nishiyama
0f1aea3e0d add test case 2022-02-15 14:41:03 +09:00
Hiroyasu Nishiyama
6a41cbebc9 evaluate env var after path initialization 2022-02-15 14:23:01 +09:00
Nick O'Leary
fba95e6a42 Merge pull request #3392 from Steve-Mcl/search-ismodified
New Feature: Add ability to find modified nodes/flows.
2022-02-14 23:19:27 +00:00
Nick O'Leary
bffb91f196 Merge pull request #3443 from node-red/delay-field-validation
Allow nbRateUnits to be undefined when validating
2022-02-14 23:18:41 +00:00
Nick O'Leary
4573b65639 Merge pull request #3444 from node-red/keyboard-filter-case
Handle mixed-cased filter terms in keyboard shortcut dialog
2022-02-14 23:18:16 +00:00
Nick O'Leary
3d8505385a Merge pull request #3442 from node-red/dupe-links
Prevent duplicate links being added between nodes
2022-02-14 23:18:01 +00:00
Nick O'Leary
95d3a8cc22 Merge pull request #3409 from node-red/let-switch-number-test-report-NaN-as-false
switch node - add check for NaN in is of type number to be false
2022-02-14 23:17:38 +00:00
Nick O'Leary
99c053f86b Merge pull request #3440 from Steve-Mcl/monaco-env-suggestions
Coding help for recently added node-red Predefined Environment Variables
2022-02-14 23:02:55 +00:00
Nick O'Leary
f2dde705ef Handle mixed-cased filter terms in keyboard shortcut dialog
Fixes #3400
2022-02-14 20:59:43 +00:00
Nick O'Leary
be11fda814 Allow nbRateUnits to be undefined when validating
Fixes #3407
2022-02-14 20:44:55 +00:00
Nick O'Leary
0261105c52 Prevent duplicate links being added between nodes 2022-02-14 20:35:47 +00:00
Nick O'Leary
264047dc0c Merge pull request #3437 from Steve-Mcl/fix-multiple-wires
bug fix: Dont add wires to undo buffer twice
2022-02-14 20:12:46 +00:00
Steve-Mcl
4d84926ed2 Update monaco for Predefined Environment Variables
- add Predefined Environment Variables to snippet suggestions
- update jsdoc for `env.get`
2022-02-14 13:38:37 +00:00
Nick O'Leary
da3211fee6 Merge pull request #3439 from node-red/remove-debug
Remove console.log when ignoring disabled module
2022-02-14 10:48:33 +00:00
Nick O'Leary
1388b03cf2 Remove console.log when ignoring disabled module 2022-02-14 10:46:08 +00:00
Hiroyasu Nishiyama
9f98b4b082 add support of property validation message 2022-02-14 10:40:49 +09:00
Steve-Mcl
b3f1401ab4 Dont add wires to undo buffer twice
Fixes #3433
2022-02-13 16:56:26 +00:00
Hiroyasu Nishiyama
e5e3832809 fix Japanese message of delay node (#3434) 2022-02-12 16:13:59 +00:00
Nick O'Leary
2eff7da171 Merge pull request #3397 from node-red-hitachi/fix-config-node-validation
fix node validation to be applied to config node
2022-02-09 19:47:23 +00:00
Nick O'Leary
e9622bcfe8 Merge pull request #3391 from node-red-hitachi/fix-hide-flow-tooltip
fix to hide tooltip after removing subflow tab
2022-02-09 19:44:05 +00:00
Dave Conway-Jones
63ebadc526 add check for NaN in is of type number to be false
and add test
to fix issue #3408
2022-02-09 12:03:38 +00:00
Steve-Mcl
fe47b07229 Add feature: search next, search previous 2022-02-09 11:00:09 +00:00
Hiroyasu Nishiyama
dc73997be3 fix not to use hasOwnProperty 2022-02-08 09:21:52 +09:00
Steve-Mcl
62315fd478 Add feature: split-wire-to-links 2022-02-07 12:25:09 +00:00
Hiroyasu Nishiyama
fb81121bd3 fix node validation to be applied to config node 2022-02-04 17:45:00 +09:00
Nick O'Leary
5293563a6a Merge pull request #3394 from Alkarex/fix-debug-node-hasOwnProperty
Fix no-prototype-builtins bug in debug node and utils
2022-02-03 16:31:46 +00:00
Alexandre Alapetite
2e1e61dabe Remove part of JSDoc 2022-02-03 16:32:51 +01:00
Alexandre Alapetite
280d63fde7 Fix util.encodeObject 2022-02-03 15:59:25 +01:00
Steve-Mcl
c6104195f6 add search options dropdown to regular search 2022-02-03 10:26:50 +00:00
Alexandre Alapetite
e55cbb3e3d Fix bug in debug node due to msg.hasOwnProperty construct
`msg.hasOwnProperty("status")` might make the debug node crash/produce an error if the payload was created with `Object.create(null)`.
This is the case e.g. for `ini` (to parse INI files), an official NPM node:
4f289946b3/lib/ini.js (L63)

My Node-RED node `node-red-contrib-parser-ini`, which is using that library, was hit by this bug and I had to ship a workaround
fe6b1eb4b1/parser-ini.js (L14)

The `msg.hasOwnProperty("xxx")` construct should not be used since ECMAScript 5.1.

ESLint advises in the same direction https://eslint.org/docs/rules/no-prototype-builtins

This patch was produced using the following regex:
Search: `\b([\w.]+).hasOwnProperty\(`
Replace: `Object.prototype.hasOwnProperty.call($1, `

This could be applied more gobally if desired.
2022-02-03 02:01:22 +01:00
Steve-Mcl
56b85e4194 Merge branch 'search-ismodified' of https://github.com/Steve-Mcl/node-red into search-ismodified 2022-02-02 17:21:33 +00:00
Steve-Mcl
6431c43d0e Add ability to find modified nodes/flows 2022-02-02 17:21:23 +00:00
Steve-Mcl
a62107fbd1 Add ability to find modified nodes/flows 2022-02-02 17:19:23 +00:00
Hiroyasu Nishiyama
7959d18248 hide tooltip after removing subflow tab 2022-02-02 11:34:58 +09:00
Nick O'Leary
2f66915a9f Update node info table based on selection of outliner 2022-01-31 21:14:07 +00:00
Nick O'Leary
a508177e21 Add copy-value button to entries in Node Props table of info sidebar 2022-01-31 20:35:42 +00:00
Mario Wolff
5a9d858604 OAuth/OpenID logout with Keycloak - Forum 57492 2022-01-31 08:03:34 +01:00
Dave Conway-Jones
514da83961 let inject optionally fire at start in only at time mode. 2022-01-28 18:05:20 +00:00
Nick O'Leary
b7bae18849 Update inner package dependency 2022-01-27 12:58:43 +00:00
Nick O'Leary
fbde247c72 Update node-red-admin dependency 2022-01-27 12:57:32 +00:00
Nick O'Leary
3a69af9034 Merge pull request #3383 from node-red/dev
Merge dev to master for 2.2.0
2022-01-27 12:50:45 +00:00
Nick O'Leary
5c87a6cb76 Update package readmes and licenses 2022-01-27 12:49:48 +00:00
Nick O'Leary
9c6bb434e8 Update contributing guide for new cla 2022-01-27 12:44:22 +00:00
Nick O'Leary
d1bd303dfa Update version for 2.2.0 2022-01-27 10:13:28 +00:00
Nick O'Leary
3813c32454 Update marked to latest 2022-01-27 10:12:55 +00:00
Nick O'Leary
3b00a692ee Update changelog 2022-01-27 10:12:06 +00:00
Nick O'Leary
3304ebe9d3 Merge pull request #3382 from node-red-hitachi/fix-subflow-update
fix opening/closing subflow template not to make subflow changed
2022-01-27 09:30:26 +00:00
Nick O'Leary
513120cbfe Merge pull request #3381 from kazuhitoyokoi/dev-addjpn
Add Japanese translations for v2.2.0
2022-01-27 09:28:29 +00:00
Hiroyasu Nishiyama
b06049d5a3 fix opening/closing subflow template not to make subflow changed 2022-01-27 12:57:37 +09:00
Kazuhito Yokoi
0f50355deb Add Japanese translations for v2.2.0 2022-01-27 11:14:24 +09:00
Nick O'Leary
bd6e35fea2 Merge branch 'dev' of github.com:node-red/node-red into dev 2022-01-26 17:46:47 +00:00
Nick O'Leary
a4fd63cd44 Merge pull request #3380 from Steve-Mcl/search-find-filenode
Pallet Label (if different to type) should be indexed for search
2022-01-26 17:00:47 +00:00
Steve-Mcl
fdc4219b68 palletLabel (if different) should be indexed
for search - fixes #3297
2022-01-26 16:14:34 +00:00
Nick O'Leary
5b428bb8e6 Merge pull request #3379 from node-red-hitachi/nr_node_path-support
add NR_NODE_PATH path support
2022-01-26 14:29:03 +00:00
Hiroyasu Nishiyama
c948ff88a5 add support of NR_NODE_PATH 2022-01-26 21:24:48 +09:00
Nick O'Leary
9b9a0d7060 Update dependencies 2022-01-26 12:20:45 +00:00
Nick O'Leary
16578e3677 Update changelog 2022-01-26 12:07:04 +00:00
Nick O'Leary
be7f84bc67 Merge pull request #3377 from Steve-Mcl/function-node-decs
Update `node` declarations in func.d.ts
2022-01-26 12:03:56 +00:00
Nick O'Leary
033d26f2cb Merge pull request #3378 from node-red/tour-update
Update tour for 2.2.0
2022-01-26 12:03:40 +00:00
Nick O'Leary
4c0826b1c4 Update tour for 2.2.0 2022-01-26 12:00:30 +00:00
Steve-Mcl
c4cc204c94 Add static declerations to func ts. fixes #3376 2022-01-26 11:40:05 +00:00
Nick O'Leary
3747db18b1 Update changelog 2022-01-26 11:34:32 +00:00
Nick O'Leary
4173625fca Merge pull request #3243 from node-red/delete-global-context
Clear context contents when switching projects
2022-01-26 11:28:34 +00:00
Nick O'Leary
0e7863a6fb Merge pull request #3375 from node-red/settings-update
Add editorTheme.tours property to default settings file
2022-01-26 11:21:55 +00:00
Nick O'Leary
207ba00ad2 Add editorTheme.tours property to default settings file 2022-01-26 11:21:11 +00:00
Nick O'Leary
87c89586a5 Merge pull request #3356 from node-red-hitachi/node-prop-env-var
Add support for accessing node id & name as environment variable
2022-01-26 11:11:02 +00:00
Nick O'Leary
1cea1ced82 Merge pull request #3371 from node-red/node-alias
Add _path property to nodes and expose as node.path in Function node
2022-01-26 11:10:43 +00:00
Nick O'Leary
08732bac0f Merge pull request #3374 from Steve-Mcl/mqtt-reconnect-fix
Mqtt reconnect fix
2022-01-26 11:03:20 +00:00
Nick O'Leary
283e8d3c08 Merge pull request #3373 from Steve-Mcl/merge-fix
bug: merge issue. fixes #3364
2022-01-26 11:01:35 +00:00
Nick O'Leary
42a7165596 Merge pull request #3372 from Steve-Mcl/use-paletteLabel-in-help
Use a nodes palette label in help tree
2022-01-26 11:00:53 +00:00
Hiroyasu Nishiyama
aa3f5001d5 additional update of test for NR_ prefix addition 2022-01-26 10:52:41 +09:00
Hiroyasu Nishiyama
56580c4005 add test for NR_ prefix addition 2022-01-26 09:26:05 +09:00
Hiroyasu Nishiyama
ba304c9651 add NR_ prefix to special environment variables 2022-01-26 09:25:30 +09:00
Nick O'Leary
703c5adba7 Add _path property to nodes and expose as node.path in Function node 2022-01-25 21:32:28 +00:00
Steve-Mcl
8b85f6e0a6 ensure help search is case insensitive 2022-01-25 18:27:47 +00:00
Nick O'Leary
c136d22382 Merge pull request #3370 from node-red/fix-vertical-align-subflow-port
Fix vertical align subflow port
2022-01-25 17:09:05 +00:00
Nick O'Leary
42358419ad Fix vertical align of subflow port labels 2022-01-25 17:08:04 +00:00
Nick O'Leary
ab2ced5c37 Merge pull request #3352 from ralphwetzel/dev
Subflow: Add labels to OUTPUT nodes
2022-01-25 17:07:12 +00:00
Steve-Mcl
faf31be0dc Ensure label is shown in help tree 2022-01-25 16:30:30 +00:00
Nick O'Leary
ff4c67d068 Merge pull request #3353 from kazuhitoyokoi/dev-addjpn
Add Japanese translations for v2.2.0-beta.1
2022-01-25 16:02:29 +00:00
Steve-Mcl
10b133db02 bug: merge issue. fixes #3364 2022-01-25 14:47:36 +00:00
Nick O'Leary
f0bf607b43 Merge pull request #3359 from node-red-hitachi/fix-action-list-i18n
fix to make actions list i18n ready and Japanese translation
2022-01-25 14:47:18 +00:00
Steve-Mcl
8948ca5323 Merge branch 'dev' into mqtt-reconnect-fix 2022-01-25 12:32:49 +00:00
Steve-Mcl
9c3be51fe9 Improve MQTT broker disconnect situation
* Ensure topic is sane to prevent error 129
* Ensure a log entry is made
* Update node status
2022-01-25 12:29:51 +00:00
Hiroyasu Nishiyama
2da9161f29 Update packages/node_modules/@node-red/editor-client/src/js/ui/actions.js
Oh, I'm sorry about this.

Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-01-25 21:21:39 +09:00
Hiroyasu Nishiyama
983dad5b53 add test for env var access of GROUP_ID & GROUP_NAME 2022-01-25 21:07:38 +09:00
Hiroyasu Nishiyama
8b23d341b4 add support for env var access of GROUP_ID & GROUP_NAME 2022-01-25 21:04:43 +09:00
Hiroyasu Nishiyama
0ad60013aa add test for env var access of FLOW_ID & FLOW_NAME 2022-01-25 20:52:45 +09:00
Hiroyasu Nishiyama
289815e128 add support of FLOW_ID & FLOW_NAME 2022-01-25 20:46:01 +09:00
Kazuhito Yokoi
f7ee83f1b9 Add translations for restoring zoom level and scroll position 2022-01-25 11:18:35 +09:00
Nick O'Leary
f67aafa8d3 Merge pull request #3361 from node-red/zoom-level
Remember Zoom level and Sidebar tab selection between sessions
2022-01-24 23:21:31 +00:00
Nick O'Leary
4e5ddd57bf Merge branch 'dev' of github.com:node-red/node-red into dev 2022-01-24 23:18:43 +00:00
Nick O'Leary
e0d4ecf835 Merge branch 'master' into dev 2022-01-24 23:18:25 +00:00
Nick O'Leary
81a461115b Merge pull request #3365 from node-red-hitachi/fix-http-request-set-cookie
Fix http request set cookie to use sync API
2022-01-24 21:26:29 +00:00
Nick O'Leary
d679b02658 Add option to remember zoom and scroll position in localStorage 2022-01-24 21:04:27 +00:00
Hiroyasu Nishiyama
5effcdb024 use setCookieSync instead of setCookie 2022-01-19 23:45:13 +09:00
Nick O'Leary
211a5eb2bb Bump for 2.1.6 2022-01-18 09:46:57 +00:00
Nick O'Leary
c4465ba58d Merge pull request #3351 from node-red-hitachi/fix-delay-rate-unit-validation
fix unit value validation of delay node
2022-01-18 09:45:56 +00:00
Nick O'Leary
7903c53876 Merge pull request #3363 from node-red/revert-copy-fix
Revert copy-text change and apply alternative fix
2022-01-18 09:28:37 +00:00
Nick O'Leary
dbefe6a560 Revert copy-text change and apply alternative fix
Reverts PR #3331 and applies the alternative fix originally proposed
in PR #3329
2022-01-18 09:27:15 +00:00
Nick O'Leary
8b1f412255 Merge pull request #3362 from node-red/update-marked
Update marked to latest
2022-01-18 09:22:28 +00:00
Nick O'Leary
a2e0074061 Update marked to latest 2022-01-18 09:20:52 +00:00
Nick O'Leary
5fc920087b Store user zoom level in localStorage 2022-01-17 21:27:48 +00:00
Nick O'Leary
085233ab9b Remember last sidebar tab between editor sessions 2022-01-17 21:27:21 +00:00
Hiroyasu Nishiyama
6657b2629f move i18n code to action list according to PR comment 2022-01-16 12:10:19 +09:00
Nick O'Leary
310a279aaf Merge pull request #3358 from node-red-hitachi/fix-property-error-tooltip
fix to make start of property error tooltip messages aligned
2022-01-15 19:44:18 +00:00
Hiroyasu Nishiyama
58f3a76da7 fix to make actions list i18n ready and Japanese translation 2022-01-15 20:39:05 +09:00
Hiroyasu Nishiyama
a2c9458b1b aligin start of property error tooltip messages 2022-01-15 13:11:56 +09:00
Hiroyasu Nishiyama
75bcd9e8d5 add support for accessing node id & name as env var 2022-01-14 23:40:12 +09:00
Kazuhito Yokoi
977e7ef395 Add Japanese translations for v2.2.0-beta.1 2022-01-14 14:43:28 +09:00
ralphwetzel
eb1b8b577f Merge branch 'node-red:dev' into dev 2022-01-13 23:36:23 +01:00
ralphwetzel
28f91685ce Subflow: Add labels to OUTPUT nodes 2022-01-13 23:33:06 +01:00
Nick O'Leary
81a4fe59d9 Update changelog/welcome tour for 2.2 2022-01-13 15:16:16 +00:00
Hiroyasu Nishiyama
e7189ab81f fix unit value validation of delay node 2022-01-13 23:52:06 +09:00
Nick O'Leary
346db89e66 Merge pull request #3349 from node-red-hitachi/fix-inject-property-validation
fix JSON propety validation of inject node
2022-01-13 12:50:17 +00:00
Hiroyasu Nishiyama
f786c7f144 fix JSON propety validation of inject node 2022-01-13 21:42:50 +09:00
Nick O'Leary
51f45293b8 Merge branch 'master' into dev 2022-01-13 10:52:36 +00:00
Nick O'Leary
943b103001 Update changelog 2022-01-13 10:29:20 +00:00
Nick O'Leary
f055d42277 Update package version for 2.1.5 2022-01-13 10:22:41 +00:00
Nick O'Leary
fb7a2a8d5d Update dependencies 2022-01-13 10:19:56 +00:00
Nick O'Leary
1e5ed2a2e3 Merge pull request #3331 from kazuhitoyokoi/master-fixcopybutton2
Fix copy buttons on the debug window (another method)
2022-01-13 09:50:27 +00:00
Nick O'Leary
e1467dfe23 Merge pull request #3348 from node-red/scrollbar-expand
Prevent function scrollbar from obscuring expand button
2022-01-13 09:49:15 +00:00
Nick O'Leary
c480f96d30 Prevent function scrollbar from obscuring expand button
Fixes #2955
2022-01-13 09:46:37 +00:00
Kazuhito Yokoi
cf613aafb2 Update packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2022-01-13 10:35:12 +09:00
Nick O'Leary
20dbf7c5f4 Merge pull request #3346 from node-red/fix-stack-capture
Handle reporting error location when stack is truncated
2022-01-12 22:54:25 +00:00
Nick O'Leary
47c912c25b Merge pull request #3345 from node-red/jsonata-compat-mode-fix
Improve jsonata legacy mode detection regex
2022-01-12 22:54:05 +00:00
Nick O'Leary
48fb1a8127 Merge pull request #3344 from node-red/fix-ws-hb
Only setup ws client heartbeat once it is connected
2022-01-12 22:53:51 +00:00
Nick O'Leary
6c1b55db16 Merge pull request #3347 from node-red/flow-name-increment
Fix generating flow name with incrementing number
2022-01-12 22:53:33 +00:00
Nick O'Leary
df70c8a800 Fix generating flow name with incrementing number
Fixes #3295
2022-01-12 22:45:18 +00:00
Nick O'Leary
82ae2e7118 Handle reporting error location when stack is truncated
Fixes #3292
2022-01-12 22:07:44 +00:00
Nick O'Leary
0cf9b5f3df Improve jsonata legacy mode detection regex
Fixes #3290
2022-01-12 21:56:38 +00:00
Nick O'Leary
036a825892 Only setup ws client heartbeat once it is connected
Fixes #3264
2022-01-12 21:46:56 +00:00
Nick O'Leary
8b43b31c64 Add checkbox on project-open screen to clear context 2022-01-12 21:05:47 +00:00
Nick O'Leary
3abef972a7 Clear context contents when switching projects
Fixes #3240
2022-01-12 18:59:29 +00:00
Nick O'Leary
30b00741b5 Merge pull request #3296 from node-red/Json-try-parse-buffer
Let JSON node attempt to parse buffer if it contains a valid string
2022-01-12 18:58:02 +00:00
Nick O'Leary
f86e743cce Merge branch 'master' into dev 2022-01-12 17:59:26 +00:00
Nick O'Leary
cb96fb735e Merge pull request #3289 from node-red/snap-grid
Snap nodes on grid using either edge as reference
2022-01-12 17:57:26 +00:00
Nick O'Leary
459a52d31d Merge pull request #3340 from node-red/cut-wires
Add wire-slice mode to delete wires with Ctrl-RHClick-Drag
2022-01-12 17:52:54 +00:00
Nick O'Leary
44ef9a13d6 Merge pull request #3338 from node-red/detach-action
Detach action
2022-01-12 17:52:32 +00:00
Nick O'Leary
0bb3652a63 Merge pull request #3323 from node-red/highlight-links
Highlight links when selecting nodes
2022-01-12 17:52:03 +00:00
Nick O'Leary
6a82d683a9 Merge pull request #3262 from node-red/search-history
Add search history to main search box
2022-01-12 17:51:46 +00:00
Nick O'Leary
fad708e8de Merge pull request #3294 from node-red/multi-select-links
Allow multiple links to be selected by ctrl-click
2022-01-12 17:51:15 +00:00
Nick O'Leary
c6a38b8355 Merge pull request #3300 from node-red/remove-use-of-verbose-flag-in-core-nodes
Remove use of verbose flag in core nodes - and use node.debug level instead
2022-01-12 17:38:34 +00:00
Nick O'Leary
ee84eb666b Merge pull request #3307 from node-red/add-tls-option-to-tcp-node
Add TLS option to tcp client nodes
2022-01-12 17:37:43 +00:00
Nick O'Leary
6d2793cac6 Merge pull request #3336 from node-red-hitachi/add-link-call-example
add link call example
2022-01-12 17:31:57 +00:00
Nick O'Leary
86d518fc2e Merge pull request #3343 from node-red/adminAuth-logging
Initialize passport when only adminAuth.tokens is set
2022-01-12 17:31:44 +00:00
Nick O'Leary
25dba1a6d5 Merge pull request #3342 from node-red/add-log-logging
Add log logging
2022-01-12 17:29:29 +00:00
Nick O'Leary
af949c62c2 Allow 'escape' to cancel wire-slicing 2022-01-12 17:24:25 +00:00
Nick O'Leary
ea20342d76 Handle non-error responses from token function 2022-01-12 13:48:06 +00:00
Nick O'Leary
7732d52583 Initialize passport when only adminAuth.tokens is set
Fixes #3341
2022-01-12 13:27:01 +00:00
Nick O'Leary
c801bc5e6b Add error logging if Node.log throws an error
Part of #3327
2022-01-12 11:13:29 +00:00
Nick O'Leary
ea43729063 Add _module to Node object to provide module info 2022-01-12 11:07:25 +00:00
Nick O'Leary
e26bae8027 Merge pull request #3333 from tobiasoort/dev
Implemented support for Websocket Subprotocols in WS Client Node.
2022-01-12 09:31:55 +00:00
Tobias Oort
555f155cad Added support for commaseparated subprotocols
Removed placeholder from html
2022-01-12 09:10:35 +01:00
Nick O'Leary
f8c47f59bc Merge pull request #3339 from node-red/fix-filter-node-start-condition
Fix for filter node narrrowbandEq mode start condition failure
2022-01-11 22:39:14 +00:00
Nick O'Leary
f3997128b9 Add wire-slice mode to delete wires with Ctrl-RHClick-Drag 2022-01-11 19:49:40 +00:00
Nick O'Leary
154a4e23dd Add delete-selection-and-reconnect action 2022-01-11 14:11:55 +00:00
Dave Conway-Jones
52e4e0e569 Fix for narrrowbandEq mode start condition failure
And add test
As discussed https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371
2022-01-11 13:56:44 +00:00
Nick O'Leary
30f2b96c68 Pressing escape whilst DETACH_DRAGGING should revert change 2022-01-11 00:24:34 +00:00
Nick O'Leary
58c94b7773 Add core:detach-selected-nodes action 2022-01-11 00:16:24 +00:00
Tobias Oort
83203d5f5d Fixed property name in unit-test 2022-01-10 22:23:45 +01:00
Dave Conway-Jones
f77d161643 remove debug msg from inject close 2022-01-10 20:22:20 +00:00
Nick O'Leary
6580b139c0 Merge pull request #3288 from node-red/wiring-shortcut
Wiring shortcut
2022-01-10 18:34:06 +00:00
Nick O'Leary
2743c7c6ac Merge pull request #3304 from node-red-hitachi/dev-unknownconfig
Check availability of type of config node on deploy
2022-01-10 18:33:36 +00:00
Nick O'Leary
062f76214e Merge pull request #3325 from hardillb/http-basic-username-only
Fix basic auth with empty username or password
2022-01-10 18:27:55 +00:00
Nick O'Leary
ce98ed98a2 Merge pull request #3334 from Steve-Mcl/fix-monaco-expanded
load extralibs when expanding monaco. fixes #3319
2022-01-10 18:23:07 +00:00
Nick O'Leary
dce9d93f6c Merge pull request #3335 from node-red-hitachi/fix-file-node-example
Update file node examples according to node name change
2022-01-10 18:22:39 +00:00
Nick O'Leary
f7e35a6cbe Merge pull request #3337 from node-red-hitachi/fix-selection
resume focus after import/export dialog close
2022-01-10 18:21:55 +00:00
Hiroyasu Nishiyama
931335220f resume focus after import/export dialog close 2022-01-09 23:34:08 +09:00
Hiroyasu Nishiyama
3ce35a8a4b add link call example 2022-01-09 20:24:15 +09:00
Hiroyasu Nishiyama
9ac4e5cf6a update file node examples according to node name change 2022-01-09 19:49:06 +09:00
Tobias Oort
bd77d7eec3 Implemented support for Websocket Subprotocols in WS Client Node. 2022-01-08 22:18:05 +01:00
Steve-Mcl
b5e48aa509 load extralibs when expanding monaco. fixes #3319 2022-01-08 19:29:49 +00:00
Kazuhito Yokoi
b14c42b6a4 Update Japanese translations in node help (#3332)
* Update Japanese translations in node help

* Fix typos
2022-01-07 17:43:53 +00:00
Kazuhito Yokoi
ba794ba58c Use clipboard.writeText() instead of execCommand("copy") 2022-01-07 11:49:26 +09:00
Kazuhito Yokoi
b00282590d Fix copy buttons on the debug window 2022-01-07 09:27:01 +09:00
Ben Hardill
44616c6872 Fix basic auth with empty username or password
fix for #3324
2022-01-05 20:56:46 +00:00
Nick O'Leary
aaa2b4c3db Merge pull request #3322 from node-red/inject-props-fix
Fix incorrect clearing of blank payload property in Inject node
2022-01-04 18:59:05 +00:00
Nick O'Leary
8974d8e4df Merge pull request #3321 from node-red/fix-prev-tab-action
Fix findPreviousVisibleTab action
2022-01-04 18:58:45 +00:00
Nick O'Leary
699063cbb0 Merge pull request #3312 from node-red/hide-tabs-fix
Fix storing hidden tab state when not hidden via action
2022-01-04 18:58:32 +00:00
Nick O'Leary
e76000b713 Merge pull request #3311 from node-red/strip-empty-env
Avoid adding empty env properties to tabs/groups
2022-01-04 18:57:53 +00:00
Nick O'Leary
332b372e31 Merge pull request #3310 from node-red/group-env-fix
Update Function to use correct api to access env vars
2022-01-04 18:57:33 +00:00
Nick O'Leary
cb3fcb7bfa Ctrl-Shift-Click on node should add to existing selection 2022-01-03 23:29:42 +00:00
Nick O'Leary
bef641609e Select links when nodes on either side selected 2022-01-03 23:29:12 +00:00
Nick O'Leary
24b52f09df Add RED.nodes.getNodeLinks to help node-link lookup 2022-01-03 23:27:25 +00:00
Nick O'Leary
942b17b807 Fix incorrect clearing of blank payload property in Inject node
Fixes #3316
2022-01-03 21:51:49 +00:00
Nick O'Leary
cf19d7f3ad Fix findPreviousVisibleTab action
Fixes #3320
2022-01-03 21:20:23 +00:00
Nick O'Leary
ebd62a4112 Fix storing hidden tab state when not hidden via action
Fixes #3305
2021-12-28 10:29:42 +00:00
Nick O'Leary
9af7357ca4 Avoid adding empty env properties to tabs/groups
Fixes #3306
2021-12-27 12:03:40 +00:00
Nick O'Leary
0dbc35c252 Update Function to use correct api to access env vars
Fixes #3299
2021-12-27 11:55:10 +00:00
Dave Conway-Jones
c9f03f1ac5 better tests
(and a small fix as a result)
2021-12-27 09:51:50 +00:00
Dave Conway-Jones
02bd292b8c fix and test 2021-12-26 16:12:47 +00:00
Dave Conway-Jones
e5f1029d0c fix variable names for test 2021-12-26 15:37:41 +00:00
Dave Conway-Jones
cae247160f Let tcprequest split incoming strings on delimiter (as per tcpin node)
and fixup i18n messages
2021-12-26 15:28:16 +00:00
Dave Conway-Jones
6692b1992c TCP add tls option to inbound nodes 2021-12-26 12:12:31 +00:00
Dave Conway-Jones
0937837b7f Add TLS config option to TCP client nodes
(not yet when in server mode)
2021-12-24 16:18:00 +00:00
Kunihiko Toumura
828888490a check availability of config node on deploy 2021-12-21 18:10:42 +09:00
Kazuhito Yokoi
91cb6ba73b Add Japanese translations for hidden flow (#3302) 2021-12-20 09:34:41 +00:00
Nick O'Leary
4ee4d32b2e Merge pull request #3301 from kazuhitoyokoi/master-fixwelcometour
Fix hide icon in tour guide
2021-12-17 11:19:27 +00:00
Kazuhito Yokoi
8df630a2f5 Fix hide button icon in tour guide 2021-12-17 19:37:29 +09:00
Dave Conway-Jones
2cad42870e chaneg exec, file and inject node to use node.debug rather than -v flag 2021-12-17 09:58:10 +00:00
Nick O'Leary
43651135f3 Replace selectedLinks array with wrapped Set object 2021-12-13 21:02:55 +00:00
Nick O'Leary
ecaf866613 Fix serialisation of selection in view 2021-12-07 09:29:11 +00:00
Nick O'Leary
5ea3329b36 Allow multiple links to be selected by ctrl-click 2021-12-07 09:19:27 +00:00
Nick O'Leary
7bb7149f4c Snap nodes on grid using either edge as reference 2021-12-05 23:23:57 +00:00
Nick O'Leary
5856d043ca Add node wiring actions 2021-12-05 19:52:47 +00:00
Nick O'Leary
a9b12e5172 Add search history to main search box 2021-11-15 23:24:57 +00:00
534 changed files with 41377 additions and 28336 deletions

View File

@@ -5,6 +5,9 @@ on:
release:
types: [published]
permissions:
contents: read
jobs:
generate:
name: 'Update node-red-docker image'
@@ -26,7 +29,7 @@ jobs:
path: 'node-red.github.io'
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '16'
- run: node ./node-red/.github/scripts/update-node-red-docker.js
- name: Create Docker Pull Request
uses: peter-evans/create-pull-request@v2

View File

@@ -6,12 +6,18 @@ on:
pull_request:
branches: [ master, dev ]
permissions:
contents: read
jobs:
build:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14, 16]
node-version: [14, 16]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}

View File

@@ -15,5 +15,5 @@
"shadow": true, // allow variable shadowing (re-use of names...)
"sub": true, // don't warn that foo['bar'] should be written as foo.bar
"proto": true, // allow setting of __proto__ in node < v0.12,
"esversion": 6 // allow es6
"esversion": 11 // allow es11(ES2020)
}

File diff suppressed because it is too large Load Diff

View File

@@ -38,12 +38,9 @@ If you want to raise a pull-request with a new feature, or a refactoring
of existing code, it may well get rejected if you haven't discussed it on
the [forum](https://discourse.nodered.org) first.
All contributors need to sign the JS Foundation's Contributor License Agreement.
It is an online process and quick to do. You can read the details of the agreement
here: https://cla.js.foundation/node-red/node-red.
If you raise a pull-request without having signed the CLA, you will be prompted
to do so automatically.
All contributors need to sign the OpenJS Foundation's Contributor License Agreement.
It is an online process and quick to do. If you raise a pull-request without
having signed the CLA, you will be prompted to do so automatically.
### Code Branches

View File

@@ -142,6 +142,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
"packages/node_modules/@node-red/editor-client/src/js/user.js",
"packages/node_modules/@node-red/editor-client/src/js/comms.js",
"packages/node_modules/@node-red/editor-client/src/js/runtime.js",
"packages/node_modules/@node-red/editor-client/src/js/text/bidi.js",
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
@@ -150,6 +151,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/font-awesome.js",
"packages/node_modules/@node-red/editor-client/src/js/history.js",
"packages/node_modules/@node-red/editor-client/src/js/validators.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/mermaid.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/utils.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js",
@@ -165,8 +167,10 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/ui/common/autoComplete.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/actions.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/diagnostics.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/diff.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/statusBar.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/view.js",
@@ -191,6 +195,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/search.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/actionList.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js",
@@ -221,7 +226,7 @@ module.exports = function(grunt) {
"node_modules/jsonata/jsonata-es5.min.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",
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ext-language_tools.js"
],
// "packages/node_modules/@node-red/editor-client/public/vendor/vendor.css": [
// // TODO: resolve relative resource paths in
@@ -230,6 +235,9 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/public/vendor/ace/worker-jsonata.js": [
"node_modules/jsonata/jsonata-es5.min.js",
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/worker-jsonata.js"
],
"packages/node_modules/@node-red/editor-client/public/vendor/mermaid/mermaid.min.js": [
"node_modules/mermaid/dist/mermaid.min.js"
]
}
}

View File

@@ -56,13 +56,13 @@ This project adheres to the [Contributor Covenant 1.4](http://contributor-covena
## Authors
Node-RED is a project of the [OpenJS Foundation](https://openjsf.org).
Node-RED is a project of the [OpenJS Foundation](http://openjsf.org).
It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-technology/).
* Nick O'Leary [@knolleary](http://twitter.com/knolleary)
* Dave Conway-Jones [@ceejay](http://twitter.com/ceejay)
It is maintained by:
* Nick O'Leary [@knolleary](http://twitter.com/knolleary)
* Dave Conway-Jones [@ceejay](http://twitter.com/ceejay)
* And many others...
## Copyright and license

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "2.2.0-beta.1",
"version": "3.1.0-beta.1",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
@@ -26,76 +26,77 @@
}
],
"dependencies": {
"acorn": "8.6.0",
"acorn": "8.8.1",
"acorn-walk": "8.2.0",
"ajv": "8.8.2",
"async-mutex": "0.3.2",
"ajv": "8.11.2",
"async-mutex": "0.4.0",
"basic-auth": "2.0.1",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"body-parser": "1.20.1",
"cheerio": "1.0.0-rc.10",
"clone": "2.1.2",
"content-type": "1.0.4",
"cookie": "0.4.1",
"cookie": "0.5.0",
"cookie-parser": "1.4.6",
"cors": "2.8.5",
"cronosjs": "1.7.1",
"denque": "2.0.1",
"express": "4.17.1",
"express-session": "1.17.2",
"denque": "2.1.0",
"express": "4.18.2",
"express-session": "1.17.3",
"form-data": "4.0.0",
"fs-extra": "10.0.0",
"fs.notify": "0.0.4",
"got": "11.8.3",
"fs-extra": "10.1.0",
"got": "11.8.5",
"hash-sum": "2.0.0",
"hpagent": "0.1.2",
"https-proxy-agent": "5.0.0",
"i18next": "21.5.4",
"hpagent": "1.2.0",
"https-proxy-agent": "5.0.1",
"i18next": "21.10.0",
"iconv-lite": "0.6.3",
"is-utf8": "0.2.1",
"js-yaml": "3.14.1",
"js-yaml": "4.1.0",
"json-stringify-safe": "5.0.1",
"jsonata": "1.8.5",
"jsonata": "1.8.6",
"lodash.clonedeep": "^4.5.0",
"media-typer": "1.1.0",
"memorystore": "1.6.6",
"mime": "2.5.2",
"moment-timezone": "0.5.34",
"mqtt": "4.2.8",
"multer": "1.4.3",
"memorystore": "1.6.7",
"mime": "3.0.0",
"moment": "2.29.4",
"moment-timezone": "0.5.39",
"mqtt": "4.3.7",
"multer": "1.4.5-lts.1",
"mustache": "4.2.0",
"node-red-admin": "^2.2.1",
"node-red-admin": "^3.0.0",
"node-watch": "0.7.3",
"nopt": "5.0.0",
"oauth2orize": "1.11.1",
"on-headers": "1.0.2",
"passport": "0.5.0",
"passport": "0.6.0",
"passport-http-bearer": "1.0.1",
"passport-oauth2-client-password": "0.1.2",
"raw-body": "2.4.2",
"semver": "7.3.5",
"tar": "6.1.11",
"tough-cookie": "4.0.0",
"uglify-js": "3.14.4",
"raw-body": "2.5.1",
"semver": "7.3.8",
"tar": "6.1.12",
"tough-cookie": "4.1.2",
"uglify-js": "3.17.4",
"uuid": "8.3.2",
"ws": "7.5.1",
"ws": "7.5.6",
"xml2js": "0.4.23"
},
"optionalDependencies": {
"bcrypt": "5.0.1"
"bcrypt": "5.1.0"
},
"devDependencies": {
"dompurify": "2.3.3",
"grunt": "1.4.1",
"dompurify": "2.4.1",
"grunt": "1.5.3",
"grunt-chmod": "~1.1.1",
"grunt-cli": "~1.4.3",
"grunt-concurrent": "3.0.0",
"grunt-contrib-clean": "~2.0.0",
"grunt-contrib-clean": "2.0.1",
"grunt-contrib-compress": "2.0.0",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-jshint": "3.1.1",
"grunt-contrib-uglify": "5.0.1",
"grunt-contrib-watch": "~1.1.0",
"grunt-contrib-concat": "2.1.0",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-jshint": "3.2.0",
"grunt-contrib-uglify": "5.2.2",
"grunt-contrib-watch": "1.1.0",
"grunt-jsdoc": "2.4.1",
"grunt-jsdoc-to-markdown": "6.0.0",
"grunt-jsonlint": "2.1.3",
@@ -104,22 +105,23 @@
"grunt-sass": "~3.1.0",
"grunt-simple-mocha": "~0.4.1",
"grunt-simple-nyc": "^3.0.1",
"i18next-http-backend": "1.3.1",
"i18next-http-backend": "1.4.1",
"jquery-i18next": "1.2.1",
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
"marked": "3.0.7",
"marked": "4.2.3",
"mermaid": "^9.3.0",
"minami": "1.2.3",
"mocha": "9.1.3",
"node-red-node-test-helper": "^0.2.7",
"nodemon": "2.0.15",
"mocha": "9.2.2",
"node-red-node-test-helper": "^0.3.0",
"nodemon": "2.0.20",
"proxy": "^1.0.2",
"sass": "1.44.0",
"sass": "1.56.1",
"should": "13.2.3",
"sinon": "11.1.2",
"stoppable": "^1.1.0",
"supertest": "6.1.6"
"supertest": "6.2.4"
},
"engines": {
"node": ">=12"
"node": ">=14"
}
}

View File

@@ -1,4 +1,4 @@
Copyright JS Foundation and other contributors, http://js.foundation
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
Apache License
Version 2.0, January 2004

View File

@@ -0,0 +1,23 @@
let runtimeAPI;
let settings;
const apiUtil = require("../util");
module.exports = {
init: function(_settings, _runtimeAPI) {
settings = _settings;
runtimeAPI = _runtimeAPI;
},
getReport: function(req, res) {
const diagnosticsOpts = settings.diagnostics || {};
const opts = {
user: req.user,
scope: diagnosticsOpts.level || "basic"
}
if(diagnosticsOpts.enabled === false || diagnosticsOpts.enabled === "false") {
apiUtil.rejectHandler(req, res, {message: "diagnostics are disabled", status: 403, code: "diagnostics.disabled" })
} else {
runtimeAPI.diagnostics.get(opts)
.then(function(result) { res.json(result); })
.catch(err => apiUtil.rejectHandler(req, res, err))
}
}
}

View File

@@ -68,5 +68,28 @@ module.exports = {
}).catch(function(err) {
apiUtils.rejectHandler(req,res,err);
})
},
getState: function(req,res) {
const opts = {
user: req.user,
req: apiUtils.getRequestLogObject(req)
}
runtimeAPI.flows.getState(opts).then(function(result) {
res.json(result);
}).catch(function(err) {
apiUtils.rejectHandler(req,res,err);
})
},
postState: function(req,res) {
const opts = {
user: req.user,
state: req.body.state || "",
req: apiUtils.getRequestLogObject(req)
}
runtimeAPI.flows.setState(opts).then(function(result) {
res.json(result);
}).catch(function(err) {
apiUtils.rejectHandler(req,res,err);
})
}
}

View File

@@ -23,6 +23,7 @@ var context = require("./context");
var auth = require("../auth");
var info = require("./settings");
var plugins = require("./plugins");
var diagnostics = require("./diagnostics");
var apiUtil = require("../util");
@@ -34,6 +35,7 @@ module.exports = {
context.init(runtimeAPI);
info.init(settings,runtimeAPI);
plugins.init(runtimeAPI);
diagnostics.init(settings, runtimeAPI);
var needsPermission = auth.needsPermission;
@@ -52,6 +54,12 @@ module.exports = {
adminApp.get("/flows",needsPermission("flows.read"),flows.get,apiUtil.errorHandler);
adminApp.post("/flows",needsPermission("flows.write"),flows.post,apiUtil.errorHandler);
// Flows/state
adminApp.get("/flows/state", needsPermission("flows.read"), flows.getState, apiUtil.errorHandler);
if (settings.runtimeState && settings.runtimeState.enabled === true) {
adminApp.post("/flows/state", needsPermission("flows.write"), flows.postState, apiUtil.errorHandler);
}
// Flow
adminApp.get("/flow/:id",needsPermission("flows.read"),flow.get,apiUtil.errorHandler);
adminApp.post("/flow",needsPermission("flows.write"),flow.post,apiUtil.errorHandler);
@@ -95,6 +103,8 @@ module.exports = {
adminApp.get("/plugins", needsPermission("plugins.read"), plugins.getAll, apiUtil.errorHandler);
adminApp.get("/plugins/messages", needsPermission("plugins.read"), plugins.getCatalogs, apiUtil.errorHandler);
adminApp.get("/diagnostics", needsPermission("diagnostics.read"), diagnostics.getReport, apiUtil.errorHandler);
return adminApp;
}
}

View File

@@ -106,9 +106,15 @@ async function login(req,res) {
urlPrefix += "/";
}
response = {
"type":"strategy",
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
"type":"strategy"
}
if (mergedAdminAuth.strategy.autoLogin) {
response.autoLogin = true
response.loginRedirect = urlPrefix + "auth/strategy"
}
response.prompts = [
{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}
]
if (mergedAdminAuth.strategy.icon) {
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
}
@@ -185,7 +191,7 @@ function genericStrategy(adminApp,strategy) {
}
};
options.verify.apply(null,args);
options.verify.apply(this,args);
} else {
var profile = arguments[arguments.length - 2];
return completeVerify(profile,originalDone);

View File

@@ -92,10 +92,16 @@ var passwordTokenExchange = function(client, username, password, scope, done) {
loginAttempts = loginAttempts.filter(function(logEntry) {
return logEntry.user !== username;
});
Tokens.create(username,client.id,scope).then(function(tokens) {
log.audit({event: "auth.login",user,username:username,client:client.id,scope:scope});
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
});
// Check if the user contains a user defined token and use it
// instead of generating a new token
if(user.token){
done(null,user.token,null,null);
} else {
Tokens.create(username,client.id,scope).then(function(tokens) {
log.audit({event: "auth.login",user,username:username,client:client.id,scope:scope});
done(null,tokens.accessToken,null,{expires_in:tokens.expires_in});
});
}
} else {
log.audit({event: "auth.login.fail.permissions",username:username,client:client.id,scope:scope});
done(null,false);
@@ -146,7 +152,7 @@ function authenticateUserToken(req) {
} else {
reject();
}
});
}).catch(reject);
} else {
reject();
}
@@ -163,6 +169,9 @@ TokensStrategy.prototype.authenticate = function(req) {
authenticateUserToken(req).then(user => {
this.success(user,{scope:user.permissions});
}).catch(err => {
if (err) {
log.trace("token authentication failure: "+err.stack?err.stack:err)
}
this.fail(401);
});
}

View File

@@ -122,6 +122,7 @@ module.exports = {
}
if (req.body.active) {
opts.clearContext = req.body.hasOwnProperty('clearContext')?req.body.clearContext:true
runtimeAPI.projects.setActiveProject(opts).then(function() {
listProjects(req,res);
}).catch(function(err) {

View File

@@ -101,7 +101,10 @@ module.exports = {
}
themeSettings = null;
theme = settings.editorTheme || {};
themeContext.asset.vendorMonaco = ((theme.codeEditor || {}).lib === "monaco") ? "vendor/monaco/monaco-bootstrap.js" : "";
themeContext.asset.vendorMonaco = "vendor/monaco/monaco-bootstrap.js"
if (theme.codeEditor && theme.codeEditor.lib === 'ace') {
themeContext.asset.vendorMonaco = ''
}
activeTheme = theme.theme;
},
@@ -263,9 +266,69 @@ module.exports = {
theme.page = theme.page || {_:{}}
theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
}
if(theme.codeEditor) {
theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
// check and load page settings from theme
if (themePlugin.page) {
if (themePlugin.page.favicon && !theme.page.favicon) {
const result = serveFilesFromTheme(
[themePlugin.page.favicon],
themeApp,
"/",
themePlugin.path
)
if(result && result.length > 0) {
// update themeContext page favicon
themeContext.page.favicon = result[0]
theme.page = theme.page || {_:{}}
theme.page._.favicon = result[0]
}
}
if (themePlugin.page.tabicon && themePlugin.page.tabicon.icon && !theme.page.tabicon) {
const result = serveFilesFromTheme(
[themePlugin.page.tabicon.icon],
themeApp,
"/page/",
themePlugin.path
)
if(result && result.length > 0) {
// update themeContext page tabicon
themeContext.page.tabicon.icon = result[0]
themeContext.page.tabicon.colour = themeContext.page.tabicon.colour || themeContext.page.tabicon.colour
theme.page = theme.page || {_:{}}
theme.page._.tabicon = theme.page._.tabicon || {}
theme.page._.tabicon.icon = themeContext.page.tabicon.icon
theme.page._.tabicon.colour = themeContext.page.tabicon.colour
}
}
// if the plugin has a title AND the users settings.js does NOT
if (themePlugin.page.title && !theme.page.title) {
themeContext.page.title = themePlugin.page.title || themeContext.page.title
}
}
// check and load header settings from theme
if (themePlugin.header) {
if (themePlugin.header.image && !theme.header.image) {
const result = serveFilesFromTheme(
[themePlugin.header.image],
themeApp,
"/header/",
themePlugin.path
)
if(result && result.length > 0) {
// update themeContext header image
themeContext.header.image = result[0]
}
}
// if the plugin has a title AND the users settings.js does NOT have a title
if (themePlugin.header.title && !theme.header.title) {
themeContext.header.title = themePlugin.header.title || themeContext.header.title
}
// if the plugin has a header url AND the users settings.js does NOT
if (themePlugin.header.url && !theme.header.url) {
themeContext.header.url = themePlugin.header.url || themeContext.header.url
}
}
theme.codeEditor = theme.codeEditor || {}
theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
}
activeThemeInitialised = true;
}

View File

@@ -90,6 +90,8 @@ function init(settings,_server,storage,runtimeAPI) {
auth.getToken,
auth.errorHandler
);
} else if (settings.adminAuth.tokens) {
adminApp.use(passport.initialize());
}
adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-api",
"version": "2.2.0-beta.1",
"version": "3.1.0-beta.1",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,25 +16,25 @@
}
],
"dependencies": {
"@node-red/util": "2.2.0-beta.1",
"@node-red/editor-client": "2.2.0-beta.1",
"@node-red/util": "3.1.0-beta.1",
"@node-red/editor-client": "3.1.0-beta.1",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"body-parser": "1.20.1",
"clone": "2.1.2",
"cors": "2.8.5",
"express-session": "1.17.2",
"express": "4.17.1",
"memorystore": "1.6.6",
"mime": "2.5.2",
"multer": "1.4.3",
"express-session": "1.17.3",
"express": "4.18.2",
"memorystore": "1.6.7",
"mime": "3.0.0",
"multer": "1.4.5-lts.1",
"mustache": "4.2.0",
"oauth2orize": "1.11.1",
"passport-http-bearer": "1.0.1",
"passport-oauth2-client-password": "0.1.2",
"passport": "0.5.0",
"ws": "7.5.1"
"passport": "0.6.0",
"ws": "7.5.6"
},
"optionalDependencies": {
"bcrypt": "5.0.1"
"bcrypt": "5.1.0"
}
}

View File

@@ -1,4 +1,4 @@
Copyright JS Foundation and other contributors, http://js.foundation
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
Apache License
Version 2.0, January 2004

269
packages/node_modules/@node-red/editor-client/locales/de/editor.json vendored Executable file → Normal file
View File

@@ -44,7 +44,8 @@
"loadNodes": "Lade Nodes __count__",
"loadFlows": "Lade Flows",
"importFlows": "Füge Flows dem Arbeitsbereich hinzu",
"importError": "<p>Fehler beim Laden von Flows.</p><p>__message__</p>"
"importError": "<p>Fehler beim Laden von Flows.</p><p>__message__</p>",
"loadingProject": "Lade Projekt"
},
"workspace": {
"defaultName": "Flow __number__",
@@ -53,7 +54,16 @@
"delete": "Sind Sie sicher, dass '__label__' gelöscht werden soll?",
"dropFlowHere": "Hier kann der Flow eingefügt werden",
"addFlow": "Flow hinzufügen",
"addFlowToRight": "Flow zum Arbeitsbereich rechts hinzufügen",
"hideFlow": "Flow ausblenden",
"hideOtherFlows": "Andere Flows ausblenden",
"showAllFlows": "Alle Flows anzeigen",
"hideAllFlows": "Alle Flows ausblenden",
"hiddenFlows": "Liste __count__ ausgeblendeten Flow auf",
"hiddenFlows_plural": "Liste __count__ ausgeblendete Flows auf",
"showLastHiddenFlow": "Letzten ausgeblendeten Flow anzeigen",
"listFlows": "Flows auflisten",
"listSubflows": "Subflows auflisten",
"status": "Status",
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
@@ -65,6 +75,8 @@
"view": {
"view": "Ansicht",
"grid": "Raster",
"storeZoom": "Zoomstufe beim Laden wiederherstellen",
"storePosition": "Scrollposition beim Laden wiederherstellen",
"showGrid": "Raster anzeigen",
"snapGrid": "Am Raster ausrichten",
"gridSize": "Rastergröße",
@@ -82,6 +94,7 @@
"palette": {
"show": "Palette anzeigen"
},
"edit": "Bearbeiten",
"settings": "Einstellungen",
"userSettings": "Einstellungen",
"nodes": "Nodes",
@@ -92,7 +105,7 @@
"search": "Flows durchsuchen",
"searchInput": "Flows durchsuchen",
"subflows": "Subflow",
"createSubflow": "Erstellen",
"createSubflow": "Hinzufügen",
"selectionToSubflow": "Auswahl in Subflow umwandeln",
"flows": "Flow",
"add": "Hinzufügen",
@@ -104,24 +117,43 @@
"editPalette": "Palette verwalten",
"other": "Sonstige",
"showTips": "Tipps anzeigen",
"showWelcomeTours": "Geführte Touren für neue Versionen anzeigen",
"help": "Node-RED-Website",
"projects": "Projekt",
"projects": "Projekte",
"projects-new": "Neu",
"projects-open": "Öffnen",
"projects-settings": "Einstellungen",
"showNodeLabelDefault": "Zeige Namen von neu hinzugefügten Nodes",
"groups": "Gruppe",
"codeEditor": "Code-Editor",
"groups": "Gruppen",
"groupSelection": "Auswahl gruppieren",
"ungroupSelection": "Gruppe auflösen",
"groupMergeSelection": "Auswahl der Gruppe hinzufügen",
"groupRemoveSelection": "Auswahl aus der Gruppe entfernen"
"groupRemoveSelection": "Auswahl aus der Gruppe entfernen",
"arrange": "Anordnen",
"alignLeft": "Links ausrichten",
"alignCenter": "Zentrieren",
"alignRight": "Rechts ausrichten",
"alignTop": "Oben ausrichten",
"alignMiddle": "Mittig ausrichten",
"alignBottom": "Unten ausrichten",
"distributeHorizontally": "Horizontal verteilen",
"distributeVertically": "Vertikal verteilen",
"moveToBack": "Nach hinten verschieben",
"moveToFront": "Nach vorne verschieben",
"moveBackwards": "Rückwärts verschieben",
"moveForwards": "Vorwärts verschieben"
}
},
"actions": {
"toggle-navigator": "Navigator ein-/ausblenden",
"zoom-out": "Verkleinern",
"zoom-reset": "Vergrößerung rücksetzen",
"zoom-in": "Vergrößern"
"zoom-in": "Vergrößern",
"search-flows": "Flows durchsuchen",
"search-prev": "Vorherige",
"search-next": "Nächste",
"search-counter": "\"__term__\" __result__ von __count__"
},
"user": {
"loggedInAs": "Angemeldet als __name__",
@@ -131,48 +163,52 @@
"loginFailed": "Anmeldung fehlgeschlagen",
"notAuthorized": "Nicht berechtigt",
"errors": {
"settings": "Sie müssen angemeldet sein, um auf die Einstellungen zuzugreifen zu können",
"settings": "Sie müssen angemeldet sein, um auf die Einstellungen zugreifen zu können",
"deploy": "Sie müssen angemeldet sein, um Änderungen übernehmen (deploy) zu können",
"notAuthorized": "Sie müssen angemeldet sein, um diese Aktion ausführen zu können"
}
},
"notification": {
"warning": "<strong>Warnung:</strong> __message__",
"state": {
"flowsStopped": "Flows gestoppt",
"flowsStarted": "Flows gestartet"
},
"warning": "<strong>Warnung</strong>: __message__",
"warnings": {
"undeployedChanges": "Node hat nicht übernommene (deploy) Änderungen",
"nodeActionDisabled": "Node-Aktionen deaktiviert",
"nodeActionDisabledSubflow": "Node-Aktionen deaktiviert im Subflow",
"nodeActionDisabledSubflow": "Node-Aktionen innerhalb des Subflows deaktiviert",
"missing-types": "<p>Flows gestoppt aufgrund fehlender Node-Typen</p>",
"missing-modules": "<p>Flows angehalten aufgrund fehlender Module</p>",
"safe-mode": "<p>Flows sind im abgesicherten Modus gestoppt.</p><p>Flows können bearbeitet und übernommen (deploy) werden, um sie neu zu starten.</p>",
"restartRequired": "Node-RED muss neu gestartet werden, damit die Module nach Upgrade aktiviert werden",
"credentials_load_failed": "<p>Flows gestoppt, da die Berechtigungen nicht entschlüsselt werden konnten.</p><p>Die Datei mit dem Flow-Berechtigungen ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p>",
"credentials_load_failed_reset": "<p>Die Berechtigungen konnten nicht entschlüsselt werden.</p><p>Die Datei mit den Flow-Berechtigungen ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p><p>Die Datei mit den Flow-Berechtigungen wird bei der nächsten Übernahme (deploy) zurückgesetzt. Alle vorhandenen Flow-Berechtigungen werden gelöscht.</p>",
"credentials_load_failed": "<p>Flows gestoppt, da die Credentials nicht entschlüsselt werden konnten.</p><p>Die Datei mit den Flow-Credentials ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p>",
"credentials_load_failed_reset": "<p>Die Credentials konnten nicht entschlüsselt werden.</p><p>Die Datei mit den Flow-Credentials ist verschlüsselt, aber der Schlüssel des Projekts fehlt oder ist ungültig.</p><p>Die Datei mit den Flow-Credentials wird bei der nächsten Übernahme (deploy) zurückgesetzt. Alle vorhandenen Flow-Credentials werden gelöscht.</p>",
"missing_flow_file": "<p>Die Flow-Datei des Projekts wurde nicht gefunden.</p><p>Das Projekt ist nicht mit einer Flow-Datei konfiguriert.</p>",
"missing_package_file": "<p>Die Paket-Datei des Projekts wurde nicht gefunden.</p><p>In dem Projekt fehlt die 'package.json'-Datei.</p>",
"project_empty": "<p>Das Projekt ist leer.</p><p>Soll ein Standardsatz an Projektdateien erstellen werden?<br/>Andernfalls müssen die Dateien manuell außerhalb des Editors dem Projekt hinzugefügt werden.</p>",
"project_not_found": "<p>Das Projekt '__project__' wurde nicht gefunden.</p>",
"git_merge_conflict": "<p>Der automatische Merge der Änderungen ist fehlgeschlagen.</p><p>Die Merge-Konflikte müssen behoben und die Ergebnisse ins Repository übertragen werden (commit).</p>"
},
"error": "<strong>Fehler:</strong> __message__",
"error": "<strong>Fehler</strong>: __message__",
"errors": {
"lostConnection": "Verbindung zum Server verloren. Verbindung wird erneut hergestellt ...",
"lostConnectionReconnect": "Verbindung zum Server verloren. Verbindung wird in __time__ s versucht wieder herzustellen.",
"lostConnectionTry": "Jetzt testen",
"lostConnectionReconnect": "Verbindung zum Server verloren. Wiederherstellung der Verbindung in __time__s.",
"lostConnectionTry": "Jetzt versuchen",
"cannotAddSubflowToItself": "Subflow kann nicht zu sich selbst hinzugefügt werden",
"cannotAddCircularReference": "Subflow kann nicht hinzugefügt werden, da ein zirkulärer Bezug erkannt wurde",
"unsupportedVersion": "<p>Nicht unterstützte Version von Node.js erkannt.</p><p>Es muss ein Upgrade auf das neueste LTS-Release von Node.js durchgeführt werden.</p>",
"failedToAppendNode": "<p>Fehler beim Laden von '__module__'.</p><p>__error__</p>"
},
"project": {
"change-branch": "Wechsel in den Branch '__project__'",
"merge-abort": "Merge abgebrochen",
"change-branch": "Wechsel in den lokalen Branch '__project__'",
"merge-abort": "Git-Merge abgebrochen",
"loaded": "Projekt '__project__' geladen",
"updated": "Projekt '__project__' aktualisiert",
"pull": "Projekt '__project__' erneut geladen",
"revert": "Änderungen im Projekt '__project__' rückgängig gemacht",
"merge-complete": "Merge abgeschlossen",
"setupCredentials": "Berechtigungen einrichten",
"merge-complete": "Git-Merge abgeschlossen",
"setupCredentials": "Credentials einrichten",
"setupProjectFiles": "Projektdateien einrichten",
"no": "Nein, Danke",
"createDefault": "Standardprojektdateien erstellen",
@@ -180,12 +216,13 @@
},
"label": {
"manage-project-dep": "Projektabhängigkeiten verwalten",
"setup-cred": "Berechtigungen einrichten",
"setup-cred": "Credentials einrichten",
"setup-project": "Projektdateien einrichten",
"create-default-package": "Standardpaketdatei erstellen",
"no-thanks": "Nein, Danke",
"create-default-project": "Standardprojektdateien erstellen",
"show-merge-conflicts": "Merge-Konflikte anzeigen"
"show-merge-conflicts": "Merge-Konflikte anzeigen",
"unknownNodesButton": "Nach unbekannten Nodes suchen"
}
},
"clipboard": {
@@ -203,17 +240,17 @@
"subflow_plural": "__count__ Subflows",
"replacedNodes": "__count__ Node ersetzt",
"replacedNodes_plural": "__count__ Nodes ersetzt",
"pasteNodes": "Flow-JSON hier einfügen oder",
"pasteNodes": "Flow-JSON einfügen oder",
"selectFile": "Datei für Import auswählen",
"importNodes": "Import",
"exportNodes": "Export",
"download": "Download",
"importUnrecognised": "Importierter Typ nicht erkannt:",
"importUnrecognised_plural": "Importierte Typen nicht erkannt:",
"importDuplicate": "Importiertes doppeltes Node:",
"importDuplicate_plural": "Importierte doppelte Nodes:",
"nodesExported": "Nodes in der Zwischenablage abgelegt",
"nodesImported": "Eingefügt:",
"importUnrecognised": "Nicht erkannten Typ importiert:",
"importUnrecognised_plural": "Nicht erkannte Typen importiert:",
"importDuplicate": "Doppelten Node importiert:",
"importDuplicate_plural": "Doppelte Nodes importiert:",
"nodesExported": "Nodes in die Zwischenablage exportiert",
"nodesImported": "Importiert:",
"nodeCopied": "__count__ Node kopiert",
"nodeCopied_plural": "__count__ Nodes kopiert",
"groupCopied": "__count__ Gruppe kopiert",
@@ -229,11 +266,11 @@
"all": "Alle Flows",
"compact": "Kompakt",
"formatted": "Formatiert",
"copy": "In Zwischenablage exportieren",
"copy": "In Zwischenablage kopieren",
"export": "In Bibliothek exportieren",
"exportAs": "Exportiere als",
"overwrite": "Ersetzen",
"exists": "<p>'__file__' existiert bereits.</p><p>Soll sie ersetzt werden?</p>"
"exists": "<p><b>\"__file__\"</b> existiert bereits.</p><p>Soll sie ersetzt werden?</p>"
},
"import": {
"import": "Importiere in",
@@ -263,13 +300,19 @@
"modifiedFlowsDesc": "Übernimmt nur Flows, die geänderte Nodes enthalten",
"modifiedNodes": "Geänderte Nodes",
"modifiedNodesDesc": "Übernimmt nur Nodes, die sich geändert haben",
"startFlows": "Start",
"startFlowsDesc": "Flows starten",
"stopFlows": "Stop",
"stopFlowsDesc": "Flows stoppen",
"restartFlows": "Flows neustarten",
"restartFlowsDesc": "Startet die aktuell übernommenen Flows (ohne vorheriges Deploy)",
"successfulDeploy": "Erfolgreich übernommen (deploy)",
"successfulRestart": "Flows erfolgreich neugestartet",
"deployFailed": "Übernahme (deploy) fehlgeschlagen: __message__",
"unusedConfigNodes": "Einige Konfigurations-Nodes werden nicht verwendet.",
"unusedConfigNodesLink": "Hier klicken, um sie anzuschauen.",
"unusedConfigNodesButton": "Suche nach unbenutzten Konfigurations-Nodes",
"unknownNodesButton": "Suche nach unbekannten Nodes",
"invalidNodesButton": "Suche nach ungültigen Nodes",
"errors": {
"noResponse": "Keine Antwort vom Server"
},
@@ -342,7 +385,7 @@
"confirmDelete": "Sind Sie sicher mit dem Löschen dieses Subflows?",
"info": "Beschreibung",
"category": "Kategorie",
"module": "Module",
"module": "Modul",
"license": "Lizenz",
"licenseNone": "Keine",
"licenseOther": "Andere",
@@ -352,10 +395,10 @@
"keys": "Schlüsselwörter",
"keysPlaceholder": "Komma-getrennte Schlüsselwörter",
"author": "Author",
"authorPlaceholder": "Dein Name <email@beispiel.de>",
"authorPlaceholder": "Ihr Name <email@example.com>",
"desc": "Beschreibung",
"env": {
"restore": "Stelle auf Subflow-Standard zurück",
"restore": "Subflow-Standard wiederherstellen",
"remove": "Entferne Umgebungsvariable"
},
"errors": {
@@ -364,9 +407,9 @@
}
},
"group": {
"editGroup": "Editiere Gruppe: __name__",
"editGroup": "Bearbeite Gruppe: __name__",
"errors": {
"cannotCreateDiffGroups": "Kann keine Gruppe erzeugen mit Nodes von verschiedenen Gruppen",
"cannotCreateDiffGroups": "Kann keine Gruppe mit Nodes von anderen Gruppen erstellen",
"cannotAddSubflowPorts": "Kann keine Subflow-Anschlüsse zu einer Gruppe hinzufügen"
}
},
@@ -380,7 +423,7 @@
"addNewConfig": "Neuen Konfigurations-Node '__type__' hinzufügen",
"editNode": "Node '__type__' bearbeiten",
"editConfig": "Konfigurations-Node '__type__' bearbeiten",
"addNewType": "Neuen Typ '__type__' hinzufügen",
"addNewType": "Neuen Typ '__type__' hinzufügen ...",
"nodeProperties": "Node-Eigenschaften",
"label": "Name",
"color": "Farbe",
@@ -400,10 +443,10 @@
"icon": "Icon",
"inputType": "Eingangstyp",
"selectType": "Wähle Typen ...",
"loadCredentials": "Lade Node-Berechtigungen",
"loadCredentials": "Lade Node-Credentials",
"inputs": {
"input": "Eingang",
"select": "hle",
"select": "Auswahl",
"checkbox": "Checkbox",
"spinner": "Spinner",
"none": "Kein",
@@ -416,7 +459,7 @@
"json": "JSON",
"bin": "buffer",
"env": "Umgebungsvariable",
"cred": "Berechtigung"
"cred": "Credentials"
},
"menu": {
"input": "Eingang",
@@ -436,7 +479,7 @@
"errors": {
"scopeChange": "Wenn Sie den Geltungsbereich (scope) ändern, wird er für Nodes in anderen Flows nicht verfügbar sein",
"invalidProperties": "Ungültige Eigenschaften:",
"credentialLoadFailed": "Laden der Node-Berechtigungen fehlgeschlagen"
"credentialLoadFailed": "Laden der Node-Credentials fehlgeschlagen"
}
},
"keyboard": {
@@ -446,23 +489,27 @@
"shortcut": "Tastenkürzel",
"scope": "Geltungsbereich",
"unassigned": "Nicht zugeordnet",
"global": "global",
"global": "Global",
"workspace": "Arbeitsbereich",
"selectAll": "Alle Nodes auswählen",
"selectAll": "Alles auswählen",
"selectNone": "Alles abwählen",
"selectAllConnected": "Alle verbundenen Nodes auswählen",
"addRemoveNode": "Node aus Auswahl hinzufügen/entfernen",
"editSelected": "Ausgewählten Node bearbeiten",
"deleteSelected": "Ausgewählte Nodes oder Links löschen",
"importNode": "Node importieren",
"exportNode": "Node exportieren",
"importNode": "Nodes importieren",
"exportNode": "Nodes exportieren",
"nudgeNode": "Ausgewählte Nodes verschieben (1px)",
"moveNode": "Ausgewählte Nodes verschieben (20px)",
"toggleSidebar": "Seitenleiste ein-/ausblenden",
"togglePalette": "Palette ein-/ausblenden",
"copyNode": "Ausgewählte Nodes kopieren",
"cutNode": "Ausgewählte Nodes ausschneiden",
"pasteNode": "Node einfügen",
"pasteNode": "Nodes einfügen",
"copyGroupStyle": "Gruppenstil kopieren",
"pasteGroupStyle": "Gruppenstil einfügen",
"undoChange": "Letzte Änderung rückgängig machen",
"redoChange": "Letzte Änderung wiederholen",
"searchBox": "Suchfeld öffnen",
"managePalette": "Palette verwalten",
"actionList": "Aktionsliste"
@@ -488,7 +535,7 @@
"palette": {
"noInfo": "Keine Informationen verfügbar",
"filter": "Nodes filtern",
"search": "Modules durchsuchen",
"search": "Module durchsuchen",
"addCategory": "Neu hinzufügen ...",
"label": {
"subflows": "Subflows",
@@ -517,7 +564,8 @@
"nodeEnabled_plural": "Nodes aktiviert:",
"nodeDisabled": "Node deaktiviert:",
"nodeDisabled_plural": "Nodes deaktiviert:",
"nodeUpgraded": "Upgrade von Node-Modul __module__ auf Version __version__ durchgeführt"
"nodeUpgraded": "Upgrade von Node-Modul __module__ auf Version __version__ durchgeführt",
"unknownNodeRegistered": "Fehler beim Laden des Nodes: <ul><li>__type__<br>__error__</li></ul>"
},
"editor": {
"title": "Palette verwalten",
@@ -633,15 +681,8 @@
"outline": "Entwurf",
"empty": "leer",
"globalConfig": "Globale Konfigurations-Nodes",
"triggerAction": "Auslösen",
"find": "Suche im Arbeitsbereich",
"search": {
"configNodes": "Konfigurations-Nodes",
"unusedConfigNodes": "Unbenutzte Konfigurations-Nodes",
"invalidNodes": "Ungültige Nodes",
"uknownNodes": "Unbekannte Nodes",
"unusedSubflows": "Unbenutzte Subflows"
}
"triggerAction": "Aktion auslösen",
"find": "Suche im Arbeitsbereich"
},
"help": {
"name": "Hilfe",
@@ -651,7 +692,8 @@
"showHelp": "Hilfe zeigen",
"showInOutline": "Zeige im Editor",
"showTopics": "Zeige Hilfethemen",
"noHelp": "Kein Hilfethema ausgewählt"
"noHelp": "Kein Hilfethema ausgewählt",
"changeLog": "Änderungsprotokoll"
},
"config": {
"name": "Konfigurations-Node",
@@ -705,7 +747,7 @@
"addToProject": "Zu Projekt hinzufügen",
"files": "Dateien",
"flow": "Flow",
"credentials": "Berechtigungen",
"credentials": "Credentials",
"package": "Paket",
"packageCreate": "Datei wird erstellt beim Speichern der Änderungen",
"fileNotExist": "Datei existiert nicht",
@@ -718,7 +760,7 @@
"changeTheEncryptionKey": "Schlüssel ändern",
"currentKey": "Aktueller Schlüssel",
"newKey": "Neuer Schlüssel",
"credentialsAlert": "Dadurch werden alle vorhandenen Berechtigungen gelöscht",
"credentialsAlert": "Dadurch werden alle vorhandenen Credentials gelöscht",
"versionControl": "Versionsverwaltung (Git)",
"branches": "Branches",
"noBranches": "Keine Branches",
@@ -743,7 +785,7 @@
"userName": "Benutzername",
"email": "E-Mail",
"workflow": "Arbeitsablauf",
"workfowTip": "Wähle deinen bevorzugten Git-Arbeitsablauf",
"workfowTip": "Wählen Sie Ihren bevorzugten Git-Arbeitsablauf (Workflow)",
"workflowManual": "Manuell",
"workflowManualTip": "Alle Änderungen müssen manuell übertragen werden (commit) über die Seitenleiste 'Projekthistorie'",
"workflowAuto": "Automatisch",
@@ -854,7 +896,7 @@
"date": "timestamp",
"jsonata": "JSONata",
"env": "Umgebungsvariable",
"cred": "Berechtigung"
"cred": "Credentials"
}
},
"editableList": {
@@ -862,8 +904,20 @@
"addTitle": "Element hinzufügen"
},
"search": {
"history": "Suchhistorie",
"clear": "Leeren",
"empty": "Keine Übereinstimmungen gefunden",
"addNode": "Node hinzufügen ..."
"addNode": "Node hinzufügen ...",
"options": {
"configNodes": "Konfigurations-Nodes",
"unusedConfigNodes": "Unbenutzte Konfigurations-Nodes",
"invalidNodes": "Ungültige Nodes",
"uknownNodes": "Unbekannte Nodes",
"unusedSubflows": "Unbenutzte Subflows",
"hiddenFlows": "Versteckte Flows",
"modifiedNodes": "Geänderte Nodes",
"thisFlow": "Aktueller Flow"
}
},
"expressionEditor": {
"functions": "Funktionen",
@@ -884,6 +938,9 @@
"eval": "Fehler beim Auswerten des Ausdrucks\n__message__"
}
},
"monaco": {
"setTheme": "Thema auswählen"
},
"jsEditor": {
"title": "JavaScript-Editor"
},
@@ -893,8 +950,10 @@
"jsonEditor": {
"title": "JSON-Editor",
"format": "JSON formatieren",
"rawMode": "JSON-Editor",
"rawMode": "Bearbeite JSON",
"uiMode": "Visueller Editor",
"rawMode-readonly": "JSON",
"uiMode-readonly": "Visuell",
"insertAbove": "Oberhalb einfügen",
"insertBelow": "Unterhalb einfügen",
"addItem": "Element hinzufügen",
@@ -965,7 +1024,7 @@
"clone": "Projekt klonen",
"desc0": "Wenn Sie bereits über ein Git-Repository verfügen, das ein Projekt enthält, können Sie es klonen, um damit zu arbeiten.",
"already-exists": "Das Projekt ist bereits vorhanden",
"must-contain": "Darf nur A-Z 0-9 _ enthalten",
"must-contain": "Darf nur A-Z 0-9 _ - enthalten",
"project-name": "Projektname",
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
"git-url": "Git-Repository-URL",
@@ -977,7 +1036,7 @@
"passphrase": "Passphrase",
"ssh-key-desc": "Bevor Sie ein Repository über SSH lokal klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zugreifen zu können",
"ssh-key-add": "SSH-Schlüssel hinzufügen",
"credential-key": "Schlüssel für Berechtigungen",
"credential-key": "Schlüssel für Credentials",
"cant-get-ssh-key": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden",
"already-exists2": "bereits vorhanden",
"git-error": "Git-Fehler",
@@ -989,27 +1048,27 @@
"create": "Erstellen Sie Ihre Projektdateien",
"desc0": "Ein Projekt enthält Ihre Flow-Dateien, eine README-Datei und die 'package.json'-Datei.",
"desc1": "Es kann alle anderen Dateien enthalten, die im Git-Repository verwaltet werden sollen.",
"desc2": "Ihre vorhandenen Flow- und Berechtigungs-Dateien werden in das Projekt kopiert.",
"desc2": "Ihre vorhandenen Flow- und Credential-Dateien werden in das Projekt kopiert.",
"flow-file": "Flow-Datei",
"credentials-file": "Datei mit Berechtigungen"
"credentials-file": "Datei mit Credentials"
},
"encryption-config": {
"setup": "Einrichtung der Verschlüsselung Ihrer Datei mit den Berechtigungen",
"desc0": "Die Datei mit den Flow-Berechtigungen kann verschlüsselt werden, um ihren Inhalt zu schützen.",
"desc1": "Wenn Sie diese Berechtigungen in einem öffentlichen Repository speichern möchten, müssen Sie sie mit einen geheimen Schlüsselausdruck verschlüsseln.",
"desc2": "Die Datei mit den Flow-Berechtigungen ist derzeit nicht verschlüsselt.",
"setup": "Einrichtung der Verschlüsselung Ihrer Datei mit den Credentials",
"desc0": "Die Datei mit den Flow-Credentials kann verschlüsselt werden, um ihren Inhalt zu schützen.",
"desc1": "Wenn Sie diese Credentials in einem öffentlichen Repository speichern möchten, müssen Sie sie mit einen geheimen Schlüsselausdruck verschlüsseln.",
"desc2": "Die Datei mit den Flow-Credentials ist derzeit nicht verschlüsselt.",
"desc3": "D.h. ihr Inhalt (z.B. Passwörter und Zugriffs-Tokens) kann von jedem mit Zugriff auf die Datei gelesen werden.",
"desc4": "Wenn Sie diese Berechtigungen in einen öffentlichen Repository speichern möchten, müssen Sie diese verschlüsseln, indem Sie einen geheimen Schlüsselausdruck eingeben.",
"desc5": "Ihre Datei mit den Flow-Berechtigungen wird derzeit mit dem Eintrag 'credentialSecret' Ihrer Einstellungsdatei als Schlüssel verschlüsselt.",
"desc6": "Die Datei mit den Flow-Berechtigungen wird derzeit mit einem vom System generierten Schlüssel verschlüsselt. Sie sollten einen neuen geheimen Schlüssel für dieses Projekt vorgeben.",
"desc4": "Wenn Sie diese Credentials in einen öffentlichen Repository speichern möchten, müssen Sie diese verschlüsseln, indem Sie einen geheimen Schlüsselausdruck eingeben.",
"desc5": "Ihre Datei mit den Flow-Credentials wird derzeit mit dem Eintrag 'credentialSecret' Ihrer Einstellungsdatei als Schlüssel verschlüsselt.",
"desc6": "Die Datei mit den Flow-Credentials wird derzeit mit einem vom System generierten Schlüssel verschlüsselt. Sie sollten einen neuen geheimen Schlüssel für dieses Projekt vorgeben.",
"desc7": "Der Schlüssel wird separat von den Projektdateien gespeichert. Sie müssen den Schlüssel angeben, damit dieses Projekt auch in einem anderen Node-RED-System verwendet werden kann.",
"credentials": "Berechtigung",
"credentials": "Credentials",
"enable": "Verschlüsselung aktivieren",
"disable": "Verschlüsselung deaktivieren",
"disabled": "deaktiviert",
"copy": "Vorhandenen Schlüssel ersetzen",
"use-custom": "Eigenen Schlüssel verwenden",
"desc8": "Die Datei mit den Berechtigungen wird nicht verschlüsselt, und ihr Inhalt kann leicht gelesen werden",
"desc8": "Die Datei mit den Credentials wird nicht verschlüsselt und ihr Inhalt kann leicht gelesen werden",
"create-project-files": "Projektdateien erstellen",
"create-project": "Projekt erstellen",
"already-exists": "bereits vorhanden",
@@ -1023,7 +1082,7 @@
"desc2": "Im Tab 'Commit-Historie' in der Seitenleiste werden alle Dateien angezeigt, die sich in Ihrem Projekt geändert haben, und um sie ins lokale Repository zu übertragen (commit). Es zeigt Ihnen eine vollständige Historie Ihrer Commits an und ermöglicht es Ihnen, Ihre Commits in ein (remote) Server-Repository zu schieben (push)."
},
"create": {
"projects": "Projekt",
"projects": "Projekte",
"already-exists": "Das Projekt ist bereits vorhanden",
"must-contain": "Darf nur A-Z 0-9 _ enthalten",
"no-info-in-url": "Geben Sie Benutzername & Passwort nicht innerhalb der URL vor",
@@ -1034,12 +1093,12 @@
"desc": "Beschreibung",
"opt": "Optional",
"flow-file": "Flow-Datei",
"credentials": "Berechtigungen",
"credentials": "Credentials",
"enable-encryption": "Verschlüsselung aktivieren",
"disable-encryption": "Verschlüsselung deaktivieren",
"encryption-key": "Schlüssel",
"desc0": "Eine Floskel, mit der Sie Ihre Berechtigungen schützen",
"desc1": "Die Datei mit den Berechtigungen wird nicht verschlüsselt, und ihr Inhalt kann leicht gelesen werden",
"desc0": "Eine Ausdruck, mit der Sie Ihre Credentials schützen",
"desc1": "Die Datei mit den Credentials wird nicht verschlüsselt und ihr Inhalt kann leicht gelesen werden",
"git-url": "Git-Repository-URL",
"protocols": "https://, ssh:// oder file://",
"auth-failed": "Authentifizierung fehlgeschlagen",
@@ -1049,14 +1108,15 @@
"passphrase": "Passphrase",
"desc2": "Bevor Sie ein Repository über SSH klonen können, müssen Sie einen SSH-Schlüssel hinzufügen, um auf diesen zu zugreifen",
"add-ssh-key": "Einen SSH-Schlüssel hinzufügen",
"credentials-encryption-key": "Schlüssel für Berechtigungen",
"credentials-encryption-key": "Schlüssel für Credentials",
"already-exists-2": "bereits vorhanden",
"git-error": "Git-Fehler",
"con-failed": "Verbindung fehlgeschlagen",
"not-git": "Kein Git-Repository",
"no-resource": "Repository nicht gefunden",
"cant-get-ssh-key-path": "Fehler! Der ausgewählte SSH-Schlüsselpfad kann nicht abgerufen werden.",
"unexpected_error": "unerwarteter_Fehler"
"unexpected_error": "unerwarteter_Fehler",
"clearContext": "Kontextdaten löschen beim Projektwechsel"
},
"delete": {
"confirm": "Sind Sie sicher, dass dieses Projekt gelöscht werden soll?"
@@ -1103,13 +1163,44 @@
"preview": "Vorschau",
"defaultValue": "Standardwert"
},
"tourGuide": {
"takeATour": "Tour starten",
"start": "Start",
"next": "Nächste",
"welcomeTours": "Welcome Tours"
},
"diagnostics": {
"title": "System-Informationen"
},
"languages": {
"de": "German",
"en-US": "English",
"ja": "Japanese",
"ko": "Korean",
"ru": "Russian",
"zh-CN": "Chinese(Simplified)",
"zh-TW": "Chinese(Traditional)"
"de": "Deutsch",
"en-US": "Englisch",
"ja": "Japanisch",
"ko": "Koreanisch",
"ru": "Russisch",
"zh-CN": "Chinesisch (Vereinfacht)",
"zh-TW": "Chinesisch (Traditionell)"
},
"validator": {
"errors": {
"invalid-json": "Ungültige JSON-Daten: __error__",
"invalid-json-prop": "__prop__: ungültige JSON-Daten: __error__",
"invalid-prop": "Ungültiger Eigenschaftsausdruck",
"invalid-prop-prop": "__prop__: ungültiger Eigenschaftsausdruck",
"invalid-num": "Ungültige Nummer",
"invalid-num-prop": "__prop__: ungültige Nummer",
"invalid-regexp": "Ungültiges Eingabemuster",
"invalid-regex-prop": "__prop__: ungültiges Eingabemuster",
"missing-required-prop": "__prop__: Eigenschaftswert fehlt",
"invalid-config": "__prop__: ungültige Konfigurations-Node",
"missing-config": "__prop__: Konfigurations-Node fehlt",
"validation-error": "__prop__: Validierungsfehler: __node__, __id__: __error__"
}
},
"contextMenu": {
"insert": "Einfügen",
"node": "Node",
"junction": "Kreuzung",
"linkNodes": "Verknüpfe Nodes"
}
}

View File

View File

View File

@@ -3,7 +3,7 @@
"label": {
"name": "Name",
"ok": "Ok",
"done":"Done",
"done": "Done",
"cancel": "Cancel",
"delete": "Delete",
"close": "Close",
@@ -23,7 +23,9 @@
"position": "Position",
"enable": "Enable",
"disable": "Disable",
"upload": "Upload"
"upload": "Upload",
"lock": "Lock",
"unlock": "Unlock"
},
"type": {
"string": "string",
@@ -53,28 +55,38 @@
"confirmDelete": "Confirm delete",
"delete": "Are you sure you want to delete '__label__'?",
"dropFlowHere": "Drop the flow here",
"dropImageHere": "Drop the image here",
"addFlow": "Add flow",
"addFlowToRight": "Add flow to the right",
"closeFlow": "Close flow",
"hideFlow": "Hide flow",
"hideOtherFlows": "Hide other flows",
"showAllFlows": "Show all flows",
"showAllFlows": "Show all flows (__count__ hidden)",
"hideAllFlows": "Hide all flows",
"hiddenFlows": "List __count__ hidden flow",
"hiddenFlows_plural": "List __count__ hidden flows",
"showLastHiddenFlow": "Show last hidden flow",
"showLastHiddenFlow": "Reopen hidden flow",
"listFlows": "List flows",
"listSubflows": "List subflows",
"status": "Status",
"enabled": "Enabled",
"disabled":"Disabled",
"disabled": "Disabled",
"info": "Description",
"selectNodes": "Click nodes to select"
"selectNodes": "Click nodes to select",
"enableFlow": "Enable flow",
"disableFlow": "Disable flow",
"lockFlow": "Lock flow",
"unlockFlow": "Unlock flow",
"moveToStart": "Move flow to start",
"moveToEnd": "Move flow to end"
},
"menu": {
"label": {
"view": {
"view": "View",
"grid": "Grid",
"storeZoom": "Restore zoom level on load",
"storePosition": "Restore scroll position on load",
"showGrid": "Show grid",
"snapGrid": "Snap to grid",
"gridSize": "Grid size",
@@ -99,6 +111,7 @@
"displayStatus": "Show node status",
"displayConfig": "Configuration nodes",
"import": "Import",
"importExample": "Import Example Flow",
"export": "Export",
"search": "Search flows",
"searchInput": "search your flows",
@@ -112,7 +125,7 @@
"keyboardShortcuts": "Keyboard shortcuts",
"login": "Login",
"logout": "Logout",
"editPalette":"Manage palette",
"editPalette": "Manage palette",
"other": "Other",
"showTips": "Show tips",
"showWelcomeTours": "Show guided tours for new versions",
@@ -128,26 +141,30 @@
"ungroupSelection": "Ungroup selection",
"groupMergeSelection": "Merge selection",
"groupRemoveSelection": "Remove from group",
"arrange":"Arrange",
"alignLeft":"Align to left",
"alignCenter":"Align to center",
"alignRight":"Align to right",
"alignTop":"Align to top",
"alignMiddle":"Align to middle",
"alignBottom":"Align to bottom",
"distributeHorizontally":"Distribute horizontally",
"distributeVertically":"Distribute vertically",
"moveToBack":"Move to back",
"moveToFront":"Move to front",
"moveBackwards":"Move backwards",
"moveForwards":"Move forwards"
"arrange": "Arrange",
"alignLeft": "Align to left",
"alignCenter": "Align to center",
"alignRight": "Align to right",
"alignTop": "Align to top",
"alignMiddle": "Align to middle",
"alignBottom": "Align to bottom",
"distributeHorizontally": "Distribute horizontally",
"distributeVertically": "Distribute vertically",
"moveToBack": "Move to back",
"moveToFront": "Move to front",
"moveBackwards": "Move backwards",
"moveForwards": "Move forwards"
}
},
"actions": {
"toggle-navigator": "Toggle navigator",
"zoom-out": "Zoom out",
"zoom-reset": "Reset zoom",
"zoom-in": "Zoom in"
"zoom-in": "Zoom in",
"search-flows": "Search flows",
"search-prev": "Previous",
"search-next": "Next",
"search-counter": "\"__term__\" __result__ of __count__"
},
"user": {
"loggedInAs": "Logged in as __name__",
@@ -163,6 +180,10 @@
}
},
"notification": {
"state": {
"flowsStopped": "Flows stopped",
"flowsStarted": "Flows started"
},
"warning": "<strong>Warning</strong>: __message__",
"warnings": {
"undeployedChanges": "node has undeployed changes",
@@ -170,10 +191,10 @@
"nodeActionDisabledSubflow": "node actions disabled within subflow",
"missing-types": "<p>Flows stopped due to missing node types.</p>",
"missing-modules": "<p>Flows stopped due to missing modules.</p>",
"safe-mode":"<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
"safe-mode": "<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
"restartRequired": "Node-RED must be restarted to enable upgraded modules",
"credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>",
"credentials_load_failed_reset":"<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
"credentials_load_failed_reset": "<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
"missing_flow_file": "<p>Project flow file not found.</p><p>The project is not configured with a flow file.</p>",
"missing_package_file": "<p>Project package file not found.</p><p>The project is missing a package.json file.</p>",
"project_empty": "<p>The project is empty.</p><p>Do you want to create a default set of project files?<br/>Otherwise, you will have to manually add files to the project outside of the editor.</p>",
@@ -211,7 +232,8 @@
"create-default-package": "Create default package file",
"no-thanks": "No thanks",
"create-default-project": "Create default project files",
"show-merge-conflicts": "Show merge conflicts"
"show-merge-conflicts": "Show merge conflicts",
"unknownNodesButton": "Search for unknown nodes"
}
},
"clipboard": {
@@ -250,11 +272,11 @@
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
"export": {
"selected":"selected nodes",
"current":"current flow",
"all":"all flows",
"compact":"compact",
"formatted":"formatted",
"selected": "selected nodes",
"current": "current flow",
"all": "all flows",
"compact": "compact",
"formatted": "formatted",
"copy": "Copy to clipboard",
"export": "Export to library",
"exportAs": "Export as",
@@ -289,13 +311,19 @@
"modifiedFlowsDesc": "Only deploys flows that contain changed nodes",
"modifiedNodes": "Modified Nodes",
"modifiedNodesDesc": "Only deploys nodes that have changed",
"startFlows": "Start",
"startFlowsDesc": "Start Flows",
"stopFlows": "Stop",
"stopFlowsDesc": "Stop Flows",
"restartFlows": "Restart Flows",
"restartFlowsDesc": "Restarts the current deployed flows",
"successfulDeploy": "Successfully deployed",
"successfulRestart": "Successfully restarted flows",
"deployFailed": "Deploy failed: __message__",
"unusedConfigNodes":"You have some unused configuration nodes.",
"unusedConfigNodesLink":"Click here to see them",
"unusedConfigNodes": "You have some unused configuration nodes.",
"unusedConfigNodesButton": "Search unused config nodes",
"unknownNodesButton": "Search for unknown nodes",
"invalidNodesButton": "Search for invalid nodes",
"errors": {
"noResponse": "no response from server"
},
@@ -342,8 +370,8 @@
},
"nodeCount": "__count__ node",
"nodeCount_plural": "__count__ nodes",
"local":"Local changes",
"remote":"Remote changes",
"local": "Local changes",
"remote": "Remote changes",
"reviewChanges": "Review Changes",
"noBinaryFileShowed": "Cannot show binary file contents",
"viewCommitDiff": "View Commit Changes",
@@ -427,7 +455,7 @@
"inputType": "Input type",
"selectType": "select types...",
"loadCredentials": "Loading node credentials",
"inputs" : {
"inputs": {
"input": "input",
"select": "select",
"checkbox": "checkbox",
@@ -480,6 +508,7 @@
"addRemoveNode": "Add/remove node from selection",
"editSelected": "Edit selected node",
"deleteSelected": "Delete selected nodes or link",
"deleteReconnect": "Delete and Reconnect",
"importNode": "Import nodes",
"exportNode": "Export nodes",
"nudgeNode": "Move selected nodes (1px)",
@@ -495,7 +524,8 @@
"redoChange": "Redo",
"searchBox": "Open search box",
"managePalette": "Manage palette",
"actionList":"Action list"
"actionList": "Action list",
"splitWireWithLinks": "Split selection with Link nodes"
},
"library": {
"library": "Library",
@@ -607,19 +637,19 @@
},
"confirm": {
"install": {
"body":"<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>",
"body": "<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>",
"title": "Install nodes"
},
"remove": {
"body":"<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>",
"body": "<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>",
"title": "Remove nodes"
},
"update": {
"body":"<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>",
"body": "<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>",
"title": "Update nodes"
},
"cannotUpdate": {
"body":"An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
"body": "An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
},
"button": {
"review": "Open node information",
@@ -653,27 +683,21 @@
"showMore": "show more",
"showLess": "show less",
"flow": "Flow",
"selection":"Selection",
"nodes":"__count__ nodes",
"selection": "Selection",
"nodes": "__count__ nodes",
"flowDesc": "Flow Description",
"subflowDesc": "Subflow Description",
"nodeHelp": "Node Help",
"none":"None",
"none": "None",
"arrayItems": "__count__ items",
"showTips":"You can open the tips from the settings panel",
"showTips": "You can open the tips from the settings panel",
"outline": "Outline",
"empty": "empty",
"globalConfig": "Global Configuration Nodes",
"triggerAction": "Trigger action",
"find": "Find in workspace",
"search": {
"configNodes": "Configuration nodes",
"unusedConfigNodes": "Unused configuration nodes",
"invalidNodes": "Invalid nodes",
"uknownNodes": "Unknown nodes",
"unusedSubflows": "Unused subflows",
"hiddenFlows": "Hidden flows"
}
"copyItemUrl": "Copy item url",
"copyURL2Clipboard": "Copied url to clipboard"
},
"help": {
"name": "Help",
@@ -683,7 +707,8 @@
"showHelp": "Show help",
"showInOutline": "Show in outline",
"showTopics": "Show topics",
"noHelp": "No help topic selected"
"noHelp": "No help topic selected",
"changeLog": "Change Log"
},
"config": {
"name": "Configuration nodes",
@@ -699,8 +724,8 @@
"filtered": "__count__ hidden"
},
"context": {
"name":"Context Data",
"label":"context",
"name": "Context Data",
"label": "context",
"none": "none selected",
"refresh": "refresh to load",
"empty": "empty",
@@ -738,9 +763,9 @@
"files": "Files",
"flow": "Flow",
"credentials": "Credentials",
"package":"Package",
"packageCreate":"File will be created when changes are saved",
"fileNotExist":"File does not exist",
"package": "Package",
"packageCreate": "File will be created when changes are saved",
"fileNotExist": "File does not exist",
"selectFile": "Select File",
"invalidEncryptionKey": "Invalid encryption key",
"encryptionEnabled": "Encryption enabled",
@@ -894,8 +919,20 @@
"addTitle": "add an item"
},
"search": {
"history": "Search history",
"clear": "clear all",
"empty": "No matches found",
"addNode": "add a node..."
"addNode": "add a node...",
"options": {
"configNodes": "Configuration nodes",
"unusedConfigNodes": "Unused configuration nodes",
"invalidNodes": "Invalid nodes",
"uknownNodes": "Unknown nodes",
"unusedSubflows": "Unused subflows",
"hiddenFlows": "Hidden flows",
"modifiedNodes": "Modified nodes and flows",
"thisFlow": "Current flow"
}
},
"expressionEditor": {
"functions": "Functions",
@@ -913,6 +950,9 @@
"invalid-expr": "Invalid JSONata expression:\n __message__",
"invalid-msg": "Invalid example JSON message:\n __message__",
"context-unsupported": "Cannot test context functions\n $flowContext or $globalContext",
"env-unsupported": "Cannot test $env function",
"moment-unsupported": "Cannot test $moment function",
"clone-unsupported": "Cannot test $clone function",
"eval": "Error evaluating expression:\n __message__"
}
},
@@ -930,6 +970,8 @@
"format": "format JSON",
"rawMode": "Edit JSON",
"uiMode": "Visual editor",
"rawMode-readonly": "JSON",
"uiMode-readonly": "Visual",
"insertAbove": "Insert above",
"insertBelow": "Insert below",
"addItem": "Add item",
@@ -956,13 +998,16 @@
"quote": "Quote",
"link": "Link",
"horizontal-rule": "Horizontal rule",
"toggle-preview": "Toggle preview"
"toggle-preview": "Toggle preview",
"mermaid": {
"summary": "Mermaid Diagram"
}
},
"bufferEditor": {
"title": "Buffer editor",
"modeString": "Handle as UTF-8 String",
"modeArray": "Handle as JSON array",
"modeDesc":"<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
"modeDesc": "<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
},
"projects": {
"config-git": "Configure Git client",
@@ -1091,7 +1136,8 @@
"not-git": "Not a git repository",
"no-resource": "Repository not found",
"cant-get-ssh-key-path": "Error! Can't get selected SSH key path.",
"unexpected_error": "unexpected_error"
"unexpected_error": "unexpected_error",
"clearContext": "Clear context when switching projects"
},
"delete": {
"confirm": "Are you sure you want to delete this project?"
@@ -1123,7 +1169,7 @@
"no-empty": "Cannot create default file set on a non-empty project",
"git-error": "git error"
},
"errors" : {
"errors": {
"no-username-email": "Your Git client is not configured with a username/email.",
"unexpected": "An unexpected error occurred",
"code": "code"
@@ -1141,9 +1187,13 @@
"tourGuide": {
"takeATour": "Take a tour",
"start": "Start",
"next": "Next"
"next": "Next",
"welcomeTours": "Welcome Tours"
},
"languages" : {
"diagnostics": {
"title": "System Info"
},
"languages": {
"de": "German",
"en-US": "English",
"ja": "Japanese",
@@ -1151,5 +1201,32 @@
"ru": "Russian",
"zh-CN": "Chinese(Simplified)",
"zh-TW": "Chinese(Traditional)"
},
"validator": {
"errors": {
"invalid-json": "Invalid JSON data: __error__",
"invalid-json-prop": "__prop__: invalid JSON data: __error__",
"invalid-prop": "Invalid property expression",
"invalid-prop-prop": "__prop__: invalid property expression",
"invalid-num": "Invalid number",
"invalid-num-prop": "__prop__: invalid number",
"invalid-regexp": "Invalid input pattern",
"invalid-regex-prop": "__prop__: invalid input pattern",
"missing-required-prop": "__prop__: property value missing",
"invalid-config": "__prop__: invalid configuration node",
"missing-config": "__prop__: missing configuration node",
"validation-error": "__prop__: validation error: __node__, __id__: __error__"
}
},
"contextMenu": {
"insert": "Insert",
"node": "Node",
"junction": "Junction",
"linkNodes": "Link Nodes"
},
"env-var": {
"environment": "Environment",
"header": "Global Environment Variables",
"revert": "Revert"
}
}

View File

@@ -1,23 +1,23 @@
{
"info": {
"tip0" : "You can remove the selected nodes or links with {{core:delete-selection}}",
"tip1" : "Search for nodes using {{core:search}}",
"tip2" : "{{core:toggle-sidebar}} will toggle the view of this sidebar",
"tip3" : "You can manage your palette of nodes with {{core:manage-palette}}",
"tip4" : "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}",
"tip5" : "Enable or disable these tips from the option in the settings",
"tip6" : "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
"tip7" : "Dragging a node onto a wire will splice it into the link",
"tip8" : "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
"tip9" : "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
"tip10" : "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
"tip11" : "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
"tip12" : "[ctrl] [click] in the workspace to open the quick-add dialog",
"tip13" : "Hold down [ctrl] when you [click] on a node port to enable quick-wiring",
"tip14" : "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
"tip15" : "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
"tip16" : "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
"tip17" : "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
"tip18" : "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
"tip0": "You can remove the selected nodes or links with {{core:delete-selection}}",
"tip1": "Search for nodes using {{core:search}}",
"tip2": "{{core:toggle-sidebar}} will toggle the view of this sidebar",
"tip3": "You can manage your palette of nodes with {{core:manage-palette}}",
"tip4": "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}",
"tip5": "Enable or disable these tips from the option in the settings",
"tip6": "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
"tip7": "Dragging a node onto a wire will splice it into the link",
"tip8": "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
"tip9": "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
"tip10": "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
"tip11": "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
"tip12": "[ctrl] [click] in the workspace to open the quick-add dialog",
"tip13": "Hold down [ctrl] when you [click] on a node port to enable quick-wiring",
"tip14": "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
"tip15": "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
"tip16": "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
"tip17": "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
"tip18": "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
}
}

View File

@@ -52,52 +52,52 @@
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
},
"$now": {
"args":"$[picture [, timezone]]",
"desc":"Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
"args": "$[picture [, timezone]]",
"desc": "Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
},
"$base64encode": {
"args":"string",
"desc":"Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
"args": "string",
"desc": "Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
},
"$base64decode": {
"args":"string",
"desc":"Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
"args": "string",
"desc": "Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
},
"$number": {
"args": "arg",
"desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown."
},
"$abs": {
"args":"number",
"desc":"Returns the absolute value of the `number` parameter."
"args": "number",
"desc": "Returns the absolute value of the `number` parameter."
},
"$floor": {
"args":"number",
"desc":"Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
"args": "number",
"desc": "Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
},
"$ceil": {
"args":"number",
"desc":"Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
"args": "number",
"desc": "Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
},
"$round": {
"args":"number [, precision]",
"desc":"Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
"args": "number [, precision]",
"desc": "Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
},
"$power": {
"args":"base, exponent",
"desc":"Returns the value of `base` raised to the power of `exponent`."
"args": "base, exponent",
"desc": "Returns the value of `base` raised to the power of `exponent`."
},
"$sqrt": {
"args":"number",
"desc":"Returns the square root of the value of the `number` parameter."
"args": "number",
"desc": "Returns the square root of the value of the `number` parameter."
},
"$random": {
"args":"",
"desc":"Returns a pseudo random number greater than or equal to zero and less than one."
"args": "",
"desc": "Returns a pseudo random number greater than or equal to zero and less than one."
},
"$millis": {
"args":"",
"desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
"args": "",
"desc": "Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
},
"$sum": {
"args": "array",
@@ -136,20 +136,20 @@
"desc": "Appends two arrays"
},
"$sort": {
"args":"array [, function]",
"desc":"Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
"args": "array [, function]",
"desc": "Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
},
"$reverse": {
"args":"array",
"desc":"Returns an array containing all the values from the `array` parameter, but in reverse order."
"args": "array",
"desc": "Returns an array containing all the values from the `array` parameter, but in reverse order."
},
"$shuffle": {
"args":"array",
"desc":"Returns an array containing all the values from the `array` parameter, but shuffled into random order."
"args": "array",
"desc": "Returns an array containing all the values from the `array` parameter, but shuffled into random order."
},
"$zip": {
"args":"array, ...",
"desc":"Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
"args": "array, ...",
"desc": "Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
},
"$keys": {
"args": "object",
@@ -168,24 +168,24 @@
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
},
"$sift": {
"args":"object, function",
"desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
"args": "object, function",
"desc": "Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
},
"$each": {
"args":"object, function",
"desc":"Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
"args": "object, function",
"desc": "Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
},
"$map": {
"args":"array, function",
"desc":"Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
"args": "array, function",
"desc": "Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
},
"$filter": {
"args":"array, function",
"desc":"Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
"args": "array, function",
"desc": "Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
},
"$reduce": {
"args":"array, function [, init]",
"desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
"args": "array, function [, init]",
"desc": "Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
},
"$flowContext": {
"args": "string[, string]",

View File

@@ -23,7 +23,9 @@
"position": "配置",
"enable": "有効",
"disable": "無効",
"upload": "アップロード"
"upload": "アップロード",
"lock": "固定",
"unlock": "固定を解除"
},
"type": {
"string": "文字列",
@@ -53,12 +55,16 @@
"confirmDelete": "削除の確認",
"delete": "本当に '__label__' を削除しますか?",
"dropFlowHere": "ここにフローをドロップしてください",
"dropImageHere": "ここに画像ファイルをドロップしてください",
"addFlow": "フローの追加",
"addFlowToRight": "右側にフローを追加",
"closeFlow": "フローを閉じる",
"hideFlow": "フローを非表示",
"hideOtherFlows": "他のフローを非表示",
"showAllFlows": "全てのフローを表示",
"hideAllFlows": "全てのフローを非表示",
"hiddenFlows": "__count__ 個の非表示のフロー一覧",
"hiddenFlows_plural": "__count__ 個の非表示のフロー一覧",
"showLastHiddenFlow": "最後に非表示にしたフローを表示",
"listFlows": "フロー一覧",
"listSubflows": "サブフロー一覧",
@@ -66,13 +72,21 @@
"enabled": "有効",
"disabled": "無効",
"info": "詳細",
"selectNodes": "ノードをクリックして選択"
"selectNodes": "ノードをクリックして選択",
"enableFlow": "フローを有効化",
"disableFlow": "フローを無効化",
"lockFlow": "フローを固定",
"unlockFlow": "フローの固定を解除",
"moveToStart": "フローを先頭へ移動",
"moveToEnd": "フローを最後へ移動"
},
"menu": {
"label": {
"view": {
"view": "表示",
"grid": "グリッド",
"storeZoom": "読み込み時に拡大/縮小のレベルを復元",
"storePosition": "読み込み時にスクロール位置を復元",
"showGrid": "グリッドを表示",
"snapGrid": "ノードの配置を補助",
"gridSize": "グリッドの大きさ",
@@ -97,6 +111,7 @@
"displayStatus": "ノードのステータスを表示",
"displayConfig": "設定ノード",
"import": "読み込み",
"importExample": "フロー例を読み込み",
"export": "書き出し",
"search": "ノードを検索",
"searchInput": "ノードを検索",
@@ -145,7 +160,11 @@
"toggle-navigator": "ナビゲータの表示/非表示を切替",
"zoom-out": "縮小",
"zoom-reset": "拡大/縮小を初期化",
"zoom-in": "拡大"
"zoom-in": "拡大",
"search-flows": "フローを検索",
"search-prev": "前へ",
"search-next": "次へ",
"search-counter": "\"__term__\" __count__ 件中の __result__ 件目"
},
"user": {
"loggedInAs": "__name__ としてログインしました",
@@ -161,6 +180,10 @@
}
},
"notification": {
"state": {
"flowsStopped": "フローを停止しました",
"flowsStarted": "フローを開始しました"
},
"warning": "<strong>警告</strong>: __message__",
"warnings": {
"undeployedChanges": "ノードの変更をデプロイしていません",
@@ -209,7 +232,8 @@
"create-default-package": "デフォルトパッケージファイルの作成",
"no-thanks": "不要",
"create-default-project": "デフォルトプロジェクトファイルの作成",
"show-merge-conflicts": "マージ競合を表示"
"show-merge-conflicts": "マージ競合を表示",
"unknownNodesButton": "不明なノードを検索する"
}
},
"clipboard": {
@@ -287,13 +311,19 @@
"modifiedFlowsDesc": "変更したノードを含むフローのみデプロイ",
"modifiedNodes": "変更したノード",
"modifiedNodesDesc": "変更したノードのみデプロイ",
"startFlows": "開始",
"startFlowsDesc": "フローを開始",
"stopFlows": "停止",
"stopFlowsDesc": "フローを停止",
"restartFlows": "フローを再起動",
"restartFlowsDesc": "デプロイされた現在のフローを再起動",
"successfulDeploy": "デプロイが成功しました",
"successfulRestart": "フローの再起動が成功しました",
"deployFailed": "デプロイが失敗しました: __message__",
"unusedConfigNodes": "使われていない設定ノードがあります。",
"unusedConfigNodesLink": "設定を参照する",
"unusedConfigNodesButton": "未使用の構成ノードを検索",
"unknownNodesButton": "不明なノードを検索する",
"invalidNodesButton": "無効なノードを検索する",
"errors": {
"noResponse": "サーバの応答がありません"
},
@@ -478,6 +508,7 @@
"addRemoveNode": "ノードの選択、選択解除",
"editSelected": "選択したノードを編集",
"deleteSelected": "選択したノードや接続を削除",
"deleteReconnect": "削除と再接続",
"importNode": "フローの読み込み",
"exportNode": "フローの書き出し",
"nudgeNode": "選択したノードを移動(移動量小)",
@@ -493,7 +524,8 @@
"redoChange": "変更操作をやり直し",
"searchBox": "ノードを検索",
"managePalette": "パレットの管理",
"actionList": "動作一覧"
"actionList": "動作一覧",
"splitWireWithLinks": "選択したワイヤーをlinkードで分離"
},
"library": {
"library": "ライブラリ",
@@ -664,13 +696,8 @@
"globalConfig": "グローバル設定ノード",
"triggerAction": "アクションを実行",
"find": "ワークスペース内を検索",
"search": {
"configNodes": "設定ノード",
"unusedConfigNodes": "未使用の設定ノード",
"invalidNodes": "不正なノード",
"uknownNodes": "未知のノード",
"unusedSubflows": "未使用のサブフロー"
}
"copyItemUrl": "要素のURLをコピー",
"copyURL2Clipboard": "URLをクリップボードにコピーしました"
},
"help": {
"name": "ヘルプ",
@@ -680,7 +707,8 @@
"showHelp": "ヘルプを表示",
"showInOutline": "アウトラインに表示",
"showTopics": "トピックを表示",
"noHelp": "ヘルプのトピックが未選択"
"noHelp": "ヘルプのトピックが未選択",
"changeLog": "更新履歴"
},
"config": {
"name": "設定ノードを表示",
@@ -840,7 +868,7 @@
"pushFailed": "リモートに新しいコミットがあるため、プッシュに失敗しました。プルしてマージしてから、再度プッシュしてください。",
"push": "プッシュ",
"pull": "プル",
"unablePull": "<p>リモートの変更のプル失敗:ステージングされていないローカルの変更上書きされてしまいます。</p><p>変更をコミットしてから再度実行してください。</p>",
"unablePull": "<p>リモートの変更のプル失敗:ステージングされていないローカルの変更上書きされてしまいます。</p><p>変更をコミットしてから再度実行してください。</p>",
"showUnstagedChanges": "ステージングされていない変更を表示",
"connectionFailed": "リモートリポジトリに接続できません: ",
"pullUnrelatedHistory": "<p>リモートに関連のないコミット履歴があります。</p><p>本当に変更をプルしてローカルリポジトリに反映しますか?</p>",
@@ -891,8 +919,20 @@
"addTitle": "要素を追加"
},
"search": {
"history": "検索履歴",
"clear": "全て削除",
"empty": "一致したものが見つかりませんでした",
"addNode": "ノードを追加..."
"addNode": "ノードを追加...",
"options": {
"configNodes": "設定ノード",
"unusedConfigNodes": "未使用の設定ノード",
"invalidNodes": "不正なノード",
"uknownNodes": "未知のノード",
"unusedSubflows": "未使用のサブフロー",
"hiddenFlows": "非表示のフロー",
"modifiedNodes": "修正したノードやフロー",
"thisFlow": "現在のフロー"
}
},
"expressionEditor": {
"functions": "関数",
@@ -909,8 +949,11 @@
"errors": {
"invalid-expr": "不正なJSONata式:\n __message__",
"invalid-msg": "不正なJSONメッセージ例:\n __message__",
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト機能をテストできません",
"eval": "表現評価エラー:\n __message__"
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト関数をテストできません",
"env-unsupported": "$env関数はテストできません",
"moment-unsupported": "$moment関数はテストできません",
"clone-unsupported": "$clone関数はテストできません",
"eval": "式評価エラー:\n __message__"
}
},
"monaco": {
@@ -927,6 +970,8 @@
"format": "JSONフォーマット",
"rawMode": "JSONを編集",
"uiMode": "ビジュアルエディタ",
"rawMode-readonly": "JSON",
"uiMode-readonly": "ビジュアル",
"insertAbove": "上に挿入",
"insertBelow": "下に挿入",
"addItem": "要素を追加",
@@ -953,7 +998,10 @@
"quote": "引用",
"link": "リンク",
"horizontal-rule": "区切り線",
"toggle-preview": "プレビュー表示切替え"
"toggle-preview": "プレビュー表示切替え",
"mermaid": {
"summary": "Mermaid図"
}
},
"bufferEditor": {
"title": "バッファエディタ",
@@ -1088,7 +1136,8 @@
"not-git": "Gitリポジトリではありません",
"no-resource": "リポジトリが見つかりません",
"cant-get-ssh-key-path": "エラー! 選択したSSHキーのパスを取得できません。",
"unexpected_error": "予期しないエラー"
"unexpected_error": "予期しないエラー",
"clearContext": "プロジェクトを切り替る際にコンテキストを初期化"
},
"delete": {
"confirm": "プロジェクトを削除しても良いですか?"
@@ -1138,7 +1187,11 @@
"tourGuide": {
"takeATour": "ツアーを開始",
"start": "開始",
"next": "次へ"
"next": "次へ",
"welcomeTours": "ウェルカムツアー"
},
"diagnostics": {
"title": "システム情報"
},
"languages": {
"de": "ドイツ語",
@@ -1148,5 +1201,181 @@
"ru": "ロシア語",
"zh-CN": "中国語(簡体)",
"zh-TW": "中国語(繁体)"
},
"validator": {
"errors": {
"invalid-json": "JSONデータが不正: __error__",
"invalid-json-prop": "__prop__: JSONデータが不正: __error__",
"invalid-prop": "プロパティ式が不正",
"invalid-prop-prop": "__prop__: プロパティ式が不正",
"invalid-num": "数値が不正",
"invalid-num-prop": "__prop__: 数値が不正",
"invalid-regexp": "入力パターンが不正",
"invalid-regex-prop": "__prop__: 入力パターンが不正",
"missing-required-prop": "__prop__: プロパティが未設定",
"invalid-config": "__prop__: 設定ノードが不正",
"missing-config": "__prop__: 設定ノードが存在しません",
"validation-error": "__prop__: チェックエラー: __node__, __id__: __error__"
}
},
"contextMenu": {
"insert": "挿入",
"node": "ノード",
"junction": "分岐点",
"linkNodes": "Linkード"
},
"env-var": {
"environment": "環境変数",
"header": "大域環境変数",
"revert": "破棄"
},
"action-list": {
"toggle-show-tips": "ヒント表示切替",
"show-about": "Node-REDの説明を表示",
"show-welcome-tour": "ウェルカムツアー表示",
"show-next-tab": "次のタブを表示",
"show-previous-tab": "前のタブを表示",
"add-flow": "フローを追加",
"add-flow-to-right": "フローを右に追加",
"edit-flow": "フローを編集",
"remove-flow": "フローを削除",
"enable-flow": "フローを有効化",
"disable-flow": "フローを無効化",
"hide-flow": "フローを隠す",
"hide-other-flows": "他のフローを非表示",
"hide-all-flows": "全てのフローを非表示",
"show-all-flows": "全てのフローを表示",
"show-last-hidden-flow": "最後に非表示にしたフローを表示",
"list-modified-nodes": "修正したフローを表示",
"list-hidden-flows": "非表示フローを表示",
"list-flows": "フロー一覧",
"list-subflows": "サブフロー一覧",
"go-to-previous-location": "前の位置に移動",
"go-to-next-location": "次の位置に移動",
"copy-selection-to-internal-clipboard": "選択をクリップボードにコピー",
"cut-selection-to-internal-clipboard": "選択をクリップボードに切り取り",
"paste-from-internal-clipboard": "クリップボードから貼り付け",
"detach-selected-nodes": "選択ノードを接続から外す",
"delete-selection": "選択を削除",
"delete-selection-and-reconnect": "選択を削除し再接続",
"edit-selected-node": "選択したノードを編集",
"go-to-selection": "選択に移動",
"undo": "変更操作を戻す",
"redo": "変更操作をやり直し",
"select-all-nodes": "全てのノードを選択",
"select-none": "ノードを選択",
"enable-selected-nodes": "選択ノードを有効化",
"disable-selected-nodes": "選択ノードを無効化",
"toggle-show-grid": "グリッド表示切替",
"toggle-snap-grid": "ノードの配置補助切替",
"toggle-status": "ステータス表示切替",
"show-selected-node-labels": "選択したノードのラベルを表示",
"hide-selected-node-labels": "選択したノードのラベルを非表示",
"scroll-view-up": "上スクロール",
"scroll-view-right": "右スクロール",
"scroll-view-down": "下スクロール",
"scroll-view-left": "左スクロール",
"step-view-up": "一単位上スクロール",
"step-view-right": "一単位右スクロール",
"step-view-down": "一単位下スクロール",
"step-view-left": "一単位左スクロール",
"move-selection-up": "選択を上移動",
"move-selection-right": "選択を右移動",
"move-selection-down": "選択を下移動",
"move-selection-left": "選択を左移動",
"move-selection-forwards": "選択を前面に移動",
"move-selection-backwards": "選択を背面に移動",
"move-selection-to-front": "選択を最前面に移動",
"move-selection-to-back": "選択を最背面に移動",
"step-selection-up": "選択を一単位上移動",
"step-selection-right": "選択を一単位右移動",
"step-selection-down": "選択を一単位下移動",
"step-selection-left": "選択を一単位左移動",
"select-connected-nodes": "接続されたノードを選択",
"select-downstream-nodes": "後方に接続されたノードを選択",
"select-upstream-nodes": "前方に接続されたノードを選択",
"go-to-next-node": "次のノードに移動",
"go-to-previous-node": "前のノードに移動",
"go-to-next-sibling": "次の兄弟ノードに移動",
"go-to-previous-sibling": "前の兄弟ノードに移動",
"go-to-nearest-node-on-left": "最も近い左側ノードに移動",
"go-to-nearest-node-on-right": "最も近い右側ノードに移動",
"go-to-nearest-node-above": "最も近い上側ノードに移動",
"go-to-nearest-node-below": "最も近い下側ノードに移動",
"align-selection-to-grid": "選択を整列",
"align-selection-to-left": "選択を左揃え",
"align-selection-to-right": "選択を右揃え",
"align-selection-to-top": "選択を上揃え",
"align-selection-to-bottom": "選択を下揃え",
"align-selection-to-middle": "選択を上下中央揃え",
"align-selection-to-center": "選択を左右中央揃え",
"distribute-selection-horizontally": "選択を左右に整列",
"distribute-selection-vertically": "選択を上下に整列",
"wire-series-of-nodes": "ノードを一続きに接続",
"wire-node-to-multiple": "ノードを複数に接続",
"split-wire-with-link-nodes": "ワイヤーをlinkードで分割",
"generate-node-names": "ノード名を生成",
"show-user-settings": "ユーザ設定を表示",
"show-help": "ヘルプを表示",
"toggle-palette": "パレットの表示切替",
"show-event-log": "イベントログを表示",
"manage-palette": "パレットの管理",
"toggle-sidebar": "サイドバーの表示切替",
"show-info-tab": "ノード情報タブの表示",
"show-help-tab": "ノードヘルプタブの表示",
"show-config-tab": "設定ノードタブの表示",
"select-all-config-nodes": "全ての設定ノードを選択",
"delete-config-selection": "選択した設定ノードを削除",
"show-context-tab": "コンテキストデータタブを表示",
"create-subflow": "サブフローを作成",
"convert-to-subflow": "選択をサブフローに変換",
"group-selection": "選択をグループ化",
"ungroup-selection": "選択をグループ解除",
"merge-selection-to-group": "選択をグループにマージ",
"remove-selection-from-group": "選択をグループから削除",
"copy-group-style": "グループのスタイルをコピー",
"paste-group-style": "グループのスタイルを貼り付け",
"show-export-dialog": "書き出しダイアログを表示",
"show-import-dialog": "読み込みダイアログを表示",
"show-library-export-dialog": "ライブラリ書き出しダイアログを表示",
"show-library-import-dialog": "ライブラリ読み込みダイアログを表示",
"show-examples-import-dialog": "サンプル読み込みダイアログを表示",
"search": "検索",
"search-previous": "前を検索",
"search-next": "次を検索",
"show-action-list": "動作一覧を表示",
"confirm-edit-tray": "編集を完了",
"cancel-edit-tray": "編集をキャンセル",
"show-remote-diff": "リモートとの変更差分を表示",
"deploy-flows": "フローをデプロイ",
"restart-flows": "フローを再起動",
"set-deploy-type-to-full": "デプロイを「全て」に設定",
"set-deploy-type-to-modified-flows": "デプロイを「変更したフロー」に設定",
"set-deploy-type-to-modified-nodes": "デプロイを「変更したノード」に設定",
"show-debug-tab": "デバッグタブを表示",
"clear-debug-messages": "デバッグメッセージを削除",
"clear-filtered-debug-messages": "フィルタしたデバッグメッセージを削除",
"activate-selected-debug-nodes": "選択したデバッグノードを有効化",
"activate-all-debug-nodes": "全てのデバッグノードを有効化",
"activate-all-flow-debug-nodes": "フロー内の全デバッグノードを有効化",
"deactivate-selected-debug-nodes": "選択したデバッグノードを無効化",
"deactivate-all-debug-nodes": "全てのデバッグノードを無効化",
"deactivate-all-flow-debug-nodes": "フロー内の全デバッグノードを無効化",
"zoom-in": "ズームイン",
"zoom-out": "ズームアウト",
"zoom-reset": "ズームリセット",
"toggle-navigator": "ナビゲータ表示切替",
"show-system-info": "システム情報",
"split-wires-with-junctions": "分岐点によりワイヤーを分割",
"new-project": "新しいプロジェクト",
"open-project": "プロジェクトを開く",
"show-project-settings": "プロジェクト設定を表示",
"show-version-control-tab": "バージョンコントロールタブを表示",
"start-flows": "フローを開始",
"stop-flows": "フローを停止",
"copy-item-url": "要素のURLをコピー",
"copy-item-edit-url": "要素の編集URLをコピー",
"move-flow-to-start": "フローを先頭に移動",
"move-flow-to-end": "フローを末尾に移動"
}
}

View File

@@ -17,7 +17,7 @@
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
"tip17": "ノードのプロティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
"tip17": "ノードのプロティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
}
}

View File

@@ -141,7 +141,8 @@
"create-default-package": "기본 패키지 파일 생성",
"no-thanks": "괜찮습니다",
"create-default-project": "기본 프로젝트 파일 생성",
"show-merge-conflicts": "병합 충돌 보여주기"
"show-merge-conflicts": "병합 충돌 보여주기",
"unknownNodesButton": "알 수 없는 노드 검색"
}
},
"clipboard": {
@@ -203,7 +204,9 @@
"successfulRestart": "플로우 재시작을 성공했습니다",
"deployFailed": "배포 실패 : __message__",
"unusedConfigNodes": "사용되지 않는 설정노드가 있습니다",
"unusedConfigNodesLink": "여기를 클릭하면 볼 수 있습니다",
"unusedConfigNodesButton":"사용하지 않는 구성 노드 검색",
"unknownNodesButton":"알 수 없는 노드 검색",
"invalidNodesButton":"잘못된 노드 검색",
"errors": {
"noResponse": "서버의 응답이 없습니다"
},

View File

View File

25
packages/node_modules/@node-red/editor-client/locales/ru/editor.json vendored Executable file → Normal file
View File

@@ -183,7 +183,8 @@
"create-default-package": "Создать файл пакета по умолчанию",
"no-thanks": "Нет, спасибо",
"create-default-project": "Создать файлы проекта по умолчанию",
"show-merge-conflicts": "Показать конфликты слияния"
"show-merge-conflicts": "Показать конфликты слияния",
"unknownNodesButton": "Поиск неизвестных узлов"
}
},
"clipboard": {
@@ -277,7 +278,9 @@
"successfulRestart": "Потоки успешно перезапущены",
"deployFailed": "Развертывание не удалось: __message__",
"unusedConfigNodes":"У вас есть неиспользуемых узлы конфигурации.",
"unusedConfigNodesLink":"Нажмите здесь, чтобы их увидеть",
"unusedConfigNodesButton":"Поиск неиспользуемых узлов конфигурации",
"unknownNodesButton":"Поиск неизвестных узлов",
"invalidNodesButton":"Поиск недопустимых узлов",
"errors": {
"noResponse": "нет ответа от сервера"
},
@@ -650,14 +653,7 @@
"empty": "пусто",
"globalConfig": "Глобальные конфиг узлы",
"triggerAction": "Вызвать действие",
"find": "Найти в рабочей области",
"search": {
"configNodes": "Узлы конфигурации",
"unusedConfigNodes": "Неиспользуемые узлы конфигурации",
"invalidNodes": "Недействительные узлы",
"uknownNodes": "Неизвестные узлы",
"unusedSubflows": "Неиспользуемые подпотоки"
}
"find": "Найти в рабочей области"
},
"help": {
"name": "Справка",
@@ -888,7 +884,14 @@
},
"search": {
"empty": "Ничего не найдено",
"addNode": "добавить узел..."
"addNode": "добавить узел...",
"options": {
"configNodes": "Узлы конфигурации",
"unusedConfigNodes": "Неиспользуемые узлы конфигурации",
"invalidNodes": "Недействительные узлы",
"uknownNodes": "Неизвестные узлы",
"unusedSubflows": "Неиспользуемые подпотоки"
}
},
"expressionEditor": {
"functions": "Функции",

View File

View File

View File

@@ -97,7 +97,7 @@
"rename": "重命名",
"delete": "删除",
"keyboardShortcuts": "键盘快捷方式",
"login": "登",
"login": "登",
"logout": "退出",
"editPalette": "节点管理",
"other": "其他",
@@ -122,16 +122,16 @@
"zoom-in": "放大"
},
"user": {
"loggedInAs": "作为 __name__ 登",
"loggedInAs": "作为 __name__ 登",
"username": "账号",
"password": "密码",
"login": "登",
"loginFailed": "登失败",
"login": "登",
"loginFailed": "登失败",
"notAuthorized": "未授权",
"errors": {
"settings": "设置信息需要登后才能访问",
"deploy": "改动需要登后才能部署",
"notAuthorized": "此操作需要登后才能执行"
"settings": "设置信息需要登后才能访问",
"deploy": "改动需要登后才能部署",
"notAuthorized": "此操作需要登后才能执行"
}
},
"notification": {
@@ -182,7 +182,8 @@
"create-default-package": "创建默认的包文件",
"no-thanks": "不了,谢谢",
"create-default-project": "创建默认项目文件",
"show-merge-conflicts": "显示合并冲突"
"show-merge-conflicts": "显示合并冲突",
"unknownNodesButton": "搜索未知节点"
}
},
"clipboard": {
@@ -264,7 +265,9 @@
"successfulRestart": "成功重启流程",
"deployFailed": "部署失败: __message__",
"unusedConfigNodes": "您有一些未使用的配置节点",
"unusedConfigNodesLink": "点击此处查看它们",
"unusedConfigNodesButton":"搜索未使用的配置节点",
"unknownNodesButton":"搜索未知节点",
"invalidNodesButton":"搜索无效节点",
"errors": {
"noResponse": "服务器没有响应"
},
@@ -614,14 +617,7 @@
"empty": "空的",
"globalConfig": "全局配置节点",
"triggerAction": "触发动作",
"find": "在工作区中查找",
"search": {
"configNodes": "配置节点",
"unusedConfigNodes": "未使用的配置节点",
"invalidNodes": "无效的节点",
"uknownNodes": "未知的节点",
"unusedSubflows": "未使用的子流程"
}
"find": "在工作区中查找"
},
"help": {
"name": "帮助",
@@ -842,7 +838,14 @@
},
"search": {
"empty": "找不到匹配",
"addNode": "添加一个节点..."
"addNode": "添加一个节点...",
"options": {
"configNodes": "配置节点",
"unusedConfigNodes": "未使用的配置节点",
"invalidNodes": "无效的节点",
"uknownNodes": "未知的节点",
"unusedSubflows": "未使用的子流程"
}
},
"expressionEditor": {
"functions": "功能",

View File

@@ -182,7 +182,8 @@
"create-default-package": "創建默認的包文件",
"no-thanks": "不了,謝謝",
"create-default-project": "創建默認項目文件",
"show-merge-conflicts": "顯示合併衝突"
"show-merge-conflicts": "顯示合併衝突",
"unknownNodesButton": "搜索未知節點"
}
},
"clipboard": {
@@ -264,7 +265,9 @@
"successfulRestart": "成功重啟流程",
"deployFailed": "部署失敗: __message__",
"unusedConfigNodes": "您有一些未使用的配置節點",
"unusedConfigNodesLink": "點擊此處查看它們",
"unusedConfigNodesButton":"搜索未使用的配置節點",
"unknownNodesButton":"搜索未知節點",
"invalidNodesButton":"搜索無效節點",
"errors": {
"noResponse": "伺服器沒有回應"
},
@@ -614,14 +617,7 @@
"empty": "空的",
"globalConfig": "全局配置節點",
"triggerAction": "觸發動作",
"find": "在工作區中查找",
"search": {
"configNodes": "配置節點",
"unusedConfigNodes": "未使用的配置節點",
"invalidNodes": "無效的節點",
"uknownNodes": "未知的節點",
"unusedSubflows": "未使用的子流程"
}
"find": "在工作區中查找"
},
"help": {
"name": "幫助",
@@ -842,7 +838,14 @@
},
"search": {
"empty": "找不到匹配",
"addNode": "添加一個節點..."
"addNode": "添加一個節點...",
"options": {
"configNodes": "配置節點",
"unusedConfigNodes": "未使用的配置節點",
"invalidNodes": "無效的節點",
"uknownNodes": "未知的節點",
"unusedSubflows": "未使用的子流程"
}
},
"expressionEditor": {
"functions": "功能",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-client",
"version": "2.2.0-beta.1",
"version": "3.1.0-beta.1",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@@ -76,7 +76,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
(function() {
this.setOptions = function(options) {
this.options = {
o.options = {
// undef: true,
// unused: true,
esversion: 9,
@@ -98,7 +98,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
if (options) {
for (var opt in options) {
if (options.hasOwnProperty(opt)) {
this.options[opt] = options.opt;
o.options[opt] = options[opt];
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

View File

@@ -0,0 +1 @@
<svg width="50" height="5" viewBox="0, 0, 50, 5" xmlns="http://www.w3.org/2000/svg"><path d="M0 1H50V4H0Z" fill="#CCC"/></svg>

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

View File

@@ -0,0 +1 @@
<svg width="5" height="50" viewBox="0, 0, 5, 50" xmlns="http://www.w3.org/2000/svg"><path d="M1 0H4V50H1Z" fill="#CCC"/></svg>

After

Width:  |  Height:  |  Size: 127 B

View File

@@ -0,0 +1,4 @@
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
<path color="#000" fill="#8c101c" d="M0 0h32v32H0z"></path>
<path style="fill:#ffffff;stroke:#000000;stroke-width:0" d="M 24,16 8,24 8,8 Z" fill="none" stroke="#000" stroke-width="1.5"></path>
</svg>

After

Width:  |  Height:  |  Size: 271 B

View File

@@ -0,0 +1,4 @@
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
<path color="#000" fill="#8c101c" d="M0 0h32v32H0z"></path>
<rect style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0;" width="15" height="15" x="8" y="8.5"></rect>
</svg>

After

Width:  |  Height:  |  Size: 256 B

View File

@@ -13,10 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
/**
* An API for undo / redo history buffer
* @namespace RED.history
*/
RED.history = (function() {
var undoHistory = [];
var redoHistory = [];
function nodeOrJunction(id) {
var node = RED.nodes.node(id);
if (node) {
return node;
}
return RED.nodes.junction(id);
}
function undoEvent(ev) {
var i;
var len;
@@ -101,6 +114,23 @@ RED.history = (function() {
RED.nodes.removeLink(ev.links[i]);
}
}
if (ev.junctions) {
inverseEv.junctions = [];
for (i=0;i<ev.junctions.length;i++) {
inverseEv.junctions.push(ev.junctions[i]);
RED.nodes.removeJunction(ev.junctions[i]);
if (ev.junctions[i].g) {
var group = RED.nodes.group(ev.junctions[i].g);
var index = group.nodes.indexOf(ev.junctions[i]);
if (index !== -1) {
group.nodes.splice(index,1);
RED.group.markDirty(group);
}
}
}
}
if (ev.groups) {
inverseEv.groups = [];
for (i = ev.groups.length - 1;i>=0;i--) {
@@ -267,6 +297,21 @@ RED.history = (function() {
}
}
}
if (ev.junctions) {
inverseEv.junctions = [];
for (i=0;i<ev.junctions.length;i++) {
inverseEv.junctions.push(ev.junctions[i]);
RED.nodes.addJunction(ev.junctions[i]);
if (ev.junctions[i].g) {
group = RED.nodes.group(ev.junctions[i].g);
if (group.nodes.indexOf(ev.junctions[i]) === -1) {
group.nodes.push(ev.junctions[i]);
}
RED.group.markDirty(group)
}
}
}
if (ev.links) {
inverseEv.links = [];
for (i=0;i<ev.links.length;i++) {
@@ -389,7 +434,9 @@ RED.history = (function() {
if (ev.node.type === 'tab' && ev.changes.hasOwnProperty('disabled')) {
$("#red-ui-tab-"+(ev.node.id.replace(".","-"))).toggleClass('red-ui-workspace-disabled',!!ev.node.disabled);
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!ev.node.disabled);
}
if (ev.node.type === 'tab' && ev.changes.hasOwnProperty('locked')) {
$("#red-ui-tab-"+(ev.node.id.replace(".","-"))).toggleClass('red-ui-workspace-locked',!!ev.node.locked);
}
if (ev.subflow) {
inverseEv.subflow = {};
@@ -477,6 +524,7 @@ RED.history = (function() {
var z = ev.activeWorkspace;
var fullNodeList = RED.nodes.filterNodes({z:ev.subflow.subflow.id});
fullNodeList = fullNodeList.concat(RED.nodes.groups(ev.subflow.subflow.id))
fullNodeList = fullNodeList.concat(RED.nodes.junctions(ev.subflow.subflow.id))
fullNodeList.forEach(function(n) {
n.x += ev.subflow.offsetX;
n.y += ev.subflow.offsetY;
@@ -486,7 +534,7 @@ RED.history = (function() {
});
inverseEv.subflows = [];
for (i=0;i<ev.nodes.length;i++) {
inverseEv.subflows.push(RED.nodes.node(ev.nodes[i]));
inverseEv.subflows.push(nodeOrJunction(ev.nodes[i]));
RED.nodes.remove(ev.nodes[i]);
}
}
@@ -684,6 +732,13 @@ RED.history = (function() {
peek: function() {
return undoHistory[undoHistory.length-1];
},
replace: function(ev) {
if (undoHistory.length === 0) {
RED.history.push(ev);
} else {
undoHistory[undoHistory.length-1] = ev;
}
},
clear: function() {
undoHistory = [];
redoHistory = [];

View File

@@ -3,16 +3,12 @@
"alt-shift-p":"core:manage-palette",
"ctrl-f": "core:search",
"ctrl-shift-f": "core:list-flows",
"ctrl-+": "core:zoom-in",
"ctrl--": "core:zoom-out",
"ctrl-0": "core:zoom-reset",
"ctrl-enter": "core:confirm-edit-tray",
"ctrl-escape": "core:cancel-edit-tray",
"ctrl-d": "core:deploy-flows",
"ctrl-g i": "core:show-info-tab",
"ctrl-g h": "core:show-help-tab",
"ctrl-g d": "core:show-debug-tab",
"ctrl-g c": "core:show-config-tab",
"ctrl-g d": "core:show-debug-tab",
"ctrl-g h": "core:show-help-tab",
"ctrl-g i": "core:show-info-tab",
"ctrl-g v": "core:show-version-control-tab",
"ctrl-g x": "core:show-context-tab",
"ctrl-e": "core:show-export-dialog",
"ctrl-i": "core:show-import-dialog",
@@ -23,11 +19,8 @@
"ctrl-alt-r": "core:show-remote-diff",
"ctrl-alt-n": "core:new-project",
"ctrl-alt-o": "core:open-project",
"ctrl-g v": "core:show-version-control-tab",
"ctrl-shift-l": "core:show-event-log",
"ctrl-shift-p":"core:show-action-list",
"alt-w": "core:hide-flow",
"alt-shift-w": "core:show-last-hidden-flow"
"ctrl-shift-p":"core:show-action-list"
},
"red-ui-sidebar-node-config": {
"backspace": "core:delete-config-selection",
@@ -38,7 +31,9 @@
},
"red-ui-workspace": {
"backspace": "core:delete-selection",
"ctrl-backspace": "core:delete-selection-and-reconnect",
"delete": "core:delete-selection",
"ctrl-delete": "core:delete-selection-and-reconnect",
"enter": "core:edit-selected-node",
"ctrl-enter": "core:go-to-selection",
"ctrl-c": "core:copy-selection-to-internal-clipboard",
@@ -88,6 +83,19 @@
"alt-a m": "core:align-selection-to-middle",
"alt-a c": "core:align-selection-to-center",
"alt-a h": "core:distribute-selection-horizontally",
"alt-a v": "core:distribute-selection-vertically"
"alt-a v": "core:distribute-selection-vertically",
"shift-f": "core:search-previous",
"f": "core:search-next",
"alt-l l": "core:split-wire-with-link-nodes",
"alt-w": "core:hide-flow",
"alt-shift-w": "core:show-last-hidden-flow",
"ctrl-+": "core:zoom-in",
"ctrl--": "core:zoom-out",
"ctrl-0": "core:zoom-reset"
},
"red-ui-editor-stack": {
"ctrl-enter": "core:confirm-edit-tray",
"ctrl-escape": "core:cancel-edit-tray"
}
}

View File

@@ -13,7 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
/**
* An Interface to nodes and utility functions for creating/adding/deleting nodes and links
* @namespace RED.nodes
*/
RED.nodes = (function() {
var PORT_TYPE_INPUT = 1;
var PORT_TYPE_OUTPUT = 0;
var node_defs = {};
var linkTabMap = {};
@@ -30,6 +37,9 @@ RED.nodes = (function() {
var groups = {};
var groupsByZ = {};
var junctions = {};
var junctionsByZ = {};
var initialLoad;
var dirty = false;
@@ -52,6 +62,7 @@ RED.nodes = (function() {
defaults: {
label: {value:""},
disabled: {value: false},
locked: {value: false},
info: {value: ""},
env: {value: []}
}
@@ -564,15 +575,48 @@ RED.nodes = (function() {
}
}
const nodeProxyHandler = {
get(node, prop) {
if (prop === '__isProxy__') {
return true
} else if (prop == '__node__') {
return node
}
return node[prop]
},
set(node, prop, value) {
if (node.z && (RED.nodes.workspace(node.z)?.locked || RED.nodes.subflow(node.z)?.locked)) {
if (
node._def.defaults[prop] ||
prop === 'z' ||
prop === 'l' ||
prop === 'd' ||
(prop === 'changed' && (!!node.changed) !== (!!value)) || // jshint ignore:line
((prop === 'x' || prop === 'y') && !node.resize && node.type !== 'group')
) {
throw new Error(`Cannot modified property '${prop}' of locked object '${node.type}:${node.id}'`)
}
}
node[prop] = value;
return true
}
}
function addNode(n) {
let newNode
if (!n.__isProxy__) {
newNode = new Proxy(n, nodeProxyHandler)
} else {
newNode = n
}
if (n.type.indexOf("subflow") !== 0) {
n["_"] = n._def._;
} else {
var subflowId = n.type.substring(8);
var sf = RED.nodes.subflow(subflowId);
if (sf) {
sf.instances.push(sf);
sf.instances.push(newNode);
}
n["_"] = RED._;
}
@@ -589,14 +633,23 @@ RED.nodes = (function() {
});
n.i = nextId+1;
}
allNodes.addNode(n);
allNodes.addNode(newNode);
if (!nodeLinks[n.id]) {
nodeLinks[n.id] = {in:[],out:[]};
}
}
RED.events.emit('nodes:add',n);
RED.events.emit('nodes:add',newNode);
return newNode
}
function addLink(l) {
if (nodeLinks[l.source.id]) {
const isUnique = nodeLinks[l.source.id].out.every(function(link) {
return link.sourcePort !== l.sourcePort || link.target.id !== l.target.id
})
if (!isUnique) {
return
}
}
links.push(l);
if (l.source) {
// Possible the node hasn't been added yet
@@ -719,6 +772,10 @@ RED.nodes = (function() {
moveGroupToTab(node,z);
return;
}
if (node.type === "junction") {
moveJunctionToTab(node,z);
return;
}
var oldZ = node.z;
allNodes.moveNode(node,z);
var nl = nodeLinks[node.id];
@@ -753,6 +810,39 @@ RED.nodes = (function() {
RED.events.emit("groups:change",group);
}
function moveJunctionToTab(junction, z) {
var index = junctionsByZ[junction.z].indexOf(junction);
junctionsByZ[junction.z].splice(index,1);
junctionsByZ[z] = junctionsByZ[z] || [];
junctionsByZ[z].push(junction);
var oldZ = junction.z;
junction.z = z;
var nl = nodeLinks[junction.id];
if (nl) {
nl.in.forEach(function(l) {
var idx = linkTabMap[oldZ].indexOf(l);
if (idx != -1) {
linkTabMap[oldZ].splice(idx, 1);
}
if ((l.source.z === z) && linkTabMap[z]) {
linkTabMap[z].push(l);
}
});
nl.out.forEach(function(l) {
var idx = linkTabMap[oldZ].indexOf(l);
if (idx != -1) {
linkTabMap[oldZ].splice(idx, 1);
}
if ((l.target.z === z) && linkTabMap[z]) {
linkTabMap[z].push(l);
}
});
}
RED.events.emit("junctions:change",junction);
}
function removeLink(l) {
var index = links.indexOf(l);
if (index != -1) {
@@ -803,6 +893,7 @@ RED.nodes = (function() {
var removedNodes = [];
var removedLinks = [];
var removedGroups = [];
var removedJunctions = [];
if (ws) {
delete workspaces[id];
delete linkTabMap[id];
@@ -821,11 +912,16 @@ RED.nodes = (function() {
}
}
}
removedJunctions = RED.nodes.junctions(id)
for (i=0;i<removedNodes.length;i++) {
var result = removeNode(removedNodes[i].id);
removedLinks = removedLinks.concat(result.links);
}
for (i=0;i<removedJunctions.length;i++) {
var result = removeJunction(removedJunctions[i])
removedLinks = removedLinks.concat(result.links)
}
// Must get 'removedGroups' in the right order.
// - start with the top-most groups
@@ -845,7 +941,7 @@ RED.nodes = (function() {
allNodes.removeTab(id);
RED.events.emit('flows:remove',ws);
}
return {nodes:removedNodes,links:removedLinks, groups: removedGroups};
return {nodes:removedNodes,links:removedLinks, groups: removedGroups, junctions: removedJunctions};
}
function addSubflow(sf, createNewIds) {
@@ -984,6 +1080,9 @@ RED.nodes = (function() {
node.type = n.type;
for (var d in n._def.defaults) {
if (n._def.defaults.hasOwnProperty(d)) {
if (d === 'locked' && !n.locked) {
continue
}
node[d] = n[d];
}
}
@@ -1102,7 +1201,7 @@ RED.nodes = (function() {
delete node.env;
}
}
if (n._def.category != "config") {
if (n._def.category != "config" || n.type === 'junction') {
node.x = n.x;
node.y = n.y;
if (exportDimensions) {
@@ -1263,7 +1362,6 @@ RED.nodes = (function() {
} else {
nodeSet = [sf];
}
console.log(nodeSet);
return createExportableNodeSet(nodeSet);
}
/**
@@ -1299,6 +1397,10 @@ RED.nodes = (function() {
exportedConfigNodes[n.id] = true;
}
});
subflowSet = subflowSet.concat(RED.nodes.junctions(subflowId))
subflowSet = subflowSet.concat(RED.nodes.groups(subflowId))
var exportableSubflow = createExportableNodeSet(subflowSet, exportedIds, exportedSubflows, exportedConfigNodes);
nns = exportableSubflow.concat(nns);
}
@@ -1365,6 +1467,11 @@ RED.nodes = (function() {
nns.push(convertNode(groups[i], opts));
}
}
for (i in junctions) {
if (junctions.hasOwnProperty(i)) {
nns.push(convertNode(junctions[i], opts));
}
}
for (i in configNodes) {
if (configNodes.hasOwnProperty(i)) {
nns.push(convertNode(configNodes[i], opts));
@@ -1446,6 +1553,7 @@ RED.nodes = (function() {
tabs: {},
subflows: {},
groups: {},
junctions: {},
configs: {},
nodes: {},
all: [],
@@ -1461,6 +1569,8 @@ RED.nodes = (function() {
imported.subflows[n.id] = n;
} else if (n.type === "group") {
imported.groups[n.id] = n;
} else if (n.type === "junction") {
imported.junctions[n.id] = n;
} else if (n.hasOwnProperty("x") && n.hasOwnProperty("y")) {
imported.nodes[n.id] = n;
} else {
@@ -1469,7 +1579,7 @@ RED.nodes = (function() {
var nodeZ = n.z || "__global__";
imported.zMap[nodeZ] = imported.zMap[nodeZ] || [];
imported.zMap[nodeZ].push(n)
if (allNodes.hasNode(n.id) || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id]) {
if (allNodes.hasNode(n.id) || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id] || junctions[n.id]) {
imported.conflicted[n.id] = n;
}
})
@@ -1578,21 +1688,20 @@ RED.nodes = (function() {
* Options:
* - generateIds - whether to replace all node ids
* - addFlow - whether to import nodes to a new tab
* - importToCurrent
* - reimport - if node has a .z property, dont overwrite it
* Only applicible when `generateIds` is false
* - importMap - how to resolve any conflicts.
* - id:import - import as-is
* - id:copy - import with new id
* - id:replace - import over the top of existing
*/
function importNodes(newNodesObj,options) { // createNewIds,createMissingWorkspace) {
options = options || {
generateIds: false,
addFlow: false,
}
options.importMap = options.importMap || {};
var createNewIds = options.generateIds;
var createMissingWorkspace = options.addFlow;
const defOpts = { generateIds: false, addFlow: false, reimport: false, importMap: {} }
options = Object.assign({}, defOpts, options)
options.importMap = options.importMap || {}
const createNewIds = options.generateIds;
const reimport = (!createNewIds && !!options.reimport)
const createMissingWorkspace = options.addFlow;
var i;
var n;
var newNodes;
@@ -1635,7 +1744,7 @@ RED.nodes = (function() {
if (!options.generateIds) {
if (!options.importMap[id]) {
// No conflict resolution for this node
var existing = allNodes.getNode(id) || configNodes[id] || workspaces[id] || subflows[id] || groups[id];
var existing = allNodes.getNode(id) || configNodes[id] || workspaces[id] || subflows[id] || groups[id] || junctions[id];
if (existing) {
existingNodes.push({existing:existing, imported:n});
}
@@ -1689,6 +1798,7 @@ RED.nodes = (function() {
n.type != "tab" &&
n.type != "subflow" &&
n.type != "group" &&
n.type != 'junction' &&
!registry.getNodeType(n.type) &&
n.type.substring(0,8) != "subflow:" &&
unknownTypes.indexOf(n.type)==-1) {
@@ -1761,6 +1871,7 @@ RED.nodes = (function() {
var new_nodes = [];
var new_links = [];
var new_groups = [];
var new_junctions = [];
var new_group_set = new Set();
var nid;
var def;
@@ -1891,7 +2002,8 @@ RED.nodes = (function() {
}
}
} else {
if (n.z && !workspace_map[n.z] && !subflow_map[n.z]) {
const keepNodesCurrentZ = reimport && n.z && (RED.workspaces.contains(n.z) || RED.nodes.subflow(n.z))
if (!keepNodesCurrentZ && n.z && !workspace_map[n.z] && !subflow_map[n.z]) {
n.z = activeWorkspace;
}
}
@@ -1952,12 +2064,15 @@ RED.nodes = (function() {
changed:false,
_config:{}
}
if (n.type !== "group") {
if (n.type !== "group" && n.type !== 'junction') {
node.wires = n.wires||[];
node.inputLabels = n.inputLabels;
node.outputLabels = n.outputLabels;
node.icon = n.icon;
}
if (n.type === 'junction') {
node.wires = n.wires||[];
}
if (n.hasOwnProperty('l')) {
node.l = n.l;
}
@@ -1989,7 +2104,8 @@ RED.nodes = (function() {
node.id = getID();
} else {
node.id = n.id;
if (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z])) {
const keepNodesCurrentZ = reimport && node.z && (RED.workspaces.contains(node.z) || RED.nodes.subflow(node.z))
if (!keepNodesCurrentZ && (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z]))) {
if (createMissingWorkspace) {
if (missingWorkspace === null) {
missingWorkspace = RED.workspaces.add(null,true);
@@ -2026,6 +2142,15 @@ RED.nodes = (function() {
node.outputs = subflow.out.length;
node.inputs = subflow.in.length;
node.env = n.env;
} else if (n.type === 'junction') {
node._def = {defaults:{}}
node._config.x = node.x
node._config.y = node.y
node.inputs = 1
node.outputs = 1
node.w = 0;
node.h = 0;
} else {
if (!node._def) {
if (node.x && node.y) {
@@ -2109,7 +2234,9 @@ RED.nodes = (function() {
node_map[n.id] = node;
// If an 'unknown' config node, it will not have been caught by the
// proper config node handling, so needs adding to new_nodes here
if (node.type === "unknown" || node._def.category !== "config") {
if (node.type === 'junction') {
new_junctions.push(node)
} else if (node.type === "unknown" || node._def.category !== "config") {
new_nodes.push(node);
} else if (node.type === "group") {
new_groups.push(node);
@@ -2120,11 +2247,15 @@ RED.nodes = (function() {
}
// Remap all wires and config node references
for (i=0;i<new_nodes.length;i++) {
n = new_nodes[i];
for (i=0;i<new_nodes.length+new_junctions.length;i++) {
if (i<new_nodes.length) {
n = new_nodes[i];
} else {
n = new_junctions[i - new_nodes.length]
}
if (n.wires) {
for (var w1=0;w1<n.wires.length;w1++) {
var wires = (n.wires[w1] instanceof Array)?n.wires[w1]:[n.wires[w1]];
var wires = (Array.isArray(n.wires[w1]))?n.wires[w1]:[n.wires[w1]];
for (var w2=0;w2<wires.length;w2++) {
if (node_map.hasOwnProperty(wires[w2])) {
if (n.z === node_map[wires[w2]].z) {
@@ -2221,19 +2352,6 @@ RED.nodes = (function() {
if (n.g && !new_group_set.has(n.g)) {
delete n.g;
}
n.nodes = n.nodes.map(function(id) {
return node_map[id];
})
// Just in case the group references a node that doesn't exist for some reason
n.nodes = n.nodes.filter(function(v) {
if (v) {
// Repair any nodes that have forgotten they are in this group
if (v.g !== n.id) {
v.g = n.id;
}
}
return !!v
});
if (!n.g) {
groupDepthMap[n.id] = 0;
}
@@ -2256,15 +2374,22 @@ RED.nodes = (function() {
return groupDepthMap[A.id] - groupDepthMap[B.id];
});
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
addGroup(n);
new_groups[i] = addGroup(new_groups[i]);
node_map[new_groups[i].id] = new_groups[i]
}
for (i=0;i<new_junctions.length;i++) {
new_junctions[i] = addJunction(new_junctions[i]);
node_map[new_junctions[i].id] = new_junctions[i]
}
// Now the nodes have been fully updated, add them.
for (i=0;i<new_nodes.length;i++) {
var node = new_nodes[i];
addNode(node);
new_nodes[i] = addNode(new_nodes[i])
node_map[new_nodes[i].id] = new_nodes[i]
}
// Finally validate them all.
// This has to be done after everything is added so that any checks for
// dependent config nodes will pass
@@ -2272,6 +2397,39 @@ RED.nodes = (function() {
var node = new_nodes[i];
RED.editor.validateNode(node);
}
const lookupNode = (id) => {
const mappedNode = node_map[id]
if (!mappedNode) {
return null
}
if (mappedNode.__isProxy__) {
return mappedNode
} else {
return node_map[mappedNode.id]
}
}
// Update groups to reference proxy node objects
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
// bypass the proxy in case the flow is locked
n.__node__.nodes = n.nodes.map(lookupNode)
// Just in case the group references a node that doesn't exist for some reason
n.__node__.nodes = n.nodes.filter(function(v) {
if (v) {
// Repair any nodes that have forgotten they are in this group
if (v.g !== n.id) {
v.g = n.id;
}
}
return !!v
});
}
// Update links to use proxy node objects
for (i=0;i<new_links.length;i++) {
new_links[i].source = lookupNode(new_links[i].source.id) || new_links[i].source
new_links[i].target = lookupNode(new_links[i].target.id) || new_links[i].target
}
RED.workspaces.refresh();
@@ -2290,6 +2448,7 @@ RED.nodes = (function() {
nodes:new_nodes,
links:new_links,
groups:new_groups,
junctions: new_junctions,
workspaces:new_workspaces,
subflows:new_subflows,
missingWorkspace: missingWorkspace,
@@ -2396,12 +2555,20 @@ RED.nodes = (function() {
workspacesOrder = [];
groups = {};
groupsByZ = {};
junctions = {};
junctionsByZ = {};
var workspaceIds = Object.keys(workspaces);
// Ensure all workspaces are unlocked so we don't get any edit-protection
// preventing removal
workspaceIds.forEach(function(id) {
workspaces[id].locked = false
});
var subflowIds = Object.keys(subflows);
subflowIds.forEach(function(id) {
RED.subflow.removeSubflow(id)
});
var workspaceIds = Object.keys(workspaces);
workspaceIds.forEach(function(id) {
RED.workspaces.remove(workspaces[id]);
});
@@ -2422,10 +2589,14 @@ RED.nodes = (function() {
}
function addGroup(group) {
if (!group.__isProxy__) {
group = new Proxy(group, nodeProxyHandler)
}
groupsByZ[group.z] = groupsByZ[group.z] || [];
groupsByZ[group.z].push(group);
groups[group.id] = group;
RED.events.emit("groups:add",group);
return group
}
function removeGroup(group) {
var i = groupsByZ[group.z].indexOf(group);
@@ -2445,6 +2616,34 @@ RED.nodes = (function() {
RED.events.emit("groups:remove",group);
}
function addJunction(junction) {
if (!junction.__isProxy__) {
junction = new Proxy(junction, nodeProxyHandler)
}
junctionsByZ[junction.z] = junctionsByZ[junction.z] || []
junctionsByZ[junction.z].push(junction)
junctions[junction.id] = junction;
if (!nodeLinks[junction.id]) {
nodeLinks[junction.id] = {in:[],out:[]};
}
RED.events.emit("junctions:add", junction)
return junction
}
function removeJunction(junction) {
var i = junctionsByZ[junction.z].indexOf(junction)
junctionsByZ[junction.z].splice(i, 1)
if (junctionsByZ[junction.z].length === 0) {
delete junctionsByZ[junction.z]
}
delete junctions[junction.id]
delete nodeLinks[junction.id];
RED.events.emit("junctions:remove", junction)
var removedLinks = links.filter(function(l) { return (l.source === junction) || (l.target === junction); });
removedLinks.forEach(removeLink);
return { links: removedLinks }
}
function getNodeHelp(type) {
var helpContent = "";
var helpElement = $("script[data-help-name='"+type+"']");
@@ -2458,6 +2657,144 @@ RED.nodes = (function() {
return helpContent;
}
function getNodeIslands(nodes) {
var selectedNodes = new Set(nodes);
// Maps node => island index
var nodeToIslandIndex = new Map();
// Maps island index => [nodes in island]
var islandIndexToNodes = new Map();
var internalLinks = new Set();
nodes.forEach((node, index) => {
nodeToIslandIndex.set(node,index);
islandIndexToNodes.set(index, [node]);
var inboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_INPUT);
var outboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
inboundLinks.forEach(l => {
if (selectedNodes.has(l.source)) {
internalLinks.add(l)
}
})
outboundLinks.forEach(l => {
if (selectedNodes.has(l.target)) {
internalLinks.add(l)
}
})
})
internalLinks.forEach(l => {
let source = l.source;
let target = l.target;
if (nodeToIslandIndex.get(source) !== nodeToIslandIndex.get(target)) {
let sourceIsland = nodeToIslandIndex.get(source);
let islandToMove = nodeToIslandIndex.get(target);
let nodesToMove = islandIndexToNodes.get(islandToMove);
nodesToMove.forEach(n => {
nodeToIslandIndex.set(n,sourceIsland);
islandIndexToNodes.get(sourceIsland).push(n);
})
islandIndexToNodes.delete(islandToMove);
}
})
const result = [];
islandIndexToNodes.forEach((nodes,index) => {
result.push(nodes);
})
return result;
}
function detachNodes(nodes) {
let allSelectedNodes = [];
nodes.forEach(node => {
if (node.type === 'group') {
let groupNodes = RED.group.getNodes(node,true,true);
allSelectedNodes = allSelectedNodes.concat(groupNodes);
} else {
allSelectedNodes.push(node);
}
})
if (allSelectedNodes.length > 0 ) {
const nodeIslands = RED.nodes.getNodeIslands(allSelectedNodes);
let removedLinks = [];
let newLinks = [];
let createdLinkIds = new Set();
nodeIslands.forEach(nodes => {
let selectedNodes = new Set(nodes);
let allInboundLinks = [];
let allOutboundLinks = [];
// Identify links that enter or exit this island of nodes
nodes.forEach(node => {
var inboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_INPUT);
var outboundLinks = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
inboundLinks.forEach(l => {
if (!selectedNodes.has(l.source)) {
allInboundLinks.push(l)
}
})
outboundLinks.forEach(l => {
if (!selectedNodes.has(l.target)) {
allOutboundLinks.push(l)
}
})
});
// Identify the links to restore
allInboundLinks.forEach(inLink => {
// For Each inbound link,
// - get source node.
// - trace through to all outbound links
let sourceNode = inLink.source;
let targetNodes = new Set();
let visited = new Set();
let stack = [inLink.target];
while (stack.length > 0) {
let node = stack.pop(stack);
visited.add(node)
let links = RED.nodes.getNodeLinks(node, PORT_TYPE_OUTPUT);
links.forEach(l => {
if (visited.has(l.target)) {
return
}
visited.add(l.target);
if (selectedNodes.has(l.target)) {
// internal link
stack.push(l.target)
} else {
targetNodes.add(l.target)
}
})
}
targetNodes.forEach(target => {
let linkId = `${sourceNode.id}[${inLink.sourcePort}] -> ${target.id}`
if (!createdLinkIds.has(linkId)) {
createdLinkIds.add(linkId);
let link = {
source: sourceNode,
sourcePort: inLink.sourcePort,
target: target
}
let existingLinks = RED.nodes.filterLinks(link)
if (existingLinks.length === 0) {
newLinks.push(link);
}
}
})
})
// 2. delete all those links
allInboundLinks.forEach(l => { RED.nodes.removeLink(l); removedLinks.push(l)})
allOutboundLinks.forEach(l => { RED.nodes.removeLink(l); removedLinks.push(l)})
})
newLinks.forEach(l => RED.nodes.addLink(l));
return {
newLinks,
removedLinks
}
}
}
return {
init: function() {
RED.events.on("registry:node-type-added",function(type) {
@@ -2475,6 +2812,7 @@ RED.nodes = (function() {
}
});
const nodeGroupMap = {}
var replaceNodeIds = Object.keys(replaceNodes);
if (replaceNodeIds.length > 0) {
var reimportList = [];
@@ -2485,6 +2823,12 @@ RED.nodes = (function() {
} else {
allNodes.removeNode(n);
}
if (n.g) {
// reimporting a node *without* including its group object
// will cause the g property to be cleared. Cache it
// here so we can restore it
nodeGroupMap[n.id] = n.g
}
reimportList.push(convertNode(n));
RED.events.emit('nodes:remove',n);
});
@@ -2502,10 +2846,22 @@ RED.nodes = (function() {
// Force the redraw to be synchronous so the view updates
// *now* and removes the unknown node
RED.view.redraw(true, true);
var result = importNodes(reimportList,{generateIds:false});
var result = importNodes(reimportList,{generateIds:false, reimport: true});
var newNodeMap = {};
result.nodes.forEach(function(n) {
newNodeMap[n.id] = n;
if (nodeGroupMap[n.id]) {
// This node is in a group - need to substitute the
// node reference inside the group
n.g = nodeGroupMap[n.id]
const group = RED.nodes.group(n.g)
if (group) {
var index = group.nodes.findIndex(gn => gn.id === n.id)
if (index > -1) {
group.nodes[index] = n
}
}
}
});
RED.nodes.eachLink(function(l) {
if (newNodeMap.hasOwnProperty(l.source.id)) {
@@ -2535,11 +2891,10 @@ RED.nodes = (function() {
getType: registry.getNodeType,
getNodeHelp: getNodeHelp,
convertNode: convertNode,
add: addNode,
remove: removeNode,
clear: clear,
detachNodes: detachNodes,
moveNodesForwards: moveNodesForwards,
moveNodesBackwards: moveNodesBackwards,
moveNodesToFront: moveNodesToFront,
@@ -2551,10 +2906,23 @@ RED.nodes = (function() {
addLink: addLink,
removeLink: removeLink,
getNodeLinks: function(id, portType) {
if (typeof id !== 'string') {
id = id.id;
}
if (nodeLinks[id]) {
if (portType === 1) {
// Return cloned arrays so they can be safely modified by caller
return [].concat(nodeLinks[id].in)
} else {
return [].concat(nodeLinks[id].out)
}
}
return [];
},
addWorkspace: addWorkspace,
removeWorkspace: removeWorkspace,
getWorkspaceOrder: function() { return workspacesOrder },
getWorkspaceOrder: function() { return [...workspacesOrder] },
setWorkspaceOrder: function(order) { workspacesOrder = order; },
workspace: getWorkspace,
@@ -2568,6 +2936,11 @@ RED.nodes = (function() {
group: function(id) { return groups[id] },
groups: function(z) { return groupsByZ[z]?groupsByZ[z].slice():[] },
addJunction: addJunction,
removeJunction: removeJunction,
junction: function(id) { return junctions[id] },
junctions: function(z) { return junctionsByZ[z]?junctionsByZ[z].slice():[] },
eachNode: function(cb) {
allNodes.eachNode(cb);
},
@@ -2625,6 +2998,7 @@ RED.nodes = (function() {
getAllFlowNodes: getAllFlowNodes,
getAllUpstreamNodes: getAllUpstreamNodes,
getAllDownstreamNodes: getAllDownstreamNodes,
getNodeIslands: getNodeIslands,
createExportableNodeSet: createExportableNodeSet,
createCompleteNodeSet: createCompleteNodeSet,
updateConfigNodeUsers: updateConfigNodeUsers,

View File

@@ -249,11 +249,51 @@ var RED = (function() {
RED.nodes.import(nodes.flows);
RED.nodes.dirty(false);
RED.view.redraw(true);
if (/^#flow\/.+$/.test(currentHash)) {
RED.workspaces.show(currentHash.substring(6),true);
if (/^#(flow|node|group)\/.+$/.test(currentHash)) {
const hashParts = currentHash.split('/')
const showEditDialog = hashParts.length > 2 && hashParts[2] === 'edit'
if (hashParts[0] === '#flow') {
RED.workspaces.show(hashParts[1], true);
if (showEditDialog) {
RED.workspaces.edit()
}
} else if (hashParts[0] === '#node') {
const nodeToShow = RED.nodes.node(hashParts[1])
if (nodeToShow) {
setTimeout(() => {
RED.view.reveal(nodeToShow.id)
window.location.hash = currentHash
if (showEditDialog) {
RED.editor.edit(nodeToShow)
}
}, 50)
}
} else if (hashParts[0] === '#group') {
const nodeToShow = RED.nodes.group(hashParts[1])
if (nodeToShow) {
RED.view.reveal(nodeToShow.id)
window.location.hash = currentHash
if (showEditDialog) {
RED.editor.editGroup(nodeToShow)
}
}
}
}
if (RED.workspaces.active() === 0 && RED.workspaces.count() > 0) {
RED.workspaces.show(RED.nodes.getWorkspaceOrder()[0])
if (RED.workspaces.count() > 0) {
const hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
const workspaces = RED.nodes.getWorkspaceOrder();
if (RED.workspaces.active() === 0) {
for (let index = 0; index < workspaces.length; index++) {
const ws = workspaces[index];
if (!hiddenTabs[ws]) {
RED.workspaces.show(ws);
break;
}
}
}
if (RED.workspaces.active() === 0) {
RED.workspaces.show(workspaces[0]);
}
}
} catch(err) {
console.warn(err);
@@ -284,6 +324,10 @@ var RED = (function() {
// handled below
return;
}
if (notificationId === "flows-run-state") {
// handled in editor-client/src/js/runtime.js
return;
}
if (notificationId === "project-update") {
loader.start(RED._("event.loadingProject"), 0);
RED.nodes.clear();
@@ -304,6 +348,8 @@ var RED = (function() {
loader.end()
RED.notify($("<p>").text(message));
RED.sidebar.info.refresh()
RED.menu.setDisabled('menu-item-projects-open',false);
RED.menu.setDisabled('menu-item-projects-settings',false);
});
});
return;
@@ -319,7 +365,6 @@ var RED = (function() {
id: notificationId
}
if (notificationId === "runtime-state") {
RED.events.emit("runtime-state",msg);
if (msg.error === "safe-mode") {
options.buttons = [
{
@@ -345,6 +390,14 @@ var RED = (function() {
} else {
options.buttons = [
{
text: RED._("notification.label.unknownNodesButton"),
class: "pull-left",
click: function() {
RED.actions.invoke("core:search", "type:unknown ");
}
},
{
class: "primary",
text: RED._("common.label.close"),
click: function() {
persistentNotifications[notificationId].hideNotification();
@@ -452,16 +505,16 @@ var RED = (function() {
} else if (persistentNotifications.hasOwnProperty(notificationId)) {
persistentNotifications[notificationId].close();
delete persistentNotifications[notificationId];
if (notificationId === 'runtime-state') {
RED.events.emit("runtime-state",msg);
}
}
if (notificationId === 'runtime-state') {
RED.events.emit("runtime-state",msg);
}
});
RED.comms.subscribe("status/#",function(topic,msg) {
var parts = topic.split("/");
var node = RED.nodes.node(parts[1]);
if (node) {
if (msg.hasOwnProperty("text") && msg.text !== null && /^[a-zA-Z]/.test(msg.text)) {
if (msg.hasOwnProperty("text") && msg.text !== null && /^[@a-zA-Z]/.test(msg.text)) {
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString()});
}
node.status = msg;
@@ -556,8 +609,7 @@ var RED = (function() {
$(".red-ui-header-toolbar").show();
RED.sidebar.show(":first");
RED.sidebar.show(":first", true);
setTimeout(function() {
loader.end();
@@ -603,7 +655,10 @@ var RED = (function() {
null,
{id: "menu-item-edit-select-all", label:RED._("keyboard.selectAll"), onselect: "core:select-all-nodes"},
{id: "menu-item-edit-select-connected", label:RED._("keyboard.selectAllConnected"), onselect: "core:select-connected-nodes"},
{id: "menu-item-edit-select-none", label:RED._("keyboard.selectNone"), onselect: "core:select-none"}
{id: "menu-item-edit-select-none", label:RED._("keyboard.selectNone"), onselect: "core:select-none"},
null,
{id: "menu-item-edit-split-wire-with-links", label:RED._("keyboard.splitWireWithLinks"), onselect: "core:split-wire-with-link-nodes"},
]});
menuOptions.push({id:"menu-item-view-menu",label:RED._("menu.label.view.view"),options:[
@@ -615,11 +670,6 @@ var RED = (function() {
]});
menuOptions.push({id:"menu-item-arrange-menu", label:RED._("menu.label.arrange"), options: [
{id: "menu-item-view-tools-move-to-back", label:RED._("menu.label.moveToBack"), disabled: true, onselect: "core:move-selection-to-back"},
{id: "menu-item-view-tools-move-to-front", label:RED._("menu.label.moveToFront"), disabled: true, onselect: "core:move-selection-to-front"},
{id: "menu-item-view-tools-move-backwards", label:RED._("menu.label.moveBackwards"), disabled: true, onselect: "core:move-selection-backwards"},
{id: "menu-item-view-tools-move-forwards", label:RED._("menu.label.moveForwards"), disabled: true, onselect: "core:move-selection-forwards"},
null,
{id: "menu-item-view-tools-align-left", label:RED._("menu.label.alignLeft"), disabled: true, onselect: "core:align-selection-to-left"},
{id: "menu-item-view-tools-align-center", label:RED._("menu.label.alignCenter"), disabled: true, onselect: "core:align-selection-to-center"},
{id: "menu-item-view-tools-align-right", label:RED._("menu.label.alignRight"), disabled: true, onselect: "core:align-selection-to-right"},
@@ -629,7 +679,12 @@ var RED = (function() {
{id: "menu-item-view-tools-align-bottom", label:RED._("menu.label.alignBottom"), disabled: true, onselect: "core:align-selection-to-bottom"},
null,
{id: "menu-item-view-tools-distribute-horizontally", label:RED._("menu.label.distributeHorizontally"), disabled: true, onselect: "core:distribute-selection-horizontally"},
{id: "menu-item-view-tools-distribute-veritcally", label:RED._("menu.label.distributeVertically"), disabled: true, onselect: "core:distribute-selection-vertically"}
{id: "menu-item-view-tools-distribute-veritcally", label:RED._("menu.label.distributeVertically"), disabled: true, onselect: "core:distribute-selection-vertically"},
null,
{id: "menu-item-view-tools-move-to-back", label:RED._("menu.label.moveToBack"), disabled: true, onselect: "core:move-selection-to-back"},
{id: "menu-item-view-tools-move-to-front", label:RED._("menu.label.moveToFront"), disabled: true, onselect: "core:move-selection-to-front"},
{id: "menu-item-view-tools-move-backwards", label:RED._("menu.label.moveBackwards"), disabled: true, onselect: "core:move-selection-backwards"},
{id: "menu-item-view-tools-move-forwards", label:RED._("menu.label.moveForwards"), disabled: true, onselect: "core:move-selection-forwards"}
]});
menuOptions.push(null);
@@ -715,14 +770,17 @@ var RED = (function() {
RED.search.init();
RED.actionList.init();
RED.editor.init();
RED.diagnostics.init();
RED.diff.init();
RED.deploy.init(RED.settings.theme("deployButton",null));
RED.keyboard.init(buildMainMenu);
RED.envVar.init();
RED.nodes.init();
RED.runtime.init()
RED.comms.connect();
$("#red-ui-main-container").show();
@@ -738,7 +796,7 @@ var RED = (function() {
$('<div id="red-ui-header-shade" class="hide"></div>').appendTo(header);
$('<div id="red-ui-main-container" class="red-ui-sidebar-closed hide">'+
'<div id="red-ui-workspace"></div>'+
'<div id="red-ui-editor-stack"></div>'+
'<div id="red-ui-editor-stack" tabindex="-1"></div>'+
'<div id="red-ui-palette"></div>'+
'<div id="red-ui-sidebar"></div>'+
'<div id="red-ui-sidebar-separator"></div>'+

View File

@@ -0,0 +1,36 @@
RED.runtime = (function() {
let state = ""
let settings = { ui: false, enabled: false };
const STOPPED = "stop"
const STARTED = "start"
const SAFE = "safe"
return {
init: function() {
// refresh the current runtime status from server
settings = Object.assign({}, settings, RED.settings.runtimeState);
RED.events.on("runtime-state", function(msg) {
if (msg.state) {
const currentState = state
state = msg.state
$(".red-ui-flow-node-button").toggleClass("red-ui-flow-node-button-stopped", state !== STARTED)
if(settings.enabled === true && settings.ui === true) {
RED.menu.setVisible("deploymenu-item-runtime-stop", state === STARTED)
RED.menu.setVisible("deploymenu-item-runtime-start", state !== STARTED)
}
// Do not notify the user about this event if:
// - This is the very first event we've received after loading the editor (currentState = '')
// - The state matches what we already thought was the case (state === currentState)
// - The event was triggered by a deploy (msg.deploy === true)
// - The event is a safe mode event - that gets notified separately
if (currentState !== '' && state !== currentState && !msg.deploy && state !== SAFE) {
RED.notify(RED._("notification.state.flows"+(state === STOPPED?'Stopped':'Started'), msg), "success")
}
}
});
},
get started() {
return state === STARTED
}
}
})()

View File

@@ -160,18 +160,19 @@ RED.actionList = (function() {
createDialog();
}
dialog.slideDown(300);
searchInput.searchBox('value',v)
searchInput.searchBox('value',v);
searchResults.editableList('empty');
results = [];
var actions = RED.actions.list();
actions.sort(function(A,B) {
return A.id.localeCompare(B.id);
var Akey = A.label;
var Bkey = B.label;
return Akey.localeCompare(Bkey);
});
actions.forEach(function(action) {
action.label = action.id.replace(/:/,": ").replace(/-/g," ").replace(/(^| )./g,function() { return arguments[0].toUpperCase()});
action._label = action.label.toLowerCase();
searchResults.editableList('addItem',action)
})
searchResults.editableList('addItem',action);
});
RED.events.emit("actionList:open");
visible = true;
}

View File

@@ -1,33 +1,67 @@
RED.actions = (function() {
var actions = {
}
};
function addAction(name,handler) {
function addAction(name,handler,options) {
if (typeof handler !== 'function') {
throw new Error("Action handler not a function");
}
if (actions[name]) {
throw new Error("Cannot override existing action");
}
actions[name] = handler;
actions[name] = {
handler: handler,
options: options,
};
}
function removeAction(name) {
delete actions[name];
}
function getAction(name) {
return actions[name];
return actions[name].handler;
}
function getActionLabel(name) {
let def = actions[name]
if (!def) {
return ''
}
if (!def.label) {
var options = def.options;
var key = options ? options.label : undefined;
if (!key) {
key = "action-list." +name.replace(/^.*:/,"");
}
var label = RED._(key);
if (label === key) {
// no translation. convert `name` to description
label = name.replace(/(^.+:([a-z]))|(-([a-z]))/g, function() {
if (arguments[5] === 0) {
return arguments[2].toUpperCase();
} else {
return " "+arguments[4].toUpperCase();
}
});
}
def.label = label;
}
return def.label
}
function invokeAction() {
var args = Array.prototype.slice.call(arguments);
var name = args.shift();
if (actions.hasOwnProperty(name)) {
actions[name].apply(null, args);
var handler = actions[name].handler;
handler.apply(null, args);
}
}
function listActions() {
var result = [];
Object.keys(actions).forEach(function(action) {
var def = actions[action];
var shortcut = RED.keyboard.getShortcut(action);
var isUser = false;
if (shortcut) {
@@ -35,19 +69,25 @@ RED.actions = (function() {
} else {
isUser = !!RED.keyboard.getUserShortcut(action);
}
if (!def.label) {
def.label = getActionLabel(action)
}
result.push({
id:action,
scope:shortcut?shortcut.scope:undefined,
key:shortcut?shortcut.key:undefined,
user:isUser
})
})
user:isUser,
label: def.label,
options: def.options,
});
});
return result;
}
return {
add: addAction,
remove: removeAction,
get: getAction,
getLabel: getActionLabel,
invoke: invokeAction,
list: listActions
}

View File

@@ -71,6 +71,7 @@ RED.clipboard = (function() {
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
RED.view.focus();
}
},
{ // red-ui-clipboard-dialog-download
@@ -81,6 +82,7 @@ RED.clipboard = (function() {
var data = $("#red-ui-clipboard-dialog-export-text").val();
downloadData("flows.json", data);
$( this ).dialog( "close" );
RED.view.focus();
}
},
{ // red-ui-clipboard-dialog-export
@@ -95,6 +97,7 @@ RED.clipboard = (function() {
$( this ).dialog( "close" );
copyText(flowData);
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
RED.view.focus();
} else {
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
var selectedPath = activeLibraries[activeTab].getSelected();
@@ -110,6 +113,7 @@ RED.clipboard = (function() {
contentType: "application/json; charset=utf-8"
}).done(function() {
$(dialog).dialog( "close" );
RED.view.focus();
RED.notify(RED._("library.exportedToLibrary"),"success");
}).fail(function(xhr,textStatus,err) {
if (xhr.status === 401) {
@@ -171,6 +175,7 @@ RED.clipboard = (function() {
}
}
$( this ).dialog( "close" );
RED.view.focus();
}
},
{ // red-ui-clipboard-dialog-import-conflict
@@ -203,6 +208,7 @@ RED.clipboard = (function() {
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
$( this ).dialog( "close" );
RED.view.focus();
}
}
],
@@ -417,11 +423,10 @@ RED.clipboard = (function() {
}
}
function showImportNodes(mode) {
function showImportNodes(library = 'clipboard') {
if (disabled) {
return;
}
mode = mode || "clipboard";
dialogContainer.empty();
dialogContainer.append($(importNodesDialog));
@@ -498,7 +503,7 @@ RED.clipboard = (function() {
$("#red-ui-clipboard-dialog-import-text").on("keyup", validateImport);
$("#red-ui-clipboard-dialog-import-text").on('paste',function() { setTimeout(validateImport,10)});
if (RED.workspaces.active() === 0) {
if (RED.workspaces.active() === 0 || RED.workspaces.isActiveLocked()) {
$("#red-ui-clipboard-dialog-import-opt-current").addClass('disabled').removeClass("selected");
$("#red-ui-clipboard-dialog-import-opt-new").addClass("selected");
} else {
@@ -527,8 +532,8 @@ RED.clipboard = (function() {
$("#red-ui-clipboard-dialog-import-file-upload").trigger("click");
})
tabs.activateTab("red-ui-clipboard-dialog-import-tab-"+mode);
if (mode === 'clipboard') {
tabs.activateTab("red-ui-clipboard-dialog-import-tab-"+library);
if (library === 'clipboard') {
setTimeout(function() {
$("#red-ui-clipboard-dialog-import-text").trigger("focus");
},100)
@@ -552,13 +557,16 @@ RED.clipboard = (function() {
});
}
function showExportNodes(mode) {
/**
* Show the export dialog
* @params library which export destination to show
* @params mode whether to default to 'auto' (default) or 'flow'
**/
function showExportNodes(library = 'clipboard', mode = 'auto' ) {
if (disabled) {
return;
}
mode = mode || "clipboard";
dialogContainer.empty();
dialogContainer.append($(exportNodesDialog));
@@ -648,7 +656,12 @@ RED.clipboard = (function() {
$("#red-ui-clipboard-dialog-tab-library-name").val("flows.json").select();
dialogContainer.i18n();
var format = RED.settings.flowFilePretty ? "red-ui-clipboard-dialog-export-fmt-full" : "red-ui-clipboard-dialog-export-fmt-mini";
const userFormat = RED.settings.get("editor.dialog.export.pretty")
if (userFormat === false || userFormat === true) {
format = userFormat ? "red-ui-clipboard-dialog-export-fmt-full" : "red-ui-clipboard-dialog-export-fmt-mini";
}
$("#red-ui-clipboard-dialog-export-fmt-group > a").on("click", function(evt) {
evt.preventDefault();
@@ -664,7 +677,8 @@ RED.clipboard = (function() {
var nodes = JSON.parse(flow);
format = $(this).attr('id');
if (format === 'red-ui-clipboard-dialog-export-fmt-full') {
const pretty = format === "red-ui-clipboard-dialog-export-fmt-full";
if (pretty) {
flow = JSON.stringify(nodes,null,4);
} else {
flow = JSON.stringify(nodes);
@@ -673,6 +687,7 @@ RED.clipboard = (function() {
setTimeout(function() { $("#red-ui-clipboard-dialog-export-text").scrollTop(0); },50);
$("#red-ui-clipboard-dialog-export-text").trigger("focus");
RED.settings.set("editor.dialog.export.pretty", pretty)
}
});
@@ -703,6 +718,7 @@ RED.clipboard = (function() {
} else if (type === 'flow') {
var activeWorkspace = RED.workspaces.active();
nodes = RED.nodes.groups(activeWorkspace);
nodes = nodes.concat(RED.nodes.junctions(activeWorkspace));
nodes = nodes.concat(RED.nodes.filterNodes({z:activeWorkspace}));
RED.nodes.eachConfig(function(n) {
if (n.z === RED.workspaces.active() && n._def.hasUsers === false) {
@@ -759,12 +775,15 @@ RED.clipboard = (function() {
}
}
}
if (mode === 'flow' && !$("#red-ui-clipboard-dialog-export-rng-flow").hasClass('disabled')) {
$("#red-ui-clipboard-dialog-export-rng-flow").trigger("click");
}
if (format === "red-ui-clipboard-dialog-export-fmt-full") {
$("#red-ui-clipboard-dialog-export-fmt-full").trigger("click");
} else {
$("#red-ui-clipboard-dialog-export-fmt-mini").trigger("click");
}
tabs.activateTab("red-ui-clipboard-dialog-export-tab-"+mode);
tabs.activateTab("red-ui-clipboard-dialog-export-tab-"+library);
var dialogHeight = 400;
var winHeight = $(window).height();
@@ -940,7 +959,8 @@ RED.clipboard = (function() {
if (truncated) {
msg += "_truncated";
}
$("#red-ui-clipboard-hidden").val(value).focus().select();
var clipboardHidden = $('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo(document.body);
clipboardHidden.val(value).focus().select();
var result = document.execCommand("copy");
if (result && element) {
var popover = RED.popover.create({
@@ -954,14 +974,13 @@ RED.clipboard = (function() {
},1000);
popover.open();
}
$("#red-ui-clipboard-hidden").val("");
clipboardHidden.remove();
if (currentFocus) {
$(currentFocus).focus();
}
return result;
}
function importNodes(nodesStr,addFlow) {
var newNodes = nodesStr;
if (typeof nodesStr === 'string') {
@@ -981,6 +1000,7 @@ RED.clipboard = (function() {
try {
RED.view.importNodes(newNodes, importOptions);
} catch(error) {
console.log(error.importConfig)
// Thrown for import_conflict
confirmImport(error.importConfig, newNodes, importOptions);
}
@@ -1236,8 +1256,6 @@ RED.clipboard = (function() {
init: function() {
setupDialogs();
$('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo("#red-ui-editor");
RED.actions.add("core:show-export-dialog",showExportNodes);
RED.actions.add("core:show-import-dialog",showImportNodes);
@@ -1260,15 +1278,17 @@ RED.clipboard = (function() {
RED.keyboard.add("#red-ui-drop-target", "escape" ,hideDropTarget);
$('#red-ui-workspace-chart').on("dragenter",function(event) {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
if (!RED.workspaces.isActiveLocked() && (
$.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1)) {
$("#red-ui-drop-target").css({display:'table'}).focus();
}
});
$('#red-ui-drop-target').on("dragover",function(event) {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1 ||
RED.workspaces.isActiveLocked()) {
event.preventDefault();
}
})
@@ -1276,27 +1296,29 @@ RED.clipboard = (function() {
hideDropTarget();
})
.on("drop",function(event) {
try {
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);
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) {
importNodes(e.target.result);
};
})(file);
reader.readAsText(file);
if (!RED.workspaces.isActiveLocked()) {
try {
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);
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) {
importNodes(e.target.result);
};
})(file);
reader.readAsText(file);
}
}
} catch(err) {
// Ensure any errors throw above doesn't stop the drop target from
// being hidden.
}
} catch(err) {
// Ensure any errors throw above doesn't stop the drop target from
// being hidden.
}
hideDropTarget();
event.preventDefault();

View File

@@ -9,12 +9,14 @@
*
* options:
*
* search : function(value, [done])
* A function that is passed the current contents of the input whenever
* it changes.
* The function must either return auto-complete options, or pass them
* to the optional 'done' parameter.
* If the function signature includes 'done', it must be used
* search: function(value, [done])
* A function that is passed the current contents of the input whenever
* it changes.
* The function must either return auto-complete options, or pass them
* to the optional 'done' parameter.
* If the function signature includes 'done', it must be used
* minLength: number
* If `minLength` is 0, pressing down arrow will show the list
*
* The auto-complete options should be an array of objects in the form:
* {
@@ -26,10 +28,11 @@
$.widget( "nodered.autoComplete", {
_create: function() {
var that = this;
const that = this;
this.completionMenuShown = false;
this.options.search = this.options.search || function() { return [] }
this.element.addClass("red-ui-autoComplete")
this.options.minLength = parseInteger(this.options.minLength, 1, 0);
this.options.search = this.options.search || function() { return [] };
this.element.addClass("red-ui-autoComplete");
this.element.on("keydown.red-ui-autoComplete", function(evt) {
if ((evt.keyCode === 13 || evt.keyCode === 9) && that.completionMenuShown) {
var opts = that.menu.options();
@@ -71,8 +74,8 @@
this.completionMenuShown = true;
},
_updateCompletions: function(val) {
var that = this;
if (val.trim() === "") {
const that = this;
if (val.trim().length < this.options.minLength) {
if (this.completionMenuShown) {
this.menu.hide();
}
@@ -96,7 +99,7 @@
}
}
if (this.options.search.length === 2) {
var requestId = 1+Math.floor(Math.random()*10000);
const requestId = 1+Math.floor(Math.random()*10000);
this.pendingRequest = requestId;
this.options.search(val,function(completions) { displayResults(completions,requestId);})
} else {
@@ -112,4 +115,12 @@
}
}
});
function parseInteger(input, def, min, max) {
if(input == null) { return (def || 0); }
min = min == null ? Number.NEGATIVE_INFINITY : min;
max = max == null ? Number.POSITIVE_INFINITY : max;
let n = parseInt(input);
if(isNaN(n) || n < min || n > max) { n = def || 0; }
return n;
}
})(jQuery);

View File

@@ -160,7 +160,7 @@
this.element.css("maxHeight",null);
}
if (this.options.height !== 'auto') {
this.uiContainer.css("overflow-y","scroll");
this.uiContainer.css("overflow-y","auto");
if (!isNaN(this.options.height)) {
this.uiHeight = this.options.height;
}

View File

@@ -16,6 +16,7 @@
RED.menu = (function() {
var menuItems = {};
let menuItemCount = 0
function createMenuItem(opt) {
var item;
@@ -59,15 +60,16 @@ RED.menu = (function() {
item = $('<li class="red-ui-menu-divider"></li>');
} else {
item = $('<li></li>');
if (!opt.id) {
opt.id = 'red-ui-menu-item-'+(menuItemCount++)
}
if (opt.group) {
item.addClass("red-ui-menu-group-"+opt.group);
}
var linkContent = '<a '+(opt.id?'id="'+opt.id+'" ':'')+'tabindex="-1" href="#">';
if (opt.toggle) {
linkContent += '<i class="fa fa-square pull-left"></i>';
linkContent += '<i class="fa fa-check-square pull-left"></i>';
linkContent += '<i class="fa fa-square'+(opt.direction!=='right'?" pull-left":"")+'"></i>';
linkContent += '<i class="fa fa-check-square'+(opt.direction!=='right'?" pull-left":"")+'"></i>';
}
if (opt.icon !== undefined) {
@@ -77,20 +79,23 @@ RED.menu = (function() {
linkContent += '<i class="'+(opt.icon?opt.icon:'" style="display: inline-block;"')+'"></i> ';
}
}
let label = opt.label
if (!opt.label && typeof opt.onselect === 'string') {
label = RED.actions.getLabel(opt.onselect)
}
if (opt.sublabel) {
linkContent += '<span class="red-ui-menu-label-container"><span class="red-ui-menu-label">'+opt.label+'</span>'+
linkContent += '<span class="red-ui-menu-label-container"><span class="red-ui-menu-label">'+label+'</span>'+
'<span class="red-ui-menu-sublabel">'+opt.sublabel+'</span></span>'
} else {
linkContent += '<span class="red-ui-menu-label"><span>'+opt.label+'</span></span>'
linkContent += '<span class="red-ui-menu-label"><span>'+label+'</span></span>'
}
linkContent += '</a>';
var link = $(linkContent).appendTo(item);
opt.link = link;
if (typeof opt.onselect === 'string') {
var shortcut = RED.keyboard.getShortcut(opt.onselect);
if (typeof opt.onselect === 'string' || opt.shortcut) {
var shortcut = opt.shortcut || RED.keyboard.getShortcut(opt.onselect);
if (shortcut && shortcut.key) {
opt.shortcutSpan = $('<span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span>').appendTo(link.find(".red-ui-menu-label"));
}
@@ -126,19 +131,45 @@ RED.menu = (function() {
});
}
if (opt.options) {
item.addClass("red-ui-menu-dropdown-submenu pull-left");
item.addClass("red-ui-menu-dropdown-submenu"+(opt.direction!=='right'?" pull-left":""));
var submenu = $('<ul id="'+opt.id+'-submenu" class="red-ui-menu-dropdown"></ul>').appendTo(item);
var hasIcons = false
var hasSubmenus = false
for (var i=0;i<opt.options.length;i++) {
if (opt.options[i]) {
if (opt.onpreselect && opt.options[i].onpreselect === undefined) {
opt.options[i].onpreselect = opt.onpreselect
}
if (opt.onpostselect && opt.options[i].onpostselect === undefined) {
opt.options[i].onpostselect = opt.onpostselect
}
opt.options[i].direction = opt.direction
hasIcons = hasIcons || (opt.options[i].icon);
hasSubmenus = hasSubmenus || (opt.options[i].options);
}
var li = createMenuItem(opt.options[i]);
if (li) {
li.appendTo(submenu);
}
}
if (!hasIcons) {
submenu.addClass("red-ui-menu-dropdown-noicons")
}
if (hasSubmenus) {
submenu.addClass("red-ui-menu-dropdown-submenus")
}
}
if (opt.disabled) {
item.addClass("disabled");
}
if (opt.visible === false) {
item.addClass("hide");
}
}
@@ -147,7 +178,9 @@ RED.menu = (function() {
}
function createMenu(options) {
var topMenu = $("<ul/>",{class:"red-ui-menu red-ui-menu-dropdown pull-right"});
if (options.direction) {
topMenu.addClass("red-ui-menu-dropdown-direction-"+options.direction)
}
if (options.id) {
topMenu.attr({id:options.id+"-submenu"});
var menuParent = $("#"+options.id);
@@ -173,9 +206,22 @@ RED.menu = (function() {
}
var lastAddedSeparator = false;
var hasSubmenus = false;
var hasIcons = false;
for (var i=0;i<options.options.length;i++) {
var opt = options.options[i];
if (opt) {
if (options.onpreselect && opt.onpreselect === undefined) {
opt.onpreselect = options.onpreselect
}
if (options.onpostselect && opt.onpostselect === undefined) {
opt.onpostselect = options.onpostselect
}
opt.direction = options.direction || 'left'
}
if (opt !== null || !lastAddedSeparator) {
hasIcons = hasIcons || (opt && opt.icon);
hasSubmenus = hasSubmenus || (opt && opt.options);
var li = createMenuItem(opt);
if (li) {
li.appendTo(topMenu);
@@ -183,13 +229,21 @@ RED.menu = (function() {
}
}
}
if (!hasIcons) {
topMenu.addClass("red-ui-menu-dropdown-noicons")
}
if (hasSubmenus) {
topMenu.addClass("red-ui-menu-dropdown-submenus")
}
return topMenu;
}
function triggerAction(id, args) {
var opt = menuItems[id];
var callback = opt.onselect;
if (opt.onpreselect) {
opt.onpreselect.call(opt,args)
}
if (typeof opt.onselect === 'string') {
callback = RED.actions.get(opt.onselect);
}
@@ -198,6 +252,9 @@ RED.menu = (function() {
} else {
console.log("No callback for",id,opt.onselect);
}
if (opt.onpostselect) {
opt.onpostselect.call(opt,args)
}
}
function isSelected(id) {
@@ -249,6 +306,14 @@ RED.menu = (function() {
}
}
function setVisible(id,state) {
if (!state) {
$("#"+id).parent().addClass("hide");
} else {
$("#"+id).parent().removeClass("hide");
}
}
function addItem(id,opt) {
var item = createMenuItem(opt);
if (opt !== null && opt.group) {
@@ -305,6 +370,7 @@ RED.menu = (function() {
isSelected: isSelected,
toggleSelected: toggleSelected,
setDisabled: setDisabled,
setVisible: setVisible,
addItem: addItem,
removeItem: removeItem,
setAction: setAction,

View File

@@ -350,6 +350,16 @@ RED.popover = (function() {
}
}
target.on("remove", function (ev) {
if (timer) {
clearTimeout(timer);
}
if (active) {
active = false;
setTimeout(closePopup,delay.hide);
}
});
if (trigger === 'hover') {
target.on('mouseenter',function(e) {
clearTimeout(timer);
@@ -461,6 +471,11 @@ RED.popover = (function() {
popover.setAction = function(newAction) {
action = newAction;
}
popover.delete = function() {
popover.close(true)
target.off("mouseenter");
target.off("mouseleave");
};
return popover;
},
@@ -595,10 +610,13 @@ RED.popover = (function() {
var target = options.target;
var align = options.align || "right";
var offset = options.offset || [0,0];
var xPos = options.x;
var yPos = options.y;
var isAbsolutePosition = (xPos !== undefined && yPos !== undefined)
var pos = target.offset();
var targetWidth = target.width();
var targetHeight = target.outerHeight();
var pos = isAbsolutePosition?{left:xPos, top: yPos}:target.offset();
var targetWidth = isAbsolutePosition?0:target.width();
var targetHeight = isAbsolutePosition?0:target.outerHeight();
var panelHeight = panel.height();
var panelWidth = panel.width();

View File

@@ -105,8 +105,8 @@
}
});
this.element.on("keydown",function(e) {
if (!menuShown && e.keyCode === 40) {
//DOWN
if (!menuShown && e.keyCode === 40 && $(this).val() === '') {
//DOWN (only show menu if search field is emty)
showMenu();
}
});

View File

@@ -141,7 +141,29 @@ RED.tabs = (function() {
})
}
if (options.contextmenu) {
wrapper.on('contextmenu', function(evt) {
let clickedTab
let target = evt.target
while(target.nodeName !== 'A' && target.nodeName !== 'UL' && target.nodeName !== 'BODY') {
target = target.parentNode
}
if (target.nodeName === 'A') {
const href = target.getAttribute('href')
if (href) {
clickedTab = tabs[href.slice(1)]
}
}
evt.preventDefault()
evt.stopPropagation()
RED.contextMenu.show({
x:evt.clientX-5,
y:evt.clientY-5,
options: options.contextmenu(clickedTab)
})
return false
})
}
var scrollLeft;
var scrollRight;
@@ -557,28 +579,24 @@ RED.tabs = (function() {
}
}
li.one("transitionend", function(evt) {
li.remove();
if (tabs[id].pinned) {
pinnedTabsCount--;
}
if (options.onremove) {
options.onremove(tabs[id]);
}
delete tabs[id];
updateTabWidths();
if (collapsibleMenu) {
collapsibleMenu.remove();
collapsibleMenu = null;
}
})
li.addClass("hide-tab");
li.width(0);
li.remove();
if (tabs[id].pinned) {
pinnedTabsCount--;
}
if (options.onremove) {
options.onremove(tabs[id]);
}
delete tabs[id];
updateTabWidths();
if (collapsibleMenu) {
collapsibleMenu.remove();
collapsibleMenu = null;
}
}
function findPreviousVisibleTab(li) {
if (!li) {
li = ul.find("li.active").parent();
li = ul.find("li.active");
}
var previous = li.prev();
while(previous.length > 0 && previous.hasClass("hide-tab")) {
@@ -588,9 +606,9 @@ RED.tabs = (function() {
}
function findNextVisibleTab(li) {
if (!li) {
li = ul.find("li.active").parent();
li = ul.find("li.active");
}
var next = ul.find("li.active").next();
var next = li.next();
while(next.length > 0 && next.hasClass("hide-tab")) {
next = next.next();
}
@@ -674,7 +692,7 @@ RED.tabs = (function() {
}
var link = $("<a/>",{href:"#"+tab.id, class:"red-ui-tab-label"}).appendTo(li);
if (tab.icon) {
$('<img src="'+tab.icon+'" class="red-ui-tab-icon"/>').appendTo(link);
$('<i>',{class:"red-ui-tab-icon", style:"mask-image: url("+tab.icon+"); -webkit-mask-image: url("+tab.icon+");"}).appendTo(link);
} else if (tab.iconClass) {
$('<i>',{class:"red-ui-tab-icon "+tab.iconClass}).appendTo(link);
}
@@ -811,19 +829,19 @@ RED.tabs = (function() {
event.preventDefault();
removeTab(tab.id);
});
RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
}
if (tab.hideable) {
li.addClass("red-ui-tabs-closeable")
var closeLink = $("<a/>",{href:"#",class:"red-ui-tab-close red-ui-tab-hide"}).appendTo(li);
closeLink.append('<i class="fa fa-eye" />');
closeLink.append('<i class="fa fa-eye-slash" />');
closeLink.on("click",function(event) {
event.preventDefault();
hideTab(tab.id);
});
RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
RED.popover.tooltip(closeLink,RED._("workspace.closeFlow"));
}
// if (tab.hideable) {
// li.addClass("red-ui-tabs-closeable")
// var closeLink = $("<a/>",{href:"#",class:"red-ui-tab-close red-ui-tab-hide"}).appendTo(li);
// closeLink.append('<i class="fa fa-eye" />');
// closeLink.append('<i class="fa fa-eye-slash" />');
// closeLink.on("click",function(event) {
// event.preventDefault();
// hideTab(tab.id);
// });
// RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
// }
var badges = $('<span class="red-ui-tabs-badges"></span>').appendTo(li);
if (options.onselect) {
@@ -832,7 +850,7 @@ RED.tabs = (function() {
}
// link.attr("title",tab.label);
RED.popover.tooltip(link,function() { return tab.label})
RED.popover.tooltip(link,function() { return RED.utils.sanitize(tab.label); });
if (options.onadd) {
options.onadd(tab);
@@ -942,6 +960,9 @@ RED.tabs = (function() {
activeIndex: function() {
return ul.find("li.active").index()
},
getTabIndex: function (id) {
return ul.find("a[href='#"+id+"']").parent().index()
},
contains: function(id) {
return ul.find("a[href='#"+id+"']").length > 0;
},

View File

@@ -21,6 +21,7 @@
* - multi : boolean - if true, .selected will return an array of results
* otherwise, returns the first selected item
* - sortable: boolean/string - TODO: see editableList
* - selectable: boolean - default true - whether individual items can be selected
* - rootSortable: boolean - if 'sortable' is set, then setting this to
* false, prevents items being sorted to the
* top level of the tree
@@ -118,6 +119,7 @@
switch(evt.keyCode) {
case 32: // SPACE
case 13: // ENTER
if (!that.options.selectable) { return }
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
return
}

View File

@@ -55,34 +55,46 @@
}
var autoComplete = function(options) {
function getMatch(value, searchValue) {
const idx = value.toLowerCase().indexOf(searchValue.toLowerCase());
const len = idx > -1 ? searchValue.length : 0;
return {
index: idx,
found: idx > -1,
pre: value.substring(0,idx),
match: value.substring(idx,idx+len),
post: value.substring(idx+len),
}
}
function generateSpans(match) {
const els = [];
if(match.pre) { els.push($('<span/>').text(match.pre)); }
if(match.match) { els.push($('<span/>',{style:"font-weight: bold; color: var(--red-ui-text-color-link);"}).text(match.match)); }
if(match.post) { els.push($('<span/>').text(match.post)); }
return els;
}
return function(val) {
var matches = [];
options.forEach(opt => {
let v = opt.value;
var i = v.toLowerCase().indexOf(val.toLowerCase());
if (i > -1) {
var pre = v.substring(0,i);
var matchedVal = v.substring(i,i+val.length);
var post = v.substring(i+val.length)
var el = $('<div/>',{style:"white-space:nowrap; overflow: hidden; flex-grow:1"});
$('<span/>').text(pre).appendTo(el);
$('<span/>',{style:"font-weight: bold"}).text(matchedVal).appendTo(el);
$('<span/>').text(post).appendTo(el);
var element = $('<div>',{style: "display: flex"});
el.appendTo(element);
if (opt.source) {
$('<div>').css({
"font-size": "0.8em"
}).text(opt.source.join(",")).appendTo(element);
const optVal = opt.value;
const optSrc = (opt.source||[]).join(",");
const valMatch = getMatch(optVal, val);
const srcMatch = getMatch(optSrc, val);
if (valMatch.found || srcMatch.found) {
const element = $('<div>',{style: "display: flex"});
const valEl = $('<div/>',{style:"font-family: var(--red-ui-monospace-font); white-space:nowrap; overflow: hidden; flex-grow:1"});
valEl.append(generateSpans(valMatch));
valEl.appendTo(element);
if (optSrc) {
const optEl = $('<div>').css({ "font-size": "0.8em" });
optEl.append(generateSpans(srcMatch));
optEl.appendTo(element);
}
matches.push({
value: v,
value: optVal,
label: element,
i:i
})
i: (valMatch.found ? valMatch.index : srcMatch.index)
});
}
})
matches.sort(function(A,B){return A.i-B.i})
@@ -93,6 +105,36 @@
// This is a hand-generated list of completions for the core nodes (based on the node help html).
var msgCompletions = [
{ value: "payload" },
{ value: "topic", source: ["mqtt","inject","rbe"] },
{ value: "action", source: ["mqtt"] },
{ value: "complete", source: ["join"] },
{ value: "contentType", source: ["mqtt"] },
{ value: "cookies", source: ["http request","http response"] },
{ value: "correlationData", source: ["mqtt"] },
{ value: "delay", source: ["delay","trigger"] },
{ value: "encoding", source: ["file"] },
{ value: "error", source: ["catch"] },
{ value: "error.message", source: ["catch"] },
{ value: "error.source", source: ["catch"] },
{ value: "error.source.id", source: ["catch"] },
{ value: "error.source.type", source: ["catch"] },
{ value: "error.source.name", source: ["catch"] },
{ value: "filename", source: ["file","file in"] },
{ value: "flush", source: ["delay"] },
{ value: "followRedirects", source: ["http request"] },
{ value: "headers", source: ["http response","http request"] },
{ value: "host", source: ["tcp request","http request"] },
{ value: "ip", source: ["udp out"] },
{ value: "kill", source: ["exec"] },
{ value: "messageExpiryInterval", source: ["mqtt"] },
{ value: "method", source: ["http request"] },
{ value: "options", source: ["xml"] },
{ value: "parts", source: ["split","join","batch","sort"] },
{ value: "pid", source: ["exec"] },
{ value: "port", source: ["tcp request"," udp out"] },
{ value: "qos", source: ["mqtt"] },
{ value: "rate", source: ["delay"] },
{ value: "rejectUnauthorized", source: ["http request"] },
{ value: "req", source: ["http in"]},
{ value: "req.body", source: ["http in"]},
{ value: "req.headers", source: ["http in"]},
@@ -100,38 +142,28 @@
{ value: "req.params", source: ["http in"]},
{ value: "req.cookies", source: ["http in"]},
{ value: "req.files", source: ["http in"]},
{ value: "complete", source: ["join"] },
{ value: "contentType", source: ["mqtt"] },
{ value: "cookies", source: ["http in","http request"] },
{ value: "correlationData", source: ["mqtt"] },
{ value: "delay", source: ["delay","trigger"] },
{ value: "encoding", source: ["file"] },
{ value: "error", source: ["catch"] },
{ value: "filename", source: ["file","file in"] },
{ value: "flush", source: ["delay"] },
{ value: "followRedirects", source: ["http request"] },
{ value: "headers", source: ["http in"," http request"] },
{ value: "kill", source: ["exec"] },
{ value: "messageExpiryInterval", source: ["mqtt"] },
{ value: "method", source: ["http-request"] },
{ value: "options", source: ["xml"] },
{ value: "parts", source: ["split","join"] },
{ value: "pid", source: ["exec"] },
{ value: "qos", source: ["mqtt"] },
{ value: "rate", source: ["delay"] },
{ value: "rejectUnauthorized", source: ["http request"] },
{ value: "requestTimeout", source: ["http request"] },
{ value: "reset", source: ["delay","trigger","join","rbe"] },
{ value: "responseCookies", source: ["http request"] },
{ value: "responseTopic", source: ["mqtt"] },
{ value: "responseUrl", source: ["http request"] },
{ value: "restartTimeout", source: ["join"] },
{ value: "retain", source: ["mqtt"] },
{ value: "schema", source: ["json"] },
{ value: "select", source: ["html"] },
{ value: "statusCode", source: ["http in"] },
{ value: "statusCode", source: ["http response","http request"] },
{ value: "status", source: ["status"] },
{ value: "status.text", source: ["status"] },
{ value: "status.source", source: ["status"] },
{ value: "status.source.type", source: ["status"] },
{ value: "status.source.id", source: ["status"] },
{ value: "status.source.name", source: ["status"] },
{ value: "target", source: ["link call"] },
{ value: "template", source: ["template"] },
{ value: "toFront", source: ["delay"] },
{ value: "topic", source: ["inject","mqtt","rbe"] },
{ value: "url", source: ["http request"] },
{ value: "userProperties", source: ["mqtt"] }
{ value: "userProperties", source: ["mqtt"] },
{ value: "_session", source: ["websocket out","tcp out"] },
]
var allOptions = {
msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression, autoComplete: autoComplete(msgCompletions)},
@@ -166,6 +198,8 @@
}
RED.editor.editJSON({
value: value,
stateId: RED.editor.generateViewStateId("typedInput", that, "json"),
focus: true,
complete: function(v) {
var value = v;
try {
@@ -188,6 +222,8 @@
var that = this;
RED.editor.editExpression({
value: this.value().replace(/\t/g,"\n"),
stateId: RED.editor.generateViewStateId("typedInput", that, "jsonata"),
focus: true,
complete: function(v) {
that.value(v.replace(/\n/g,"\t"));
}
@@ -202,6 +238,8 @@
var that = this;
RED.editor.editBuffer({
value: this.value(),
stateId: RED.editor.generateViewStateId("typedInput", that, "bin"),
focus: true,
complete: function(v) {
that.value(v);
}
@@ -463,7 +501,7 @@
this.options.types = this.options.types||Object.keys(allOptions);
}
this.selectTrigger = $('<button class="red-ui-typedInput-type-select" tabindex="0"></button>').prependTo(this.uiSelect);
this.selectTrigger = $('<button type="button" class="red-ui-typedInput-type-select" tabindex="0"></button>').prependTo(this.uiSelect);
$('<i class="red-ui-typedInput-icon fa fa-caret-down"></i>').toggle(this.options.types.length > 1).appendTo(this.selectTrigger);
this.selectLabel = $('<span class="red-ui-typedInput-type-label"></span>').appendTo(this.selectTrigger);
@@ -532,7 +570,7 @@
})
// explicitly set optionSelectTrigger display to inline-block otherwise jQ sets it to 'inline'
this.optionSelectTrigger = $('<button tabindex="0" class="red-ui-typedInput-option-trigger" style="display:inline-block"><span class="red-ui-typedInput-option-caret"><i class="red-ui-typedInput-icon fa fa-caret-down"></i></span></button>').appendTo(this.uiSelect);
this.optionSelectTrigger = $('<button type="button" tabindex="0" class="red-ui-typedInput-option-trigger" style="display:inline-block"><span class="red-ui-typedInput-option-caret"><i class="red-ui-typedInput-icon fa fa-caret-down"></i></span></button>').appendTo(this.uiSelect);
this.optionSelectLabel = $('<span class="red-ui-typedInput-option-label"></span>').prependTo(this.optionSelectTrigger);
// RED.popover.tooltip(this.optionSelectLabel,function() {
// return that.optionValue;
@@ -553,7 +591,7 @@
that.uiSelect.addClass('red-ui-typedInput-focus');
});
this.optionExpandButton = $('<button tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"></button>').appendTo(this.uiSelect);
this.optionExpandButton = $('<button type="button" tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"></button>').appendTo(this.uiSelect);
this.optionExpandButtonIcon = $('<i class="red-ui-typedInput-icon fa fa-ellipsis-h"></i>').appendTo(this.optionExpandButton);
this.type(this.typeField.val() || this.options.default||this.typeList[0].value);
@@ -637,7 +675,7 @@
if (opt.icon.indexOf("<") === 0) {
$(opt.icon).prependTo(op);
} else if (opt.icon.indexOf("/") !== -1) {
$('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px; height: 18px;"}).prependTo(op);
$('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+");"}).prependTo(op);
} else {
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(op);
}
@@ -988,10 +1026,7 @@
$(opt.icon).prependTo(this.selectLabel);
}
else if (opt.icon.indexOf("/") !== -1) {
image = new Image();
image.name = opt.icon;
image.src = mapDeprecatedIcon(opt.icon);
$('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
$('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+"); margin-right: 4px;height: 18px;width:13px"}).prependTo(this.selectLabel);
}
else {
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel);
@@ -1147,7 +1182,8 @@
this.elementDiv.show();
if (opt.autoComplete) {
this.input.autoComplete({
search: opt.autoComplete
search: opt.autoComplete,
minLength: 0
})
}
}

View File

@@ -0,0 +1,238 @@
RED.contextMenu = (function () {
let menu;
function disposeMenu() {
$(document).off("mousedown.red-ui-workspace-context-menu");
if (menu) {
menu.remove();
}
menu = null;
}
function show(options) {
if (menu) {
menu.remove()
}
let menuItems = []
if (options.options) {
menuItems = options.options
} else if (options.type === 'workspace') {
const selection = RED.view.selection()
const noSelection = !selection || Object.keys(selection).length === 0
const hasSelection = (selection.nodes && selection.nodes.length > 0);
const hasMultipleSelection = hasSelection && selection.nodes.length > 1;
const virtulLinks = (selection.links && selection.links.filter(e => !!e.link)) || [];
const wireLinks = (selection.links && selection.links.filter(e => !e.link)) || [];
const hasLinks = wireLinks.length > 0;
const isSingleLink = !hasSelection && hasLinks && wireLinks.length === 1
const isMultipleLinks = !hasSelection && hasLinks && wireLinks.length > 1
const canDelete = hasSelection || hasLinks
const isGroup = hasSelection && selection.nodes.length === 1 && selection.nodes[0].type === 'group'
const canEdit = !RED.workspaces.isActiveLocked()
const canRemoveFromGroup = hasSelection && !!selection.nodes[0].g
const isAllGroups = hasSelection && selection.nodes.filter(n => n.type !== 'group').length === 0
const hasGroup = hasSelection && selection.nodes.filter(n => n.type === 'group' ).length > 0
const offset = $("#red-ui-workspace-chart").offset()
let addX = options.x - offset.left + $("#red-ui-workspace-chart").scrollLeft()
let addY = options.y - offset.top + $("#red-ui-workspace-chart").scrollTop()
if (RED.view.snapGrid) {
const gridSize = RED.view.gridSize()
addX = gridSize * Math.floor(addX / gridSize)
addY = gridSize * Math.floor(addY / gridSize)
}
menuItems.push(
{ onselect: 'core:show-action-list', onpostselect: function () { } }
)
const insertOptions = []
menuItems.push({ label: RED._("contextMenu.insert"), options: insertOptions })
insertOptions.push(
{
label: RED._("contextMenu.node"),
onselect: function () {
RED.view.showQuickAddDialog({
position: [addX, addY],
touchTrigger: true,
splice: isSingleLink ? selection.links[0] : undefined,
// spliceMultiple: isMultipleLinks
})
},
disabled: !canEdit
},
(hasLinks) ? { // has least 1 wire selected
label: RED._("contextMenu.junction"),
onselect: 'core:split-wires-with-junctions',
disabled: !canEdit || !hasLinks
} : {
label: RED._("contextMenu.junction"),
onselect: function () {
const nn = {
_def: { defaults: {} },
type: 'junction',
z: RED.workspaces.active(),
id: RED.nodes.id(),
x: addX,
y: addY,
w: 0, h: 0,
outputs: 1,
inputs: 1,
dirty: true
}
const historyEvent = {
dirty: RED.nodes.dirty(),
t: 'add',
junctions: [nn]
}
RED.nodes.addJunction(nn);
RED.history.push(historyEvent);
RED.nodes.dirty(true);
RED.view.select({nodes: [nn] });
RED.view.redraw(true)
},
disabled: !canEdit
},
{
label: RED._("contextMenu.linkNodes"),
onselect: 'core:split-wire-with-link-nodes',
disabled: !canEdit || !hasLinks
},
null,
{ onselect: 'core:show-import-dialog', label: RED._('common.label.import')},
{ onselect: 'core:show-examples-import-dialog', label: RED._('menu.label.importExample') }
)
if (hasSelection && canEdit) {
const nodeOptions = []
if (!hasMultipleSelection && !isGroup) {
nodeOptions.push(
{ onselect: 'core:show-node-help' },
null
)
}
nodeOptions.push(
{ onselect: 'core:enable-selected-nodes' },
{ onselect: 'core:disable-selected-nodes' },
null,
{ onselect: 'core:show-selected-node-labels' },
{ onselect: 'core:hide-selected-node-labels' }
)
menuItems.push({
label: RED._('sidebar.info.node'),
options: nodeOptions
})
menuItems.push({
label: RED._('sidebar.info.group'),
options: [
{ onselect: 'core:group-selection' },
{ onselect: 'core:ungroup-selection', disabled: !hasGroup },
null,
{ onselect: 'core:copy-group-style', disabled: !hasGroup },
{ onselect: 'core:paste-group-style', disabled: !hasGroup}
]
})
if (canRemoveFromGroup) {
menuItems[menuItems.length - 1].options.push(
null,
{ onselect: 'core:remove-selection-from-group', label: RED._("menu.label.groupRemoveSelection") }
)
}
}
if (canEdit && hasMultipleSelection) {
menuItems.push({
label: RED._('menu.label.arrange'),
options: [
{ label:RED._("menu.label.alignLeft"), onselect: "core:align-selection-to-left"},
{ label:RED._("menu.label.alignCenter"), onselect: "core:align-selection-to-center"},
{ label:RED._("menu.label.alignRight"), onselect: "core:align-selection-to-right"},
null,
{ label:RED._("menu.label.alignTop"), onselect: "core:align-selection-to-top"},
{ label:RED._("menu.label.alignMiddle"), onselect: "core:align-selection-to-middle"},
{ label:RED._("menu.label.alignBottom"), onselect: "core:align-selection-to-bottom"},
null,
{ label:RED._("menu.label.distributeHorizontally"), onselect: "core:distribute-selection-horizontally"},
{ label:RED._("menu.label.distributeVertically"), onselect: "core:distribute-selection-vertically"}
]
})
}
menuItems.push(
null,
{ onselect: 'core:undo', disabled: RED.history.list().length === 0 },
{ onselect: 'core:redo', disabled: RED.history.listRedo().length === 0 },
null,
{ onselect: 'core:cut-selection-to-internal-clipboard', label: RED._("keyboard.cutNode"), disabled: !canEdit || !hasSelection },
{ onselect: 'core:copy-selection-to-internal-clipboard', label: RED._("keyboard.copyNode"), disabled: !hasSelection },
{ onselect: 'core:paste-from-internal-clipboard', label: RED._("keyboard.pasteNode"), disabled: !canEdit || !RED.view.clipboard() },
{ onselect: 'core:delete-selection', disabled: !canEdit || !canDelete },
{ onselect: 'core:delete-selection-and-reconnect', label: RED._('keyboard.deleteReconnect'), disabled: !canEdit || !canDelete },
{ onselect: 'core:show-export-dialog', label: RED._("menu.label.export") },
{ onselect: 'core:select-all-nodes' },
)
}
var direction = "right";
var MENU_WIDTH = 500; // can not use menu width here
if ((options.x -$(document).scrollLeft()) >
($(window).width() -MENU_WIDTH)) {
direction = "left";
}
menu = RED.menu.init({
direction: direction,
onpreselect: function() {
disposeMenu()
},
onpostselect: function () {
RED.view.focus()
},
options: menuItems
});
menu.attr("id", "red-ui-workspace-context-menu");
menu.css({
position: "absolute"
})
menu.appendTo("body");
// TODO: prevent the menu from overflowing the window.
var top = options.y
var left = options.x
if (top + menu.height() - $(document).scrollTop() > $(window).height()) {
top -= (top + menu.height()) - $(window).height() + 22;
}
if (left + menu.width() - $(document).scrollLeft() > $(window).width()) {
left -= (left + menu.width()) - $(window).width() + 18;
}
menu.css({
top: top + "px",
left: left + "px"
})
$(".red-ui-menu.red-ui-menu-dropdown").hide();
$(document).on("mousedown.red-ui-workspace-context-menu", function (evt) {
if (menu && menu[0].contains(evt.target)) {
return
}
disposeMenu()
});
menu.show();
// set focus to first item so that pressing escape key closes the menu
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
}
// Allow escape key hook and other editor events to close context menu
RED.keyboard.add("red-ui-workspace-context-menu", "escape", function () { RED.contextMenu.hide() })
RED.events.on("editor:open", function () { RED.contextMenu.hide() });
RED.events.on("search:open", function () { RED.contextMenu.hide() });
RED.events.on("type-search:open", function () { RED.contextMenu.hide() });
RED.events.on("actionList:open", function () { RED.contextMenu.hide() });
RED.events.on("view:selection-changed", function () { RED.contextMenu.hide() });
return {
show: show,
hide: disposeMenu
}
})()

View File

@@ -63,16 +63,18 @@ RED.deploy = (function() {
'</a>'+
'<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
'</span></li>').prependTo(".red-ui-header-toolbar");
RED.menu.init({id:"red-ui-header-button-deploy-options",
options: [
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.svg",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}},
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}},
null,
{id:"deploymenu-item-reload", icon:"red/images/deploy-reload.svg",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"},
]
});
const mainMenuItems = [
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.svg",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}},
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}},
null
]
if (RED.settings.runtimeState && RED.settings.runtimeState.ui === true) {
mainMenuItems.push({id:"deploymenu-item-runtime-start", icon:"red/images/start.svg",label:RED._("deploy.startFlows"),sublabel:RED._("deploy.startFlowsDesc"),onselect:"core:start-flows", visible:false})
mainMenuItems.push({id:"deploymenu-item-runtime-stop", icon:"red/images/stop.svg",label:RED._("deploy.stopFlows"),sublabel:RED._("deploy.stopFlowsDesc"),onselect:"core:stop-flows", visible:false})
}
mainMenuItems.push({id:"deploymenu-item-reload", icon:"red/images/deploy-reload.svg",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"})
RED.menu.init({id:"red-ui-header-button-deploy-options", options: mainMenuItems });
} else if (type == "simple") {
var label = options.label || RED._("deploy.deploy");
var icon = 'red/images/deploy-full-o.svg';
@@ -100,6 +102,10 @@ RED.deploy = (function() {
RED.actions.add("core:deploy-flows",save);
if (type === "default") {
if (RED.settings.runtimeState && RED.settings.runtimeState.ui === true) {
RED.actions.add("core:stop-flows",function() { stopStartFlows("stop") });
RED.actions.add("core:start-flows",function() { stopStartFlows("start") });
}
RED.actions.add("core:restart-flows",restart);
RED.actions.add("core:set-deploy-type-to-full",function() { RED.menu.setSelected("deploymenu-item-full",true);});
RED.actions.add("core:set-deploy-type-to-modified-flows",function() { RED.menu.setSelected("deploymenu-item-flow",true); });
@@ -270,18 +276,73 @@ RED.deploy = (function() {
function sanitize(html) {
return html.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
}
function restart() {
var startTime = Date.now();
$(".red-ui-deploy-button-content").css('opacity',0);
$(".red-ui-deploy-button-spinner").show();
var deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled");
$("#red-ui-header-button-deploy").addClass("disabled");
deployInflight = true;
function shadeShow() {
$("#red-ui-header-shade").show();
$("#red-ui-editor-shade").show();
$("#red-ui-palette-shade").show();
$("#red-ui-sidebar-shade").show();
}
function shadeHide() {
$("#red-ui-header-shade").hide();
$("#red-ui-editor-shade").hide();
$("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide();
}
function deployButtonSetBusy(){
$(".red-ui-deploy-button-content").css('opacity',0);
$(".red-ui-deploy-button-spinner").show();
$("#red-ui-header-button-deploy").addClass("disabled");
}
function deployButtonClearBusy(){
$(".red-ui-deploy-button-content").css('opacity',1);
$(".red-ui-deploy-button-spinner").hide();
}
function stopStartFlows(state) {
const startTime = Date.now()
const deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled")
deployInflight = true
deployButtonSetBusy()
shadeShow()
$.ajax({
url:"flows/state",
type: "POST",
data: {state: state}
}).done(function(data,textStatus,xhr) {
if (deployWasEnabled) {
$("#red-ui-header-button-deploy").removeClass("disabled")
}
}).fail(function(xhr,textStatus,err) {
if (deployWasEnabled) {
$("#red-ui-header-button-deploy").removeClass("disabled")
}
if (xhr.status === 401) {
RED.notify(RED._("notification.error", { message: RED._("user.notAuthorized") }), "error")
} else if (xhr.responseText) {
const errorDetail = { message: err ? (err + "") : "" }
try {
errorDetail.message = JSON.parse(xhr.responseText).message
} finally {
errorDetail.message = errorDetail.message || xhr.responseText
}
RED.notify(RED._("notification.error", errorDetail), "error")
} else {
RED.notify(RED._("notification.error", { message: RED._("deploy.errors.noResponse") }), "error")
}
}).always(function() {
const delta = Math.max(0, 300 - (Date.now() - startTime))
setTimeout(function () {
deployButtonClearBusy()
shadeHide()
deployInflight = false
}, delta);
});
}
function restart() {
var startTime = Date.now();
var deployWasEnabled = !$("#red-ui-header-button-deploy").hasClass("disabled");
deployInflight = true;
deployButtonSetBusy();
$.ajax({
url:"flows",
type: "POST",
@@ -307,204 +368,252 @@ RED.deploy = (function() {
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
}
}).always(function() {
deployInflight = false;
var delta = Math.max(0,300-(Date.now()-startTime));
setTimeout(function() {
$(".red-ui-deploy-button-content").css('opacity',1);
$(".red-ui-deploy-button-spinner").hide();
$("#red-ui-header-shade").hide();
$("#red-ui-editor-shade").hide();
$("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide();
deployButtonClearBusy();
deployInflight = false;
},delta);
});
}
function save(skipValidation,force) {
if (!$("#red-ui-header-button-deploy").hasClass("disabled")) {
if (!RED.user.hasPermission("flows.write")) {
RED.notify(RED._("user.errors.deploy"),"error");
function save(skipValidation, force) {
if ($("#red-ui-header-button-deploy").hasClass("disabled")) {
return; //deploy is disabled
}
if ($("#red-ui-header-shade").is(":visible")) {
return; //deploy is shaded
}
if (!RED.user.hasPermission("flows.write")) {
RED.notify(RED._("user.errors.deploy"), "error");
return;
}
let hasUnusedConfig = false;
if (!skipValidation) {
let hasUnknown = false;
let hasInvalid = false;
const unknownNodes = [];
const invalidNodes = [];
RED.nodes.eachConfig(function (node) {
if (node.valid === undefined) {
RED.editor.validateNode(node);
}
if (!node.valid && !node.d) {
invalidNodes.push(getNodeInfo(node));
}
if (node.type === "unknown") {
if (unknownNodes.indexOf(node.name) == -1) {
unknownNodes.push(node.name);
}
}
});
RED.nodes.eachNode(function (node) {
if (!node.valid && !node.d) {
invalidNodes.push(getNodeInfo(node));
}
if (node.type === "unknown") {
if (unknownNodes.indexOf(node.name) == -1) {
unknownNodes.push(node.name);
}
}
});
hasUnknown = unknownNodes.length > 0;
hasInvalid = invalidNodes.length > 0;
const unusedConfigNodes = [];
RED.nodes.eachConfig(function (node) {
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
unusedConfigNodes.push(getNodeInfo(node));
hasUnusedConfig = true;
}
});
let showWarning = false;
let notificationMessage;
let notificationButtons = [];
let notification;
if (hasUnknown && !ignoreDeployWarnings.unknown) {
showWarning = true;
notificationMessage = "<p>" + RED._('deploy.confirm.unknown') + "</p>" +
'<ul class="red-ui-deploy-dialog-confirm-list"><li>' + cropList(unknownNodes).map(function (n) { return sanitize(n) }).join("</li><li>") + "</li></ul><p>" +
RED._('deploy.confirm.confirm') +
"</p>";
notificationButtons = [
{
text: RED._("deploy.unknownNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","type:unknown ");
}
},
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
class: "primary",
click: function () {
save(true);
notification.close();
}
}
];
} else if (hasInvalid && !ignoreDeployWarnings.invalid) {
showWarning = true;
invalidNodes.sort(sortNodeInfo);
notificationMessage = "<p>" + RED._('deploy.confirm.improperlyConfigured') + "</p>" +
'<ul class="red-ui-deploy-dialog-confirm-list"><li>' + cropList(invalidNodes.map(function (A) { return sanitize((A.tab ? "[" + A.tab + "] " : "") + A.label + " (" + A.type + ")") })).join("</li><li>") + "</li></ul><p>" +
RED._('deploy.confirm.confirm') +
"</p>";
notificationButtons = [
{
text: RED._("deploy.invalidNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","is:invalid ");
}
},
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
class: "primary",
click: function () {
save(true);
notification.close();
}
}
];
}
if (showWarning) {
notificationButtons.unshift(
{
text: RED._("common.label.cancel"),
click: function () {
notification.close();
}
}
);
notification = RED.notify(notificationMessage, {
modal: true,
fixed: true,
buttons: notificationButtons
});
return;
}
if (!skipValidation) {
var hasUnknown = false;
var hasInvalid = false;
var hasUnusedConfig = false;
var unknownNodes = [];
var invalidNodes = [];
RED.nodes.eachNode(function(node) {
if (!node.valid && !node.d) {
invalidNodes.push(getNodeInfo(node));
}
if (node.type === "unknown") {
if (unknownNodes.indexOf(node.name) == -1) {
unknownNodes.push(node.name);
}
}
});
hasUnknown = unknownNodes.length > 0;
hasInvalid = invalidNodes.length > 0;
var unusedConfigNodes = [];
RED.nodes.eachConfig(function(node) {
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
unusedConfigNodes.push(getNodeInfo(node));
hasUnusedConfig = true;
}
});
var showWarning = false;
var notificationMessage;
var notificationButtons = [];
var notification;
if (hasUnknown && !ignoreDeployWarnings.unknown) {
showWarning = true;
notificationMessage = "<p>"+RED._('deploy.confirm.unknown')+"</p>"+
'<ul class="red-ui-deploy-dialog-confirm-list"><li>'+cropList(unknownNodes).map(function(n) { return sanitize(n) }).join("</li><li>")+"</li></ul><p>"+
RED._('deploy.confirm.confirm')+
"</p>";
notificationButtons= [
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
class: "primary",
click: function() {
save(true);
notification.close();
}
}
];
} else if (hasInvalid && !ignoreDeployWarnings.invalid) {
showWarning = true;
invalidNodes.sort(sortNodeInfo);
notificationMessage = "<p>"+RED._('deploy.confirm.improperlyConfigured')+"</p>"+
'<ul class="red-ui-deploy-dialog-confirm-list"><li>'+cropList(invalidNodes.map(function(A) { return sanitize( (A.tab?"["+A.tab+"] ":"")+A.label+" ("+A.type+")")})).join("</li><li>")+"</li></ul><p>"+
RED._('deploy.confirm.confirm')+
"</p>";
notificationButtons= [
{
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
text: RED._("deploy.confirm.button.confirm"),
class: "primary",
click: function() {
save(true);
notification.close();
}
}
];
}
if (showWarning) {
notificationButtons.unshift(
{
text: RED._("common.label.cancel"),
click: function() {
notification.close();
}
}
);
notification = RED.notify(notificationMessage,{
modal: true,
fixed: true,
buttons:notificationButtons
});
return;
}
}
var nns = RED.nodes.createCompleteNodeSet();
var startTime = Date.now();
$(".red-ui-deploy-button-content").css('opacity',0);
$(".red-ui-deploy-button-spinner").show();
$("#red-ui-header-button-deploy").addClass("disabled");
var data = {flows:nns};
if (!force) {
data.rev = RED.nodes.version();
}
deployInflight = true;
$("#red-ui-header-shade").show();
$("#red-ui-editor-shade").show();
$("#red-ui-palette-shade").show();
$("#red-ui-sidebar-shade").show();
$.ajax({
url:"flows",
type: "POST",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
headers: {
"Node-RED-Deployment-Type":deploymentType
}
}).done(function(data,textStatus,xhr) {
RED.nodes.dirty(false);
RED.nodes.version(data.rev);
RED.nodes.originalFlow(nns);
if (hasUnusedConfig) {
RED.notify(
'<p>'+RED._("deploy.successfulDeploy")+'</p>'+
'<p>'+RED._("deploy.unusedConfigNodes")+' <a href="#" onclick="RED.sidebar.config.show(true); return false;">'+RED._("deploy.unusedConfigNodesLink")+'</a></p>',"success",false,6000);
} else {
RED.notify('<p>'+RED._("deploy.successfulDeploy")+'</p>',"success");
}
RED.nodes.eachNode(function(node) {
if (node.changed) {
node.dirty = true;
node.changed = false;
}
if (node.moved) {
node.dirty = true;
node.moved = false;
}
if(node.credentials) {
delete node.credentials;
}
});
RED.nodes.eachConfig(function (confNode) {
confNode.changed = false;
if (confNode.credentials) {
delete confNode.credentials;
}
});
RED.nodes.eachSubflow(function(subflow) {
subflow.changed = false;
});
RED.nodes.eachWorkspace(function(ws) {
ws.changed = false;
});
// Once deployed, cannot undo back to a clean state
RED.history.markAllDirty();
RED.view.redraw();
RED.events.emit("deploy");
}).fail(function(xhr,textStatus,err) {
RED.nodes.dirty(true);
$("#red-ui-header-button-deploy").removeClass("disabled");
if (xhr.status === 401) {
RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error");
} else if (xhr.status === 409) {
resolveConflict(nns, true);
} else if (xhr.responseText) {
RED.notify(RED._("deploy.deployFailed",{message:xhr.responseText}),"error");
} else {
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
}
}).always(function() {
deployInflight = false;
var delta = Math.max(0,300-(Date.now()-startTime));
setTimeout(function() {
$(".red-ui-deploy-button-content").css('opacity',1);
$(".red-ui-deploy-button-spinner").hide();
$("#red-ui-header-shade").hide();
$("#red-ui-editor-shade").hide();
$("#red-ui-palette-shade").hide();
$("#red-ui-sidebar-shade").hide();
},delta);
});
}
const nns = RED.nodes.createCompleteNodeSet();
const startTime = Date.now();
deployButtonSetBusy();
const data = { flows: nns };
if (!force) {
data.rev = RED.nodes.version();
}
deployInflight = true;
shadeShow();
$.ajax({
url: "flows",
type: "POST",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
headers: {
"Node-RED-Deployment-Type": deploymentType
}
}).done(function (data, textStatus, xhr) {
RED.nodes.dirty(false);
RED.nodes.version(data.rev);
RED.nodes.originalFlow(nns);
if (hasUnusedConfig) {
let notification;
const opts = {
type: "success",
fixed: false,
timeout: 6000,
buttons: [
{
text: RED._("deploy.unusedConfigNodesButton"),
class: "pull-left",
click: function() {
notification.close();
RED.actions.invoke("core:search","is:config is:unused ");
}
},
{
text: RED._("common.label.close"),
class: "primary",
click: function () {
save(true);
notification.close();
}
}
]
}
notification = RED.notify(
'<p>' + RED._("deploy.successfulDeploy") + '</p>' +
'<p>' + RED._("deploy.unusedConfigNodes") + '</p>', opts);
} else {
RED.notify('<p>' + RED._("deploy.successfulDeploy") + '</p>', "success");
}
RED.nodes.eachNode(function (node) {
const flow = node.z && (RED.nodes.workspace(node.z) || RED.nodes.subflow(node.z) || null);
const isLocked = flow ? flow.locked : false;
if (flow && isLocked) {
flow.locked = false;
}
if (node.changed) {
node.dirty = true;
node.changed = false;
}
if (node.moved) {
node.dirty = true;
node.moved = false;
}
if (node.credentials) {
delete node.credentials;
}
if (flow && isLocked) {
flow.locked = isLocked;
}
});
RED.nodes.eachConfig(function (confNode) {
confNode.changed = false;
if (confNode.credentials) {
delete confNode.credentials;
}
});
RED.nodes.eachSubflow(function (subflow) {
subflow.changed = false;
});
RED.nodes.eachWorkspace(function (ws) {
ws.changed = false;
});
// Once deployed, cannot undo back to a clean state
RED.history.markAllDirty();
RED.view.redraw();
RED.events.emit("deploy");
}).fail(function (xhr, textStatus, err) {
RED.nodes.dirty(true);
$("#red-ui-header-button-deploy").removeClass("disabled");
if (xhr.status === 401) {
RED.notify(RED._("deploy.deployFailed", { message: RED._("user.notAuthorized") }), "error");
} else if (xhr.status === 409) {
resolveConflict(nns, true);
} else if (xhr.responseText) {
RED.notify(RED._("deploy.deployFailed", { message: xhr.responseText }), "error");
} else {
RED.notify(RED._("deploy.deployFailed", { message: RED._("deploy.errors.noResponse") }), "error");
}
}).always(function () {
const delta = Math.max(0, 300 - (Date.now() - startTime));
setTimeout(function () {
deployInflight = false;
deployButtonClearBusy()
shadeHide()
}, delta);
});
}
return {
init: init,

View File

@@ -0,0 +1,61 @@
RED.diagnostics = (function () {
function init() {
if (RED.settings.get('diagnostics.ui', true) === false) {
return;
}
RED.actions.add("core:show-system-info", function () { show(); });
}
function show() {
$.ajax({
headers: {
"Accept": "application/json"
},
cache: false,
url: 'diagnostics',
success: function (data) {
var json = JSON.stringify(data || {}, "", 4);
if (json === "{}") {
json = "{\n\n}";
}
RED.editor.editJSON({
title: RED._('diagnostics.title'),
value: json,
requireValid: true,
readOnly: true,
toolbarButtons: [
{
text: RED._('clipboard.export.copy'),
icon: 'fa fa-copy',
click: function () {
RED.clipboard.copyText(json, $(this), RED._('clipboard.copyMessageValue'))
}
},
{
text: RED._('clipboard.download'),
icon: 'fa fa-download',
click: function () {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(json));
element.setAttribute('download', "system-info.json");
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
},
]
});
},
error: function (jqXHR, textStatus, errorThrown) {
console.log("Unexpected error loading system info:", jqXHR.status, textStatus, errorThrown);
}
});
}
return {
init: init,
};
})();

View File

@@ -110,7 +110,11 @@ RED.editor = (function() {
var result = [];
for (var prop in definition) {
if (definition.hasOwnProperty(prop)) {
if (!validateNodeProperty(node, definition, prop, properties[prop])) {
var valid = validateNodeProperty(node, definition, prop, properties[prop]);
if ((typeof valid) === "string") {
result.push(valid);
}
else if(!valid) {
result.push(prop);
}
}
@@ -124,7 +128,7 @@ RED.editor = (function() {
* @param definition - the node property definitions (either def.defaults or def.creds)
* @param property - the property name being validated
* @param value - the property value being validated
* @returns {boolean} whether the node proprty is valid
* @returns {boolean|string} whether the node proprty is valid. `true`: valid `false|String`: invalid
*/
function validateNodeProperty(node,definition,property,value) {
var valid = true;
@@ -136,22 +140,74 @@ RED.editor = (function() {
if (/^\$\{[a-zA-Z_][a-zA-Z0-9_]*\}$/.test(value)) {
return true;
}
var label = null;
if (("label" in definition[property]) &&
((typeof definition[property].label) == "string")) {
label = definition[property].label;
}
if ("required" in definition[property] && definition[property].required) {
valid = value !== "";
if (!valid && label) {
return RED._("validator.errors.missing-required-prop", {
prop: label
});
}
}
if (valid && "validate" in definition[property]) {
try {
valid = definition[property].validate.call(node,value);
var opt = {};
if (label) {
opt.label = label;
}
valid = definition[property].validate.call(node,value, opt);
// If the validator takes two arguments, it is a 3.x validator that
// can return a String to mean 'invalid' and provide a reason
if ((definition[property].validate.length === 2) &&
((typeof valid) === "string")) {
return valid;
} else {
// Otherwise, a 2.x returns a truth-like/false-like value that
// we should cooerce to a boolean.
valid = !!valid
}
} catch(err) {
console.log("Validation error:",node.type,node.id,"property: "+property,"value:",value,err);
return RED._("validator.errors.validation-error", {
prop: property,
node: node.type,
id: node.id,
error: err.message
});
}
}
if (valid && definition[property].type && RED.nodes.getType(definition[property].type) && !("validate" in definition[property])) {
if (!value || value == "_ADD_") {
valid = definition[property].hasOwnProperty("required") && !definition[property].required;
if (!valid && label) {
return RED._("validator.errors.missing-required-prop", {
prop: label
});
}
} else {
var configNode = RED.nodes.node(value);
valid = (configNode && (configNode.valid == null || configNode.valid));
if (configNode) {
if ((configNode.valid == null) || configNode.valid) {
return true;
}
if (label) {
return RED._("validator.errors.invalid-config", {
prop: label
});
}
}
else {
if (label) {
return RED._("validator.errors.missing-config", {
prop: label
});
}
}
return false;
}
}
return valid;
@@ -179,10 +235,28 @@ RED.editor = (function() {
if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
value = input.text();
}
if (!validateNodeProperty(node, defaults, property,value)) {
var valid = validateNodeProperty(node, defaults, property,value);
if (((typeof valid) === "string") || !valid) {
input.addClass("input-error");
input.next(".red-ui-typedInput-container").addClass("input-error");
if ((typeof valid) === "string") {
var tooltip = input.data("tooltip");
if (tooltip) {
tooltip.setContent(valid);
}
else {
tooltip = RED.popover.tooltip(input, valid);
input.data("tooltip", tooltip);
}
}
} else {
input.removeClass("input-error");
input.next(".red-ui-typedInput-container").removeClass("input-error");
var tooltip = input.data("tooltip");
if (tooltip) {
input.data("tooltip", null);
tooltip.delete();
}
}
}
}
@@ -349,20 +423,11 @@ RED.editor = (function() {
* @param prefix - the prefix to use in the input element ids (node-input|node-config-input)
*/
function attachPropertyChangeHandler(node,definition,property,prefix) {
var input = $("#"+prefix+"-"+property);
if (definition !== undefined && "format" in definition[property] && definition[property].format !== "" && input[0].nodeName === "DIV") {
$("#"+prefix+"-"+property).on('change keyup', function(event) {
if (!$(this).attr("skipValidation")) {
validateNodeEditor(node,prefix);
}
});
} else {
$("#"+prefix+"-"+property).on("change", function(event) {
if (!$(this).attr("skipValidation")) {
validateNodeEditor(node,prefix);
}
});
}
$("#"+prefix+"-"+property).on("change keyup paste", function(event) {
if (!$(this).attr("skipValidation")) {
validateNodeEditor(node,prefix);
}
});
}
/**
@@ -796,6 +861,7 @@ RED.editor = (function() {
if (buildingEditDialog) { return }
buildingEditDialog = true;
var editing_node = node;
var removeInfoEditorOnClose = false;
var skipInfoRefreshOnClose = false;
var activeEditPanes = [];
@@ -991,6 +1057,14 @@ RED.editor = (function() {
}
if (!node._def.defaults || !node._def.defaults.hasOwnProperty('info')) {
nodeEditPanes.push('editor-tab-description');
removeInfoEditorOnClose = true;
if(node.infoEditor) {
//As 'editor-tab-description' adds `node.infoEditor` store original & set a
//flag to NOT remove this property
node.infoEditor__orig = node.infoEditor;
delete node.infoEditor;
removeInfoEditorOnClose = false;
}
}
nodeEditPanes.push("editor-tab-appearance");
@@ -1006,8 +1080,17 @@ RED.editor = (function() {
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
RED.view.state(RED.state.DEFAULT);
}
if (editing_node && !skipInfoRefreshOnClose) {
RED.sidebar.info.refresh(editing_node);
if (editing_node) {
if (editing_node.infoEditor__orig) {
editing_node.infoEditor = editing_node.infoEditor__orig;
delete editing_node.infoEditor__orig;
}
if (removeInfoEditorOnClose) {
delete editing_node.infoEditor;
}
if (!skipInfoRefreshOnClose) {
RED.sidebar.info.refresh(editing_node);
}
}
RED.workspaces.refresh();
@@ -1024,6 +1107,10 @@ RED.editor = (function() {
if (editing_node) {
RED.sidebar.info.refresh(editing_node);
RED.sidebar.help.show(editing_node.type, false);
//ensure focused element is NOT body (for keyboard scope to operate correctly)
if (document.activeElement.tagName === 'BODY') {
$('#red-ui-editor-stack').trigger('focus')
}
}
}
}
@@ -1766,11 +1853,15 @@ RED.editor = (function() {
workspace.disabled = disabled;
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('red-ui-workspace-disabled',!!workspace.disabled);
if (workspace.id === RED.workspaces.active()) {
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!workspace.disabled);
}
}
var locked = $("#node-input-locked").prop("checked");
if (workspace.locked !== locked) {
editState.changes.locked = workspace.locked;
editState.changed = true;
workspace.locked = locked;
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('red-ui-workspace-locked',!!workspace.locked);
}
if (editState.changed) {
var historyEvent = {
t: "edit",
@@ -1811,6 +1902,7 @@ RED.editor = (function() {
var trayBody = tray.find('.red-ui-tray-body');
trayBody.parent().css('overflow','hidden');
var trayFooterLeft = $('<div class="red-ui-tray-footer-left"></div>').appendTo(trayFooter)
var trayFooterRight = $('<div class="red-ui-tray-footer-right"></div>').appendTo(trayFooter)
var nodeEditPanes = [
'editor-tab-flow-properties',
@@ -1825,6 +1917,18 @@ RED.editor = (function() {
disabledIcon: "fa-ban",
invertState: true
})
if (!workspace.hasOwnProperty("locked")) {
workspace.locked = false;
}
$('<input id="node-input-locked" type="checkbox">').prop("checked",workspace.locked).appendTo(trayFooterRight).toggleButton({
enabledLabel: 'Unlocked',
enabledIcon: "fa-unlock-alt",
disabledLabel: 'Locked',
disabledIcon: "fa-lock",
invertState: true
})
prepareEditDialog(trayBody, nodeEditPanes, workspace, {}, "node-input", defaultTab, function(_activeEditPanes) {
activeEditPanes = _activeEditPanes;
trayBody.i18n();
@@ -1867,6 +1971,48 @@ RED.editor = (function() {
}
}
/** Genrate a consistent but unique ID for saving and restoring the code editors view state */
function generateViewStateId(source, thing, suffix) {
try {
thing = thing || {};
const thingOptions = typeof thing.options === "object" ? thing.options : {};
let stateId;
if (thing.hasOwnProperty("stateId")) {
stateId = thing.stateId
} else if (thingOptions.hasOwnProperty("stateId")) {
stateId = thing.stateId
}
if (stateId === false) { return false; }
if (!stateId) {
let id;
const selection = RED.view.selection();
if (source === "node" && thing.id) {
id = thing.id;
} else if (selection.nodes && selection.nodes.length) {
id = selection.nodes[0].id;
} else {
return false; //cant obtain Id.
}
//Use a string builder to build an ID
const sb = [id];
//get the index of the el - there may be more than one editor.
const el = $(thing.element || thingOptions.element);
if(el.length) {
sb.push(el.closest(".form-row").index());
sb.push(el.index());
}
if (source == "typedInput") {
sb.push(el.closest("li").index());//for when embeded in editable list
if (!suffix && thing.propertyType) { suffix = thing.propertyType }
}
stateId = sb.join("/");
}
if (stateId && suffix) { stateId += "/" + suffix; }
return stateId;
} catch (error) {
return false;
}
}
return {
init: function() {
if(window.ace) { window.ace.config.set('basePath', 'vendor/ace'); }
@@ -1883,6 +2029,7 @@ RED.editor = (function() {
});
RED.editor.codeEditor.init();
},
generateViewStateId: generateViewStateId,
edit: showEditDialog,
editConfig: showEditConfigNodeDialog,
editFlow: showEditFlowDialog,

View File

@@ -47,6 +47,7 @@
var definition = {
show: function(options) {
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_buffer"
if ($("script[data-template-name='"+type+"']").length === 0) {
@@ -60,12 +61,14 @@
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: "inherit",
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if (onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -74,7 +77,8 @@
text: RED._("common.label.done"),
class: "primary",
click: function() {
onComplete(JSON.stringify(bufferBinValue));
bufferStringEditor.saveView();
if (onComplete) { onComplete(JSON.stringify(bufferBinValue),null,bufferStringEditor); }
RED.tray.close();
}
}
@@ -86,19 +90,20 @@
}
},
open: function(tray) {
var trayBody = tray.find('.red-ui-tray-body');
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
bufferStringEditor = RED.editor.createEditor({
id: 'red-ui-editor-type-buffer-str',
value: "",
value: value||"",
stateId: RED.editor.generateViewStateId("buffer", options, ""),
focus: true,
mode:"ace/mode/text"
});
bufferStringEditor.getSession().setValue(value||"",-1);
bufferBinEditor = RED.editor.createEditor({
id: 'red-ui-editor-type-buffer-bin',
value: "",
stateId: false,
focus: false,
mode:"ace/mode/text",
readOnly: true
});

View File

@@ -21,7 +21,7 @@
const MONACO = "monaco";
const ACE = "ace";
const defaultEditor = ACE;
const defaultEditor = MONACO;
const DEFAULT_SETTINGS = { lib: defaultEditor, options: {} };
var selectedCodeEditor = null;
var initialised = false;
@@ -45,15 +45,18 @@
selectedCodeEditor = RED.editor.codeEditor[defaultEditor];
initialised = selectedCodeEditor.init();
}
$('<div id="red-ui-image-drop-target"><div data-i18n="[append]workspace.dropImageHere"><i class="fa fa-download"></i><br></div></div>').appendTo('#red-ui-editor');
$("#red-ui-image-drop-target").hide();
}
function create(options) {
//TODO: (quandry - for consideration)
//TODO: (quandry - for consideration)
// Below, I had to create a hidden element if options.id || options.element is not in the DOM
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
// invalid (non existing html element selector) (e.g. node-red-contrib-components does this)
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
// code is thus skipped.
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
// code is thus skipped.
// In ACE mode, creating an ACE editor (with an invalid ID) allows the editor to be created (but obviously there is no UI)
// Because one (or more) contrib nodes have left this bad code in place, how would we handle this?
// For compatibility, I have decided to create a hidden element so that at least an editor is created & errors do not occur.
@@ -64,6 +67,7 @@
options = {};
}
var editor = null;
if (this.editor.type === MONACO) {
// compatibility (see above note)
if (!options.element && !options.id) {
@@ -74,12 +78,16 @@
console.warn("createEditor() options.element or options.id is not valid", options);
$("#dialog-form").append('<div id="' + options.id + '" style="display: none;" />');
}
return this.editor.create(options);
editor = this.editor.create(options);
} else {
return this.editor.create(options);//fallback to ACE
editor = this.editor.create(options);//fallback to ACE
}
if (options.mode === "ace/mode/markdown") {
RED.editor.customEditTypes['_markdown'].postInit(editor, options);
}
return editor;
}
return {
init: init,
/**
@@ -91,7 +99,7 @@
},
/**
* Get user selected code editor
* @return {string} Returns
* @return {string} Returns
* @memberof RED.editor.codeEditor
*/
get editor() {
@@ -104,4 +112,4 @@
*/
create: create
}
})();
})();

View File

@@ -80,6 +80,9 @@ RED.editor.codeEditor.ace = (function() {
}
},100);
}
if (!options.stateId && options.stateId !== false) {
options.stateId = RED.editor.generateViewStateId("ace", options, (options.mode || options.title).split("/").pop());
}
if (options.mode === 'ace/mode/markdown') {
$(el).addClass("red-ui-editor-text-container-toolbar");
editor.toolbar = RED.editor.customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
@@ -92,11 +95,15 @@ RED.editor.codeEditor.ace = (function() {
RED.editor.editMarkdown({
value: value,
width: "Infinity",
cursor: editor.getCursorPosition(),
stateId: options.stateId,
focus: true,
cancel: function () {
editor.focus();
},
complete: function(v,cursor) {
editor.setValue(v, -1);
editor.gotoLine(cursor.row+1,cursor.column,false);
setTimeout(function() {
editor.restoreView();
editor.focus();
},300);
}
@@ -117,11 +124,56 @@ RED.editor.codeEditor.ace = (function() {
editor._destroy = editor.destroy;
editor.destroy = function() {
try {
editor.saveView();
editor._initState = null;
this._destroy();
} catch (e) { }
$(el).remove();
$(toolbarRow).remove();
}
editor.on("blur", function () {
editor.focusMemory = false;
editor.saveView();
})
editor.on("focus", function () {
if (editor._initState) {
editor.restoreView(editor._initState);
editor._initState = null;
}
})
editor.getView = function () {
var session = editor.getSession();
return {
selection: session.selection.toJSON(),
scrollTop: session.getScrollTop(),
scrollLeft: session.getScrollLeft(),
options: session.getOptions()
}
}
editor.saveView = function () {
if (!options.stateId) { return; } //only possible if created with a unique stateId
window._editorStateAce = window._editorStateAce || {};
var state = editor.getView();
window._editorStateAce[options.stateId] = state;
return state;
}
editor.restoreView = function (state) {
if (!options.stateId) { return; } //only possible if created with a unique stateId
window._editorStateAce = window._editorStateAce || {};
var _state = state || window._editorStateAce[options.stateId];
if (!_state) { return; } //no view state available
try {
var session = editor.getSession();
session.setOptions(_state.options);
session.selection.fromJSON(_state.selection);
session.setScrollTop(_state.scrollTop);
session.setScrollLeft(_state.scrollLeft);
editor._initState = _state;
} catch (error) {
delete window._editorStateMonaco[options.stateId];
}
};
editor.restoreView();
editor.type = type;
return editor;
}

View File

@@ -100,7 +100,7 @@ RED.editor.codeEditor.monaco = (function() {
"node-red-util": {package: "node-red", module: "util", path: "node-red/util.d.ts" },
"node-red-func": {package: "node-red", module: "func", path: "node-red/func.d.ts" },
}
const defaultServerSideTypes = [ knownModules["node-red-util"], knownModules["node-red-func"], knownModules["globals"], knownModules["console"], knownModules["buffer"] ];
const defaultServerSideTypes = [ knownModules["node-red-util"], knownModules["node-red-func"], knownModules["globals"], knownModules["console"], knownModules["buffer"] , knownModules["util"] ];
const modulesCache = {};
@@ -171,7 +171,7 @@ RED.editor.codeEditor.monaco = (function() {
options = options || {};
window.MonacoEnvironment = window.MonacoEnvironment || {};
window.MonacoEnvironment.getWorkerUrl = function (moduleId, label) {
window.MonacoEnvironment.getWorkerUrl = window.MonacoEnvironment.getWorkerUrl || function (moduleId, label) {
if (label === 'json') { return './vendor/monaco/dist/json.worker.js'; }
if (label === 'css' || label === 'scss') { return './vendor/monaco/dist/css.worker.js'; }
if (label === 'html' || label === 'handlebars') { return './vendor/monaco/dist/html.worker.js'; }
@@ -577,7 +577,7 @@ RED.editor.codeEditor.monaco = (function() {
createMonacoCompletionItem("set (flow context)", 'flow.set("${1:name}", ${1:value});','Set a value in flow context',range),
createMonacoCompletionItem("get (global context)", 'global.get("${1:name}");','Get a value from global context',range),
createMonacoCompletionItem("set (global context)", 'global.set("${1:name}", ${1:value});','Set a value in global context',range),
createMonacoCompletionItem("get (env)", 'env.get("${1:name}");','Get env variable value',range),
createMonacoCompletionItem("get (env)", 'env.get("${1|NR_NODE_ID,NR_NODE_NAME,NR_NODE_PATH,NR_GROUP_ID,NR_GROUP_NAME,NR_FLOW_ID,NR_FLOW_NAME|}");','Get env variable value',range),
createMonacoCompletionItem("cloneMessage (RED.util)", 'RED.util.cloneMessage(${1:msg});',
["```typescript",
"RED.util.cloneMessage<T extends registry.NodeMessage>(msg: T): T",
@@ -747,13 +747,25 @@ RED.editor.codeEditor.monaco = (function() {
mode = "html";
break;
case "appcache":
case "sh":
case "bash":
mode = "shell";
break;
case "batchfile":
mode = "bat";
break;
case "protobuf":
mode = "proto";
break;
//TODO: add other compatability types.
}
return mode;
}
if(!options.stateId && options.stateId !== false) {
options.stateId = RED.editor.generateViewStateId("monaco", options, (options.mode || options.title || "").split("/").pop());
}
var el = options.element || $("#"+options.id)[0];
var toolbarRow = $("<div>").appendTo(el);
el = $("<div>").appendTo(el).addClass("red-ui-editor-text-container")[0];
@@ -1098,6 +1110,7 @@ RED.editor.codeEditor.monaco = (function() {
try {
var m = this.getModel();
if(m && !m.isDisposed()) {
ed._initState = null;
m.dispose();
}
this.setModel(null);
@@ -1151,7 +1164,7 @@ RED.editor.codeEditor.monaco = (function() {
try {
var _model = ed.getModel();
if (_model !== null) {
var id = _model.getModeId(); // e.g. javascript
var id = _model._languageId; // e.g. javascript
var ra = _model._associatedResource.authority; //e.g. model
var rp = _model._associatedResource.path; //e.g. /18
var rs = _model._associatedResource.scheme; //e.g. inmemory
@@ -1243,14 +1256,7 @@ RED.editor.codeEditor.monaco = (function() {
//#endregion "ACE compatability"
//final setup
if (options.cursor) {
var row = options.cursor.row || options.cursor.lineNumber;
var col = options.cursor.column || options.cursor.col;
ed.gotoLine(row, col);
}
if (options.focus) {
ed.focus();
}
ed.focusMemory = options.focus;
ed._mode = editorOptions.language;
//as models are signleton, consts and let are avialable to other javascript instances
@@ -1262,11 +1268,12 @@ RED.editor.codeEditor.monaco = (function() {
}
ed.onDidBlurEditorWidget(function() {
ed.focusMemory = false;
ed.saveView();
if(isVisible(el) == false) {
onVisibilityChange(false, 0, el);
}
});
ed.onDidFocusEditorWidget(function() {
onVisibilityChange(true, 10, el);
});
@@ -1300,17 +1307,33 @@ RED.editor.codeEditor.monaco = (function() {
}
function onVisibilityChange(visible, delay, element) {
if(visible) {
if(ed._mode == "javascript" && ed._tempMode == "text") {
delay = delay || 50;
if (visible) {
if (ed.focusMemory) {
setTimeout(function () {
if (element.parentElement) { //ensure el is still in DOM
ed.focus();
}
}, 300)
}
if (ed._initState) {
setTimeout(function () {
if (element.parentElement) { //ensure el is still in DOM
ed.restoreViewState(ed._initState);
ed._initState = null;
}
}, delay);
}
if (ed._mode == "javascript" && ed._tempMode == "text") {
ed._tempMode = "";
setTimeout(function() {
if(element.parentElement) { //ensure el is still in DOM
setTimeout(function () {
if (element.parentElement) { //ensure el is still in DOM
ed.setMode('javascript', undefined, false);
}
}, delay || 50);
}, delay);
}
} else if(ed._mode == "javascript" && ed._tempMode != "text") {
if(element.parentElement) { //ensure el is still in DOM
} else if (ed._mode == "javascript" && ed._tempMode != "text") {
if (element.parentElement) { //ensure el is still in DOM
ed.setMode('text', undefined, false);
ed._tempMode = "text";
}
@@ -1329,15 +1352,19 @@ RED.editor.codeEditor.monaco = (function() {
expandButton.on("click", function (e) {
e.preventDefault();
var value = ed.getValue();
ed.saveView();
RED.editor.editMarkdown({
value: value,
width: "Infinity",
cursor: ed.getCursorPosition(),
stateId: options.stateId,
cancel: function () {
ed.focus();
},
complete: function (v, cursor) {
ed.setValue(v, -1);
ed.gotoLine(cursor.row + 1, cursor.column, false);
setTimeout(function () {
ed.focus();
ed.restoreView();
}, 300);
}
})
@@ -1353,7 +1380,37 @@ RED.editor.codeEditor.monaco = (function() {
autoClose: 50
});
}
ed.getView = function () {
return ed.saveViewState();
}
ed.saveView = function (debuginfo) {
if (!options.stateId) { return; } //only possible if created with a unique stateId
window._editorStateMonaco = window._editorStateMonaco || {};
var state = ed.getView();
window._editorStateMonaco[options.stateId] = state;
return state;
}
ed.restoreView = function (state) {
if (!options.stateId) { return; } //only possible if created with a unique stateId
window._editorStateMonaco = window._editorStateMonaco || {};
var _state = state || window._editorStateMonaco[options.stateId];
if (!_state) { return; } //no view state available
try {
if (ed.type) { //is editor already initialised?
ed.restoreViewState(_state);
} else {
ed._initState = _state;
}
} catch (error) {
delete window._editorStateMonaco[options.stateId];
}
};
ed.restoreView();
if (options.cursor && !ed._initState) {
var row = options.cursor.row || options.cursor.lineNumber;
var col = options.cursor.column || options.cursor.col;
ed.gotoLine(row, col);
}
ed.type = type;
return ed;
}

View File

@@ -76,6 +76,9 @@ RED.editor.colorPicker = RED.colorPicker = (function() {
var focusTarget = colorInput;
colorInput.on("change", function (e) {
var color = colorInput.val();
if (options.defaultValue && !color.match(/^([a-z]+|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3})$/)) {
color = options.defaultValue;
}
colorHiddenInput.val(color).trigger('change');
refreshDisplay(color);
});

View File

@@ -2,7 +2,7 @@ RED.editor.envVarList = (function() {
var currentLocale = 'en-US';
var DEFAULT_ENV_TYPE_LIST = ['str','num','bool','json','bin','env'];
var DEFAULT_ENV_TYPE_LIST_INC_CRED = ['str','num','bool','json','bin','env','cred'];
var DEFAULT_ENV_TYPE_LIST_INC_CRED = ['str','num','bool','json','bin','env','cred','jsonata'];
/**
* Create env var edit interface
@@ -41,8 +41,12 @@ RED.editor.envVarList = (function() {
style: "width:100%",
class: "node-input-env-value",
type: "text",
}).attr("autocomplete","disable").appendTo(envRow)
valueField.typedInput({default:'str',types:isTemplateNode?DEFAULT_ENV_TYPE_LIST:DEFAULT_ENV_TYPE_LIST_INC_CRED});
}).attr("autocomplete","disable").appendTo(envRow);
var types = (opt.ui && opt.ui.opts && opt.ui.opts.types);
if (!types) {
types = isTemplateNode ? DEFAULT_ENV_TYPE_LIST : DEFAULT_ENV_TYPE_LIST_INC_CRED;
}
valueField.typedInput({default:'str',types:types});
valueField.typedInput('type', opt.type);
if (opt.type === "cred") {
if (opt.value) {
@@ -94,6 +98,11 @@ RED.editor.envVarList = (function() {
}
opt.ui.label = opt.ui.label || {};
opt.ui.type = opt.ui.type || "input";
if ((opt.ui.type === "cred") &&
opt.ui.opts &&
opt.ui.opts.types) {
opt.ui.type = "input";
}
var uiRow = $('<div/>').appendTo(container).hide();
// save current info for reverting on cancel

View File

@@ -50,6 +50,7 @@
show: function(options) {
var expressionTestCacheId = options.parent||"_";
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_expression"
if ($("script[data-template-name='"+type+"']").length === 0) {
@@ -63,12 +64,14 @@
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: "inherit",
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if(onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -78,7 +81,8 @@
class: "primary",
click: function() {
$("#red-ui-editor-type-expression-help").text("");
onComplete(expressionEditor.getValue());
expressionEditor.saveView();
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(),expressionEditor); }
RED.tray.close();
}
}
@@ -110,6 +114,8 @@
id: 'red-ui-editor-type-expression',
value: "",
mode:"ace/mode/jsonata",
stateId: options.stateId,
focus: true,
options: {
enableBasicAutocompletion:true,
enableSnippets:true,
@@ -233,6 +239,8 @@
testDataEditor = RED.editor.createEditor({
id: 'red-ui-editor-type-expression-test-data',
value: expressionTestCache[expressionTestCacheId] || '{\n "payload": "hello world"\n}',
stateId: false,
focus: false,
mode:"ace/mode/json",
lineNumbers: false
});
@@ -247,7 +255,10 @@
var currentExpression = expressionEditor.getValue();
var expr;
var usesContext = false;
var legacyMode = /(^|[^a-zA-Z0-9_'"])msg([^a-zA-Z0-9_'"]|$)/.test(currentExpression);
var usesEnv = false;
var usesMoment = false;
var usesClone = false;
var legacyMode = /(^|[^a-zA-Z0-9_'".])msg([^a-zA-Z0-9_'"]|$)/.test(currentExpression);
$(".red-ui-editor-type-expression-legacy").toggle(legacyMode);
try {
expr = jsonata(currentExpression);
@@ -259,6 +270,18 @@
usesContext = true;
return null;
});
expr.assign("env", function(name) {
usesEnv = true;
return null;
});
expr.assign("moment", function(name) {
usesMoment = true;
return null;
});
expr.assign("clone", function(name) {
usesClone = true;
return null;
});
} catch(err) {
testResultEditor.setValue(RED._("expressionEditor.errors.invalid-expr",{message:err.message}),-1);
return;
@@ -276,6 +299,18 @@
testResultEditor.setValue(RED._("expressionEditor.errors.context-unsupported"),-1);
return;
}
if (usesEnv) {
testResultEditor.setValue(RED._("expressionEditor.errors.env-unsupported"),-1);
return;
}
if (usesMoment) {
testResultEditor.setValue(RED._("expressionEditor.errors.moment-unsupported"),-1);
return;
}
if (usesClone) {
testResultEditor.setValue(RED._("expressionEditor.errors.clone-unsupported"),-1);
return;
}
var formattedResult;
if (result !== undefined) {
@@ -302,6 +337,8 @@
testResultEditor = RED.editor.createEditor({
id: 'red-ui-editor-type-expression-test-result',
value: "",
stateId: false,
focus: false,
mode:"ace/mode/json",
lineNumbers: false,
readOnly: true

View File

@@ -21,6 +21,7 @@
var definition = {
show: function(options) {
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_js"
if ($("script[data-template-name='"+type+"']").length === 0) {
@@ -28,16 +29,16 @@
}
RED.view.state(RED.state.EDITING);
var expressionEditor;
var changeTimer;
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: options.width||"inherit",
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if (onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -46,7 +47,8 @@
text: RED._("common.label.done"),
class: "primary",
click: function() {
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
expressionEditor.saveView();
if (onComplete) { onComplete(expressionEditor.getValue(), expressionEditor.getCursorPosition(), expressionEditor); }
RED.tray.close();
}
}
@@ -62,11 +64,12 @@
expressionEditor.resize();
},
open: function(tray) {
var trayBody = tray.find('.red-ui-tray-body');
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
expressionEditor = RED.editor.createEditor({
id: 'node-input-js',
mode: options.mode || 'ace/mode/javascript',
stateId: options.stateId,
focus: true,
value: value,
globals: {
msg:true,
@@ -81,21 +84,19 @@
clearTimeout: true,
setInterval: true,
clearInterval: true
}
},
extraLibs: options.extraLibs
});
if (options.cursor) {
if (options.cursor && !expressionEditor._initState) {
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
}
dialogForm.i18n();
setTimeout(function() {
expressionEditor.focus();
},300);
},
close: function() {
expressionEditor.destroy();
if (options.onclose) {
options.onclose();
}
expressionEditor.destroy();
},
show: function() {}
}

View File

@@ -21,7 +21,9 @@
'<ul id="red-ui-editor-type-json-tabs"></ul>'+
'<div id="red-ui-editor-type-json-tab-raw" class="red-ui-editor-type-json-tab-content hide">'+
'<div class="form-row" style="margin-bottom: 3px; text-align: right;">'+
'<button id="node-input-json-reformat" class="red-ui-button red-ui-button-small"><span data-i18n="jsonEditor.format"></span></button>'+
'<span class="button-group">'+
'<button id="node-input-json-reformat" class="red-ui-button red-ui-button-small"><span data-i18n="jsonEditor.format"></span></button>'+
'<span class="button-group">'+
'</div>'+
'<div class="form-row node-text-editor-row">'+
'<div style="height: 200px;min-height: 150px;" class="node-text-editor" id="node-input-json"></div>'+
@@ -34,7 +36,7 @@
var activeTab;
function insertNewItem(parent,index,copyIndex) {
function insertNewItem(parent,index,copyIndex,readOnly) {
var newValue = "";
if (parent.children.length > 0) {
@@ -60,26 +62,26 @@
newKey = keyRoot+"-"+(keySuffix++);
}
}
var newItem = handleItem(newKey,newValue,parent.depth+1,parent);
var newItem = handleItem(newKey,newValue,parent.depth+1,parent,readOnly);
parent.treeList.insertChildAt(newItem, index, true);
parent.treeList.expand();
}
function showObjectMenu(button,item) {
function showObjectMenu(button,item,readOnly) {
var elementPos = button.offset();
var options = [];
if (item.parent) {
options.push({id:"red-ui-editor-type-json-menu-insert-above", icon:"fa fa-toggle-up", label:RED._('jsonEditor.insertAbove'),onselect:function(){
var index = item.parent.children.indexOf(item);
insertNewItem(item.parent,index,index);
insertNewItem(item.parent,index,index,readOnly);
}});
options.push({id:"red-ui-editor-type-json-menu-insert-below", icon:"fa fa-toggle-down", label:RED._('jsonEditor.insertBelow'),onselect:function(){
var index = item.parent.children.indexOf(item)+1;
insertNewItem(item.parent,index,index-1);
insertNewItem(item.parent,index,index-1,readOnly);
}});
}
if (item.type === 'array' || item.type === 'object') {
options.push({id:"red-ui-editor-type-json-menu-add-child", icon:"fa fa-plus", label:RED._('jsonEditor.addItem'),onselect:function(){
insertNewItem(item,item.children.length,item.children.length-1);
insertNewItem(item,item.children.length,item.children.length-1,readOnly);
}});
}
if (item.parent) {
@@ -121,7 +123,7 @@
newKey = keyRoot+"-"+(keySuffix++);
}
}
var newItem = handleItem(newKey,convertToObject(item),item.parent.depth+1,item.parent);
var newItem = handleItem(newKey,convertToObject(item),item.parent.depth+1,item.parent,readOnly);
var index = item.parent.children.indexOf(item)+1;
item.parent.treeList.insertChildAt(newItem, index, true);
@@ -171,24 +173,24 @@
menuOptionMenu.show();
}
function parseObject(obj,depth,parent) {
function parseObject(obj,depth,parent,readOnly) {
var result = [];
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
result.push(handleItem(prop,obj[prop],depth,parent));
result.push(handleItem(prop,obj[prop],depth,parent,readOnly));
}
}
return result;
}
function parseArray(obj,depth,parent) {
function parseArray(obj,depth,parent,readOnly) {
var result = [];
var l = obj.length;
for (var i=0;i<l;i++) {
result.push(handleItem(i,obj[i],depth,parent));
result.push(handleItem(i,obj[i],depth,parent,readOnly));
}
return result;
}
function handleItem(key,val,depth,parent) {
function handleItem(key,val,depth,parent,readOnly) {
var item = {depth:depth, type: typeof val};
var container = $('<span class="red-ui-editor-type-json-editor-label">');
if (key != null) {
@@ -204,11 +206,14 @@
if (parent && parent.type === "array") {
keyLabel.addClass("red-ui-editor-type-json-editor-label-array-key")
}
if(readOnly) {
keyLabel.addClass("readonly")
}
keyLabel.on("click", function(evt) {
if (item.parent.type === 'array') {
return;
}
if (readOnly) { return; }
evt.preventDefault();
evt.stopPropagation();
var w = Math.max(150,keyLabel.width());
@@ -253,10 +258,10 @@
item.expanded = depth < 2;
item.type = "array";
item.deferBuild = depth >= 2;
item.children = parseArray(val,depth+1,item);
item.children = parseArray(val,depth+1,item,readOnly);
} else if (val !== null && item.type === "object") {
item.expanded = depth < 2;
item.children = parseObject(val,depth+1,item);
item.children = parseObject(val,depth+1,item,readOnly);
item.deferBuild = depth >= 2;
} else {
item.value = val;
@@ -287,7 +292,11 @@
//
var orphanedChildren;
var valueLabel = $('<span class="red-ui-editor-type-json-editor-label-value">').addClass(valClass).text(valValue).appendTo(container);
if (readOnly) {
valueLabel.addClass("readonly")
}
valueLabel.on("click", function(evt) {
if (readOnly) { return; }
evt.preventDefault();
evt.stopPropagation();
if (valType === 'str') {
@@ -302,8 +311,8 @@
types:[
'str','num','bool',
{value:"null",label:RED._("common.type.null"),hasValue:false},
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"},
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"},
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"}
],
default: valType
});
@@ -395,17 +404,19 @@
valueLabel.hide();
})
item.gutter = $('<span class="red-ui-editor-type-json-editor-item-gutter"></span>');
if (parent) {//red-ui-editor-type-json-editor-item-handle
$('<span class="red-ui-editor-type-json-editor-item-handle"><i class="fa fa-bars"></span>').appendTo(item.gutter);
} else {
$('<span></span>').appendTo(item.gutter);
if(!readOnly) {
if (parent) {
$('<span class="red-ui-editor-type-json-editor-item-handle"><i class="fa fa-bars"></span>').appendTo(item.gutter);
} else {
$('<span></span>').appendTo(item.gutter);
}
$('<button type="button" class="editor-button editor-button-small"><i class="fa fa-caret-down"></button>').appendTo(item.gutter).on("click", function(evt) {
evt.preventDefault();
evt.stopPropagation();
showObjectMenu($(this), item, readOnly);
});
}
$('<button type="button" class="editor-button editor-button-small"><i class="fa fa-caret-down"></button>').appendTo(item.gutter).on("click", function(evt) {
evt.preventDefault();
evt.stopPropagation();
showObjectMenu($(this), item);
});
item.element = container;
return item;
}
@@ -434,6 +445,7 @@
var definition = {
show: function(options) {
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_json"
if ($("script[data-template-name='"+type+"']").length === 0) {
@@ -455,15 +467,16 @@
}
}
var rootNode;
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: options.width||700,
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if (onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -485,7 +498,8 @@
} else if (activeTab === "json-raw") {
result = expressionEditor.getValue();
}
if (onComplete) { onComplete(result) }
expressionEditor.saveView();
if (onComplete) { onComplete(result,null,expressionEditor) }
RED.tray.close();
}
}
@@ -498,10 +512,29 @@
open: function(tray) {
var trayBody = tray.find('.red-ui-tray-body');
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
var toolbarButtons = options.toolbarButtons || [];
if (toolbarButtons.length) {
toolbarButtons.forEach(function (button) {
var element = $('<button type="button" class="red-ui-button red-ui-button-small"> </button>')
.insertBefore("#node-input-json-reformat")
.on("click", function (evt) {
evt.preventDefault();
if (button.click !== undefined) {
button.click.call(element, evt);
}
});
if (button.id) { element.attr("id", button.id); }
if (button.title) { element.attr("title", button.title); }
if (button.icon) { element.append($("<i></i>").attr("class", button.icon)); }
if (button.label || button.text) {
element.append($("<span></span>").text(" " + (button.label || button.text)));
}
});
}
var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"});
var filterDepth = Infinity;
var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({
selectable: false,
rootSortable: false,
sortable: ".red-ui-editor-type-json-editor-item-handle",
}).on("treelistchangeparent", function(event, evt) {
@@ -528,13 +561,15 @@
})
});
expressionEditor = RED.editor.createEditor({
id: 'node-input-json',
value: "",
mode:"ace/mode/json"
value: value||"",
mode:"ace/mode/json",
readOnly: !!options.readOnly,
stateId: options.stateId,
focus: true
});
expressionEditor.getSession().setValue(value||"",-1);
if (options.requireValid) {
expressionEditor.getSession().on('change', function() {
clearTimeout(changeTimer);
@@ -571,7 +606,7 @@
var raw = expressionEditor.getValue().trim() ||"{}";
try {
var parsed = JSON.parse(raw);
rootNode = handleItem(null,parsed,0,null);
rootNode = handleItem(null,parsed,0,null,options.readOnly);
rootNode.class = "red-ui-editor-type-json-root-node"
list.treeList('data',[rootNode]);
} catch(err) {
@@ -589,17 +624,15 @@
tabs.addTab({
id: 'json-raw',
label: RED._('jsonEditor.rawMode'),
label: options.readOnly ? RED._('jsonEditor.rawMode-readonly') : RED._('jsonEditor.rawMode'),
content: $("#red-ui-editor-type-json-tab-raw")
});
tabs.addTab({
id: 'json-ui',
label: RED._('jsonEditor.uiMode'),
label: options.readOnly ? RED._('jsonEditor.uiMode-readonly') : RED._('jsonEditor.uiMode'),
content: $("#red-ui-editor-type-json-tab-ui")
});
finishedBuild = true;
},
close: function() {
if (options.onclose) {

View File

@@ -14,6 +14,61 @@
* limitations under the License.
**/
(function() {
/**
* Converts dropped image file to date URL
*/
function file2base64Image(file, cb) {
var reader = new FileReader();
reader.onload = (function (fd) {
return function (e) {
cb(e.target.result);
};
})(file);
reader.readAsDataURL(file);
}
var initialized = false;
var currentEditor = null;
/**
* Initialize handler for image file drag events
*/
function initImageDrag(elem, editor) {
$(elem).on("dragenter", function (ev) {
ev.preventDefault();
$("#red-ui-image-drop-target").css({display:'table'}).focus();
currentEditor = editor;
});
if (!initialized) {
initialized = true;
$("#red-ui-image-drop-target").on("dragover", function (ev) {
ev.preventDefault();
}).on("dragleave", function (ev) {
$("#red-ui-image-drop-target").hide();
}).on("drop", function (ev) {
ev.preventDefault();
if ($.inArray("Files",ev.originalEvent.dataTransfer.types) != -1) {
var files = ev.originalEvent.dataTransfer.files;
if (files.length === 1) {
var file = files[0];
var name = file.name.toLowerCase();
if (name.match(/\.(apng|avif|gif|jpeg|png|svg|webp)$/)) {
file2base64Image(file, function (image) {
var session = currentEditor.getSession();
var img = `<img src="${image}"/>\n`;
var pos = session.getCursorPosition();
session.insert(pos, img);
$("#red-ui-image-drop-target").hide();
});
return;
}
}
}
$("#red-ui-image-drop-target").hide();
});
}
}
var toolbarTemplate = '<div style="margin-bottom: 5px">'+
'<span class="button-group">'+
@@ -54,24 +109,26 @@
var definition = {
show: function(options) {
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_markdown"
if ($("script[data-template-name='"+type+"']").length === 0) {
$(template).appendTo("#red-ui-editor-node-configs");
}
RED.view.state(RED.state.EDITING);
var expressionEditor;
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: options.width||Infinity,
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if (onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -80,7 +137,8 @@
text: RED._("common.label.done"),
class: "primary",
click: function() {
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
expressionEditor.saveView();
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(), expressionEditor); }
RED.tray.close();
}
}
@@ -99,6 +157,8 @@
expressionEditor = RED.editor.createEditor({
id: 'red-ui-editor-type-markdown',
value: value,
stateId: options.stateId,
focus: true,
mode:"ace/mode/markdown",
expandable: false
});
@@ -109,6 +169,7 @@
var currentScrollTop = $(".red-ui-editor-type-markdown-panel-preview").scrollTop();
$(".red-ui-editor-type-markdown-panel-preview").html(RED.utils.renderMarkdown(expressionEditor.getValue()));
$(".red-ui-editor-type-markdown-panel-preview").scrollTop(currentScrollTop);
mermaid.init();
},200);
})
if (options.header) {
@@ -117,6 +178,7 @@
if (value) {
$(".red-ui-editor-type-markdown-panel-preview").html(RED.utils.renderMarkdown(expressionEditor.getValue()));
mermaid.init();
}
panels = RED.panels.create({
id:"red-ui-editor-type-markdown-panels",
@@ -143,17 +205,21 @@
});
RED.popover.tooltip($("#node-btn-markdown-preview"), RED._("markdownEditor.toggle-preview"));
if (options.cursor) {
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
}
if(!expressionEditor._initState) {
if (options.cursor) {
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
}
else {
expressionEditor.gotoLine(0, 0, false);
}
}
dialogForm.i18n();
},
close: function() {
expressionEditor.destroy();
if (options.onclose) {
options.onclose();
}
expressionEditor.destroy();
},
show: function() {}
}
@@ -168,7 +234,7 @@
'b': { before:"**", after: "**", tooltip: RED._("markdownEditor.bold")},
'i': { before:"_", after: "_", tooltip: RED._("markdownEditor.italic")},
'code': { before:"`", after: "`", tooltip: RED._("markdownEditor.code")},
'ol': { before:" * ", newline: true, tooltip: RED._("markdownEditor.ordered-list")},
'ol': { before:" 1. ", newline: true, tooltip: RED._("markdownEditor.ordered-list")},
'ul': { before:" - ", newline: true, tooltip: RED._("markdownEditor.unordered-list")},
'bq': { before:"> ", newline: true, tooltip: RED._("markdownEditor.quote")},
'link': { before:"[", after: "]()", tooltip: RED._("markdownEditor.link")},
@@ -210,7 +276,11 @@
}
})
return toolbar;
}
},
postInit: function (editor, options) {
var elem = $("#"+options.id);
initImageDrag(elem, editor);
}
}
RED.editor.registerTypeEditor("_markdown", definition);
})();

View File

@@ -35,9 +35,9 @@
editState.changed = true;
}
if (!node._def.defaults || !node._def.defaults.hasOwnProperty("icon")) {
var icon = $("#red-ui-editor-node-icon").val()||""
var icon = $("#red-ui-editor-node-icon").val()||"";
if (!this.isDefaultIcon) {
if (icon !== node.icon) {
if ((node.icon && icon !== node.icon) || (!node.icon && icon !== "")) {
editState.changes.icon = node.icon;
node.icon = icon;
editState.changed = true;
@@ -101,14 +101,14 @@
if (showLabel) {
// Default to show label
if (node.l !== false) {
editState.changes.l = node.l
editState.changes.l = node.l;
editState.changed = true;
}
node.l = false;
} else {
// Node has showLabel:false (eg link nodes)
if (node.hasOwnProperty('l') && node.l) {
editState.changes.l = node.l
editState.changes.l = node.l;
editState.changed = true;
}
delete node.l;
@@ -118,20 +118,20 @@
if (showLabel) {
// Default to show label
if (node.hasOwnProperty('l') && !node.l) {
editState.changes.l = node.l
editState.changes.l = node.l;
editState.changed = true;
}
delete node.l;
} else {
if (!node.l) {
editState.changes.l = node.l
editState.changes.l = node.l;
editState.changed = true;
}
node.l = true;
}
}
}
}
};
});
function buildAppearanceForm(container,node) {
@@ -164,10 +164,10 @@
var categories = RED.palette.getCategories();
categories.sort(function(A,B) {
return A.label.localeCompare(B.label);
})
});
categories.forEach(function(cat) {
categorySelector.append($("<option/>").val(cat.id).text(cat.label));
})
});
categorySelector.append($("<option/>").attr('disabled',true).text("---"));
categorySelector.append($("<option/>").val("_custom_").text(RED._("palette.addCategory")));
@@ -180,7 +180,7 @@
$("#subflow-appearance-input-category").width(250);
$("#subflow-appearance-input-custom-category").hide();
}
})
});
$("#subflow-appearance-input-category").val(node.category||"subflows");
var userCount = 0;
@@ -204,7 +204,7 @@
$("#node-input-show-label").toggleButton({
enabledLabel: RED._("editor.show"),
disabledLabel: RED._("editor.hide")
})
});
if (!node.hasOwnProperty("l")) {
// Show label unless def.showLabel set to false
@@ -230,11 +230,12 @@
"#E9967A", "#F3B567", "#FDD0A2",
"#FDF0C2", "#FFAAAA", "#FFCC66",
"#FFF0F0", "#FFFFFF"
]
];
RED.editor.colorPicker.create({
id: "red-ui-editor-node-color",
value: color,
defaultValue: "#DDAA99",
palette: recommendedColors,
sortPalette: function (a, b) {return a.l - b.l;}
}).appendTo(colorRow);
@@ -245,9 +246,9 @@
nodeDiv.css('backgroundColor',colour);
var borderColor = RED.utils.getDarkerColor(colour);
if (borderColor !== colour) {
nodeDiv.css('border-color',borderColor)
nodeDiv.css('border-color',borderColor);
}
})
});
}
@@ -264,7 +265,7 @@
nodeDiv.css('backgroundColor',colour);
var borderColor = RED.utils.getDarkerColor(colour);
if (borderColor !== colour) {
nodeDiv.css('border-color',borderColor)
nodeDiv.css('border-color',borderColor);
}
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
@@ -292,7 +293,7 @@
RED.popover.tooltip(iconButton, function() {
return $("#red-ui-editor-node-icon").val() || RED._("editor.default");
})
});
$('<input type="hidden" id="red-ui-editor-node-icon">').val(node.icon).appendTo(iconRow);
}
@@ -417,11 +418,11 @@
});
rows.sort(function(A,B) {
return A.i-B.i;
})
});
rows.forEach(function(r,i) {
r.r.find("label").text((i+1)+".");
r.r.appendTo(outputsDiv);
})
});
if (rows.length === 0) {
buildLabelRow("output",i,"").appendTo(outputsDiv);
} else {
@@ -467,7 +468,7 @@
clear.on("click", function(evt) {
evt.preventDefault();
input.val("");
})
});
}
return result;
}
@@ -501,6 +502,12 @@
}
var v = $(this).val();
hasNonBlankLabel = hasNonBlankLabel || v!== "";
// mark changed output port labels as dirty
if (node.type === "subflow" && (!node.outputLabels || node.outputLabels[index] !== v)) {
node.out[index].dirty = true;
}
newValue[index] = v;
});
@@ -509,6 +516,12 @@
changes.outputLabels = node.outputLabels;
node.outputLabels = newValue;
changed = true;
// trigger redraw of dirty port labels
if (node.type === "subflow") {
RED.view.redraw();
}
}
return changed;
}

View File

@@ -8,7 +8,6 @@
create: function(container) {
this.editor = buildDescriptionForm(container,node);
RED.e = this.editor;
},
resize: function(size) {
this.editor.resize();
@@ -58,11 +57,9 @@
var nodeInfoEditor = RED.editor.createEditor({
id: editorId,
mode: 'ace/mode/markdown',
value: ""
stateId: RED.editor.generateViewStateId("node", node, "nodeinfo"),
value: node.info || ""
});
if (node.info) {
nodeInfoEditor.getSession().setValue(node.info, -1);
}
node.infoEditor = nodeInfoEditor;
return nodeInfoEditor;
}

View File

@@ -55,7 +55,9 @@
}
});
}
if (!isSameObj(old_env, new_env)) {
if (!old_env && new_env.length === 0) {
delete node.env;
} else if (!isSameObj(old_env, new_env)) {
editState.changes.env = node.env;
if (new_env.length === 0) {
delete node.env;

View File

@@ -52,8 +52,6 @@
node.info = info;
}
$("#red-ui-tab-"+(node.id.replace(".","-"))).toggleClass('red-ui-workspace-disabled',!!node.disabled);
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!node.disabled);
}
}
});

View File

@@ -107,7 +107,7 @@
newValue = "";
}
}
if (node[d] != newValue) {
if (!isEqual(node[d], newValue)) {
if (node._def.defaults[d].type) {
// Change to a related config node
var configNode = RED.nodes.node(node[d]);
@@ -139,6 +139,23 @@
}
});
/**
* Compares `newValue` with `originalValue` for equality.
* @param {*} originalValue Original value
* @param {*} newValue New value
* @returns {boolean} true if originalValue equals newValue, otherwise false
*/
function isEqual(originalValue, newValue) {
try {
if(originalValue == newValue) {
return true;
}
return JSON.stringify(originalValue) === JSON.stringify(newValue);
} catch (err) {
return false;
}
}
/**
* Update the node credentials from the edit form
* @param node - the node containing the credentials

View File

@@ -21,6 +21,7 @@
var definition = {
show: function(options) {
var value = options.value;
var onCancel = options.cancel;
var onComplete = options.complete;
var type = "_text"
if ($("script[data-template-name='"+type+"']").length === 0) {
@@ -28,16 +29,16 @@
}
RED.view.state(RED.state.EDITING);
var expressionEditor;
var changeTimer;
var trayOptions = {
title: options.title,
focusElement: options.focusElement,
width: options.width||"inherit",
buttons: [
{
id: "node-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
if(onCancel) { onCancel(); }
RED.tray.close();
}
},
@@ -46,7 +47,8 @@
text: RED._("common.label.done"),
class: "primary",
click: function() {
onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition());
expressionEditor.saveView();
if (onComplete) { onComplete(expressionEditor.getValue(),expressionEditor.getCursorPosition(),expressionEditor);}
RED.tray.close();
}
}
@@ -55,31 +57,27 @@
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
var editorRow = $("#dialog-form>div.node-text-editor-row");
var height = $("#dialog-form").height();
// for (var i=0;i<rows.size();i++) {
// height -= $(rows[i]).outerHeight(true);
// }
// height -= (parseInt($("#dialog-form").css("marginTop"))+parseInt($("#dialog-form").css("marginBottom")));
$(".node-text-editor").css("height",height+"px");
expressionEditor.resize();
},
open: function(tray) {
var trayBody = tray.find('.red-ui-tray-body');
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
expressionEditor = RED.editor.createEditor({
id: 'node-input-text',
value: "",
mode:"ace/mode/"+(options.mode||"text")
value: value||"",
stateId: options.stateId,
mode:"ace/mode/"+(options.mode||"text"),
focus: true,
});
expressionEditor.getSession().setValue(value||"",-1);
if (options.cursor) {
if (options.cursor && !expressionEditor._initState) {
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
}
},
close: function() {
expressionEditor.destroy();
if (options.onclose) {
options.onclose();
}
expressionEditor.destroy();
},
show: function() {}
}

View File

@@ -0,0 +1,175 @@
RED.envVar = (function() {
function saveEnvList(list) {
const items = list.editableList("items")
const new_env = [];
items.each(function (i,el) {
var data = el.data('data');
var item;
if (data.nameField && data.valueField) {
item = {
name: data.nameField.val(),
value: data.valueField.typedInput("value"),
type: data.valueField.typedInput("type")
};
new_env.push(item);
}
});
return new_env;
}
function getGlobalConf(create) {
var gconf = null;
RED.nodes.eachConfig(function (conf) {
if (conf.type === "global-config") {
gconf = conf;
}
});
if ((gconf === null) && create) {
var cred = {
_ : {},
map: {}
};
gconf = {
id: RED.nodes.id(),
type: "global-config",
env: [],
name: "global-config",
label: "",
hasUsers: false,
users: [],
credentials: cred,
_def: RED.nodes.getType("global-config"),
};
RED.nodes.add(gconf);
}
return gconf;
}
function applyChanges(list) {
var gconf = getGlobalConf(false);
var new_env = [];
var items = list.editableList('items');
var credentials = gconf ? gconf.credentials : null;
if (!credentials) {
credentials = {
_ : {},
map: {}
};
}
items.each(function (i,el) {
var data = el.data('data');
if (data.nameField && data.valueField) {
var item = {
name: data.nameField.val(),
value: data.valueField.typedInput("value"),
type: data.valueField.typedInput("type")
};
if (item.name.trim() !== "") {
new_env.push(item);
if ((item.type === "cred") && (item.value !== "__PWRD__")) {
credentials.map[item.name] = item.value;
credentials.map["has_"+item.name] = (item.value !== "");
item.value = "__PWRD__";
}
}
}
});
if (gconf === null) {
gconf = getGlobalConf(true);
}
if ((JSON.stringify(new_env) !== JSON.stringify(gconf.env)) ||
(JSON.stringify(credentials) !== JSON.stringify(gconf.credentials))) {
gconf.env = new_env;
gconf.credentials = credentials;
RED.nodes.dirty(true);
}
}
function getSettingsPane() {
var gconf = getGlobalConf(false);
var env = gconf ? gconf.env : [];
var cred = gconf ? gconf.credentials : null;
if (!cred) {
cred = {
_ : {},
map: {}
};
}
var pane = $("<div/>", {
id: "red-ui-settings-tab-envvar",
class: "form-horizontal"
});
var content = $("<div/>", {
class: "form-row node-input-env-container-row"
}).css({
"margin": "10px"
}).appendTo(pane);
var label = $("<label></label>").css({
width: "100%"
}).appendTo(content);
$("<i/>", {
class: "fa fa-list"
}).appendTo(label);
$("<span/>").text(" "+RED._("env-var.header")).appendTo(label);
var list = $("<ol/>", {
id: "node-input-env-container"
}).appendTo(content);
var node = {
type: "",
env: env,
credentials: cred.map,
};
RED.editor.envVarList.create(list, node);
var buttons = $("<div/>").css({
"text-align": "right",
}).appendTo(content);
var revertButton = $("<button/>", {
class: "red-ui-button"
}).css({
}).text(RED._("env-var.revert")).appendTo(buttons);
var items = saveEnvList(list);
revertButton.on("click", function (ev) {
list.editableList("empty");
list.editableList("addItems", items);
});
return pane;
}
function init(done) {
if (!RED.user.hasPermission("settings.write")) {
RED.notify(RED._("user.errors.settings"),"error");
return;
}
RED.userSettings.add({
id:'envvar',
title: RED._("env-var.environment"),
get: getSettingsPane,
focus: function() {
var height = $("#red-ui-settings-tab-envvar").parent().height();
$("#node-input-env-container").editableList("height", (height -100));
},
close: function() {
var list = $("#node-input-env-container");
try {
applyChanges(list);
}
catch (e) {
console.log(e);
console.log(e.stack);
}
}
});
}
return {
init: init,
};
})();

View File

@@ -101,6 +101,7 @@ RED.group = (function() {
RED.editor.colorPicker.create({
id:"node-input-style-stroke",
value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4",
defaultValue: "#a4a4a4",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
@@ -112,6 +113,7 @@ RED.group = (function() {
RED.editor.colorPicker.create({
id:"node-input-style-fill",
value: style.fill || defaultGroupStyle.fill ||"none",
defaultValue: "none",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
@@ -129,6 +131,7 @@ RED.group = (function() {
RED.editor.colorPicker.create({
id:"node-input-style-color",
value: style.color || defaultGroupStyle.color ||"#a4a4a4",
defaultValue: "#a4a4a4",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
@@ -185,6 +188,8 @@ RED.group = (function() {
var activateMerge = false;
var activateRemove = false;
var singleGroupSelected = false;
var locked = RED.workspaces.isActiveLocked()
if (activateGroup) {
singleGroupSelected = selection.nodes.length === 1 && selection.nodes[0].type === 'group';
selection.nodes.forEach(function (n) {
@@ -199,12 +204,12 @@ RED.group = (function() {
activateMerge = (selection.nodes.length > 1);
}
}
RED.menu.setDisabled("menu-item-group-group", !activateGroup);
RED.menu.setDisabled("menu-item-group-ungroup", !activateUngroup);
RED.menu.setDisabled("menu-item-group-merge", !activateMerge);
RED.menu.setDisabled("menu-item-group-remove", !activateRemove);
RED.menu.setDisabled("menu-item-group-group", locked || !activateGroup);
RED.menu.setDisabled("menu-item-group-ungroup", locked || !activateUngroup);
RED.menu.setDisabled("menu-item-group-merge", locked || !activateMerge);
RED.menu.setDisabled("menu-item-group-remove", locked || !activateRemove);
RED.menu.setDisabled("menu-item-edit-copy-group-style", !singleGroupSelected);
RED.menu.setDisabled("menu-item-edit-paste-group-style", !activateUngroup);
RED.menu.setDisabled("menu-item-edit-paste-group-style", locked || !activateUngroup);
});
RED.actions.add("core:group-selection", function() { groupSelection() })
@@ -261,6 +266,7 @@ RED.group = (function() {
}
}
function pasteGroupStyle() {
if (RED.workspaces.isActiveLocked()) { return }
if (RED.view.state() !== RED.state.DEFAULT) { return }
if (groupStyleClipboard) {
var selection = RED.view.selection();
@@ -295,6 +301,7 @@ RED.group = (function() {
}
function groupSelection() {
if (RED.workspaces.isActiveLocked()) { return }
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
@@ -308,10 +315,12 @@ RED.group = (function() {
RED.history.push(historyEvent);
RED.view.select({nodes:[group]});
RED.nodes.dirty(true);
RED.view.focus();
}
}
}
function ungroupSelection() {
if (RED.workspaces.isActiveLocked()) { return }
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
@@ -323,9 +332,6 @@ RED.group = (function() {
groups: [ ],
dirty: RED.nodes.dirty()
}
RED.history.push(historyEvent);
groups.forEach(function(g) {
newSelection = newSelection.concat(ungroup(g))
historyEvent.groups.push(g);
@@ -333,10 +339,12 @@ RED.group = (function() {
RED.history.push(historyEvent);
RED.view.select({nodes:newSelection})
RED.nodes.dirty(true);
RED.view.focus();
}
}
function ungroup(g) {
if (RED.workspaces.isActiveLocked()) { return }
var nodes = [];
var parentGroup = RED.nodes.group(g.g);
g.nodes.forEach(function(n) {
@@ -352,8 +360,10 @@ RED.group = (function() {
}
if (n.type === 'group') {
RED.events.emit("groups:change",n)
} else {
} else if (n.type !== 'junction') {
RED.events.emit("nodes:change",n)
} else {
RED.events.emit("junctions:change",n)
}
})
RED.nodes.removeGroup(g);
@@ -361,6 +371,7 @@ RED.group = (function() {
}
function mergeSelection() {
if (RED.workspaces.isActiveLocked()) { return }
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
@@ -425,10 +436,12 @@ RED.group = (function() {
});
RED.history.push(historyEvent);
RED.nodes.dirty(true);
RED.view.focus();
}
}
function removeSelection() {
if (RED.workspaces.isActiveLocked()) { return }
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
@@ -452,9 +465,11 @@ RED.group = (function() {
}
}
RED.view.select({nodes:selection.nodes})
RED.view.focus();
}
}
function createGroup(nodes) {
if (RED.workspaces.isActiveLocked()) { return }
if (nodes.length === 0) {
return;
}
@@ -477,7 +492,7 @@ RED.group = (function() {
}
group.z = nodes[0].z;
RED.nodes.addGroup(group);
group = RED.nodes.addGroup(group);
try {
addToGroup(group,nodes);
@@ -547,8 +562,10 @@ RED.group = (function() {
group.h = Math.max(group.h,n.y+n.h/2+25-group.y);
if (n.type === 'group') {
RED.events.emit("groups:change",n)
} else {
} else if (n.type !== 'junction') {
RED.events.emit("nodes:change",n)
} else {
RED.events.emit("junctions:change",n)
}
}
}
@@ -558,6 +575,7 @@ RED.group = (function() {
markDirty(group);
}
function removeFromGroup(group, nodes, reparent) {
if (RED.workspaces.isActiveLocked()) { return }
if (!Array.isArray(nodes)) {
nodes = [nodes];
}
@@ -583,19 +601,23 @@ RED.group = (function() {
}
if (n.type === 'group') {
RED.events.emit("groups:change",n)
} else {
} else if (n.type !== 'junction') {
RED.events.emit("nodes:change",n)
} else {
RED.events.emit("junctions:change",n)
}
}
markDirty(group);
}
function getNodes(group,recursive) {
function getNodes(group,recursive,excludeGroup) {
var nodes = [];
group.nodes.forEach(function(n) {
nodes.push(n);
if (n.type !== 'group' || !excludeGroup) {
nodes.push(n);
}
if (recursive && n.type === 'group') {
nodes = nodes.concat(getNodes(n,recursive))
nodes = nodes.concat(getNodes(n,recursive,excludeGroup))
}
})
return nodes;

View File

@@ -49,15 +49,15 @@ RED.keyboard = (function() {
"]": 221,
"{": 219,// <- QWERTY specific
"}": 221 // <- QWERTY specific
}
};
var metaKeyCodes = {
16: true,
17: true,
18: true,
91: true,
93: true
}
var actionToKeyMap = {}
};
var actionToKeyMap = {};
var defaultKeyMap = {};
// FF generates some different keycodes because reasons.
@@ -65,7 +65,7 @@ RED.keyboard = (function() {
59:186,
61:187,
173:189
}
};
function migrateOldKeymap() {
// pre-0.18
@@ -80,7 +80,7 @@ RED.keyboard = (function() {
}
function getUserKey(action) {
return RED.settings.get('editor.keymap',{})[action]
return RED.settings.get('editor.keymap',{})[action];
}
function mergeKeymaps(defaultKeymap, themeKeymap) {
@@ -105,7 +105,7 @@ RED.keyboard = (function() {
scope:scope,
key:key,
user:false
})
});
}
}
}
@@ -115,13 +115,13 @@ RED.keyboard = (function() {
if (themeKeymap.hasOwnProperty(action)) {
if (!themeKeymap[action].key) {
// No key for this action - default is no keybinding
delete mergedKeymap[action]
delete mergedKeymap[action];
} else {
mergedKeymap[action] = [{
scope: themeKeymap[action].scope || "*",
key: themeKeymap[action].key,
user: false
}]
}];
if (mergedKeymap[action][0].scope === "workspace") {
mergedKeymap[action][0].scope = "red-ui-workspace";
}
@@ -179,7 +179,7 @@ RED.keyboard = (function() {
close: function() {
RED.menu.refreshShortcuts();
}
})
});
}
function revertToDefault(action) {
@@ -265,13 +265,18 @@ RED.keyboard = (function() {
if (partialState) {
partialState = null;
return resolveKeyEvent(evt);
} else if (Object.keys(handler).length > 0) {
partialState = handler;
evt.preventDefault();
return null;
} else {
return null;
}
if (Object.keys(handler).length > 0) {
// check if there's a potential combined handler initiated by this keyCode
for (let h in handler) {
if (matchHandlerToEvent(evt,handler[h]) > -1) {
partialState = handler;
evt.preventDefault();
break;
}
}
}
return null;
} else {
var depth = Infinity;
var matchedHandler;
@@ -327,7 +332,7 @@ RED.keyboard = (function() {
scope:scope,
key:key,
user:false
}
};
}
if (!ondown) {
var userAction = getUserKey(cbdown);
@@ -350,7 +355,7 @@ RED.keyboard = (function() {
}
}
} else {
keys.push([key,mod])
keys.push([key,mod]);
}
var slot = handlers;
for (i=0;i<keys.length;i++) {
@@ -373,7 +378,7 @@ RED.keyboard = (function() {
//slot[key] = {scope: scope, ondown:cbdown};
}
slot.handlers = slot.handlers || [];
slot.handlers.push({scope:scope,ondown:cbdown})
slot.handlers.push({scope:scope,ondown:cbdown});
slot.scope = scope;
slot.ondown = cbdown;
}
@@ -390,12 +395,12 @@ RED.keyboard = (function() {
if (parsedKey) {
keys.push(parsedKey);
} else {
console.log("Unrecognised key specifier:",key)
console.log("Unrecognised key specifier:",key);
return;
}
}
} else {
keys.push([key,mod])
keys.push([key,mod]);
}
var slot = handlers;
for (i=0;i<keys.length;i++) {
@@ -417,7 +422,7 @@ RED.keyboard = (function() {
}
if (typeof slot.ondown === "string") {
if (typeof modifiers === 'boolean' && modifiers) {
actionToKeyMap[slot.ondown] = {user: modifiers}
actionToKeyMap[slot.ondown] = {user: modifiers};
} else {
delete actionToKeyMap[slot.ondown];
}
@@ -433,11 +438,11 @@ RED.keyboard = (function() {
function formatKey(key,plain) {
var formattedKey = isMac?key.replace(/ctrl-?/,"&#8984;"):key;
formattedKey = isMac?formattedKey.replace(/alt-?/,"&#8997;"):key;
formattedKey = formattedKey.replace(/shift-?/,"&#8679;")
formattedKey = formattedKey.replace(/left/,"&#x2190;")
formattedKey = formattedKey.replace(/up/,"&#x2191;")
formattedKey = formattedKey.replace(/right/,"&#x2192;")
formattedKey = formattedKey.replace(/down/,"&#x2193;")
formattedKey = formattedKey.replace(/shift-?/,"&#8679;");
formattedKey = formattedKey.replace(/left/,"&#x2190;");
formattedKey = formattedKey.replace(/up/,"&#x2191;");
formattedKey = formattedKey.replace(/right/,"&#x2192;");
formattedKey = formattedKey.replace(/down/,"&#x2193;");
if (plain) {
return formattedKey;
}
@@ -461,7 +466,6 @@ RED.keyboard = (function() {
var container = $(this);
var object = container.data('data');
if (!container.hasClass('keyboard-shortcut-entry-expanded')) {
endEditShortcut();
@@ -485,7 +489,7 @@ RED.keyboard = (function() {
}
$(this).toggleClass("input-error",!valid);
okButton.attr("disabled",!valid);
})
});
var scopeSelect = $('<select><option value="*" data-i18n="keyboard.global"></option><option value="red-ui-workspace" data-i18n="keyboard.workspace"></option></select>').appendTo(scope);
scopeSelect.i18n();
@@ -495,7 +499,7 @@ RED.keyboard = (function() {
scopeSelect.val(object.scope||'*');
scopeSelect.on("change", function() {
keyInput.trigger("change");
})
});
var div = $('<div class="keyboard-shortcut-edit button-group-vertical"></div>').appendTo(scope);
var okButton = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-check"></i></button>').appendTo(div);
@@ -521,10 +525,13 @@ RED.keyboard = (function() {
id:object.id,
scope:shortcut?shortcut.scope:undefined,
key:shortcut?shortcut.key:undefined,
user:shortcut?shortcut.user:undefined
}
user:shortcut?shortcut.user:undefined,
label: object.label,
options: object.options,
};
buildShortcutRow(container,obj);
})
});
keyInput.trigger("focus");
}
@@ -559,7 +566,7 @@ RED.keyboard = (function() {
delete object.scope;
} else {
keyDiv.parent().removeClass("keyboard-shortcut-entry-unassigned");
keyDiv.append(RED.keyboard.formatKey(key))
keyDiv.append(RED.keyboard.formatKey(key));
$("<span>").text(scope).appendTo(scopeDiv);
object.key = key;
object.scope = scope;
@@ -572,7 +579,7 @@ RED.keyboard = (function() {
userKeymap[object.id] = {
scope:shortcut.scope,
key:shortcut.key
}
};
RED.settings.set('editor.keymap',userKeymap);
}
}
@@ -588,13 +595,7 @@ RED.keyboard = (function() {
var item = $('<div class="keyboard-shortcut-entry">').appendTo(container);
container.data('data',object);
var text = object.id.replace(/(^.+:([a-z]))|(-([a-z]))/g,function() {
if (arguments[5] === 0) {
return arguments[2].toUpperCase();
} else {
return " "+arguments[4].toUpperCase();
}
});
var text = object.label;
var label = $('<div>').addClass("keyboard-shortcut-entry-text").text(text).appendTo(item);
var user = $('<i class="fa fa-user"></i>').prependTo(label);
@@ -629,14 +630,15 @@ RED.keyboard = (function() {
pane.find("#red-ui-settings-tab-keyboard-filter").searchBox({
delay: 100,
change: function() {
var filterValue = $(this).val().trim();
var filterValue = $(this).val().trim().toLowerCase();
if (filterValue === "") {
shortcutList.editableList('filter', null);
} else {
filterValue = filterValue.replace(/\s/g,"");
shortcutList.editableList('filter', function(data) {
return data.id.toLowerCase().replace(/^.*:/,"").replace("-","").indexOf(filterValue) > -1;
})
var label = data.label.toLowerCase();
return label.indexOf(filterValue) > -1;
});
}
}
});
@@ -657,9 +659,9 @@ RED.keyboard = (function() {
});
var shortcuts = RED.actions.list();
shortcuts.sort(function(A,B) {
var Aid = A.id.replace(/^.*:/,"").replace(/[ -]/g,"").toLowerCase();
var Bid = B.id.replace(/^.*:/,"").replace(/[ -]/g,"").toLowerCase();
return Aid.localeCompare(Bid);
var Akey = A.label;
var Bkey = B.label;
return Akey.localeCompare(Bkey);
});
knownShortcuts = new Set();
shortcuts.forEach(function(s) {

200
packages/node_modules/@node-red/editor-client/src/js/ui/library.js vendored Executable file → Normal file
View File

@@ -363,106 +363,112 @@ RED.library = (function() {
options.onconfirm(item);
}
});
var itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
.on("click", function(evt) {
evt.preventDefault();
evt.stopPropagation();
var elementPos = menuButton.offset();
var menuOptionMenu = RED.menu.init({id:"red-ui-library-browser-menu",
options: [
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
var defaultFolderName = "new-folder";
var defaultFolderNameMatches = {};
var selected = dirList.treeList('selected');
if (!selected.children) {
selected = selected.parent;
}
var complete = function() {
selected.children.forEach(function(c) {
if (/^new-folder/.test(c.label)) {
defaultFolderNameMatches[c.label] = true
}
});
var folderIndex = 2;
while(defaultFolderNameMatches[defaultFolderName]) {
defaultFolderName = "new-folder-"+(folderIndex++)
}
selected.treeList.expand();
var input = $('<input type="text" class="red-ui-treeList-input">').val(defaultFolderName);
var newItem = {
icon: "fa fa-folder-o",
children:[],
path: selected.path,
element: input
}
var confirmAdd = function() {
var val = input.val().trim();
if (val === "") {
cancelAdd();
return;
} else {
for (var i=0;i<selected.children.length;i++) {
if (selected.children[i].label === val) {
cancelAdd();
return;
}
}
}
newItem.treeList.remove();
var finalItem = {
library: selected.library,
type: selected.type,
icon: "fa fa-folder",
children:[],
label: val,
path: newItem.path+val+"/"
}
selected.treeList.addChild(finalItem,true);
}
var cancelAdd = function() {
newItem.treeList.remove();
}
input.on('keydown', function(evt) {
evt.stopPropagation();
if (evt.keyCode === 13) {
confirmAdd();
} else if (evt.keyCode === 27) {
cancelAdd();
}
})
input.on("blur", function() {
confirmAdd();
})
selected.treeList.addChild(newItem);
setTimeout(function() {
input.trigger("focus");
input.select();
},400);
}
selected.treeList.expand(complete);
} },
// null,
// {id:"red-ui-library-browser-menu-rename",label:"Rename", onselect: function() {} },
// {id:"red-ui-library-browser-menu-delete",label:"Delete", onselect: function() {} }
]
}).on('mouseleave', function(){ $(this).remove(); dirList.focus() })
.on('mouseup', function() { var self = $(this);self.hide(); dirList.focus(); setTimeout(function() { self.remove() },100)})
.appendTo("body");
menuOptionMenu.css({
position: "absolute",
top: elementPos.top+"px",
left: (elementPos.left - menuOptionMenu.width() + 20)+"px"
}).show();
}).appendTo(itemTools);
var itemTools = null;
if (options.folderTools) {
dirList.on('treelistselect', function(event, item) {
if (item.writable !== false && item.treeList) {
if (itemTools) {
itemTools.remove();
}
itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
.on("click", function(evt) {
evt.preventDefault();
evt.stopPropagation();
var elementPos = menuButton.offset();
var menuOptionMenu
= RED.menu.init({id:"red-ui-library-browser-menu",
options: [
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
var defaultFolderName = "new-folder";
var defaultFolderNameMatches = {};
var selected = dirList.treeList('selected');
if (!selected.children) {
selected = selected.parent;
}
var complete = function() {
selected.children.forEach(function(c) {
if (/^new-folder/.test(c.label)) {
defaultFolderNameMatches[c.label] = true
}
});
var folderIndex = 2;
while(defaultFolderNameMatches[defaultFolderName]) {
defaultFolderName = "new-folder-"+(folderIndex++)
}
selected.treeList.expand();
var input = $('<input type="text" class="red-ui-treeList-input">').val(defaultFolderName);
var newItem = {
icon: "fa fa-folder-o",
children:[],
path: selected.path,
element: input
}
var confirmAdd = function() {
var val = input.val().trim();
if (val === "") {
cancelAdd();
return;
} else {
for (var i=0;i<selected.children.length;i++) {
if (selected.children[i].label === val) {
cancelAdd();
return;
}
}
}
newItem.treeList.remove();
var finalItem = {
library: selected.library,
type: selected.type,
icon: "fa fa-folder",
children:[],
label: val,
path: newItem.path+val+"/"
}
selected.treeList.addChild(finalItem,true);
}
var cancelAdd = function() {
newItem.treeList.remove();
}
input.on('keydown', function(evt) {
evt.stopPropagation();
if (evt.keyCode === 13) {
confirmAdd();
} else if (evt.keyCode === 27) {
cancelAdd();
}
})
input.on("blur", function() {
confirmAdd();
})
selected.treeList.addChild(newItem);
setTimeout(function() {
input.trigger("focus");
input.select();
},400);
}
selected.treeList.expand(complete);
} },
// null,
// {id:"red-ui-library-browser-menu-rename",label:"Rename", onselect: function() {} },
// {id:"red-ui-library-browser-menu-delete",label:"Delete", onselect: function() {} }
]
}).on('mouseleave', function(){ $(this).remove(); dirList.focus() })
.on('mouseup', function() { var self = $(this);self.hide(); dirList.focus(); setTimeout(function() { self.remove() },100)})
.appendTo("body");
menuOptionMenu.css({
position: "absolute",
top: elementPos.top+"px",
left: (elementPos.left - menuOptionMenu.width() + 20)+"px"
}).show();
}).appendTo(itemTools);
itemTools.appendTo(item.treeList.label);
}
});

View File

@@ -0,0 +1,46 @@
// Mermaid diagram stub library for on-demand dynamic loading
// Will be overwritten after script loading by $.getScript
var mermaid = (function () {
var enabled /* = undefined */;
var initializing = false;
var initCalled = false;
function initialize(opt) {
if (enabled === undefined) {
if (RED.settings.markdownEditor &&
RED.settings.markdownEditor.mermaid) {
enabled = RED.settings.markdownEditor.mermaid.enabled;
}
else {
enabled = true;
}
}
if (enabled) {
initializing = true;
$.getScript("vendor/mermaid/mermaid.min.js",
function (data, stat, jqxhr) {
$(".mermaid").show();
// invoke loaded mermaid API
initializing = false;
mermaid.initialize(opt);
if (initCalled) {
mermaid.init();
initCalled = false;
}
});
}
}
function init() {
if (initializing) {
$(".mermaid").hide();
initCalled = true;
}
}
return {
initialize: initialize,
init: init,
};
})();

191
packages/node_modules/@node-red/editor-client/src/js/ui/palette.js vendored Executable file → Normal file
View File

@@ -175,9 +175,19 @@ RED.palette = (function() {
$('<button type="button" onclick="RED.workspaces.show(\''+type.substring(8).replace(/'/g,"\\'")+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-pencil"></i></button>').appendTo(popOverContent)
}
var safeType = type.replace(/'/g,"\\'");
const safeType = type.replace(/'/g,"\\'");
const wrapStr = function (str) {
if(str.indexOf(' ') >= 0) {
return '"' + str + '"'
}
return str
}
$('<button type="button" onclick="RED.search.show(\'type:'+safeType+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-search"></i></button>').appendTo(popOverContent)
$('<button type="button"; return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-search"></i></button>')
.appendTo(popOverContent)
.on('click', function() {
RED.search.show('type:' + wrapStr(safeType))
})
$('<button type="button" onclick="RED.sidebar.help.show(\''+safeType+'\'); return false;" class="red-ui-button red-ui-button-small" style="float: right; margin-left: 5px;"><i class="fa fa-book"></i></button>').appendTo(popOverContent)
$('<p>',{style:"font-size: 0.8em"}).text(metaData).appendTo(popOverContent);
@@ -208,7 +218,7 @@ RED.palette = (function() {
}
function escapeCategory(category) {
return category.replace(/[ /.]/g,"_");
return category.replace(/[\x00-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]/g,"_");
}
function addNodeType(nt,def) {
if (getPaletteNode(nt).length) {
@@ -224,14 +234,7 @@ RED.palette = (function() {
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
var label = nt;///^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1];
if (typeof def.paletteLabel !== "undefined") {
try {
label = (typeof def.paletteLabel === "function" ? def.paletteLabel.call(def) : def.paletteLabel)||"";
} catch(err) {
console.log("Definition error: "+nt+".paletteLabel",err);
}
}
var label = RED.utils.getPaletteLabel(nt, def);///^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1];
$('<div/>', {
class: "red-ui-palette-label"+(((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-label-right" : "")
@@ -289,6 +292,7 @@ RED.palette = (function() {
var hoverGroup;
var paletteWidth;
var paletteTop;
var dropEnabled;
$(d).draggable({
helper: 'clone',
appendTo: '#red-ui-editor',
@@ -296,6 +300,7 @@ RED.palette = (function() {
revertDuration: 200,
containment:'#red-ui-main-container',
start: function() {
dropEnabled = !(RED.nodes.workspace(RED.workspaces.active())?.locked);
paletteWidth = $("#red-ui-palette").width();
paletteTop = $("#red-ui-palette").parent().position().top + $("#red-ui-palette-container").position().top;
hoverGroup = null;
@@ -306,96 +311,100 @@ RED.palette = (function() {
RED.view.focus();
},
stop: function() {
d3.select('.red-ui-flow-link-splice').classed('red-ui-flow-link-splice',false);
if (hoverGroup) {
document.getElementById("group_select_"+hoverGroup.id).classList.remove("red-ui-flow-group-hovered");
if (dropEnabled) {
d3.select('.red-ui-flow-link-splice').classed('red-ui-flow-link-splice',false);
if (hoverGroup) {
document.getElementById("group_select_"+hoverGroup.id).classList.remove("red-ui-flow-group-hovered");
}
if (activeGroup) {
document.getElementById("group_select_"+activeGroup.id).classList.remove("red-ui-flow-group-active-hovered");
}
if (spliceTimer) { clearTimeout(spliceTimer); spliceTimer = null; }
if (groupTimer) { clearTimeout(groupTimer); groupTimer = null; }
}
if (activeGroup) {
document.getElementById("group_select_"+activeGroup.id).classList.remove("red-ui-flow-group-active-hovered");
}
if (spliceTimer) { clearTimeout(spliceTimer); spliceTimer = null; }
if (groupTimer) { clearTimeout(groupTimer); groupTimer = null; }
},
drag: function(e,ui) {
var paletteNode = getPaletteNode(nt);
ui.originalPosition.left = paletteNode.offset().left;
mouseX = ui.position.left - paletteWidth + (ui.helper.width()/2) + chart.scrollLeft();
mouseY = ui.position.top - paletteTop + (ui.helper.height()/2) + chart.scrollTop() + 10;
if (!groupTimer) {
groupTimer = setTimeout(function() {
var mx = mouseX / RED.view.scale();
var my = mouseY / RED.view.scale();
var group = RED.view.getGroupAtPoint(mx,my);
if (group !== hoverGroup) {
if (hoverGroup) {
document.getElementById("group_select_"+hoverGroup.id).classList.remove("red-ui-flow-group-hovered");
}
if (group) {
document.getElementById("group_select_"+group.id).classList.add("red-ui-flow-group-hovered");
}
hoverGroup = group;
if (hoverGroup) {
$(ui.helper).data('group',hoverGroup);
} else {
$(ui.helper).removeData('group');
}
}
groupTimer = null;
},200)
}
if (def.inputs > 0 && def.outputs > 0) {
if (!spliceTimer) {
spliceTimer = setTimeout(function() {
var nodes = [];
var bestDistance = Infinity;
var bestLink = null;
if (chartSVG.getIntersectionList) {
var svgRect = chartSVG.createSVGRect();
svgRect.x = mouseX;
svgRect.y = mouseY;
svgRect.width = 1;
svgRect.height = 1;
nodes = chartSVG.getIntersectionList(svgRect,chartSVG);
} else {
// Firefox doesn't do getIntersectionList and that
// makes us sad
nodes = RED.view.getLinksAtPoint(mouseX,mouseY);
}
if (dropEnabled) {
mouseX = ui.position.left - paletteWidth + (ui.helper.width()/2) + chart.scrollLeft();
mouseY = ui.position.top - paletteTop + (ui.helper.height()/2) + chart.scrollTop() + 10;
if (!groupTimer) {
groupTimer = setTimeout(function() {
var mx = mouseX / RED.view.scale();
var my = mouseY / RED.view.scale();
for (var i=0;i<nodes.length;i++) {
var node = d3.select(nodes[i]);
if (node.classed('red-ui-flow-link-background') && !node.classed('red-ui-flow-link-link')) {
var length = nodes[i].getTotalLength();
for (var j=0;j<length;j+=10) {
var p = nodes[i].getPointAtLength(j);
var d2 = ((p.x-mx)*(p.x-mx))+((p.y-my)*(p.y-my));
if (d2 < 200 && d2 < bestDistance) {
bestDistance = d2;
bestLink = nodes[i];
var group = RED.view.getGroupAtPoint(mx,my);
if (group !== hoverGroup) {
if (hoverGroup) {
document.getElementById("group_select_"+hoverGroup.id).classList.remove("red-ui-flow-group-hovered");
}
if (group) {
document.getElementById("group_select_"+group.id).classList.add("red-ui-flow-group-hovered");
}
hoverGroup = group;
if (hoverGroup) {
$(ui.helper).data('group',hoverGroup);
} else {
$(ui.helper).removeData('group');
}
}
groupTimer = null;
},200)
}
if (def.inputs > 0 && def.outputs > 0) {
if (!spliceTimer) {
spliceTimer = setTimeout(function() {
var nodes = [];
var bestDistance = Infinity;
var bestLink = null;
if (chartSVG.getIntersectionList) {
var svgRect = chartSVG.createSVGRect();
svgRect.x = mouseX;
svgRect.y = mouseY;
svgRect.width = 1;
svgRect.height = 1;
nodes = chartSVG.getIntersectionList(svgRect,chartSVG);
} else {
// Firefox doesn't do getIntersectionList and that
// makes us sad
nodes = RED.view.getLinksAtPoint(mouseX,mouseY);
}
var mx = mouseX / RED.view.scale();
var my = mouseY / RED.view.scale();
for (var i=0;i<nodes.length;i++) {
var node = d3.select(nodes[i]);
if (node.classed('red-ui-flow-link-background') && !node.classed('red-ui-flow-link-link')) {
var length = nodes[i].getTotalLength();
for (var j=0;j<length;j+=10) {
var p = nodes[i].getPointAtLength(j);
var d2 = ((p.x-mx)*(p.x-mx))+((p.y-my)*(p.y-my));
if (d2 < 200 && d2 < bestDistance) {
bestDistance = d2;
bestLink = nodes[i];
}
}
}
}
}
if (activeSpliceLink && activeSpliceLink !== bestLink) {
d3.select(activeSpliceLink.parentNode).classed('red-ui-flow-link-splice',false);
}
if (bestLink) {
d3.select(bestLink.parentNode).classed('red-ui-flow-link-splice',true)
} else {
d3.select('.red-ui-flow-link-splice').classed('red-ui-flow-link-splice',false);
}
if (activeSpliceLink !== bestLink) {
if (bestLink) {
$(ui.helper).data('splice',d3.select(bestLink).data()[0]);
} else {
$(ui.helper).removeData('splice');
if (activeSpliceLink && activeSpliceLink !== bestLink) {
d3.select(activeSpliceLink.parentNode).classed('red-ui-flow-link-splice',false);
}
}
activeSpliceLink = bestLink;
spliceTimer = null;
},200);
if (bestLink) {
d3.select(bestLink.parentNode).classed('red-ui-flow-link-splice',true)
} else {
d3.select('.red-ui-flow-link-splice').classed('red-ui-flow-link-splice',false);
}
if (activeSpliceLink !== bestLink) {
if (bestLink) {
$(ui.helper).data('splice',d3.select(bestLink).data()[0]);
} else {
$(ui.helper).removeData('splice');
}
}
activeSpliceLink = bestLink;
spliceTimer = null;
},200);
}
}
}
}
@@ -429,6 +438,7 @@ RED.palette = (function() {
categoryNode.find(".red-ui-palette-content").slideToggle();
categoryNode.find("i").toggleClass("expanded");
}
categoryNode.hide();
}
}
@@ -507,6 +517,7 @@ RED.palette = (function() {
currentCategoryNode.find(".red-ui-palette-content").slideToggle();
currentCategoryNode.find("i").toggleClass("expanded");
}
currentCategoryNode.hide();
}
}

View File

@@ -120,6 +120,7 @@ RED.projects.settings = (function() {
title: RED._('sidebar.project.editDescription'),
header: $('<span><i class="fa fa-book"></i> README.md</span>'),
value: activeProject.description,
stateId: "sidebar.project.editDescription",
complete: function(v) {
container.empty();
var spinner = utils.addSpinnerOverlay(container);

View File

@@ -545,7 +545,7 @@ RED.projects = (function() {
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.clone-project.ssh-key-desc")+'</div>').appendTo(sshwarningRow);
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
e.preventDefault();
dialog.dialog( "close" );
RED.userSettings.show('gitconfig');
@@ -1171,11 +1171,11 @@ RED.projects = (function() {
row = $('<div class="form-row button-group"></div>').appendTo(container);
var openProject = $('<button data-type="open" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
// var createAsCopy = $('<button data-type="copy" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
// var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
var openProject = $('<button type="button" data-type="open" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
var createAsEmpty = $('<button type="button" data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
// var createAsCopy = $('<button type="button" data-type="copy" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
var createAsClone = $('<button type="button" data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
// var createAsClone = $('<button type="button" data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
row.find(".red-ui-projects-dialog-screen-create-type").on("click", function(evt) {
evt.preventDefault();
container.find(".red-ui-projects-dialog-screen-create-type").removeClass('selected');
@@ -1212,6 +1212,9 @@ RED.projects = (function() {
}
}).appendTo(row);
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-open"></div>').hide().appendTo(container);
$('<span style="display: flex; align-items: center;"><input style="padding:0; margin: 0 5px 0 0" checked type="checkbox" id="red-ui-projects-dialog-screen-clear-context"> <label for="red-ui-projects-dialog-screen-clear-context" style="padding:0; margin: 0"> <span data-i18n="projects.create.clearContext"></span></label></span>').appendTo(row).i18n();
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-empty red-ui-projects-dialog-screen-create-row-clone"></div>').appendTo(container);
$('<label for="red-ui-projects-dialog-screen-create-project-name">'+RED._("projects.create.project-name")+'</label>').appendTo(row);
@@ -1268,7 +1271,7 @@ RED.projects = (function() {
var credentialsLeftBox = $('<div class="red-ui-projects-dialog-credentials-box-left">').appendTo(credentialsBox);
var credentialsEnabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-enabled"></div>').appendTo(credentialsLeftBox);
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="enabled"> <i class="fa fa-lock"></i> <span>'+RED._("projects.encryption-config.enable")+'</span></label>').appendTo(credentialsEnabledBox);
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="enabled" checked> <i class="fa fa-lock"></i> <span>'+RED._("projects.encryption-config.enable")+'</span></label>').appendTo(credentialsEnabledBox);
var credentialsDisabledBox = $('<div class="form-row red-ui-projects-dialog-credentials-box-disabled disabled"></div>').appendTo(credentialsLeftBox);
$('<label class="red-ui-projects-edit-form-inline-label"><input type="radio" name="projects-encryption-type" value="disabled"> <i class="fa fa-unlock"></i> <span>'+RED._("projects.encryption-config.disable")+'</span></label>').appendTo(credentialsDisabledBox);
@@ -1394,7 +1397,7 @@ RED.projects = (function() {
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.create.desc2")+'</div>').appendTo(sshwarningRow);
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
e.preventDefault();
$('#red-ui-projects-dialog-cancel').trigger("click");
RED.userSettings.show('gitconfig');
@@ -1501,7 +1504,8 @@ RED.projects = (function() {
};
}
} else if (projectType === 'open') {
return switchProject(selectedProject.name,function(err,data) {
var clearContext = $("#red-ui-projects-dialog-screen-clear-context").prop("checked")
return switchProject(selectedProject.name, clearContext, function(err,data) {
if (err) {
if (err.code !== 'credentials_load_failed') {
console.log(RED._("projects.create.unexpected_error"),err)
@@ -1595,7 +1599,7 @@ RED.projects = (function() {
}
}
function switchProject(name,done) {
function switchProject(name,clearContext,done) {
RED.deploy.setDeployInflight(true);
RED.projects.settings.switchProject(name);
sendRequest({
@@ -1614,7 +1618,7 @@ RED.projects = (function() {
'*': done
},
}
},{active:true}).then(function() {
},{active:true, clearContext:clearContext}).then(function() {
dialog.dialog( "close" );
RED.events.emit("project:change", {name:name});
}).always(function() {
@@ -1627,14 +1631,14 @@ RED.projects = (function() {
function deleteProject(row,name,done) {
var cover = $('<div class="red-ui-projects-dialog-project-list-entry-delete-confirm"></div>').on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
$('<span>').text(RED._("projects.delete.confirm")).appendTo(cover);
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("common.label.cancel")+'</button>')
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button">'+RED._("common.label.cancel")+'</button>')
.appendTo(cover)
.on("click", function(e) {
e.stopPropagation();
cover.remove();
done(true);
});
$('<button class="red-ui-button red-ui-projects-dialog-button primary">'+RED._("common.label.delete")+'</button>')
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button primary">'+RED._("common.label.delete")+'</button>')
.appendTo(cover)
.on("click", function(e) {
e.stopPropagation();
@@ -1687,7 +1691,7 @@ RED.projects = (function() {
dialogHeight = 590 - (750 - winHeight);
}
$(".red-ui-projects-dialog-box").height(dialogHeight);
$(".red-ui-projects-dialog-project-list-inner-container").height(Math.max(500,dialogHeight) - 180);
$(".red-ui-projects-dialog-project-list-inner-container").height(Math.max(500,dialogHeight) - 210);
dialog.dialog('option','title',screen.title||"");
dialog.dialog("open");
}
@@ -1818,7 +1822,7 @@ RED.projects = (function() {
header.addClass("selectable");
var tools = $('<div class="red-ui-projects-dialog-project-list-entry-tools"></div>').appendTo(header);
$('<button class="red-ui-button red-ui-projects-dialog-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
$('<button type="button" class="red-ui-button red-ui-projects-dialog-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
.appendTo(tools)
.on("click", function(e) {
e.stopPropagation();

View File

@@ -22,8 +22,11 @@ RED.search = (function() {
var selected = -1;
var visible = false;
var searchHistory = [];
var index = {};
var currentResults = [];
var activeResults = [];
var currentIndex = 0;
var previousActiveElement;
function indexProperty(node,label,property) {
@@ -52,10 +55,22 @@ RED.search = (function() {
}
l = l||n.label||n.name||n.id||"";
var properties = ['id','type','name','label','info'];
if (n._def && n._def.defaults) {
properties = properties.concat(Object.keys(n._def.defaults));
const node_def = n && n._def;
if (node_def) {
if (node_def.defaults) {
properties = properties.concat(Object.keys(node_def.defaults));
}
if (n.type !== "group" && node_def.paletteLabel && node_def.paletteLabel !== node_def.type) {
try {
const label = ("" + (typeof node_def.paletteLabel === "function" ? node_def.paletteLabel.call(node_def) : node_def.paletteLabel)).toLowerCase();
if(label && label !== (""+node_def.type).toLowerCase()) {
indexProperty(n, l, label);
}
} catch(err) {
console.warn(`error indexing ${l}`, err);
}
}
}
for (var i=0;i<properties.length;i++) {
if (n.hasOwnProperty(properties[i])) {
@@ -91,44 +106,62 @@ RED.search = (function() {
return val;
}
function search(val) {
var results = [];
var keys = [];
var typeFilter;
var m = /(?:^| )type:([^ ]+)/.exec(val);
if (m) {
val = val.replace(/(?:^| )type:[^ ]+/,"");
typeFilter = m[1];
function extractType(val, flags) {
// extracts: type:XYZ & type:"X Y Z"
const regEx = /(?:type):\s*(?:"([^"]+)"|([^" ]+))/;
let m
while ((m = regEx.exec(val)) !== null) {
// avoid infinite loops with zero-width matches
if (m.index === regEx.lastIndex) {
regEx.lastIndex++;
}
val = val.replace(m[0]," ").trim()
const flag = m[2] || m[1] // quoted entries in capture group 1, unquoted in capture group 2
flags.type = flags.type || [];
flags.type.push(flag);
}
var flags = {};
return val;
}
function search(val) {
const results = [];
const flags = {};
val = extractFlag(val,"invalid",flags);
val = extractFlag(val,"unused",flags);
val = extractFlag(val,"config",flags);
val = extractFlag(val,"subflow",flags);
val = extractFlag(val,"hidden",flags);
// uses:<node-id>
val = extractValue(val,"uses",flags);
var hasFlags = Object.keys(flags).length > 0;
val = extractFlag(val,"modified",flags);
val = extractValue(val,"flow",flags);// flow:current or flow:<flow-id>
val = extractValue(val,"uses",flags);// uses:<node-id>
val = extractType(val,flags);// type:<node-type>
val = val.trim();
if (val.length > 0 || typeFilter || hasFlags) {
const hasFlags = Object.keys(flags).length > 0;
const hasTypeFilter = flags.type && flags.type.length > 0
if (flags.flow && flags.flow.indexOf("current") >= 0) {
let idx = flags.flow.indexOf("current");
flags.flow[idx] = RED.workspaces.active();//convert 'current' to active flow ID
}
if (flags.flow && flags.flow.length) {
flags.flow = [ ...new Set(flags.flow) ]; //deduplicate
}
if (val.length > 0 || hasFlags) {
val = val.toLowerCase();
var i;
var j;
var list = [];
var nodes = {};
let i;
let j;
let list = [];
const nodes = {};
let keys = [];
if (flags.uses) {
keys = flags.uses;
} else {
keys = Object.keys(index);
}
for (i=0;i<keys.length;i++) {
var key = keys[i];
var kpos = keys[i].indexOf(val);
if (kpos > -1) {
var ids = Object.keys(index[key]);
const key = keys[i];
const kpos = val ? keys[i].indexOf(val) : -1;
if (kpos > -1 || (val === "" && hasFlags)) {
const ids = Object.keys(index[key]||{});
for (j=0;j<ids.length;j++) {
var node = index[key][ids[j]];
var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
@@ -136,7 +169,7 @@ RED.search = (function() {
continue;
}
if (flags.hasOwnProperty("invalid")) {
var nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
const nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
if (flags.invalid === nodeIsValid) {
continue;
}
@@ -151,6 +184,11 @@ RED.search = (function() {
continue;
}
}
if (flags.hasOwnProperty("modified")) {
if (!node.node.changed && !node.node.moved) {
continue;
}
}
if (flags.hasOwnProperty("hidden")) {
// Only tabs can be hidden
if (node.node.type !== 'tab') {
@@ -161,18 +199,27 @@ RED.search = (function() {
}
}
if (flags.hasOwnProperty("unused")) {
var isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
(isConfigNode && node.node.users.length === 0)
const isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
(isConfigNode && node.node.users.length === 0 && node.node._def.hasUsers !== false)
if (flags.unused !== isUnused) {
continue;
}
}
if (!typeFilter || node.node.type === typeFilter) {
nodes[node.node.id] = nodes[node.node.id] = {
if (flags.hasOwnProperty("flow")) {
if (flags.flow.indexOf(node.node.z || node.node.id) < 0) {
continue;
}
}
let typeIndex = -1
if(hasTypeFilter) {
typeIndex = flags.type.indexOf(node.node.type)
}
if (!hasTypeFilter || typeIndex > -1) {
nodes[node.node.id] = nodes[node.node.id] || {
node: node.node,
label: node.label
};
nodes[node.node.id].index = Math.min(nodes[node.node.id].index||Infinity,kpos);
nodes[node.node.id].index = Math.min(nodes[node.node.id].index || Infinity, typeIndex > -1 ? typeIndex : kpos);
}
}
}
@@ -205,6 +252,20 @@ RED.search = (function() {
}
}
function populateSearchHistory() {
if (searchHistory.length > 0) {
searchResults.editableList('addItem',{
historyHeader: true
});
searchHistory.forEach(function(entry) {
searchResults.editableList('addItem',{
history: true,
value: entry
});
})
}
}
function createDialog() {
dialog = $("<div>",{id:"red-ui-search",class:"red-ui-search"}).appendTo("#red-ui-main-container");
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
@@ -213,9 +274,14 @@ RED.search = (function() {
change: function() {
searchResults.editableList('empty');
selected = -1;
currentResults = search($(this).val());
var value = $(this).val();
if (value === "") {
populateSearchHistory();
return;
}
currentResults = search(value);
if (currentResults.length > 0) {
for (i=0;i<Math.min(currentResults.length,25);i++) {
for (let i=0;i<Math.min(currentResults.length,25);i++) {
searchResults.editableList('addItem',currentResults[i])
}
if (currentResults.length > 25) {
@@ -229,9 +295,8 @@ RED.search = (function() {
} else {
searchResults.editableList('addItem',{});
}
}
},
options: getSearchOptions()
});
var copySearchContainer = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-caret-right"></button>').appendTo(searchDiv).on('click', function(evt) {
evt.preventDefault();
@@ -285,9 +350,15 @@ RED.search = (function() {
})
}
}
} else {
} if ($(children[selected]).hasClass("red-ui-search-history")) {
var object = $(children[selected]).find(".red-ui-editableList-item-content").data('data');
if (object) {
searchInput.searchBox('value',object.value)
}
} else if (!$(children[selected]).hasClass("red-ui-search-historyHeader")) {
if (currentResults.length > 0) {
reveal(currentResults[Math.max(0,selected)].node);
currentIndex = Math.max(0,selected);
reveal(currentResults[currentIndex].node);
}
}
}
@@ -301,7 +372,32 @@ RED.search = (function() {
addItem: function(container,i,object) {
var node = object.node;
var div;
if (object.more) {
if (object.historyHeader) {
container.parent().addClass("red-ui-search-historyHeader")
$('<div>',{class:"red-ui-search-empty"}).text(RED._("search.history")).appendTo(container);
$('<button type="button" class="red-ui-button red-ui-button-small"></button>').text(RED._("search.clear")).appendTo(container).on("click", function(evt) {
evt.preventDefault();
searchHistory = [];
searchResults.editableList('empty');
});
} else if (object.history) {
container.parent().addClass("red-ui-search-history")
div = $('<a>',{href:'#',class:"red-ui-search-result"}).appendTo(container);
div.text(object.value);
div.on("click", function(evt) {
evt.preventDefault();
searchInput.searchBox('value',object.value)
searchInput.focus();
})
$('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-remove"></i></button>').appendTo(container).on("click", function(evt) {
evt.preventDefault();
var index = searchHistory.indexOf(object.value);
searchHistory.splice(index,1);
searchResults.editableList('removeItem', object);
});
} else if (object.more) {
container.parent().addClass("red-ui-search-more")
div = $('<a>',{href:'#',class:"red-ui-search-result red-ui-search-empty"}).appendTo(container);
div.text(RED._("palette.editor.more",{count:object.more.results.length-object.more.start}));
@@ -346,6 +442,7 @@ RED.search = (function() {
div.on("click", function(evt) {
evt.preventDefault();
currentIndex = i;
reveal(node);
});
}
@@ -356,12 +453,64 @@ RED.search = (function() {
}
function reveal(node) {
hide();
var searchVal = searchInput.val();
var existingIndex = searchHistory.indexOf(searchVal);
if (existingIndex > -1) {
searchHistory.splice(existingIndex,1);
}
searchHistory.unshift(searchVal);
$("#red-ui-view-searchtools-search").data("term", searchVal);
activeResults = Object.assign([], currentResults);
hide(null, activeResults.length > 0);
RED.view.reveal(node.id);
}
function revealPrev() {
if (disabled) {
updateSearchToolbar();
return;
}
if (!searchResults || !activeResults.length) {
show();
return;
}
if (currentIndex > 0) {
currentIndex--;
} else {
currentIndex = activeResults.length - 1;
}
const n = activeResults[currentIndex];
if (n && n.node && n.node.id) {
RED.view.reveal(n.node.id);
$("#red-ui-view-searchtools-prev").trigger("focus");
}
updateSearchToolbar();
}
function revealNext() {
if (disabled) {
updateSearchToolbar();
return;
}
if (!searchResults || !activeResults.length) {
show();
return;
}
if (currentIndex < activeResults.length - 1) {
currentIndex++
} else {
currentIndex = 0;
}
const n = activeResults[currentIndex];
if (n && n.node && n.node.id) {
RED.view.reveal(n.node.id);
$("#red-ui-view-searchtools-next").trigger("focus");
}
updateSearchToolbar();
}
function show(v) {
if (disabled) {
updateSearchToolbar();
return;
}
if (!visible) {
@@ -374,16 +523,21 @@ RED.search = (function() {
if (dialog === null) {
createDialog();
} else {
searchResults.editableList('empty');
}
dialog.slideDown(300);
searchInput.searchBox('value',v)
if (!v || v === "") {
populateSearchHistory();
}
RED.events.emit("search:open");
visible = true;
}
searchInput.trigger("focus");
}
function hide() {
function hide(el, keepSearchToolbar) {
if (visible) {
visible = false;
$("#red-ui-header-shade").hide();
@@ -397,13 +551,37 @@ RED.search = (function() {
});
}
RED.events.emit("search:close");
if (previousActiveElement) {
if (previousActiveElement && (!keepSearchToolbar || !activeResults.length)) {
$(previousActiveElement).trigger("focus");
previousActiveElement = null;
}
previousActiveElement = null;
}
if(!keepSearchToolbar) {
clearActiveSearch();
}
updateSearchToolbar();
if(keepSearchToolbar && activeResults.length) {
$("#red-ui-view-searchtools-next").trigger("focus");
}
}
function updateSearchToolbar() {
if (!disabled && currentIndex >= 0 && activeResults && activeResults.length) {
let term = $("#red-ui-view-searchtools-search").data("term") || "";
if (term.length > 16) {
term = term.substring(0, 12) + "..."
}
const i18nSearchCounterData = {
term: term,
result: (currentIndex + 1),
count: activeResults.length
}
$("#red-ui-view-searchtools-counter").text(RED._('actions.search-counter', i18nSearchCounterData));
$("#view-search-tools > :not(:first-child)").show(); //show other tools
} else {
clearActiveSearch();
$("#view-search-tools > :not(:first-child)").hide(); //hide all but search button
}
}
function clearIndex() {
index = {};
}
@@ -425,9 +603,29 @@ RED.search = (function() {
addItemToIndex(item);
}
function clearActiveSearch() {
activeResults = [];
currentIndex = 0;
$("#red-ui-view-searchtools-search").data("term", "");
}
function getSearchOptions() {
return [
{label:RED._("search.options.configNodes"), value:"is:config"},
{label:RED._("search.options.unusedConfigNodes"), value:"is:config is:unused"},
{label:RED._("search.options.modifiedNodes"), value:"is:modified"},
{label:RED._("search.options.invalidNodes"), value: "is:invalid"},
{label:RED._("search.options.uknownNodes"), value: "type:unknown"},
{label:RED._("search.options.unusedSubflows"), value:"is:subflow is:unused"},
{label:RED._("search.options.hiddenFlows"), value:"is:hidden"},
{label:RED._("search.options.thisFlow"), value:"flow:current"},
]
}
function init() {
RED.actions.add("core:search",show);
RED.actions.add("core:search-previous",revealPrev);
RED.actions.add("core:search-next",revealNext);
RED.events.on("editor:open",function() { disabled = true; });
RED.events.on("editor:close",function() { disabled = false; });
@@ -438,11 +636,21 @@ RED.search = (function() {
RED.keyboard.add("red-ui-search","escape",hide);
RED.keyboard.add("view-search-tools","escape",function() {
clearActiveSearch();
updateSearchToolbar();
});
$("#red-ui-header-shade").on('mousedown',hide);
$("#red-ui-editor-shade").on('mousedown',hide);
$("#red-ui-palette-shade").on('mousedown',hide);
$("#red-ui-sidebar-shade").on('mousedown',hide);
$("#red-ui-view-searchtools-close").on("click", function close() {
clearActiveSearch();
updateSearchToolbar();
});
$("#red-ui-view-searchtools-close").trigger("click");
RED.events.on("workspace:clear", clearIndex);
@@ -468,7 +676,8 @@ RED.search = (function() {
init: init,
show: show,
hide: hide,
search: search
search: search,
getSearchOptions: getSearchOptions
};
})();

View File

@@ -19,6 +19,15 @@ RED.sidebar = (function() {
var sidebar_tabs;
var knownTabs = {};
// We store the current sidebar tab id in localStorage as 'last-sidebar-tab'
// This is restored when the editor is reloaded.
// We use sidebar_tabs.onchange to update localStorage. However that will
// also get triggered when the first tab gets added to the tabs - typically
// the 'info' tab. So we use the following variable to store the retrieved
// value from localStorage before we start adding the actual tabs
var lastSessionSelectedTab = null;
function addTab(title,content,closeable,visible) {
var options;
if (typeof title === "string") {
@@ -194,16 +203,16 @@ RED.sidebar = (function() {
RED.events.emit("sidebar:resize");
}
function showSidebar(id) {
function showSidebar(id, skipShowSidebar) {
if (id === ":first") {
id = RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])[0]
id = lastSessionSelectedTab || RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])[0]
}
if (id) {
if (!containsTab(id) && knownTabs[id]) {
sidebar_tabs.addTab(knownTabs[id]);
}
sidebar_tabs.activateTab(id);
if (!RED.menu.isSelected("menu-item-sidebar")) {
if (!skipShowSidebar && !RED.menu.isSelected("menu-item-sidebar")) {
RED.menu.setSelected("menu-item-sidebar",true);
}
}
@@ -227,6 +236,7 @@ RED.sidebar = (function() {
if (tab.toolbar) {
$(tab.toolbar).show();
}
RED.settings.setLocal("last-sidebar-tab", tab.id)
},
onremove: function(tab) {
$(tab.wrapper).hide();
@@ -255,7 +265,9 @@ RED.sidebar = (function() {
}
});
RED.popover.tooltip($("#red-ui-sidebar-separator").find(".red-ui-sidebar-control-right"),RED._("keyboard.toggleSidebar"),"core:toggle-sidebar");
showSidebar();
lastSessionSelectedTab = RED.settings.getLocal("last-sidebar-tab")
RED.sidebar.info.init();
RED.sidebar.help.init();
RED.sidebar.config.init();

View File

@@ -27,5 +27,8 @@ RED.state = {
PANNING: 10,
SELECTING_NODE: 11,
GROUP_DRAGGING: 12,
GROUP_RESIZE: 13
GROUP_RESIZE: 13,
DETACHED_DRAGGING: 14,
SLICING: 15,
SLICING_JUNCTION: 16
}

View File

@@ -31,6 +31,7 @@ RED.statusBar = (function() {
function addWidget(options) {
widgets[options.id] = options;
var el = $('<span class="red-ui-statusbar-widget"></span>');
el.prop('id', options.id);
options.element.appendTo(el);
if (options.align === 'left') {
leftBucket.append(el);

View File

@@ -273,6 +273,11 @@ RED.subflow = (function() {
var subflowInstances = [];
if (activeSubflow) {
RED.nodes.filterNodes({type:"subflow:"+activeSubflow.id}).forEach(function(n) {
const parentFlow = RED.nodes.workspace(n.z)
const wasLocked = parentFlow && parentFlow.locked
if (wasLocked) {
parentFlow.locked = false
}
subflowInstances.push({
id: n.id,
changed: n.changed
@@ -285,6 +290,9 @@ RED.subflow = (function() {
n.resize = true;
n.dirty = true;
RED.editor.updateNodeProperties(n);
if (wasLocked) {
parentFlow.locked = true
}
});
RED.editor.validateNode(activeSubflow);
return {
@@ -431,44 +439,7 @@ RED.subflow = (function() {
$("#red-ui-subflow-delete").on("click", function(event) {
event.preventDefault();
var subflow = RED.nodes.subflow(RED.workspaces.active());
if (subflow.instances.length > 0) {
var msg = $('<div>')
$('<p>').text(RED._("subflow.subflowInstances",{count: subflow.instances.length})).appendTo(msg);
$('<p>').text(RED._("subflow.confirmDelete")).appendTo(msg);
var confirmDeleteNotification = RED.notify(msg, {
modal: true,
fixed: true,
buttons: [
{
text: RED._('common.label.cancel'),
click: function() {
confirmDeleteNotification.close();
}
},
{
text: RED._('workspace.confirmDelete'),
class: "primary",
click: function() {
confirmDeleteNotification.close();
completeDelete();
}
}
]
});
return;
} else {
completeDelete();
}
function completeDelete() {
var startDirty = RED.nodes.dirty();
var historyEvent = removeSubflow(RED.workspaces.active());
historyEvent.t = 'delete';
historyEvent.dirty = startDirty;
RED.history.push(historyEvent);
}
RED.subflow.delete(RED.workspaces.active())
});
refreshToolbar(activeSubflow);
@@ -481,7 +452,51 @@ RED.subflow = (function() {
$("#red-ui-workspace-toolbar").hide().empty();
$("#red-ui-workspace-chart").css({"margin-top": "0"});
}
function deleteSubflow(id) {
const subflow = RED.nodes.subflow(id || RED.workspaces.active());
if (!subflow) {
return
}
if (subflow.instances.length > 0) {
if (subflow.instances.some(sf => { const ws = RED.nodes.workspace(sf.z); return ws?ws.locked:false })) {
return
}
const msg = $('<div>')
$('<p>').text(RED._("subflow.subflowInstances",{count: subflow.instances.length})).appendTo(msg);
$('<p>').text(RED._("subflow.confirmDelete")).appendTo(msg);
const confirmDeleteNotification = RED.notify(msg, {
modal: true,
fixed: true,
buttons: [
{
text: RED._('common.label.cancel'),
click: function() {
confirmDeleteNotification.close();
}
},
{
text: RED._('workspace.confirmDelete'),
class: "primary",
click: function() {
confirmDeleteNotification.close();
completeDelete();
}
}
]
});
return;
} else {
completeDelete();
}
function completeDelete() {
const startDirty = RED.nodes.dirty();
const historyEvent = removeSubflow(subflow.id);
historyEvent.t = 'delete';
historyEvent.dirty = startDirty;
RED.history.push(historyEvent);
}
}
function removeSubflow(id, keepInstanceNodes) {
// TODO: A lot of this logic is common with RED.nodes.removeWorkspace
var removedNodes = [];
@@ -506,6 +521,13 @@ RED.subflow = (function() {
RED.nodes.groups(id).forEach(function(n) {
removedGroups.push(n);
})
var removedJunctions = RED.nodes.junctions(id)
for (var i=0;i<removedJunctions.length;i++) {
var removedEntities = RED.nodes.removeJunction(removedJunctions[i])
removedLinks = removedLinks.concat(removedEntities.links)
}
var removedConfigNodes = [];
for (var i=0;i<removedNodes.length;i++) {
var removedEntities = RED.nodes.remove(removedNodes[i].id);
@@ -536,6 +558,7 @@ RED.subflow = (function() {
nodes:removedNodes,
links:removedLinks,
groups: removedGroups,
junctions: removedJunctions,
subflows: [activeSubflow]
}
}
@@ -550,7 +573,7 @@ RED.subflow = (function() {
}
});
RED.events.on("view:selection-changed",function(selection) {
if (!selection.nodes) {
if (!selection.nodes || RED.workspaces.isActiveLocked()) {
RED.menu.setDisabled("menu-item-subflow-convert",true);
} else {
RED.menu.setDisabled("menu-item-subflow-convert",false);
@@ -604,7 +627,18 @@ RED.subflow = (function() {
return x;
}
function nodeOrJunction(id) {
var node = RED.nodes.node(id);
if (node) {
return node;
}
return RED.nodes.junction(id);
}
function convertToSubflow() {
if (RED.workspaces.isActiveLocked()) {
return
}
var selection = RED.view.selection();
if (!selection.nodes) {
RED.notify(RED._("subflow.errors.noNodesSelected"),"error");
@@ -760,7 +794,7 @@ RED.subflow = (function() {
}
subflowInstance._def = RED.nodes.getType(subflowInstance.type);
RED.editor.validateNode(subflowInstance);
RED.nodes.add(subflowInstance);
subflowInstance = RED.nodes.add(subflowInstance);
if (containingGroup) {
RED.group.addToGroup(containingGroup, subflowInstance);
@@ -792,14 +826,15 @@ RED.subflow = (function() {
subflow.in.forEach(function(input) {
input.wires.forEach(function(wire) {
var link = {source: input, sourcePort: 0, target: RED.nodes.node(wire.id) }
var link = {source: input, sourcePort: 0, target: nodeOrJunction(wire.id) }
new_links.push(link);
RED.nodes.addLink(link);
});
});
subflow.out.forEach(function(output,i) {
output.wires.forEach(function(wire) {
var link = {source: RED.nodes.node(wire.id), sourcePort: wire.port , target: output }
var link = {source: nodeOrJunction(wire.id), sourcePort: wire.port , target: output }
new_links.push(link);
RED.nodes.addLink(link);
});
@@ -815,7 +850,7 @@ RED.subflow = (function() {
n.links = n.links.filter(function(id) {
var isLocalLink = nodes.hasOwnProperty(id);
if (!isLocalLink) {
var otherNode = RED.nodes.node(id);
var otherNode = nodeOrJunction(id);
if (otherNode && otherNode.links) {
var i = otherNode.links.indexOf(n.id);
if (i > -1) {
@@ -831,7 +866,6 @@ RED.subflow = (function() {
RED.nodes.moveNodeToTab(n, subflow.id);
}
var historyEvent = {
t:'createSubflow',
nodes:[subflowInstance.id],
@@ -869,6 +903,7 @@ RED.subflow = (function() {
RED.nodes.dirty(true);
RED.view.updateActive();
RED.view.select(null);
RED.view.focus();
}
@@ -983,6 +1018,17 @@ RED.subflow = (function() {
default: inputType
})
input.typedInput('value',val.value)
if (inputType === 'cred') {
if (node.credentials) {
if (node.credentials[tenv.name]) {
input.typedInput('value', node.credentials[tenv.name]);
} else if (node.credentials['has_'+tenv.name]) {
input.typedInput('value', "__PWRD__")
} else {
input.typedInput('value', "");
}
}
}
} else {
input.val(val.value)
}
@@ -1302,7 +1348,10 @@ RED.subflow = (function() {
init: init,
createSubflow: createSubflow,
convertToSubflow: convertToSubflow,
// removeSubflow: Internal function to remove subflow
removeSubflow: removeSubflow,
// delete: Prompt user for confirmation
delete: deleteSubflow,
refresh: refresh,
removeInput: removeSubflowInput,
removeOutput: removeSubflowOutput,

View File

@@ -15,6 +15,8 @@
**/
RED.sidebar.config = (function() {
let flashingConfigNode;
let flashingConfigNodeTimer;
var content = document.createElement("div");
content.className = "red-ui-sidebar-node-config";
@@ -41,12 +43,15 @@ RED.sidebar.config = (function() {
var categories = {};
function getOrCreateCategory(name,parent,label) {
function getOrCreateCategory(name,parent,label,isLocked) {
name = name.replace(/\./i,"-");
if (!categories[name]) {
var container = $('<div class="red-ui-palette-category red-ui-sidebar-config-category" id="red-ui-sidebar-config-category-'+name+'"></div>').appendTo(parent);
var header = $('<div class="red-ui-sidebar-config-tray-header red-ui-palette-header"><i class="fa fa-angle-down expanded"></i></div>').appendTo(container);
let lockIcon
if (label) {
lockIcon = $('<span style="margin-right: 5px"><i class="fa fa-lock"/></span>').appendTo(header)
lockIcon.toggle(!!isLocked)
$('<span class="red-ui-palette-node-config-label"/>').text(label).appendTo(header);
} else {
$('<span class="red-ui-palette-node-config-label" data-i18n="sidebar.config.'+name+'">').appendTo(header);
@@ -60,6 +65,7 @@ RED.sidebar.config = (function() {
var icon = header.find("i");
var result = {
label: label,
lockIcon,
list: category,
size: function() {
return result.list.find("li:not(.red-ui-palette-node-config-none)").length
@@ -98,6 +104,9 @@ RED.sidebar.config = (function() {
});
categories[name] = result;
} else {
if (isLocked !== undefined && categories[name].lockIcon) {
categories[name].lockIcon.toggle(!!isLocked)
}
if (categories[name].label !== label) {
categories[name].list.parent().find('.red-ui-palette-node-config-label').text(label);
categories[name].label = label;
@@ -145,6 +154,7 @@ RED.sidebar.config = (function() {
var entry = $('<li class="red-ui-palette-node_id_'+node.id.replace(/\./g,"-")+'"></li>').appendTo(list);
var nodeDiv = $('<div class="red-ui-palette-node-config red-ui-palette-node"></div>').appendTo(entry);
entry.data('node',node.id);
nodeDiv.data('node',node.id);
var label = $('<div class="red-ui-palette-label"></div>').text(label).appendTo(nodeDiv);
if (node.d) {
nodeDiv.addClass("red-ui-palette-node-config-disabled");
@@ -213,7 +223,7 @@ RED.sidebar.config = (function() {
RED.nodes.eachWorkspace(function(ws) {
validList[ws.id.replace(/\./g,"-")] = true;
getOrCreateCategory(ws.id,flowCategories,ws.label);
getOrCreateCategory(ws.id,flowCategories,ws.label, ws.locked);
})
RED.nodes.eachSubflow(function(sf) {
validList[sf.id.replace(/\./g,"-")] = true;
@@ -271,6 +281,15 @@ RED.sidebar.config = (function() {
changes: {},
dirty: RED.nodes.dirty()
}
for (let i = 0; i < selectedNodes.length; i++) {
let node = RED.nodes.node(selectedNodes[i])
if (node.z) {
let ws = RED.nodes.workspace(node.z)
if (ws && ws.locked) {
return
}
}
}
selectedNodes.forEach(function(id) {
var node = RED.nodes.node(id);
try {
@@ -346,10 +365,36 @@ RED.sidebar.config = (function() {
refreshConfigNodeList();
}
});
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllUnusedConfigNodes"));
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllConfigNodes"));
RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'), RED._("sidebar.config.showAllUnusedConfigNodes"));
}
function flashConfigNode(el) {
if(flashingConfigNode && flashingConfigNode.length) {
//cancel current flashing node before flashing new node
clearInterval(flashingConfigNodeTimer);
flashingConfigNodeTimer = null;
flashingConfigNode.children("div").removeClass('highlighted');
flashingConfigNode = null;
}
if(!el || !el.children("div").length) { return; }
flashingConfigNodeTimer = setInterval(function(flashEndTime) {
if (flashEndTime >= Date.now()) {
const highlighted = el.children("div").hasClass("highlighted");
el.children("div").toggleClass('highlighted', !highlighted)
} else {
clearInterval(flashingConfigNodeTimer);
flashingConfigNodeTimer = null;
flashingConfigNode = null;
el.children("div").removeClass('highlighted');
}
}, 100, Date.now() + 2200);
flashingConfigNode = el;
el.children("div").addClass('highlighted');
}
function show(id) {
if (typeof id === 'boolean') {
if (id) {
@@ -374,19 +419,7 @@ RED.sidebar.config = (function() {
} else if (y<0) {
scrollWindow.animate({scrollTop: '+='+(y-10)},150);
}
var flash = 21;
var flashFunc = function() {
if ((flash%2)===0) {
node.removeClass('node_highlighted');
} else {
node.addClass('node_highlighted');
}
flash--;
if (flash >= 0) {
setTimeout(flashFunc,100);
}
}
flashFunc();
flashConfigNode(node, id);
},100);
}
RED.sidebar.show("config");

View File

@@ -20,10 +20,8 @@ RED.sidebar.help = (function() {
var helpSection;
var panels;
var panelRatio;
var helpTopics = [];
var treeList;
var tocPanel;
var helpIndex = {};
function resizeStack() {
var h = $(content).parent().height() - toolbar.outerHeight();
@@ -52,7 +50,7 @@ RED.sidebar.help = (function() {
tocPanel = $("<div>", {class: "red-ui-sidebar-help-toc"}).appendTo(stackContainer);
var helpPanel = $("<div>").css({
"overflow-y": "scroll"
"overflow-y": "auto"
}).appendTo(stackContainer);
panels = RED.panels.create({
@@ -64,15 +62,17 @@ RED.sidebar.help = (function() {
style: "compact",
delay: 100,
change: function() {
var val = $(this).val().toLowerCase();
if (val) {
const searchFor = $(this).val().toLowerCase();
if (searchFor) {
showTOC();
var c = treeList.treeList('filter',function(item) {
treeList.treeList('filter',function(item) {
if (item.depth === 0) {
return true;
}
return (item.nodeType && item.nodeType.indexOf(val) > -1) ||
(item.subflowLabel && item.subflowLabel.indexOf(val) > -1)
let found = item.nodeType && item.nodeType.toLowerCase().indexOf(searchFor) > -1;
found = found || item.subflowLabel && item.subflowLabel.toLowerCase().indexOf(searchFor) > -1;
found = found || item.palleteLabel && item.palleteLabel.toLowerCase().indexOf(searchFor) > -1;
return found;
},true)
} else {
treeList.treeList('filter',null);
@@ -95,7 +95,10 @@ RED.sidebar.help = (function() {
var pendingContentLoad;
treeList.on('treelistselect', function(e,item) {
pendingContentLoad = item;
if (item.nodeType) {
if (item.tour) {
RED.tourGuide.run(item.tour);
}
else if (item.nodeType) {
showNodeTypeHelp(item.nodeType);
} else if (item.content) {
helpSection.empty();
@@ -138,7 +141,8 @@ RED.sidebar.help = (function() {
RED.events.on('registry:node-type-removed', queueRefresh);
RED.events.on('subflows:change', refreshSubflow);
RED.actions.add("core:show-help-tab",show);
RED.actions.add("core:show-help-tab", show);
RED.actions.add("core:show-node-help", showNodeHelp)
}
@@ -187,7 +191,6 @@ RED.sidebar.help = (function() {
}
function refreshHelpIndex() {
helpTopics = [];
var modules = RED.nodes.registry.getModuleList();
var moduleNames = Object.keys(modules);
moduleNames.sort();
@@ -196,15 +199,32 @@ RED.sidebar.help = (function() {
label: RED._("sidebar.help.nodeHelp"),
children: [],
expanded: true
}
};
var tours = RED.tourGuide.list().map(function (item) {
return {
icon: "fa fa-play-circle-o",
label: item.label,
tour: item.path,
};
});
var helpData = [
{
id: 'changelog',
label: "Node-RED v"+RED.settings.version,
content: getChangelog
label: "Node-RED",
children: [
{
id: 'changelog',
label: RED._("sidebar.help.changeLog"),
content: getChangelog
},
{
label: RED._("tourGuide.welcomeTours"),
children: tours
}
]
},
nodeHelp
]
];
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
if (subflows.length > 0) {
nodeHelp.children.push({
@@ -224,17 +244,21 @@ RED.sidebar.help = (function() {
moduleNames.forEach(function(moduleName) {
var module = modules[moduleName];
var nodeTypes = [];
var setNames = Object.keys(module.sets);
const module = modules[moduleName];
const nodeTypes = [];
const moduleSets = module.sets;
const setNames = Object.keys(moduleSets);
setNames.forEach(function(setName) {
module.sets[setName].types.forEach(function(nodeType) {
const moduleSet = moduleSets[setName];
moduleSet.types.forEach(function(nodeType) {
if ($("script[data-help-name='"+nodeType+"']").length) {
const n = {_def:RED.nodes.getType(nodeType),type:nodeType}
n.name = getNodePaletteLabel(n);
nodeTypes.push({
id: "node-type:"+nodeType,
nodeType: nodeType,
element:getNodeLabel({_def:RED.nodes.getType(nodeType),type:nodeType})
palleteLabel: n.name,
element: getNodeLabel(n)
})
}
})
@@ -254,18 +278,21 @@ RED.sidebar.help = (function() {
treeList.treeList("data",helpData);
}
function getNodeLabel(n) {
var div = $('<div>',{class:"red-ui-node-list-item"});
var icon = RED.utils.createNodeIcon(n).appendTo(div);
var label = n.name;
function getNodePaletteLabel(n) {
let label = n.name;
if (!label && n._def && n._def.paletteLabel) {
try {
label = (typeof n._def.paletteLabel === "function" ? n._def.paletteLabel.call(n._def) : n._def.paletteLabel)||"";
} catch (err) {
}
}
label = label || n.type;
$('<div>',{class:"red-ui-node-label"}).text(n.name||n.type).appendTo(icon);
return label || n.type;
}
function getNodeLabel(n) {
const div = $('<div>',{class:"red-ui-node-list-item"});
const icon = RED.utils.createNodeIcon(n).appendTo(div);
$('<div>',{class:"red-ui-node-label"}).text(getNodePaletteLabel(n)).appendTo(icon);
return div;
}
@@ -312,6 +339,19 @@ RED.sidebar.help = (function() {
resizeStack();
}
function showNodeHelp(node) {
if (!node) {
const selection = RED.view.selection()
if (selection.nodes && selection.nodes.length > 0) {
node = selection.nodes.find(n => n.type !== 'group' && n.type !== 'junction')
}
}
if (node) {
show(node.type, true)
}
}
// TODO: DRY - projects.js
function addTargetToExternalLinks(el) {
$(el).find("a").each(function(el) {
@@ -361,7 +401,7 @@ RED.sidebar.help = (function() {
var node = selection.nodes[0];
if (node.type === "subflow" && node.direction) {
// ignore subflow virtual ports
} else if (node.type !== 'group'){
} else if (node.type !== 'group' && node.type !== 'junction'){
showNodeTypeHelp(node.type);
}
}

View File

@@ -221,6 +221,22 @@ RED.sidebar.info.outliner = (function() {
} else {
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
}
if (n.type === 'tab') {
var lockToggleButton = $('<button type="button" class="red-ui-info-outline-item-control-lock red-ui-button red-ui-button-small"><i class="fa fa-unlock-alt"></i><i class="fa fa-lock"></i></button>').appendTo(controls).on("click",function(evt) {
evt.preventDefault();
evt.stopPropagation();
if (n.locked) {
RED.workspaces.unlock(n.id)
} else {
RED.workspaces.lock(n.id)
}
})
RED.popover.tooltip(lockToggleButton,function() {
return RED._("common.label."+(n.locked?"unlock":"lock"));
});
} else {
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
}
controls.find("button").on("dblclick", function(evt) {
evt.preventDefault();
evt.stopPropagation();
@@ -268,14 +284,7 @@ RED.sidebar.info.outliner = (function() {
}
},
options: [
{label:RED._("sidebar.info.search.configNodes"), value:"is:config"},
{label:RED._("sidebar.info.search.unusedConfigNodes"), value:"is:config is:unused"},
{label:RED._("sidebar.info.search.invalidNodes"), value: "is:invalid"},
{label:RED._("sidebar.info.search.uknownNodes"), value: "type:unknown"},
{label:RED._("sidebar.info.search.unusedSubflows"), value:"is:subflow is:unused"},
{label:RED._("sidebar.info.search.hiddenFlows"), value:"is:hidden"},
]
options: RED.search.getSearchOptions()
});
projectInfo = $('<div class="red-ui-treeList-label red-ui-info-outline-project"><span class="red-ui-treeList-icon"><i class="fa fa-archive"></i></span></div>').hide().appendTo(container)
@@ -287,15 +296,18 @@ RED.sidebar.info.outliner = (function() {
data:getFlowData()
})
treeList.on('treelistselect', function(e,item) {
var node = RED.nodes.node(item.id) || RED.nodes.group(item.id);
var node = RED.nodes.node(item.id) || RED.nodes.group(item.id) || RED.nodes.workspace(item.id) || RED.nodes.subflow(item.id);
if (node) {
if (node.type === 'group' || node._def.category !== "config") {
// RED.view.select({nodes:[node]})
} else if (node._def.category === "config") {
RED.sidebar.info.refresh(node);
} else {
// RED.view.select({nodes:[]})
}
RED.sidebar.info.refresh(node);
// if (node.type === 'group' || node._def.category !== "config") {
// // RED.view.select({nodes:[node]})
// } else if (node._def.category === "config") {
// RED.sidebar.info.refresh(node);
// } else {
// // RED.view.select({nodes:[]})
// }
} else {
RED.sidebar.info.refresh(null);
}
})
treeList.on('treelistconfirm', function(e,item) {
@@ -368,6 +380,8 @@ RED.sidebar.info.outliner = (function() {
flowList.treeList.addChild(objects[ws.id])
objects[ws.id].element.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
objects[ws.id].treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
objects[ws.id].element.toggleClass("red-ui-info-outline-item-locked", !!ws.locked)
objects[ws.id].treeList.container.toggleClass("red-ui-info-outline-item-locked", !!ws.locked)
updateSearch();
}
@@ -382,6 +396,8 @@ RED.sidebar.info.outliner = (function() {
existingObject.element.find(".red-ui-info-outline-item-label").text(label);
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
existingObject.treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
existingObject.element.toggleClass("red-ui-info-outline-item-locked", !!n.locked)
existingObject.treeList.container.toggleClass("red-ui-info-outline-item-locked", !!n.locked)
updateSearch();
}
function onFlowsReorder(order) {

View File

@@ -25,6 +25,7 @@ RED.sidebar.info = (function() {
var propertiesPanelHeaderLabel;
var propertiesPanelHeaderReveal;
var propertiesPanelHeaderHelp;
var propertiesPanelHeaderCopyLink;
var selectedObject;
@@ -67,10 +68,20 @@ RED.sidebar.info = (function() {
propertiesPanelHeaderIcon = $("<span>").appendTo(propertiesPanelHeader);
propertiesPanelHeaderLabel = $("<span>").appendTo(propertiesPanelHeader);
propertiesPanelHeaderHelp = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-book"></button>').css({
propertiesPanelHeaderCopyLink = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-link"></button>').css({
position: 'absolute',
top: '12px',
right: '32px'
}).on("click", function(evt) {
RED.actions.invoke('core:copy-item-url',selectedObject)
}).appendTo(propertiesPanelHeader);
RED.popover.tooltip(propertiesPanelHeaderCopyLink,RED._("sidebar.info.copyItemUrl"));
propertiesPanelHeaderHelp = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-book"></button>').css({
position: 'absolute',
top: '12px',
right: '56px'
}).on("click", function(evt) {
evt.preventDefault();
evt.stopPropagation();
@@ -80,8 +91,7 @@ RED.sidebar.info = (function() {
}).appendTo(propertiesPanelHeader);
RED.popover.tooltip(propertiesPanelHeaderHelp,RED._("sidebar.help.showHelp"));
propertiesPanelHeaderReveal = $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-search"></button>').css({
propertiesPanelHeaderReveal = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-search"></button>').css({
position: 'absolute',
top: '12px',
right: '8px'
@@ -98,7 +108,7 @@ RED.sidebar.info = (function() {
propertiesPanelContent = $("<div>").css({
"flex":"1 1 auto",
"overflow-y":"scroll",
"overflow-y":"auto",
}).appendTo(propertiesPanel);
@@ -163,6 +173,7 @@ RED.sidebar.info = (function() {
});
return el;
}
function refresh(node) {
if (node === undefined) {
refreshSelection();
@@ -184,6 +195,7 @@ RED.sidebar.info = (function() {
propertiesPanelHeaderLabel.text("");
propertiesPanelHeaderReveal.hide();
propertiesPanelHeaderHelp.hide();
propertiesPanelHeaderCopyLink.hide();
return;
} else if (Array.isArray(node)) {
// Multiple things selected
@@ -195,6 +207,7 @@ RED.sidebar.info = (function() {
propertiesPanelHeaderLabel.text("Selection");
propertiesPanelHeaderReveal.hide();
propertiesPanelHeaderHelp.hide();
propertiesPanelHeaderCopyLink.hide();
selectedObject = null;
var types = {
@@ -271,14 +284,16 @@ RED.sidebar.info = (function() {
objectType = "group";
}
$(propRow.children()[0]).text(RED._("sidebar.info."+objectType))
RED.utils.createObjectElement(node.id).appendTo(propRow.children()[1]);
RED.utils.createObjectElement(node.id,{sourceId: node.id}).appendTo(propRow.children()[1]);
if (node.type === "tab" || node.type === "subflow") {
// If nothing is selected, but we're on a flow or subflow tab.
propertiesPanelHeaderHelp.hide();
propertiesPanelHeaderCopyLink.show();
} else if (node.type === "group") {
propertiesPanelHeaderHelp.hide();
propertiesPanelHeaderCopyLink.show();
propRow = $('<tr class="red-ui-help-info-row"><td>&nbsp;</td><td></td></tr>').appendTo(tableBody);
@@ -301,10 +316,12 @@ RED.sidebar.info = (function() {
if (typeCounts.groups > 0) {
$('<div>').text(RED._("clipboard.group",{count:typeCounts.groups})).appendTo(counts);
}
} else if (node.type === 'junction') {
propertiesPanelHeaderHelp.hide();
propertiesPanelHeaderCopyLink.hide();
} else {
propertiesPanelHeaderHelp.show();
propertiesPanelHeaderCopyLink.show();
if (!subflowRegex) {
propRow = $('<tr class="red-ui-help-info-row"><td>'+RED._("sidebar.info.type")+'</td><td></td></tr>').appendTo(tableBody);
@@ -365,7 +382,7 @@ RED.sidebar.info = (function() {
}
} else {
RED.utils.createObjectElement(val).appendTo(propRow.children()[1]);
RED.utils.createObjectElement(val,{sourceId: node.id}).appendTo(propRow.children()[1]);
}
}
}
@@ -431,6 +448,7 @@ RED.sidebar.info = (function() {
}
function setInfoText(infoText,target) {
var info = addTargetToExternalLinks($('<div class="red-ui-help"><span class="red-ui-text-bidi-aware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(target);
info.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
@@ -445,8 +463,10 @@ RED.sidebar.info = (function() {
el = el.next();
}
$(this).toggleClass('expanded',!isExpanded);
})
});
mermaid.init();
}
var tips = (function() {
var enabled = true;
var startDelay = 1000;

View File

@@ -256,6 +256,10 @@ RED.tourGuide = (function() {
}
$('<div>').css("text-align","left").html(getLocaleText(step.description)).appendTo(stepDescription);
if (step.image) {
$(`<img src="red/tours/${step.image}" />`).appendTo(stepDescription)
}
var stepToolbar = $('<div>',{class:"red-ui-tourGuide-toolbar"}).appendTo(stepContent);
// var breadcrumbs = $('<div>',{class:"red-ui-tourGuide-breadcrumbs"}).appendTo(stepToolbar);
@@ -429,9 +433,35 @@ RED.tourGuide = (function() {
})
}
function listTour() {
return [
{
id: "3_1",
label: "3.1",
path: "./tours/welcome.js"
},
{
id: "3_0",
label: "3.0",
path: "./tours/3.0/welcome.js"
},
{
id: "2_2",
label: "2.2",
path: "./tours/2.2/welcome.js"
},
{
id: "2_1",
label: "2.1",
path: "./tours/2.1/welcome.js"
}
];
}
return {
load: loadTour,
run: run,
list: listTour,
reset: function() {
RED.settings.set("editor.tours.welcome",'');
}

View File

@@ -169,7 +169,13 @@
raiseTrayZ();
handleWindowResize();//cause call to monaco layout
},200);
body.find(":focusable:first").trigger("focus");
if(!options.hasOwnProperty("focusElement")) {
//focusElement is not inside options - default to focusing 1st
body.find(":focusable:first").trigger("focus");
} else if(options.focusElement !== false) {
//focusElement IS specified, focus that instead (if not false)
$(options.focusElement).trigger("focus");
}
},150);
el.css({right:0});

View File

@@ -104,7 +104,9 @@ RED.typeSearch = (function() {
var index = Math.max(0,selected);
if (index < children.length) {
var n = $(children[index]).find(".red-ui-editableList-item-content").data('data');
typesUsed[n.type] = Date.now();
if (!/^_action_:/.test(n.type)) {
typesUsed[n.type] = Date.now();
}
if (n.def.outputs === 0) {
confirm(n);
} else {
@@ -171,18 +173,27 @@ RED.typeSearch = (function() {
var div = $('<div>',{class:"red-ui-search-result"}).appendTo(container);
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(div);
var colour = RED.utils.getNodeColor(object.type,def);
if (object.type === "junction") {
nodeDiv.addClass("red-ui-palette-icon-junction");
} else if (/^_action_:/.test(object.type)) {
nodeDiv.addClass("red-ui-palette-icon-junction")
} else {
var colour = RED.utils.getNodeColor(object.type,def);
nodeDiv.css('backgroundColor',colour);
}
var icon_url = RED.utils.getNodeIcon(def);
nodeDiv.css('backgroundColor',colour);
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
RED.utils.createIconElement(icon_url, iconContainer, false);
if (def.inputs > 0) {
$('<div/>',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv);
}
if (def.outputs > 0) {
$('<div/>',{class:"red-ui-search-result-node-port red-ui-search-result-node-output"}).appendTo(nodeDiv);
if (!/^_action_:/.test(object.type) && object.type !== "junction") {
if (def.inputs > 0) {
$('<div/>',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv);
}
if (def.outputs > 0) {
$('<div/>',{class:"red-ui-search-result-node-port red-ui-search-result-node-output"}).appendTo(nodeDiv);
}
}
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
@@ -203,7 +214,9 @@ RED.typeSearch = (function() {
}
function confirm(def) {
hide();
typesUsed[def.type] = Date.now();
if (!/^_action_:/.test(def.type)) {
typesUsed[def.type] = Date.now();
}
addCallback(def.type);
}
@@ -256,8 +269,8 @@ RED.typeSearch = (function() {
moveCallback = opts.move;
RED.events.emit("type-search:open");
//shade.show();
if ($("#red-ui-main-container").height() - opts.y - 150 < 0) {
opts.y = opts.y - 235;
if ($("#red-ui-main-container").height() - opts.y - 195 < 0) {
opts.y = opts.y - 275;
}
dialog.css({left:opts.x+"px",top:opts.y+"px"}).show();
searchResultsDiv.slideDown(300);
@@ -312,9 +325,10 @@ RED.typeSearch = (function() {
function applyFilter(filter,type,def) {
return !filter ||
(
(!filter.spliceMultiple) &&
(!filter.type || type === filter.type) &&
(!filter.input || def.inputs > 0) &&
(!filter.output || def.outputs > 0)
(!filter.input || type === 'junction' || def.inputs > 0) &&
(!filter.output || type === 'junction' || def.outputs > 0)
)
}
function refreshTypeList(opts) {
@@ -323,9 +337,16 @@ RED.typeSearch = (function() {
searchInput.searchBox('value','').focus();
selected = -1;
var common = [
'inject','debug','function','change','switch'
'inject','debug','function','change','switch','junction'
].filter(function(t) { return applyFilter(opts.filter,t,RED.nodes.getType(t)); });
// if (opts.filter && opts.filter.input && opts.filter.output && !opts.filter.type) {
// if (opts.filter.spliceMultiple) {
// common.push('_action_:core:split-wires-with-junctions')
// }
// common.push('_action_:core:split-wire-with-link-nodes')
// }
var recentlyUsed = Object.keys(typesUsed);
recentlyUsed.sort(function(a,b) {
return typesUsed[b]-typesUsed[a];
@@ -348,6 +369,11 @@ RED.typeSearch = (function() {
var index = 0;
for(i=0;i<common.length;i++) {
var itemDef = RED.nodes.getType(common[i]);
if (common[i] === 'junction') {
itemDef = { inputs:1, outputs: 1, label: 'junction', type: 'junction'}
} else if (/^_action_:/.test(common[i]) ) {
itemDef = { inputs:1, outputs: 1, label: common[i], type: common[i]}
}
if (itemDef) {
item = {
type: common[i],

View File

@@ -121,6 +121,13 @@ RED.userSettings = (function() {
// {setting:"theme", label:"Theme",options:function(done){ done([{val:'',text:'default'}].concat(RED.settings.theme("themes"))) }},
// ]
// },
{
title: "menu.label.view.view",
options: [
{setting:"view-store-zoom",label:"menu.label.view.storeZoom", default: false, toggle:true, onchange: function(val) { if (!val) { RED.settings.removeLocal("zoom-level")}}},
{setting:"view-store-position",label:"menu.label.view.storePosition", default: false, toggle:true, onchange: function(val) { if (!val) { RED.settings.removeLocal("scroll-positions")}}},
]
},
{
title: "menu.label.view.grid",
options: [

Some files were not shown because too many files have changed in this diff Show More