Merge branch 'dev' into pr_2242
2
.github/ISSUE_TEMPLATE.md
vendored
@ -28,7 +28,7 @@ To help us understand the issue, please fill-in as much of the following informa
|
||||
### Please tell us about your environment:
|
||||
|
||||
- [ ] Node-RED version:
|
||||
- [ ] node.js version:
|
||||
- [ ] Node.js version:
|
||||
- [ ] npm version:
|
||||
- [ ] Platform/OS:
|
||||
- [ ] Browser:
|
||||
|
2
.github/ISSUE_TEMPLATE/--bug_report.md
vendored
@ -33,7 +33,7 @@ To help us understand the issue, please fill-in as much of the following informa
|
||||
### Please tell us about your environment:
|
||||
|
||||
- [ ] Node-RED version:
|
||||
- [ ] node.js version:
|
||||
- [ ] Node.js version:
|
||||
- [ ] npm version:
|
||||
- [ ] Platform/OS:
|
||||
- [ ] Browser:
|
||||
|
@ -9,5 +9,3 @@ matrix:
|
||||
before_script:
|
||||
- npm install -g istanbul coveralls
|
||||
- node_js: "8"
|
||||
allow_failures:
|
||||
- node_js: "12"
|
||||
|
227
CHANGELOG.md
@ -1,3 +1,223 @@
|
||||
#### 1.0.3: Maintenance Release
|
||||
|
||||
Runtime
|
||||
- Increase timeouts in Subflow tests to minimise false positives
|
||||
- Update grunt-sass and add node-sass for node12 support
|
||||
- Fix timings of Delay node tests
|
||||
- #2340 Update JSONata to 1.7.0
|
||||
- Bump https-proxy-agent version
|
||||
- #2332 Fix error handling of nodes with multiple input handlers
|
||||
- Add script to generate npm publish script
|
||||
- #2371 Ensure folder is present before write (e.g. flows file not in user folder)
|
||||
- #2371 Handle windows UNC '\\' paths
|
||||
- #2366 Handle logging of non-JSON encodable objects
|
||||
|
||||
Editor
|
||||
- #2328 Fix language handling in subflow node
|
||||
- Use default language if lng param not set in i18n req
|
||||
- #2326 Fix palette editor search visualization
|
||||
- #2375 Subflow status not showing i18n version of contained core nodes status
|
||||
- Fix inverse of 'replace' editor event
|
||||
- #2376 Fallback to base language files if present
|
||||
- #2373 Support UI testing on the latest Google Chrome
|
||||
- #2364 Add tooltip to expand button in markdown editor
|
||||
- #2363 Support ctrl key to select tabs for Windows
|
||||
- #2356 Make JSONata help initially shown in expression editor
|
||||
- #2355 Prohibit line break in type menu of typedInput
|
||||
|
||||
Nodes
|
||||
- Delay: Fix delay to not pass through .reset and .flush props consistently
|
||||
- #2352 File: Using the ‘a msg per line’ the last line does not get msg.topic passed
|
||||
- #2339 HTTP Request: Check auth type on opening
|
||||
- HTTP Request: add units info
|
||||
- #2372 MQTT/WS: Improved proxy support for MQTT and WebSocket nodes
|
||||
- #2370 MQTT: Add clarification that MQTT Out requires payload to send msg
|
||||
|
||||
|
||||
#### 1.0.2: Maintenance Release
|
||||
|
||||
Runtime
|
||||
- Allow node.status() to be passed number/bool types
|
||||
- Allow node emitted events to have multiple arguments
|
||||
- #2323 Fixed docstrings to have them match the function signature (name of parameters).
|
||||
- #2318 NLS: Unify translations of "boolean"
|
||||
|
||||
Editor
|
||||
- Ensure node status is refreshed whenever node is edited
|
||||
- #2315 #2316 Ensure z property included in full message debug payload
|
||||
- #2321 Fixed editor.json (JA nls)
|
||||
- #2313 Fix element to collapse items in visual JSON editor
|
||||
- #2314 Insert divider in menu by calling RED.menu.addItem('id', null);
|
||||
|
||||
Nodes
|
||||
- Change: Fixup use of node.done
|
||||
- #2322 Template: Fix invalid JSON data in template node docs
|
||||
- #2320 File: Fixed a typo in 10-file.html (JA nls)
|
||||
- #2312 Template: Remove unnecessary comma in help text
|
||||
- #2319 Inject: Interval of inject node should be 596 hours or less.
|
||||
|
||||
#### 1.0.1: Maintenance Release
|
||||
|
||||
Runtime
|
||||
- #2301 Add env vars to enable safe mode and projects
|
||||
- `NODE_RED_ENABLE_SAFE_MODE`
|
||||
- `NODE_RED_ENABLE_PROJECTS`
|
||||
|
||||
Editor
|
||||
- #2308 Fix grid setting
|
||||
- #2306 i18n support in tooltips
|
||||
- Fix error when setting typedInput to boolean true/false
|
||||
- #2299 Fix SVG icons in IE11
|
||||
- #2303 Fix issue where subflow color did not update when not on a flow
|
||||
|
||||
Nodes
|
||||
- #2297 TLS: Allow TLS config node to provide just CA cert
|
||||
- #2307 Inject: Fix width on inject node property
|
||||
- #2305 Switch: Let switch node between rule work both ways round
|
||||
- Range: Add example to range node info and make use of target consistent
|
||||
- Join: node must clone group message before sending
|
||||
|
||||
|
||||
#### 1.0.0: Milestone Release
|
||||
|
||||
Editor
|
||||
- Add click-on-tooltip to close
|
||||
- Fix node draggable handling
|
||||
- Ensure complete node scope property is remapped on import
|
||||
- Update i18n for project feature
|
||||
- Fix menu hiding function for flow editor
|
||||
- Normalise default subflow color references
|
||||
- Hide header text of very small screens to deploy is visible
|
||||
- Fix tab access on touch screens
|
||||
- Update radialMenu to use standard theme colours
|
||||
- Fix undefined reference loading on mobile
|
||||
- Allow word breaking of node name with long word
|
||||
- Enable wrap mode in Markdown editor
|
||||
- Maximize the size of markdown editor
|
||||
|
||||
Nodes
|
||||
- remove legacy error option from file in mode
|
||||
- Change MQTT node default 3.1 compatibility mode to false
|
||||
- Show clear debug shortcut in tooltip
|
||||
- Fix file-in port labels for all 4 options
|
||||
- Add extra comment re Mustache escapes to Template info
|
||||
- Fix typo in complete node
|
||||
- Allow Function node output input to go to 0
|
||||
|
||||
#### 1.0.0-beta.4: Beta Release
|
||||
|
||||
Runtime
|
||||
- Clone the first message passed to node.send in Function node
|
||||
|
||||
Editor
|
||||
- Move flow-status button to footer for consistency
|
||||
- Fix node hover effect to prevent jumping position
|
||||
- Filter quick-add properly when splicing a wire
|
||||
- Mark workspace dirty when deleting link node link Fixes #2274
|
||||
- Add red-ui-button class to strategy login button
|
||||
- Fix padding of subflow locale select Closes #2276
|
||||
- Update info text of complete node & add JP text
|
||||
- Add class red-ui-button to cancel button
|
||||
- Add css class to login submit button (#2275)
|
||||
- Realign subflow output port labels
|
||||
- Move context sidebar auto-refresh option to individual sections
|
||||
- Update Japanese message catalogue
|
||||
- Fix subflow UI for select
|
||||
- remove padding before label text for SUBFLOW UI row
|
||||
- Allow SUBFLOW UI label row without variable name
|
||||
|
||||
Nodes
|
||||
- Remove old rc option from exec node for 1.0
|
||||
- Add python and SQL to template language options
|
||||
- Fix Switch node display of jsonata_exp type
|
||||
- Remove sentiment from core nodes
|
||||
|
||||
#### 1.0.0-beta.3: Beta Release
|
||||
|
||||
Runtime
|
||||
- [FEATURE] Add Node Done API - make message passing async
|
||||
- Ensure the subflow stop promise is waiting for before restarting
|
||||
- Limit the regex for the /nodes/ api end points
|
||||
- Add error event handler to ssh-keygen child_process Fixes #2255
|
||||
- Fix default value handling on context array access Fixes #2252
|
||||
- Remove all ui test dependencies from package.json
|
||||
- Add req back to audit log events and extend to Projects api
|
||||
- Ensure 2nd arg to node.error is an object Fixes #2228
|
||||
- Use a more atomic process for writing context files Fixes #2271
|
||||
|
||||
|
||||
Editor
|
||||
- [FEATURE] Change core node categories
|
||||
- [FEATURE] Subflow Instance property UI (#2236)
|
||||
- [FEATURE] Add visual JSON editor
|
||||
- [FEATURE] Add Action List dialog
|
||||
- [FEATURE] Add new shortcut to clear debug message list - ctrl-alt-l
|
||||
- [FEATURE] Add show-library dialog actions
|
||||
- [FEATURE] Add shift-cursor handling for moving quick-add dialog
|
||||
- [FEATURE] Add enable/disable-flow actions
|
||||
- [FEATURE] Add actions to change deploy type
|
||||
- [FEATURE] Allow config nodes to be disabled, tidy css and add actions
|
||||
- [FEATURE] Add default shortcut (ctrl-d) for deploy
|
||||
- [FEATURE] Initial implementation of redo (un-undo) - ctrl-y
|
||||
- [FEATURE] add support for specifying subflow template color
|
||||
- [FEATURE] Use ctrl-click on wire to splice node in place
|
||||
- [FEATURE] Allow search results to show more than 25 results
|
||||
- [FEATURE] Allow a node to change if it has an input port Closes #2268
|
||||
- Revealing node position needs to account for zoom level Fixes #2172
|
||||
- Fix typedInput option selection Fixes #2174
|
||||
- Fix palette node id handling so search works Fixes #2173
|
||||
- Add popover tooltips to debug sidebar,function and template
|
||||
- Add popovers to context sidebar mini buttons
|
||||
- Ensure node status icon is shown when value set
|
||||
- Revert treeList children function signature change
|
||||
- Restore tray component css for compatibility. Mark as deprecated
|
||||
- fix function name & string compare function
|
||||
- Handle empty list of example flows Fixes #2171
|
||||
- Ensure library list has an item selected when opened
|
||||
- Ensure tooltip popover doesn't replace normal popover
|
||||
- Fix clipboard export download button
|
||||
- Ensure input box has focus on repeated quick add
|
||||
- Fix width calculation of typedInput
|
||||
- Remove some hardcoded css colors
|
||||
- Fix display of node help when clicking in palette Fixes #2194
|
||||
- Ensure node help is loaded in the right language Fixes #2195
|
||||
- Do not allow tab focus on clipboard hidden element
|
||||
- Fix undefined error on typedInput due to valueLabel used before being added
|
||||
- Fix undo of flow disable state change
|
||||
- Fix select-all action in main view
|
||||
- Fix delete-all action on config node sidebar
|
||||
- Update UI tests for new editor css
|
||||
- Add insertItemAt doc to editableList
|
||||
- Ensure focus returns to the right element after dialogs shown
|
||||
- Set autocomplete to disabled in form input elements
|
||||
- Update all node icons to SVG
|
||||
- Handle png/svg fallback for def.icon values. Remove old pngs
|
||||
- Ignore empty examples directories (don't add to import menu)
|
||||
- better handle example file at any depth - #2222
|
||||
- Properly escape node types in palette
|
||||
- Ensure session expiry timeout doesn't exceed limit
|
||||
- Use node/tab map to make filterNodes more efficient
|
||||
- Rearrange contents of subflow template settings tab
|
||||
- Handle undefined node.\_def in edit stack title.
|
||||
- fix converting selection to subflow
|
||||
- Fix inserting new subflow node to existing wire between nodes
|
||||
- Support displaying falsey node status values Fixes #2246
|
||||
- Remove tab menu from node property UI for subflow and config nodes
|
||||
- Mark workspace dirty when shift-click-drag detaches wires Fixes #2260
|
||||
- Fix subflow category change on palette
|
||||
|
||||
|
||||
Nodes
|
||||
- Remove pi gpi, twitter, email and feedparser nodes from core
|
||||
- Fix error handling in Websocket broadcast function Fixes #2182
|
||||
- Handle websocket item being parseable but not an object better
|
||||
- stop join tripping up if last message of buffer is blank.
|
||||
- Add support for env var propety in switch node
|
||||
- Improve handling of file upload in request node
|
||||
- Add "has key" rule to switch node + tests
|
||||
- Optimise generation of switch node edit dialog
|
||||
- Add keep-alive option to HTTP Request - #2261
|
||||
|
||||
#### 1.0.0-beta.2: Beta Release
|
||||
|
||||
Runtime
|
||||
@ -46,6 +266,11 @@ Nodes
|
||||
- Add expand editor button to Template node
|
||||
- Update catch/status nodes to use selectNodes api and treeList
|
||||
|
||||
#### 0.20.8: Maintenance Release
|
||||
|
||||
- Sanitize tab name in edit dialog
|
||||
- Pass httpServer to runtime even when httpAdmin disabled Fixes #2272
|
||||
|
||||
#### 0.20.7: Maintenance Release
|
||||
|
||||
- Update jsonata to 1.6.5 which should fix #2183
|
||||
@ -725,7 +950,7 @@ Nodes
|
||||
- Initial support of sequence rules for SWITCH node (#1545)
|
||||
- initial support of SORT node (#1500)
|
||||
- Inject node - let once delay be editable (#1541)
|
||||
- Introduce `nodeMaxMessageBufferLength` setting for msg sequence nodes
|
||||
- Introduce `nodeMessageBufferMaxLength` setting for msg sequence nodes
|
||||
- Let CSV correct parts if we remove header row.
|
||||
- let default apply if msg.delay not set in override mode. (#1397)
|
||||
- let trigger node be reset by boolean message (#1554)
|
||||
|
@ -26,7 +26,7 @@ relevant nodes, press Ctrl-E and copy the flow data from the Export dialog.
|
||||
At a minimum, please include:
|
||||
|
||||
- Version of Node-RED - either release number if you downloaded a zip, or the first few lines of `git log` if you are cloning the repository directly.
|
||||
- Version of node.js - what does `node -v` say?
|
||||
- Version of Node.js - what does `node -v` say?
|
||||
|
||||
## Feature requests
|
||||
|
||||
|
75
Gruntfile.js
@ -16,6 +16,7 @@
|
||||
|
||||
var path = require("path");
|
||||
var fs = require("fs-extra");
|
||||
var sass = require("node-sass");
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
@ -25,9 +26,13 @@ module.exports = function(grunt) {
|
||||
nodemonArgs.push(flowFile);
|
||||
}
|
||||
|
||||
var browserstack = grunt.option('browserstack');
|
||||
if (browserstack) {
|
||||
process.env.BROWSERSTACK = true;
|
||||
}
|
||||
var nonHeadless = grunt.option('non-headless');
|
||||
if (nonHeadless) {
|
||||
process.env.NODE_RED_NON_HEADLESS = 'true';
|
||||
process.env.NODE_RED_NON_HEADLESS = true;
|
||||
}
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
@ -79,20 +84,20 @@ module.exports = function(grunt) {
|
||||
//"loopfunc": true, // allow functions to be defined in loops
|
||||
//"sub": true // don't warn that foo['bar'] should be written as foo.bar
|
||||
},
|
||||
all: [
|
||||
'Gruntfile.js',
|
||||
'red.js',
|
||||
'packages/**/*.js'
|
||||
],
|
||||
core: {
|
||||
files: {
|
||||
src: [
|
||||
'Gruntfile.js',
|
||||
'red.js',
|
||||
'packages/**/*.js',
|
||||
]
|
||||
}
|
||||
},
|
||||
// all: [
|
||||
// 'Gruntfile.js',
|
||||
// 'red.js',
|
||||
// 'packages/**/*.js'
|
||||
// ],
|
||||
// core: {
|
||||
// files: {
|
||||
// src: [
|
||||
// 'Gruntfile.js',
|
||||
// 'red.js',
|
||||
// 'packages/**/*.js',
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
nodes: {
|
||||
files: {
|
||||
src: [ 'nodes/core/*/*.js' ]
|
||||
@ -100,7 +105,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
editor: {
|
||||
files: {
|
||||
src: [ 'editor/js/**/*.js' ]
|
||||
src: [ 'packages/node_modules/@node-red/editor-client/src/js/**/*.js' ]
|
||||
}
|
||||
},
|
||||
tests: {
|
||||
@ -220,6 +225,7 @@ module.exports = function(grunt) {
|
||||
sass: {
|
||||
build: {
|
||||
options: {
|
||||
implementation: sass,
|
||||
outputStyle: 'compressed'
|
||||
},
|
||||
files: [{
|
||||
@ -276,7 +282,7 @@ module.exports = function(grunt) {
|
||||
files: [
|
||||
'packages/node_modules/@node-red/editor-client/src/js/**/*.js'
|
||||
],
|
||||
tasks: ['copy:build','concat','uglify','attachCopyright:js']
|
||||
tasks: ['copy:build','concat',/*'uglify',*/ 'attachCopyright:js']
|
||||
},
|
||||
sass: {
|
||||
files: [
|
||||
@ -496,7 +502,9 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-chmod');
|
||||
grunt.loadNpmTasks('grunt-jsonlint');
|
||||
grunt.loadNpmTasks('grunt-mocha-istanbul');
|
||||
grunt.loadNpmTasks('grunt-webdriver');
|
||||
if (fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
||||
grunt.loadNpmTasks('grunt-webdriver');
|
||||
}
|
||||
grunt.loadNpmTasks('grunt-jsdoc');
|
||||
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
||||
grunt.loadNpmTasks('grunt-npm-command');
|
||||
@ -555,12 +563,25 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
grunt.registerTask('verifyUiTestDependencies', function() {
|
||||
if (!fs.existsSync(path.join("node_modules", "chromedriver"))) {
|
||||
grunt.fail.fatal('You need to run "npm install chromedriver@2" before running UI test.');
|
||||
if (!fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
||||
grunt.fail.fatal('You need to install the UI test dependencies first.\nUse the script in "scripts/install-ui-test-dependencies.sh"');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
grunt.registerTask('generatePublishScript',
|
||||
'Generates a script to publish build output to npm',
|
||||
function () {
|
||||
const done = this.async();
|
||||
const generatePublishScript = require("./scripts/generate-publish-script.js");
|
||||
generatePublishScript().then(function(output) {
|
||||
grunt.log.writeln(output);
|
||||
|
||||
const filePath = path.join(grunt.config.get('paths.dist'),"modules","publish.sh");
|
||||
grunt.file.write(filePath,output);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
grunt.registerTask('setDevEnv',
|
||||
'Sets NODE_ENV=development so non-minified assets are used',
|
||||
function () {
|
||||
@ -579,9 +600,15 @@ module.exports = function(grunt) {
|
||||
'Runs code style check on editor code',
|
||||
['jshint:editor']);
|
||||
|
||||
grunt.registerTask('test-ui',
|
||||
'Builds editor content then runs unit tests on editor ui',
|
||||
['verifyUiTestDependencies','build','jshint:editor','webdriver:all']);
|
||||
if (!fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
||||
grunt.registerTask('test-ui',
|
||||
'Builds editor content then runs unit tests on editor ui',
|
||||
['verifyUiTestDependencies']);
|
||||
} else {
|
||||
grunt.registerTask('test-ui',
|
||||
'Builds editor content then runs unit tests on editor ui',
|
||||
['verifyUiTestDependencies','build','jshint:editor','webdriver:all']);
|
||||
}
|
||||
|
||||
grunt.registerTask('test-nodes',
|
||||
'Runs unit tests on core nodes',
|
||||
@ -597,7 +624,7 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('release',
|
||||
'Create distribution zip file',
|
||||
['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules']);
|
||||
['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules','generatePublishScript']);
|
||||
|
||||
grunt.registerTask('pack-modules',
|
||||
'Create module pack files for release',
|
||||
|
@ -5,9 +5,9 @@ http://nodered.org
|
||||
[![Build Status](https://travis-ci.org/node-red/node-red.svg?branch=master)](https://travis-ci.org/node-red/node-red)
|
||||
[![Coverage Status](https://coveralls.io/repos/node-red/node-red/badge.svg?branch=master)](https://coveralls.io/r/node-red/node-red?branch=master)
|
||||
|
||||
A visual tool for wiring the Internet of Things.
|
||||
Low-code programming for event-driven applications.
|
||||
|
||||
![Node-RED: A visual tool for wiring the Internet of Things](http://nodered.org/images/node-red-screenshot.png)
|
||||
![Node-RED: Low-code programming for event-driven applications](http://nodered.org/images/node-red-screenshot.png)
|
||||
|
||||
## Quick Start
|
||||
|
||||
@ -56,7 +56,7 @@ This project adheres to the [Contributor Covenant 1.4](http://contributor-covena
|
||||
|
||||
## Authors
|
||||
|
||||
Node-RED is a project of the [JS Foundation](http://js.foundation).
|
||||
Node-RED is a project of the [OpenJS Foundation](https://openjsf.org).
|
||||
|
||||
It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-technology/).
|
||||
|
||||
@ -67,4 +67,4 @@ It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-t
|
||||
|
||||
## Copyright and license
|
||||
|
||||
Copyright JS Foundation and other contributors, http://js.foundation under [the Apache 2.0 license](LICENSE).
|
||||
Copyright JS Foundation and other contributors, https://openjsf.org under [the Apache 2.0 license](LICENSE).
|
||||
|
13
SECURITY.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 1.0.0 | :white_check_mark: |
|
||||
| 0.20.x | :white_check_mark: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report any potential security issues to `team@nodered.org`. This will notify the core project team who will respond accordingly.
|
56
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "1.0.0-beta.2",
|
||||
"description": "A visual tool for wiring the Internet of Things",
|
||||
"version": "1.0.3",
|
||||
"description": "Low-code programming for event-driven applications",
|
||||
"homepage": "http://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@ -24,7 +24,7 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"ajv": "6.10.0",
|
||||
"ajv": "6.10.2",
|
||||
"basic-auth": "2.0.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.19.0",
|
||||
@ -34,29 +34,29 @@
|
||||
"cookie": "0.4.0",
|
||||
"cookie-parser": "1.4.4",
|
||||
"cors": "2.8.5",
|
||||
"cron": "1.7.1",
|
||||
"cron": "1.7.2",
|
||||
"denque": "1.4.1",
|
||||
"express": "4.17.1",
|
||||
"express-session": "1.16.2",
|
||||
"express-session": "1.17.0",
|
||||
"fs-extra": "8.1.0",
|
||||
"fs.notify": "0.0.4",
|
||||
"hash-sum": "2.0.0",
|
||||
"https-proxy-agent": "2.2.1",
|
||||
"https-proxy-agent": "2.2.4",
|
||||
"i18next": "15.1.2",
|
||||
"iconv-lite": "0.5.0",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "3.13.1",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"jsonata": "1.6.5",
|
||||
"jsonata": "1.8.0",
|
||||
"media-typer": "1.1.0",
|
||||
"memorystore": "1.6.1",
|
||||
"mime": "2.4.4",
|
||||
"mqtt": "2.18.8",
|
||||
"multer": "1.4.1",
|
||||
"mustache": "3.0.1",
|
||||
"node-red-node-rbe": "^0.2.4",
|
||||
"node-red-node-sentiment": "^0.1.3",
|
||||
"node-red-node-tail": "^0.0.2",
|
||||
"multer": "1.4.2",
|
||||
"mustache": "3.0.2",
|
||||
"node-red-node-rbe": "^0.2.6",
|
||||
"node-red-node-sentiment": "^0.1.6",
|
||||
"node-red-node-tail": "^0.1.0",
|
||||
"nopt": "4.0.1",
|
||||
"oauth2orize": "1.11.0",
|
||||
"on-headers": "1.0.2",
|
||||
@ -65,11 +65,11 @@
|
||||
"passport-oauth2-client-password": "0.1.2",
|
||||
"raw-body": "2.4.1",
|
||||
"request": "2.88.0",
|
||||
"semver": "6.2.0",
|
||||
"uglify-js": "3.6.0",
|
||||
"semver": "6.3.0",
|
||||
"uglify-js": "3.6.9",
|
||||
"when": "3.7.8",
|
||||
"ws": "6.2.1",
|
||||
"xml2js": "0.4.19"
|
||||
"xml2js": "0.4.22"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bcrypt": "3.0.6"
|
||||
@ -79,38 +79,34 @@
|
||||
"grunt-chmod": "~1.1.1",
|
||||
"grunt-cli": "~1.3.2",
|
||||
"grunt-concurrent": "~2.3.1",
|
||||
"grunt-contrib-clean": "~1.1.0",
|
||||
"grunt-contrib-compress": "~1.4.0",
|
||||
"grunt-contrib-clean": "~2.0.0",
|
||||
"grunt-contrib-compress": "~1.5.0",
|
||||
"grunt-contrib-concat": "~1.0.1",
|
||||
"grunt-contrib-copy": "~1.0.0",
|
||||
"grunt-contrib-jshint": "~1.1.0",
|
||||
"grunt-contrib-uglify": "~3.4.0",
|
||||
"grunt-contrib-jshint": "~2.1.0",
|
||||
"grunt-contrib-uglify": "~4.0.1",
|
||||
"grunt-contrib-watch": "~1.1.0",
|
||||
"grunt-jsdoc": "^2.2.1",
|
||||
"grunt-jsdoc-to-markdown": "^4.0.0",
|
||||
"grunt-jsonlint": "~1.1.0",
|
||||
"grunt-jsonlint": "~2.0.0",
|
||||
"grunt-mkdir": "~1.0.0",
|
||||
"grunt-mocha-istanbul": "5.0.2",
|
||||
"grunt-nodemon": "~0.4.2",
|
||||
"grunt-npm-command": "~0.1.2",
|
||||
"grunt-sass": "~2.0.0",
|
||||
"grunt-sass": "~3.1.0",
|
||||
"grunt-simple-mocha": "~0.4.1",
|
||||
"grunt-webdriver": "^2.0.3",
|
||||
"http-proxy": "^1.16.2",
|
||||
"http-proxy": "1.18.0",
|
||||
"istanbul": "0.4.5",
|
||||
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
|
||||
"minami": "1.2.3",
|
||||
"mocha": "^5.2.0",
|
||||
"mosca": "^2.8.3",
|
||||
"node-red-node-test-helper": "^0.2.3",
|
||||
"node-sass": "^4.13.0",
|
||||
"should": "^8.4.0",
|
||||
"sinon": "1.17.7",
|
||||
"stoppable": "^1.1.0",
|
||||
"supertest": "3.4.2",
|
||||
"wdio-chromedriver-service": "^0.1.5",
|
||||
"wdio-mocha-framework": "^0.6.4",
|
||||
"wdio-spec-reporter": "^0.1.5",
|
||||
"webdriverio": "^4.14.1",
|
||||
"node-red-node-test-helper": "^0.2.3",
|
||||
"jsdoc-nr-template": "node-red/jsdoc-nr-template"
|
||||
"supertest": "3.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
|
@ -30,7 +30,8 @@ module.exports = {
|
||||
scope: req.params.scope,
|
||||
id: req.params.id,
|
||||
key: req.params[0],
|
||||
store: req.query['store']
|
||||
store: req.query['store'],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.context.getValue(opts).then(function(result) {
|
||||
res.json(result);
|
||||
@ -45,7 +46,8 @@ module.exports = {
|
||||
scope: req.params.scope,
|
||||
id: req.params.id,
|
||||
key: req.params[0],
|
||||
store: req.query['store']
|
||||
store: req.query['store'],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.context.delete(opts).then(function(result) {
|
||||
res.status(204).end();
|
||||
|
@ -24,7 +24,8 @@ module.exports = {
|
||||
get: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.flows.getFlow(opts).then(function(result) {
|
||||
return res.json(result);
|
||||
@ -35,7 +36,8 @@ module.exports = {
|
||||
post: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
flow: req.body
|
||||
flow: req.body,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.flows.addFlow(opts).then(function(id) {
|
||||
return res.json({id:id});
|
||||
@ -47,7 +49,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
flow: req.body
|
||||
flow: req.body,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.flows.updateFlow(opts).then(function(id) {
|
||||
return res.json({id:id});
|
||||
@ -58,7 +61,8 @@ module.exports = {
|
||||
delete: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.flows.deleteFlow(opts).then(function() {
|
||||
res.status(204).end();
|
||||
|
@ -27,7 +27,8 @@ module.exports = {
|
||||
return res.status(400).json({code:"invalid_api_version", message:"Invalid API Version requested"});
|
||||
}
|
||||
var opts = {
|
||||
user: req.user
|
||||
user: req.user,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.flows.getFlows(opts).then(function(result) {
|
||||
if (version === "v1") {
|
||||
@ -46,7 +47,8 @@ module.exports = {
|
||||
}
|
||||
var opts = {
|
||||
user: req.user,
|
||||
deploymentType: req.get("Node-RED-Deployment-Type")||"full"
|
||||
deploymentType: req.get("Node-RED-Deployment-Type")||"full",
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
|
||||
if (opts.deploymentType !== 'reload') {
|
||||
|
@ -48,13 +48,13 @@ module.exports = {
|
||||
// Nodes
|
||||
adminApp.get("/nodes",needsPermission("nodes.read"),nodes.getAll,apiUtil.errorHandler);
|
||||
adminApp.post("/nodes",needsPermission("nodes.write"),nodes.post,apiUtil.errorHandler);
|
||||
adminApp.get(/\/nodes\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalogs,apiUtil.errorHandler);
|
||||
adminApp.get(/\/nodes\/((@[^\/]+\/)?[^\/]+\/[^\/]+)\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalog,apiUtil.errorHandler);
|
||||
adminApp.get(/\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.read"),nodes.getModule,apiUtil.errorHandler);
|
||||
adminApp.put(/\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.write"),nodes.putModule,apiUtil.errorHandler);
|
||||
adminApp.delete(/\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.write"),nodes.delete,apiUtil.errorHandler);
|
||||
adminApp.get(/\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,needsPermission("nodes.read"),nodes.getSet,apiUtil.errorHandler);
|
||||
adminApp.put(/\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,needsPermission("nodes.write"),nodes.putSet,apiUtil.errorHandler);
|
||||
adminApp.get(/^\/nodes\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalogs,apiUtil.errorHandler);
|
||||
adminApp.get(/^\/nodes\/((@[^\/]+\/)?[^\/]+\/[^\/]+)\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalog,apiUtil.errorHandler);
|
||||
adminApp.get(/^\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.read"),nodes.getModule,apiUtil.errorHandler);
|
||||
adminApp.put(/^\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.write"),nodes.putModule,apiUtil.errorHandler);
|
||||
adminApp.delete(/^\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.write"),nodes.delete,apiUtil.errorHandler);
|
||||
adminApp.get(/^\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,needsPermission("nodes.read"),nodes.getSet,apiUtil.errorHandler);
|
||||
adminApp.put(/^\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,needsPermission("nodes.write"),nodes.putSet,apiUtil.errorHandler);
|
||||
|
||||
// Context
|
||||
adminApp.get("/context/:scope(global)",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
||||
|
@ -24,7 +24,8 @@ module.exports = {
|
||||
},
|
||||
getAll: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
user: req.user,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
if (req.get("accept") == "application/json") {
|
||||
runtimeAPI.nodes.getNodeList(opts).then(function(list) {
|
||||
@ -42,7 +43,9 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
module: req.body.module,
|
||||
version: req.body.version
|
||||
version: req.body.version,
|
||||
url: req.body.url,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.addModule(opts).then(function(info) {
|
||||
res.json(info);
|
||||
@ -54,7 +57,8 @@ module.exports = {
|
||||
delete: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
module: req.params[0]
|
||||
module: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.removeModule(opts).then(function() {
|
||||
res.status(204).end();
|
||||
@ -66,7 +70,8 @@ module.exports = {
|
||||
getSet: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params[0] + "/" + req.params[2]
|
||||
id: req.params[0] + "/" + req.params[2],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
if (req.get("accept") === "application/json") {
|
||||
runtimeAPI.nodes.getNodeInfo(opts).then(function(result) {
|
||||
@ -87,7 +92,8 @@ module.exports = {
|
||||
getModule: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
module: req.params[0]
|
||||
module: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.getModuleInfo(opts).then(function(result) {
|
||||
res.send(result);
|
||||
@ -106,7 +112,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params[0] + "/" + req.params[2],
|
||||
enabled: body.enabled
|
||||
enabled: body.enabled,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.setNodeSetState(opts).then(function(result) {
|
||||
res.send(result);
|
||||
@ -125,7 +132,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
module: req.params[0],
|
||||
enabled: body.enabled
|
||||
enabled: body.enabled,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.setModuleState(opts).then(function(result) {
|
||||
res.send(result);
|
||||
@ -139,7 +147,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
module: req.params[0],
|
||||
lang: req.query.lng
|
||||
lang: req.query.lng,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.getModuleCatalog(opts).then(function(result) {
|
||||
res.json(result);
|
||||
@ -152,7 +161,8 @@ module.exports = {
|
||||
getModuleCatalogs: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
lang: req.query.lng
|
||||
lang: req.query.lng,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.getModuleCatalogs(opts).then(function(result) {
|
||||
res.json(result);
|
||||
@ -164,7 +174,8 @@ module.exports = {
|
||||
|
||||
getIcons: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
user: req.user,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.nodes.getIconList(opts).then(function(list) {
|
||||
res.json(list);
|
||||
|
@ -88,13 +88,13 @@ module.exports = {
|
||||
// Locales
|
||||
var locales = require("./locales");
|
||||
locales.init(runtimeAPI);
|
||||
editorApp.get(/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler);
|
||||
editorApp.get(/^\/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler);
|
||||
|
||||
// Library
|
||||
var library = require("./library");
|
||||
library.init(runtimeAPI);
|
||||
editorApp.get(/library\/([^\/]+)\/([^\/]+)(?:$|\/(.*))/,needsPermission("library.read"),library.getEntry);
|
||||
editorApp.post(/library\/([^\/]+)\/([^\/]+)\/(.*)/,needsPermission("library.write"),library.saveEntry);
|
||||
editorApp.get(/^\/library\/([^\/]+)\/([^\/]+)(?:$|\/(.*))/,needsPermission("library.read"),library.getEntry);
|
||||
editorApp.post(/^\/library\/([^\/]+)\/([^\/]+)\/(.*)/,needsPermission("library.write"),library.saveEntry);
|
||||
|
||||
|
||||
// Credentials
|
||||
|
@ -15,7 +15,7 @@
|
||||
**/
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
//var apiUtil = require('../util');
|
||||
// var apiUtil = require('../util');
|
||||
|
||||
var i18n = require("@node-red/util").i18n; // TODO: separate module
|
||||
|
||||
@ -41,7 +41,7 @@ module.exports = {
|
||||
var namespace = req.params[0];
|
||||
var lngs = req.query.lng;
|
||||
namespace = namespace.replace(/\.json$/,"");
|
||||
var lang = req.query.lng; //apiUtil.determineLangFromHeaders(req.acceptsLanguages() || []);
|
||||
var lang = req.query.lng || i18n.defaultLang; //apiUtil.determineLangFromHeaders(req.acceptsLanguages() || []);
|
||||
var prevLang = i18n.i.language;
|
||||
// Trigger a load from disk of the language if it is not the default
|
||||
i18n.i.changeLanguage(lang, function(){
|
||||
|
@ -22,7 +22,8 @@ var needsPermission = require("../auth").needsPermission;
|
||||
|
||||
function listProjects(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
user: req.user,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.listProjects(opts).then(function(result) {
|
||||
res.json(result);
|
||||
@ -33,7 +34,8 @@ function listProjects(req,res) {
|
||||
function getProject(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getProject(opts).then(function(data) {
|
||||
if (data) {
|
||||
@ -49,7 +51,8 @@ function getProjectStatus(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.query.remote
|
||||
remote: req.query.remote,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getStatus(opts).then(function(data){
|
||||
if (data) {
|
||||
@ -64,7 +67,8 @@ function getProjectStatus(req,res) {
|
||||
function getProjectRemotes(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getRemotes(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -98,7 +102,8 @@ module.exports = {
|
||||
app.post("/", needsPermission("projects.write"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
project: req.body
|
||||
project: req.body,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.createProject(opts).then(function(result) {
|
||||
res.json(result);
|
||||
@ -112,7 +117,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
project: req.body
|
||||
project: req.body,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
|
||||
if (req.body.active) {
|
||||
@ -150,7 +156,8 @@ module.exports = {
|
||||
app.delete("/:id", needsPermission("projects.write"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.deleteProject(opts).then(function() {
|
||||
res.status(204).end();
|
||||
@ -168,7 +175,8 @@ module.exports = {
|
||||
app.get("/:id/files", needsPermission("projects.read"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getFiles(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -185,7 +193,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0],
|
||||
tree: req.params.treeish
|
||||
tree: req.params.treeish,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getFile(opts).then(function(data) {
|
||||
res.json({content:data});
|
||||
@ -199,7 +208,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0]
|
||||
path: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
|
||||
runtimeAPI.projects.revertFile(opts).then(function() {
|
||||
@ -214,7 +224,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0]
|
||||
path: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.stageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
@ -228,7 +239,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.body.files
|
||||
path: req.body.files,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.stageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
@ -242,7 +254,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
message: req.body.message
|
||||
message: req.body.message,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.commit(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
@ -256,7 +269,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0]
|
||||
path: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.unstageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
@ -269,7 +283,8 @@ module.exports = {
|
||||
app.delete("/:id/stage", needsPermission("projects.write"), function(req, res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.unstageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
@ -284,7 +299,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0],
|
||||
type: req.params.type
|
||||
type: req.params.type,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getFileDiff(opts).then(function(data) {
|
||||
res.json({
|
||||
@ -301,7 +317,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
limit: req.query.limit || 20,
|
||||
before: req.query.before
|
||||
before: req.query.before,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getCommits(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -315,7 +332,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
sha: req.params.sha
|
||||
sha: req.params.sha,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getCommit(opts).then(function(data) {
|
||||
res.json({commit:data});
|
||||
@ -330,7 +348,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.params[0],
|
||||
track: req.query.u
|
||||
track: req.query.u,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.push(opts).then(function(data) {
|
||||
res.status(204).end();
|
||||
@ -346,7 +365,8 @@ module.exports = {
|
||||
id: req.params.id,
|
||||
remote: req.params[0],
|
||||
track: req.query.setUpstream,
|
||||
allowUnrelatedHistories: req.query.allowUnrelatedHistories
|
||||
allowUnrelatedHistories: req.query.allowUnrelatedHistories,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.pull(opts).then(function(data) {
|
||||
res.status(204).end();
|
||||
@ -359,7 +379,8 @@ module.exports = {
|
||||
app.delete("/:id/merge", needsPermission("projects.write"), function(req, res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
id: req.params.id,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.abortMerge(opts).then(function() {
|
||||
res.status(204).end();
|
||||
@ -374,7 +395,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
path: req.params[0],
|
||||
resolution: req.body.resolutions
|
||||
resolution: req.body.resolutions,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.resolveMerge(opts).then(function() {
|
||||
res.status(204).end();
|
||||
@ -388,7 +410,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: false
|
||||
remote: false,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getBranches(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -403,7 +426,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
branch: req.params.branchName,
|
||||
force: !!req.query.force
|
||||
force: !!req.query.force,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.deleteBranch(opts).then(function(data) {
|
||||
res.status(204).end();
|
||||
@ -417,7 +441,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: true
|
||||
remote: true,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getBranches(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -431,7 +456,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
branch: req.params[0]
|
||||
branch: req.params[0],
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.getBranchStatus(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -446,7 +472,8 @@ module.exports = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
branch: req.body.name,
|
||||
create: req.body.create
|
||||
create: req.body.create,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.setBranch(opts).then(function(data) {
|
||||
res.json(data);
|
||||
@ -463,7 +490,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.body
|
||||
remote: req.body,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
if (/^https?:\/\/[^/]+@/i.test(req.body.url)) {
|
||||
res.status(400).json({error:"unexpected_error", message:"Git http url must not include username/password"});
|
||||
@ -481,7 +509,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.params.remoteName
|
||||
remote: req.params.remoteName,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.removeRemote(opts).then(function(data) {
|
||||
getProjectRemotes(req,res);
|
||||
@ -497,7 +526,8 @@ module.exports = {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: remote
|
||||
remote: remote,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
runtimeAPI.projects.updateRemote(opts).then(function() {
|
||||
res.status(204).end();
|
||||
|
@ -42,7 +42,7 @@ var editor;
|
||||
/**
|
||||
* Initialise the module.
|
||||
* @param {Object} settings The runtime settings
|
||||
* @param {HTTPServer} server An instance of HTTP Server
|
||||
* @param {HTTPServer} _server An instance of HTTP Server
|
||||
* @param {Storage} storage An instance of Node-RED Storage
|
||||
* @param {Runtime} runtimeAPI An instance of Node-RED Runtime
|
||||
* @memberof @node-red/editor-api
|
||||
|
@ -47,5 +47,12 @@ module.exports = {
|
||||
code: err.code||"unexpected_error",
|
||||
message: err.message||err.toString()
|
||||
});
|
||||
},
|
||||
getRequestLogObject: function(req) {
|
||||
return {
|
||||
user: req.user,
|
||||
path: req.path,
|
||||
ip: (req.headers && req.headers['x-forwarded-for']) || (req.connection && req.connection.remoteAddress) || undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-api",
|
||||
"version": "1.0.0-beta.2",
|
||||
"version": "1.0.3",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@ -16,17 +16,17 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "1.0.0-beta.2",
|
||||
"@node-red/editor-client": "1.0.0-beta.2",
|
||||
"@node-red/util": "1.0.3",
|
||||
"@node-red/editor-client": "1.0.3",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.19.0",
|
||||
"clone": "2.1.2",
|
||||
"cors": "2.8.5",
|
||||
"express-session": "1.16.2",
|
||||
"express-session": "1.17.0",
|
||||
"express": "4.17.1",
|
||||
"memorystore": "1.6.1",
|
||||
"mime": "2.4.4",
|
||||
"mustache": "3.0.1",
|
||||
"mustache": "3.0.2",
|
||||
"oauth2orize": "1.11.0",
|
||||
"passport-http-bearer": "1.0.1",
|
||||
"passport-oauth2-client-password": "0.1.2",
|
||||
|
@ -26,8 +26,7 @@
|
||||
"status" : "Status",
|
||||
"enabled" : "Aktiviert",
|
||||
"disabled" : "Inaktiviert",
|
||||
"info" : "Beschreibung",
|
||||
"tip" : "Beschreibung akzeptiert Markdown und wird auf der Registerkarte Info angezeigt."
|
||||
"info" : "Beschreibung"
|
||||
},
|
||||
"menu" : {
|
||||
"label" : {
|
||||
@ -237,7 +236,6 @@
|
||||
"deleteSubflow" : "Subflow löschen",
|
||||
"info" : "Beschreibung",
|
||||
"category" : "Kategorie",
|
||||
"format" : "Markdown-Format",
|
||||
"errors" : {
|
||||
"noNodesSelected" : "<strong> Subflow kann nicht erstellt werden </strong>: Es wurden keine Nodes ausgewählt.",
|
||||
"multipleInputsToSelection" : "<strong> Subflow kann nicht erstellt werden </strong>: Mehrere Eingaben zur Auswahl"
|
||||
@ -446,8 +444,8 @@
|
||||
"none" : "keine",
|
||||
"subflows" : "Subflows",
|
||||
"flows" : "Flows",
|
||||
"filterUnused" : "Nicht verwendet",
|
||||
"filterAll" : "alle",
|
||||
"filterUnused" : "Nicht verwendet",
|
||||
"filtered" : "__count__ verdeckt"
|
||||
},
|
||||
"context" : {
|
||||
|
@ -15,6 +15,17 @@
|
||||
"next": "Next",
|
||||
"clone": "Clone project",
|
||||
"cont": "Continue"
|
||||
},
|
||||
"type": {
|
||||
"string": "string",
|
||||
"number": "number",
|
||||
"boolean": "boolean",
|
||||
"array": "array",
|
||||
"buffer": "buffer",
|
||||
"object": "object",
|
||||
"jsonString": "JSON string",
|
||||
"undefined": "undefined",
|
||||
"null": "null"
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
@ -310,10 +321,12 @@
|
||||
"addNewType": "Add new __type__...",
|
||||
"nodeProperties": "node properties",
|
||||
"label": "Label",
|
||||
"color": "Color",
|
||||
"portLabels": "Port labels",
|
||||
"labelInputs": "Inputs",
|
||||
"labelOutputs": "Outputs",
|
||||
"settingIcon": "Icon",
|
||||
"default": "default",
|
||||
"noDefaultLabel": "none",
|
||||
"defaultLabel": "use default label",
|
||||
"searchIcons": "Search icons",
|
||||
@ -321,6 +334,40 @@
|
||||
"description": "Description",
|
||||
"show": "Show",
|
||||
"hide": "Hide",
|
||||
"locale": "Select UI Language",
|
||||
"icon": "Icon",
|
||||
"inputType": "Input type",
|
||||
"inputs" : {
|
||||
"input": "input",
|
||||
"select": "select",
|
||||
"checkbox": "checkbox",
|
||||
"spinner": "spinner",
|
||||
"none": "none",
|
||||
"hidden": "hide property"
|
||||
},
|
||||
"types": {
|
||||
"str": "string",
|
||||
"num": "number",
|
||||
"bool": "bool",
|
||||
"json": "JSON",
|
||||
"bin": "buffer",
|
||||
"env": "env variable"
|
||||
},
|
||||
"menu": {
|
||||
"input": "input",
|
||||
"select": "select",
|
||||
"checkbox": "checkbox",
|
||||
"spinner": "spinner",
|
||||
"hidden": "label only"
|
||||
},
|
||||
"select": {
|
||||
"label": "Label",
|
||||
"value": "Value"
|
||||
},
|
||||
"spinner": {
|
||||
"min": "Minimum",
|
||||
"max": "Maximum"
|
||||
},
|
||||
"errors": {
|
||||
"scopeChange": "Changing the scope will make it unavailable to nodes in other flows that use it",
|
||||
"invalidProperties": "Invalid properties:"
|
||||
@ -379,9 +426,13 @@
|
||||
"addCategory": "Add new...",
|
||||
"label": {
|
||||
"subflows": "subflows",
|
||||
"network": "network",
|
||||
"common": "common",
|
||||
"input": "input",
|
||||
"output": "output",
|
||||
"function": "function",
|
||||
"sequence": "sequence",
|
||||
"parser": "parser",
|
||||
"social": "social",
|
||||
"storage": "storage",
|
||||
"analysis": "analysis",
|
||||
@ -518,8 +569,10 @@
|
||||
"none": "none",
|
||||
"subflows": "subflows",
|
||||
"flows": "flows",
|
||||
"filterUnused":"unused",
|
||||
"filterAll":"all",
|
||||
"filterAll": "all",
|
||||
"showAllConfigNodes": "Show all config nodes",
|
||||
"filterUnused": "unused",
|
||||
"showAllUnusedConfigNodes": "Show all unused config nodes",
|
||||
"filtered": "__count__ hidden"
|
||||
},
|
||||
"context": {
|
||||
@ -532,7 +585,7 @@
|
||||
"flow": "Flow",
|
||||
"global": "Global",
|
||||
"deleteConfirm": "Are you sure you want to delete this item?",
|
||||
"autoRefresh": "Auto-refresh",
|
||||
"autoRefresh": "Refresh on selection change",
|
||||
"refrsh": "Refresh",
|
||||
"delete": "Delete"
|
||||
},
|
||||
@ -549,6 +602,7 @@
|
||||
"noSummaryAvailable": "No summary available",
|
||||
"editDescription": "Edit project description",
|
||||
"editDependencies": "Edit project dependencies",
|
||||
"noDescriptionAvailable": "No description available",
|
||||
"editReadme": "Edit README.md",
|
||||
"showProjectSettings": "Show project settings",
|
||||
"projectSettings": {
|
||||
@ -703,7 +757,8 @@
|
||||
"bin": "buffer",
|
||||
"date": "timestamp",
|
||||
"jsonata": "expression",
|
||||
"env": "env variable"
|
||||
"env": "env variable",
|
||||
"cred": "credential"
|
||||
}
|
||||
},
|
||||
"editableList": {
|
||||
@ -749,10 +804,14 @@
|
||||
"copyPath": "Copy path to item",
|
||||
"expandItems": "Expand items",
|
||||
"collapseItems": "Collapse items",
|
||||
"duplicate": "Duplicate"
|
||||
"duplicate": "Duplicate",
|
||||
"error": {
|
||||
"invalidJSON": "Invalid JSON: "
|
||||
}
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "Markdown editor",
|
||||
"expand": "Expand",
|
||||
"format": "Formatted with markdown",
|
||||
"heading1": "Heading 1",
|
||||
"heading2": "Heading 2",
|
||||
@ -939,15 +998,18 @@
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "Properties",
|
||||
"envProperties": "Environment Variables",
|
||||
"description": "Description",
|
||||
"appearance": "Appearance",
|
||||
"env": "Environment Variables"
|
||||
"preview": "UI Preview",
|
||||
"defaultValue": "Default value"
|
||||
},
|
||||
"languages" : {
|
||||
"de": "German",
|
||||
"en-US": "English",
|
||||
"ja": "Japanese",
|
||||
"ko": "Korean",
|
||||
"zh-CN": "Chinese(Simplified)"
|
||||
"zh-CN": "Chinese(Simplified)",
|
||||
"zh-TW": "Chinese(Traditional)"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg",
|
||||
"desc": "Casts the *arg* parameter to a string using the following casting rules:\n\n - Strings are unchanged\n - Functions are converted to an empty string\n - Numeric infinity and NaN throw an error because they cannot be represented as a JSON number\n - All other values are converted to a JSON string using the `JSON.stringify` function"
|
||||
"args": "arg[, prettify]",
|
||||
"desc": "Casts the `arg` parameter to a string using the following casting rules:\n\n - Strings are unchanged\n - Functions are converted to an empty string\n - Numeric infinity and NaN throw an error because they cannot be represented as a JSON number\n - All other values are converted to a JSON string using the `JSON.stringify` function. If `prettify` is true, then \"prettified\" JSON is produced. i.e One line per field and lines will be indented based on the field depth."
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
@ -185,7 +185,7 @@
|
||||
},
|
||||
"$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`.\n\nThe optional `init` parameter is used as the initial value in the aggregation."
|
||||
"desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string[, string]",
|
||||
@ -230,6 +230,41 @@
|
||||
"$parseInteger": {
|
||||
"args": "string, picture",
|
||||
"desc": "Parses the contents of the `string` parameter to an integer (as a JSON number) using the format specified by the `picture` string. The `picture` string parameter has the same format as `$formatInteger`."
|
||||
|
||||
},
|
||||
"$error": {
|
||||
"args": "[str]",
|
||||
"desc": "Throws an error with a message. The optional `str` will replace the default message of `$error() function evaluated`"
|
||||
},
|
||||
"$assert": {
|
||||
"args": "arg, str",
|
||||
"desc": "If `arg` is true the function returns undefined. If `arg` is false an exception is thrown with `str` as the message of the exception."
|
||||
},
|
||||
"$single": {
|
||||
"args": "array, function",
|
||||
"desc": "Returns the one and only value in the `array` parameter that satisfies the `function` predicate (i.e. the `function` returns Boolean `true` when passed the value). Throws an exception if the number of matching values is not exactly one.\n\nThe function should be supplied in the following signature: `function(value [, index [, array]])` where value is each input of the array, index is the position of that value and the whole array is passed as the third argument"
|
||||
},
|
||||
"$encodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "Encodes a Uniform Resource Locator (URL) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.\n\nExample: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
|
||||
},
|
||||
"$encodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "Encodes a Uniform Resource Locator (URL) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character. \n\nExample: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`"
|
||||
},
|
||||
"$decodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "Decodes a Uniform Resource Locator (URL) component previously created by encodeUrlComponent. \n\nExample: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`"
|
||||
},
|
||||
"$decodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "Decodes a Uniform Resource Locator (URL) previously created by encodeUrl. \n\nExample: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`"
|
||||
},
|
||||
"$distinct": {
|
||||
"args": "array",
|
||||
"desc": "Returns an array with duplicate values removed from `array`"
|
||||
},
|
||||
"$type": {
|
||||
"args": "value",
|
||||
"desc": "Returns the type of `value` as a string. If `value` is undefined, this will return `undefined`"
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,17 @@
|
||||
"next": "進む",
|
||||
"clone": "プロジェクトをクローン",
|
||||
"cont": "続ける"
|
||||
},
|
||||
"type": {
|
||||
"string": "文字列",
|
||||
"number": "数値",
|
||||
"boolean": "真偽値",
|
||||
"array": "配列",
|
||||
"buffer": "バッファ",
|
||||
"object": "オブジェクト",
|
||||
"jsonString": "JSON文字列",
|
||||
"undefined": "undefined",
|
||||
"null": "null"
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
@ -80,7 +91,7 @@
|
||||
"projects-new": "新規",
|
||||
"projects-open": "開く",
|
||||
"projects-settings": "設定",
|
||||
"showNodeLabelDefault": "追加したノードのラベルを表示する"
|
||||
"showNodeLabelDefault": "追加したノードのラベルを表示"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
@ -310,10 +321,12 @@
|
||||
"addNewType": "新規に __type__ を追加...",
|
||||
"nodeProperties": "プロパティ",
|
||||
"label": "ラベル",
|
||||
"color": "色",
|
||||
"portLabels": "ポートラベル",
|
||||
"labelInputs": "入力",
|
||||
"labelOutputs": "出力",
|
||||
"settingIcon": "アイコン",
|
||||
"default": "デフォルト",
|
||||
"noDefaultLabel": "なし",
|
||||
"defaultLabel": "既定のラベルを使用",
|
||||
"searchIcons": "アイコンを検索",
|
||||
@ -321,6 +334,40 @@
|
||||
"description": "詳細",
|
||||
"show": "表示",
|
||||
"hide": "非表示",
|
||||
"locale": "UI言語の選択",
|
||||
"icon": "記号",
|
||||
"inputType": "入力形式",
|
||||
"inputs": {
|
||||
"input": "入力",
|
||||
"select": "メニュー",
|
||||
"checkbox": "チェックボックス",
|
||||
"spinner": "スピナー",
|
||||
"none": "無し",
|
||||
"hidden": "非表示"
|
||||
},
|
||||
"types": {
|
||||
"str": "文字列",
|
||||
"num": "数値",
|
||||
"bool": "真偽",
|
||||
"json": "JSON",
|
||||
"bin": "バッファ",
|
||||
"env": "環境変数"
|
||||
},
|
||||
"menu": {
|
||||
"input": "入力",
|
||||
"select": "選択",
|
||||
"checkbox": "チェックボックス",
|
||||
"spinner": "数値",
|
||||
"hidden": "ラベルのみ"
|
||||
},
|
||||
"select": {
|
||||
"label": "ラベル",
|
||||
"value": "値"
|
||||
},
|
||||
"spinner": {
|
||||
"min": "最小値",
|
||||
"max": "最大値"
|
||||
},
|
||||
"errors": {
|
||||
"scopeChange": "スコープの変更は、他のフローで使われているノードを無効にします",
|
||||
"invalidProperties": "プロパティが不正です:"
|
||||
@ -351,7 +398,8 @@
|
||||
"pasteNode": "ノードを貼り付け",
|
||||
"undoChange": "変更操作を戻す",
|
||||
"searchBox": "ノードを検索",
|
||||
"managePalette": "パレットの管理"
|
||||
"managePalette": "パレットの管理",
|
||||
"actionList": "動作一覧"
|
||||
},
|
||||
"library": {
|
||||
"library": "ライブラリ",
|
||||
@ -378,9 +426,13 @@
|
||||
"addCategory": "新規追加...",
|
||||
"label": {
|
||||
"subflows": "サブフロー",
|
||||
"network": "ネットワーク",
|
||||
"common": "共通",
|
||||
"input": "入力",
|
||||
"output": "出力",
|
||||
"function": "機能",
|
||||
"sequence": "シーケンス",
|
||||
"parser": "パーサ",
|
||||
"social": "ソーシャル",
|
||||
"storage": "ストレージ",
|
||||
"analysis": "分析",
|
||||
@ -517,8 +569,10 @@
|
||||
"none": "なし",
|
||||
"subflows": "サブフロー",
|
||||
"flows": "フロー",
|
||||
"filterUnused": "未使用",
|
||||
"filterAll": "全て",
|
||||
"showAllConfigNodes": "全設定ノードを表示",
|
||||
"filterUnused": "未使用",
|
||||
"showAllUnusedConfigNodes": "未使用の全設定ノードを表示",
|
||||
"filtered": "__count__ 個が無効"
|
||||
},
|
||||
"context": {
|
||||
@ -527,11 +581,13 @@
|
||||
"none": "選択されていません",
|
||||
"refresh": "読み込みのため更新してください",
|
||||
"empty": "データが存在しません",
|
||||
"node": "Node",
|
||||
"flow": "Flow",
|
||||
"global": "Global",
|
||||
"node": "ノード",
|
||||
"flow": "フロー",
|
||||
"global": "グローバル",
|
||||
"deleteConfirm": "データを削除しても良いですか?",
|
||||
"autoRefresh": "自動更新"
|
||||
"autoRefresh": "選択対象が変化した場合更新",
|
||||
"refrsh": "更新",
|
||||
"delete": "削除"
|
||||
},
|
||||
"palette": {
|
||||
"name": "パレットの管理",
|
||||
@ -543,9 +599,10 @@
|
||||
"description": "詳細",
|
||||
"dependencies": "依存関係",
|
||||
"settings": "設定",
|
||||
"noSummaryAvailable": "サマリが存在しません",
|
||||
"noSummaryAvailable": "要約が存在しません",
|
||||
"editDescription": "プロジェクトの詳細を編集",
|
||||
"editDependencies": "プロジェクトの依存関係を編集",
|
||||
"noDescriptionAvailable": "詳細が存在しません",
|
||||
"editReadme": "README.mdを編集",
|
||||
"showProjectSettings": "プロジェクト設定を表示",
|
||||
"projectSettings": {
|
||||
@ -736,10 +793,23 @@
|
||||
},
|
||||
"jsonEditor": {
|
||||
"title": "JSONエディタ",
|
||||
"format": "JSONフォーマット"
|
||||
"format": "JSONフォーマット",
|
||||
"rawMode": "JSONを編集",
|
||||
"uiMode": "ビジュアルエディタ",
|
||||
"insertAbove": "上に挿入",
|
||||
"insertBelow": "下に挿入",
|
||||
"addItem": "要素を追加",
|
||||
"copyPath": "要素のパスをコピー",
|
||||
"expandItems": "要素を展開",
|
||||
"collapseItems": "要素を折り畳む",
|
||||
"duplicate": "複製",
|
||||
"error": {
|
||||
"invalidJSON": "不正なJSON: "
|
||||
}
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "マークダウンエディタ",
|
||||
"expand": "拡大",
|
||||
"format": "マークダウン形式で記述",
|
||||
"heading1": "見出しレベル1",
|
||||
"heading2": "見出しレベル2",
|
||||
@ -900,7 +970,7 @@
|
||||
"confirm": "<p>デプロイされていない変更は失われます。</p><p>続けますか?</p>"
|
||||
},
|
||||
"send-req": {
|
||||
"auth-req": "リポジトリ対する認証が必要です",
|
||||
"auth-req": "リポジトリに対する認証が必要です",
|
||||
"username": "ユーザ名",
|
||||
"password": "パスワード",
|
||||
"passphrase": "パスフレーズ",
|
||||
@ -926,15 +996,18 @@
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "プロパティ",
|
||||
"envProperties": "環境変数",
|
||||
"description": "説明",
|
||||
"appearance": "外観",
|
||||
"env": "環境変数"
|
||||
"preview": "UIプレビュー",
|
||||
"defaultValue": "デフォルト値"
|
||||
},
|
||||
"languages" : {
|
||||
"languages": {
|
||||
"de": "ドイツ語",
|
||||
"en-US": "英語",
|
||||
"ja": "日本語",
|
||||
"ko": "韓国語",
|
||||
"zh-CN": "中国語(簡体)"
|
||||
"zh-CN": "中国語(簡体)",
|
||||
"zh-TW": "中国語(繁体)"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg",
|
||||
"desc": "以下の型変換ルールを用いて、引数 *arg* を文字列へ型変換します。:\n\n - 文字列は変換しません。\n - 関数は空の文字列に変換します。\n - JSONの数値として表現できないため、無限大やNaNはエラーになります。\n - 他の値は `JSON.stringify` 関数を用いて、JSONの文字列へ変換します。"
|
||||
"args": "arg[, prettify]",
|
||||
"desc": "以下の型変換ルールを用いて、引数 *arg* を文字列へ型変換します。:\n\n - 文字列は変換しません。\n - 関数は空の文字列に変換します。\n - JSONの数値として表現できないため、無限大やNaNはエラーになります。\n - 他の値は `JSON.stringify` 関数を用いて、JSONの文字列へ変換します。`prettify`が真の場合、JSONを整形出力します。フィールドを1行毎に出力。フィールドのネスト深さによってインデントを行います。"
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
@ -185,7 +185,7 @@
|
||||
},
|
||||
"$reduce": {
|
||||
"args": "array, function [, init]",
|
||||
"desc": "配列の各要素値に関数 `function` を連続的に適用して得られる集約値を返します。 `function` の適用の際には、直前の `function` の適用結果と要素値が引数として与えられます。\n\n関数 `function` は引数を2つ取り、配列の各要素の間に配置する中置演算子のように作用しなくてはなりません。\n\n任意の引数 `init` には、集約時の初期値を設定します。"
|
||||
"desc": "配列の各要素値に関数 `function` を連続的に適用して得られる集約値を返します。 `function` の適用の際には、直前の `function` の適用結果と要素値が引数として与えられます。\n\n関数 `function` は引数を2つ取り、配列の各要素の間に配置する中置演算子のように作用しなくてはなりません。関数`function`のシグネチャは`myfunc($accumulator, $value[, $index[, $array]])`という形式でなければなりません。\n\n任意の引数 `init` には、集約時の初期値を設定します。"
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string",
|
||||
@ -230,5 +230,41 @@
|
||||
"$parseInteger": {
|
||||
"args": "string, picture",
|
||||
"desc": "`picture`文字列の指定に従って、`string`パラメータを整数(JSON数値)に変換します。`picture`文字列は`$formatInteger`と同じ形式です。"
|
||||
},
|
||||
"$error": {
|
||||
"args": "[str]",
|
||||
"desc": "メッセージを指定して例外を送出します。メッセージ`str`を省略した場合は`$error() function evaluated`をメッセージとします。"
|
||||
},
|
||||
"$assert": {
|
||||
"args": "arg, str",
|
||||
"desc": "`arg`が真の場合、undefinedを返します。偽の場合、`str`をメッセージとする例外を送出します。"
|
||||
},
|
||||
"$single": {
|
||||
"args": "array, function",
|
||||
"desc": "`array`の要素のうち、条件判定関数`function`を満たす(`function`に与えた場合に真偽値`true`を返す)要素が1つのみである場合、それを返します。マッチする要素が1つのみでない場合、例外を送出します。\n\n指定する関数は`function(value [, index [, array]])`というシグネチャでなければなりません。ここで、`value`は`array`の要素値、`index`は要素の添字、第三引数には配列全体を渡します。"
|
||||
},
|
||||
"$encodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "Uniform Resource Locator (URL)を構成する文字を1、2、3、もしくは、4文字エスケープシーケンスのUTF-8文字エンコーディングで置換します。\n\n例: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
|
||||
},
|
||||
"$encodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "Uniform Resource Locator (URL)要素を構成する文字を1、2、3、もしくは、4文字エスケープシーケンスのUTF-8文字エンコーディングで置換します。\n\n例: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`"
|
||||
},
|
||||
"$decodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "encodeUrlComponentで置換したUniform Resource Locator (URL)をデコードします。\n\n例: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`"
|
||||
},
|
||||
"$decodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "encodeUrlで置換したUniform Resource Locator (URL)要素をデコードします。 \n\n例: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`"
|
||||
},
|
||||
"$distinct": {
|
||||
"args": "array",
|
||||
"desc": "配列`array`から重複要素を削除した配列を返します。"
|
||||
},
|
||||
"$type": {
|
||||
"args": "value",
|
||||
"desc": "`value` の型を文字列として返します。もし `value` が未定義の場合、 `undefined` が返されます。"
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +273,6 @@
|
||||
"deleteSubflow": "서브 플로우 삭제",
|
||||
"info": "상세내역",
|
||||
"category": "카테고리",
|
||||
"format": "Markdown 형식",
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>서브 플로우를 생성할 수 없습니다</strong> : 노드가 선택되지 않았습니다",
|
||||
"multipleInputsToSelection": "<strong>서브 플로우를 생성할 수 없습니다</strong> : 복수의 입력이 선택되었습니다"
|
||||
@ -495,8 +494,8 @@
|
||||
"none": "없음",
|
||||
"subflows": "보조 플로우",
|
||||
"flows": "플로우",
|
||||
"filterUnused": "미사용",
|
||||
"filterAll": "전체",
|
||||
"filterUnused": "미사용",
|
||||
"filtered": "__count__ 개 숨김"
|
||||
},
|
||||
"context": {
|
||||
|
@ -10,7 +10,22 @@
|
||||
"load": "读取",
|
||||
"save": "保存",
|
||||
"import": "导入",
|
||||
"export": "导出"
|
||||
"export": "导出",
|
||||
"back": "后退",
|
||||
"next": "下一个",
|
||||
"clone": "克隆项目",
|
||||
"cont": "继续"
|
||||
},
|
||||
"type": {
|
||||
"string": "字符串",
|
||||
"number": "数字",
|
||||
"boolean": "布尔值",
|
||||
"array": "数组",
|
||||
"buffer": "buffer",
|
||||
"object": "对象",
|
||||
"jsonString": "JSON字符串",
|
||||
"undefined": "为定义",
|
||||
"null": "空"
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
@ -19,10 +34,13 @@
|
||||
"confirmDelete": "确认删除",
|
||||
"delete": "你确定想删除 '__label__'?",
|
||||
"dropFlowHere": "把流程放到这里",
|
||||
"addFlow": "添加流程",
|
||||
"listFlows": "流程一览",
|
||||
"status": "状态",
|
||||
"enabled": "有效",
|
||||
"disabled": "无效",
|
||||
"info": "详细描述"
|
||||
"info": "详细描述",
|
||||
"selectNodes": "点击节点来选择"
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
@ -36,11 +54,16 @@
|
||||
"defaultDir": "默认方向",
|
||||
"ltr": "从左到右",
|
||||
"rtl": "从右到左",
|
||||
"auto": "上下文"
|
||||
"auto": "上下文",
|
||||
"language": "语言",
|
||||
"browserDefault": "浏览器默认"
|
||||
},
|
||||
"sidebar": {
|
||||
"show": "显示侧边栏"
|
||||
},
|
||||
"palette": {
|
||||
"show": "显示控制板"
|
||||
},
|
||||
"settings": "设置",
|
||||
"userSettings": "用户设置",
|
||||
"nodes": "节点",
|
||||
@ -60,11 +83,23 @@
|
||||
"keyboardShortcuts": "键盘快捷方式",
|
||||
"login": "登陆",
|
||||
"logout": "退出",
|
||||
"editPalette":"节点管理",
|
||||
"editPalette": "节点管理",
|
||||
"other": "其他",
|
||||
"showTips": "显示小提示"
|
||||
"showTips": "显示小提示",
|
||||
"help": "Node-RED网页",
|
||||
"projects": "项目",
|
||||
"projects-new": "新建",
|
||||
"projects-open": "打开",
|
||||
"projects-settings": "项目设定",
|
||||
"showNodeLabelDefault": "显示新添加的节点的标签"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"toggle-navigator": "切换导航器",
|
||||
"zoom-out": "缩小",
|
||||
"zoom-reset": "重设缩放",
|
||||
"zoom-in": "放大"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "作为__name__登陆",
|
||||
"username": "账号",
|
||||
@ -82,29 +117,73 @@
|
||||
"warning": "<strong>警告</strong>: __message__",
|
||||
"warnings": {
|
||||
"undeployedChanges": "节点中存在未部署的更改",
|
||||
"nodeActionDisabled": "节点操作已禁用",
|
||||
"nodeActionDisabledSubflow": "节点动作在子流程中被禁用",
|
||||
"missing-types": "流程由于缺少节点类型而停止。请检查日志的详细信息",
|
||||
"restartRequired": "Node-RED必须重新启动,以启用升级的模块"
|
||||
"safe-mode": "<p>流程以安全模式停止。</p><p>您可以修改流程并部署更改以重新启动。</p>",
|
||||
"restartRequired": "Node-RED必须重新启动,以启用升级的模块",
|
||||
"credentials_load_failed": "<p>由于无法解密凭据,因此流程停止。</p><p>流程凭据文件已加密,但是项目的加密密钥丢失或无效。</p>",
|
||||
"credentials_load_failed_reset": "<p>凭据无法解密</p><p>流凭据文件已加密,但是项目的加密密钥丢失或无效。</p><p>流凭据文件将在下一次部署时重置。任何现有的流凭证将被清除。</p>",
|
||||
"missing_flow_file": "<p>找不到项目流程文件。</p><p>该项目未配置流程文件。</p>",
|
||||
"missing_package_file": "<p>找不到项目包文件。</p><p>项目缺少package.json文件。</p>",
|
||||
"project_empty": "<p>该项目为空。</p><p>是否要创建一组默认的项目文件?<br/>否则,您将必须在编辑器外部手动将文件添加到项目中。</p>",
|
||||
"project_not_found": "<p>未找到项目'__project__'。</p>",
|
||||
"git_merge_conflict": "<p>自动合并更改失败。</p><p>修复未合并的冲突,然后提交结果。</p>"
|
||||
},
|
||||
"error": "<strong>Error</strong>: __message__",
|
||||
"error": "<strong>错误</strong>: __message__",
|
||||
"errors": {
|
||||
"lostConnection": "丢失与服务器的连接,重新连接...",
|
||||
"lostConnectionReconnect": "丢失与服务器的连接,__time__秒后重新连接",
|
||||
"lostConnectionTry": "现在尝试",
|
||||
"cannotAddSubflowToItself": "无法向其自身添加子流程",
|
||||
"cannotAddCircularReference": "无法添加子流程 - 循环引用",
|
||||
"unsupportedVersion": "您正在使用不受支持的Node.js版本<br/>请升级到最新版本的Node.js LTS"
|
||||
"unsupportedVersion": "您正在使用不受支持的Node.js版本<br/>请升级到最新版本的Node.js LTS",
|
||||
"failedToAppendNode": "<p>'__module__'加载失败</p><p>__error__</p>"
|
||||
},
|
||||
"project": {
|
||||
"change-branch": "转到本地分支'__project__'",
|
||||
"merge-abort": "Git合并中止",
|
||||
"loaded": "项目'__project__'已加载",
|
||||
"updated": "项目'__project__'已更新",
|
||||
"pull": "项目'__project__'已重新加载",
|
||||
"revert": "项目 '__project__'已还原",
|
||||
"merge-complete": "Git合并完成",
|
||||
"setupCredentials": "设定证书",
|
||||
"setupProjectFiles": "设置项目文件",
|
||||
"no": "不了,谢谢",
|
||||
"createDefault": "创建默认项目文件",
|
||||
"mergeConflict": "显示合并冲突"
|
||||
},
|
||||
"label": {
|
||||
"manage-project-dep": "管理项目依赖性",
|
||||
"setup-cred": "设定证书",
|
||||
"setup-project": "设置项目文件",
|
||||
"create-default-package": "创建默认的包文件",
|
||||
"no-thanks": "不了,谢谢",
|
||||
"create-default-project": "创建默认项目文件",
|
||||
"show-merge-conflicts": "显示合并冲突"
|
||||
}
|
||||
},
|
||||
"clipboard": {
|
||||
"clipboard": "剪贴板",
|
||||
"nodes": "节点",
|
||||
"node": "__count__节点",
|
||||
"node_plural": "__count__节点",
|
||||
"configNode": "__count__配置节点",
|
||||
"configNode_plural": "__count__配置节点",
|
||||
"flow": "__count__流程",
|
||||
"flow_plural": "__count__流程",
|
||||
"subflow": "__count__子流程",
|
||||
"subflow_plural": "__count__子流程",
|
||||
"pasteNodes": "在这里粘贴节点",
|
||||
"selectFile": "选择要导入的文件",
|
||||
"importNodes": "导入节点",
|
||||
"exportNodes": "导出节点至剪贴板",
|
||||
"download": "下载",
|
||||
"importUnrecognised": "导入了无法识别的类型:",
|
||||
"importUnrecognised_plural": "导入了无法识别的类型:",
|
||||
"nodesExported": "节点导出到了剪贴板",
|
||||
"nodesImported": "导入:",
|
||||
"nodeCopied": "已复制__count__个节点",
|
||||
"nodeCopied_plural": "已复制__count__个节点",
|
||||
"invalidFlow": "无效的流程: __message__",
|
||||
@ -114,11 +193,21 @@
|
||||
"all": "所有流程",
|
||||
"compact": "紧凑",
|
||||
"formatted": "已格式化",
|
||||
"copy": "导出到剪贴板"
|
||||
"copy": "导出到剪贴板",
|
||||
"export": "到处到库",
|
||||
"exportAs": "导出为",
|
||||
"overwrite": "替换",
|
||||
"exists": "<p><b>\"__file__\"</b>已存在</p><p>是否要替换它?</p>"
|
||||
},
|
||||
"import": {
|
||||
"import": "导入到",
|
||||
"newFlow": "新流程"
|
||||
"newFlow": "新流程",
|
||||
"errors": {
|
||||
"notArray": "输入的不是JSON数组",
|
||||
"itemNotObject": "输入的流无效 - 项目__index__不是节点对象",
|
||||
"missingId": "输入的流无效-项 __index__ 缺少'id'属性",
|
||||
"missingType": "输入的流程无效-项__index__缺少'类型'属性"
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "已复制路径",
|
||||
"copyMessageValue": "已复制数值",
|
||||
@ -132,7 +221,10 @@
|
||||
"modifiedFlowsDesc": "只部署包含已更改节点的流",
|
||||
"modifiedNodes": "已更改的节点",
|
||||
"modifiedNodesDesc": "只部署已经更改的节点",
|
||||
"restartFlows": "重启流程",
|
||||
"restartFlowsDesc": "重新启动当前部署的流程",
|
||||
"successfulDeploy": "部署成功",
|
||||
"successfulRestart": "成功重启流程",
|
||||
"deployFailed": "部署失败: __message__",
|
||||
"unusedConfigNodes": "您有一些未使用的配置节点",
|
||||
"unusedConfigNodesLink": "点击此处查看它们",
|
||||
@ -152,16 +244,24 @@
|
||||
"improperlyConfigured": "工作区包含一些未正确配置的节点:",
|
||||
"unknown": "工作区包含一些未知的节点类型:",
|
||||
"confirm": "你确定要部署吗?",
|
||||
"doNotWarn": "不要再对此发出警告",
|
||||
"conflict": "服务器正在运行较新的一组流程。",
|
||||
"backgroundUpdate": "服务器上的流程已更新。",
|
||||
"conflictChecking": "检查是否可以自动合并更改",
|
||||
"conflictAutoMerge": "此更改不包括冲突,可以自动合并",
|
||||
"conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。"
|
||||
"conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。",
|
||||
"plusNMore": "+ __count__更多"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
"title": "事件记录日志",
|
||||
"view": "查看日志"
|
||||
},
|
||||
"diff": {
|
||||
"unresolvedCount": "__count__个未解决的冲突",
|
||||
"unresolvedCount_plural": "__count__个未解决的冲突",
|
||||
"globalNodes": "全局节点",
|
||||
"flowProperties": "流程属性",
|
||||
"type": {
|
||||
"added": "已添加",
|
||||
"changed": "已更改",
|
||||
@ -175,9 +275,19 @@
|
||||
"nodeCount": "__count__个节点",
|
||||
"nodeCount_plural": "__count__个节点",
|
||||
"local": "本地",
|
||||
"remote": "远程"
|
||||
"remote": "远程",
|
||||
"reviewChanges": "查看变更",
|
||||
"noBinaryFileShowed": "无法显示二进制文件内容",
|
||||
"viewCommitDiff": "查看提交更改",
|
||||
"compareChanges": "比较变更",
|
||||
"saveConflict": "保存冲突解决",
|
||||
"conflictHeader": "已解决<span>__unresolved__</span>中的<span>__resolved__</span>个冲突",
|
||||
"commonVersionError": "通用版本不包含有效的JSON:",
|
||||
"oldVersionError": "旧版本不包含有效的JSON:",
|
||||
"newVersionError": "新版本不包含有效的JSON:"
|
||||
},
|
||||
"subflow": {
|
||||
"editSubflowInstance": "编辑子流实例:__name__",
|
||||
"editSubflow": "编辑流程模板: __name__",
|
||||
"edit": "编辑流程模板",
|
||||
"subflowInstances": "这个子流程模板有__count__个实例",
|
||||
@ -185,8 +295,14 @@
|
||||
"editSubflowProperties": "编辑属性",
|
||||
"input": "输入:",
|
||||
"output": "输出:",
|
||||
"status": "状态节点",
|
||||
"deleteSubflow": "删除子流程",
|
||||
"info": "详细描述",
|
||||
"category": "类别",
|
||||
"env": {
|
||||
"restore": "恢复为默认子流",
|
||||
"remove": "删除环境变量"
|
||||
},
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>无法创建子流程</strong>: 未选择节点",
|
||||
"multipleInputsToSelection": "<strong>无法创建子流程</strong>: 多个输入到了选择"
|
||||
@ -204,18 +320,68 @@
|
||||
"editConfig": "编辑__type__配置",
|
||||
"addNewType": "添加新的__type__节点",
|
||||
"nodeProperties": "节点属性",
|
||||
"label": "标签",
|
||||
"color": "颜色",
|
||||
"portLabels": "端口标签",
|
||||
"labelInputs": "输入",
|
||||
"labelOutputs": "输出",
|
||||
"settingIcon": "图标",
|
||||
"default": "默认",
|
||||
"noDefaultLabel": "无",
|
||||
"defaultLabel": "使用默认标签",
|
||||
"searchIcons": "搜索图标",
|
||||
"useDefault": "使用默认",
|
||||
"description": "描述",
|
||||
"show": "显示",
|
||||
"hide": "隐藏",
|
||||
"locale": "选择界面语言",
|
||||
"icon": "图标",
|
||||
"inputType": "输入类型",
|
||||
"inputs": {
|
||||
"input": "输入",
|
||||
"select": "选择",
|
||||
"checkbox": "复选框",
|
||||
"spinner": "微调器",
|
||||
"none": "空",
|
||||
"hidden": "隐藏属性"
|
||||
},
|
||||
"types": {
|
||||
"str": "字符串",
|
||||
"num": "数字",
|
||||
"bool": "布尔",
|
||||
"json": "JSON",
|
||||
"bin": "buffer",
|
||||
"env": "环境变量"
|
||||
},
|
||||
"menu": {
|
||||
"input": "输入",
|
||||
"select": "选择",
|
||||
"checkbox": "复选框",
|
||||
"spinner": "微调器",
|
||||
"hidden": "仅标签"
|
||||
},
|
||||
"select": {
|
||||
"label": "标签",
|
||||
"value": "值"
|
||||
},
|
||||
"spinner": {
|
||||
"min": "最小值",
|
||||
"max": "最大值"
|
||||
},
|
||||
"errors": {
|
||||
"scopeChange": "更改范围将使其他流中的节点无法使用"
|
||||
"scopeChange": "更改范围将使其他流中的节点无法使用",
|
||||
"invalidProperties": "无效的属性:"
|
||||
}
|
||||
},
|
||||
"keyboard": {
|
||||
"title": "键盘快捷键",
|
||||
"keyboard": "键盘",
|
||||
"filterActions": "筛选动作",
|
||||
"shortcut": "快捷键",
|
||||
"scope": "范围",
|
||||
"unassigned": "未分配",
|
||||
"global": "全局",
|
||||
"workspace": "工作组",
|
||||
"selectAll": "选择所有节点",
|
||||
"selectAllConnected": "选择所有连接的节点",
|
||||
"addRemoveNode": "从选择中添加/删除节点",
|
||||
@ -226,12 +392,14 @@
|
||||
"nudgeNode": "移动所选节点(1px)",
|
||||
"moveNode": "移动所选节点(20px)",
|
||||
"toggleSidebar": "切换侧边栏",
|
||||
"togglePalette": "切换控制板",
|
||||
"copyNode": "复制所选节点",
|
||||
"cutNode": "剪切所选节点",
|
||||
"pasteNode": "粘贴节点",
|
||||
"undoChange": "撤消上次执行的更改",
|
||||
"searchBox": "打开搜索框",
|
||||
"managePalette": "管理面板"
|
||||
"managePalette": "管理面板",
|
||||
"actionList": "动作列表"
|
||||
},
|
||||
"library": {
|
||||
"library": "库",
|
||||
@ -239,30 +407,42 @@
|
||||
"saveToLibrary": "保存到库...",
|
||||
"typeLibrary": "__type__类型库",
|
||||
"unnamedType": "无名__type__",
|
||||
"exportToLibrary": "将节点导出到库",
|
||||
"exportedToLibrary": "节点导出到库",
|
||||
"dialogSaveOverwrite": "一个叫做__libraryName__的__libraryType__已经存在,您需要覆盖么?",
|
||||
"invalidFilename": "无效的文件名",
|
||||
"savedNodes": "保存的节点",
|
||||
"savedType": "已保存__type__",
|
||||
"saveFailed": "保存失败: __message__",
|
||||
"newFolder": "新文件夹",
|
||||
"types": {
|
||||
"local": "本地的",
|
||||
"examples": "例子"
|
||||
}
|
||||
},
|
||||
"exportToLibrary": "将节点导出到库"
|
||||
},
|
||||
"palette": {
|
||||
"noInfo": "无可用信息",
|
||||
"filter": "过滤节点",
|
||||
"search": "搜索模块",
|
||||
"addCategory": "添加新的...",
|
||||
"label": {
|
||||
"subflows": "子流程",
|
||||
"network": "网络",
|
||||
"common": "共通",
|
||||
"input": "输入",
|
||||
"output": "输出",
|
||||
"function": "功能",
|
||||
"sequence": "序列",
|
||||
"parser": "解析",
|
||||
"social": "社交",
|
||||
"storage": "存储",
|
||||
"analysis": "分析",
|
||||
"advanced": "高级"
|
||||
},
|
||||
"actions": {
|
||||
"collapse-all": "收起所有类别",
|
||||
"expand-all": "展开所有类别"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "添加到面板中的节点:",
|
||||
"nodeAdded_plural": "添加到面板中的多个节点",
|
||||
@ -276,6 +456,7 @@
|
||||
},
|
||||
"editor": {
|
||||
"title": "面板管理",
|
||||
"palette": "控制板",
|
||||
"times": {
|
||||
"seconds": "秒前",
|
||||
"minutes": "分前",
|
||||
@ -309,6 +490,8 @@
|
||||
"updated": "已更新",
|
||||
"install": "安装",
|
||||
"installed": "已安装",
|
||||
"conflict": "冲突",
|
||||
"conflictTip": "<p>无法安装此模块,因为它包含已安装的<br/>节点类型</p><p>与<code>__module__</code>冲突</p>",
|
||||
"loading": "加载目录...",
|
||||
"tab-nodes": "节点",
|
||||
"tab-install": "安装",
|
||||
@ -356,6 +539,7 @@
|
||||
"label": "信息",
|
||||
"node": "节点",
|
||||
"type": "类型",
|
||||
"module": "模组",
|
||||
"id": "ID",
|
||||
"status": "状态",
|
||||
"enabled": "启用",
|
||||
@ -364,17 +548,18 @@
|
||||
"instances": "实例",
|
||||
"properties": "属性",
|
||||
"info": "信息",
|
||||
"desc": "描述",
|
||||
"blank": "空白",
|
||||
"null": "空",
|
||||
"showMore": "展开",
|
||||
"showLess": "收起",
|
||||
"flow": "流程",
|
||||
"selection":"选择",
|
||||
"nodes":"__count__ 个节点",
|
||||
"selection": "选择",
|
||||
"nodes": "__count__ 个节点",
|
||||
"flowDesc": "流程描述",
|
||||
"subflowDesc": "子流程描述",
|
||||
"nodeHelp": "节点帮助",
|
||||
"none":"无",
|
||||
"none": "无",
|
||||
"arrayItems": "__count__个项目",
|
||||
"showTips": "您可以从设置面板启用提示信息"
|
||||
},
|
||||
@ -385,10 +570,26 @@
|
||||
"none": "无",
|
||||
"subflows": "子流程",
|
||||
"flows": "流程",
|
||||
"filterUnused": "未使用",
|
||||
"filterAll": "所有",
|
||||
"showAllConfigNodes": "显示所有配置节点",
|
||||
"filterUnused": "未使用",
|
||||
"showAllUnusedConfigNodes": "显示所有未使用的配置节点",
|
||||
"filtered": "__count__ 个隐藏"
|
||||
},
|
||||
"context": {
|
||||
"name": "上下文数据",
|
||||
"label": "上下午",
|
||||
"none": "未选择",
|
||||
"refresh": "刷新以加载",
|
||||
"empty": "空",
|
||||
"node": "节点",
|
||||
"flow": "流程",
|
||||
"global": "全局",
|
||||
"deleteConfirm": "你确定要删除这个项目吗?",
|
||||
"autoRefresh": "刷新选择更改",
|
||||
"refrsh": "刷新",
|
||||
"delete": "删除"
|
||||
},
|
||||
"palette": {
|
||||
"name": "节点管理",
|
||||
"label": "节点"
|
||||
@ -399,8 +600,151 @@
|
||||
"description": "描述",
|
||||
"dependencies": "依赖",
|
||||
"settings": "设置",
|
||||
"noSummaryAvailable": "无可用摘要",
|
||||
"editDescription": "编辑项目描述",
|
||||
"editDependencies": "编辑项目依赖"
|
||||
"editDependencies": "编辑项目依赖",
|
||||
"noDescriptionAvailable": "没有可用的描述",
|
||||
"editReadme": "编辑README.md",
|
||||
"showProjectSettings": "显示项目设置",
|
||||
"projectSettings": {
|
||||
"title": "项目设置",
|
||||
"edit": "编辑",
|
||||
"none": "空",
|
||||
"install": "安装",
|
||||
"removeFromProject": "从项目中删除",
|
||||
"addToProject": "添加到项目",
|
||||
"files": "文件",
|
||||
"package": "包",
|
||||
"flow": "流程",
|
||||
"credentials": "证书",
|
||||
"packageCreate": "保存更改后将创建文件",
|
||||
"fileNotExist": "文件不存在",
|
||||
"selectFile": "选择文件",
|
||||
"invalidEncryptionKey": "无效的加密密钥",
|
||||
"encryptionEnabled": "启用加密",
|
||||
"encryptionDisabled": "加密已禁用",
|
||||
"setTheEncryptionKey": "设置加密密钥",
|
||||
"resetTheEncryptionKey": "重置加密密钥",
|
||||
"changeTheEncryptionKey": "更改加密密钥",
|
||||
"currentKey": "当前密钥",
|
||||
"newKey": "新密钥",
|
||||
"credentialsAlert": "这将删除所有现有凭证",
|
||||
"versionControl": "版本控制",
|
||||
"branches": "分支",
|
||||
"noBranches": "没有分支",
|
||||
"deleteConfirm": "您确定要删除本地分支'__name__'吗? 这不能被撤消。",
|
||||
"unmergedConfirm": "本地分支'__name__'具有未合并的更改,这些更改将丢失。你确定要删除吗?",
|
||||
"deleteUnmergedBranch": "删除未合并的分支",
|
||||
"gitRemotes": "Git远程仓库",
|
||||
"addRemote": "添加远程仓库",
|
||||
"addRemote2": "添加远程仓库",
|
||||
"remoteName": "远程仓库名",
|
||||
"nameRule": "只能包含A-Z 0-9 _ -",
|
||||
"url": "URL",
|
||||
"urlRule": "https://, ssh:// or file://",
|
||||
"urlRule2": "网址中不能包含用户名/密码",
|
||||
"noRemotes": "没有远程仓库",
|
||||
"deleteRemoteConfrim": "您确定要删除远程仓库'__name__'吗?",
|
||||
"deleteRemote": "删除远程仓库"
|
||||
},
|
||||
"userSettings": {
|
||||
"committerDetail": "提交者详细信息",
|
||||
"committerTip": "保留空白以使用系统默认值",
|
||||
"userName": "用户名",
|
||||
"email": "电子邮件",
|
||||
"sshKeys": "SSH密钥",
|
||||
"sshKeysTip": "允许您创建到远程git存储库的安全连接。",
|
||||
"add": "添加密钥",
|
||||
"addSshKey": "添加SSH密钥",
|
||||
"addSshKeyTip": "生成新的公钥/私钥对",
|
||||
"name": "名字",
|
||||
"nameRule": "只能包含A-Z 0-9 _ -",
|
||||
"passphrase": "密码短语",
|
||||
"passphraseShort": "密码短语过短",
|
||||
"optional": "可选的",
|
||||
"cancel": "取消",
|
||||
"generate": "生成密钥",
|
||||
"noSshKeys": "没有SSH密钥",
|
||||
"copyPublicKey": "将公钥复制到剪贴板",
|
||||
"delete": "删除密钥",
|
||||
"gitConfig": "Git配置",
|
||||
"deleteConfirm": "您确定要删除SSH密钥__name__吗?这不能被撤消。"
|
||||
},
|
||||
"versionControl": {
|
||||
"unstagedChanges": "未暂存的变更",
|
||||
"stagedChanges": "暂存的变更",
|
||||
"unstageChange": "取消变更的暂存",
|
||||
"stageChange": "暂存变更",
|
||||
"unstageAllChange": "取消所有变更的暂存",
|
||||
"stageAllChange": "暂存所有变更",
|
||||
"commitChanges": "提交变更",
|
||||
"resolveConflicts": "解决冲突",
|
||||
"head": "HEAD",
|
||||
"staged": "暂存的",
|
||||
"unstaged": "未暂存的",
|
||||
"local": "本地的",
|
||||
"remote": "远程的",
|
||||
"revert": "您确定要将更改恢复为'__file__'吗?这不能被撤消。",
|
||||
"revertChanges": "还原变更",
|
||||
"localChanges": "本地变更",
|
||||
"none": "None",
|
||||
"conflictResolve": "解决所有冲突。提交更改以完成合并。",
|
||||
"localFiles": "本地文件",
|
||||
"all": "所有的",
|
||||
"unmergedChanges": "未合并的更改",
|
||||
"abortMerge": "中止合并",
|
||||
"commit": "提交",
|
||||
"changeToCommit": "提交变更",
|
||||
"commitPlaceholder": "输入您的提交信息",
|
||||
"cancelCapital": "取消",
|
||||
"commitCapital": "提交",
|
||||
"commitHistory": "提交历史",
|
||||
"branch": "分支:",
|
||||
"moreCommits": "更多提交",
|
||||
"changeLocalBranch": "变更本地分支",
|
||||
"createBranchPlaceholder": "查找或创建分支",
|
||||
"upstream": "上游",
|
||||
"localOverwrite": "切换分支会覆盖您现有的本地更改。您必须先提交或撤消那些更改。",
|
||||
"manageRemoteBranch": "管理远程分支",
|
||||
"unableToAccess": "无法访问远程存储库",
|
||||
"retry": "重试",
|
||||
"setUpstreamBranch": "设置为上游分支",
|
||||
"createRemoteBranchPlaceholder": "查找或创建远程分支",
|
||||
"trackedUpstreamBranch": "创建的分支将被设置为跟踪的上游分支。",
|
||||
"selectUpstreamBranch": "分支将被创建。 在下面选择以将其设置为被跟踪的上游分支。",
|
||||
"pushFailed": "推送失败,因为远程具有更多的最新提交。请先拉取并合并,然后再尝试推送。",
|
||||
"push": "推送",
|
||||
"pull": "拉取",
|
||||
"unablePull": "<p>无法提取远程更改;您未暂存的本地更改将被覆盖。</p><p>请先提交更改,然后重试。</p>",
|
||||
"showUnstagedChanges": "显示未暂存的更改",
|
||||
"connectionFailed": "无法连接到远程存储库:",
|
||||
"pullUnrelatedHistory": "<p>远程有无关的提交历史</p><p>您确定要将这些更改拉入本地仓库吗?</p>",
|
||||
"pullChanges": "拉取更改",
|
||||
"history": "历史",
|
||||
"projectHistory": "项目历史",
|
||||
"daysAgo": "__count__天前",
|
||||
"daysAgo_plural": "__count__天前",
|
||||
"hoursAgo": "__count__小时前",
|
||||
"hoursAgo_plural": "__count__小时前",
|
||||
"minsAgo": "__count__分钟前",
|
||||
"minsAgo_plural": "__count__分钟前",
|
||||
"secondsAgo": "秒前",
|
||||
"notTracking": "您的本地分支当前未跟踪一个远程分支。",
|
||||
"statusUnmergedChanged": "您的仓库中有未合并的更改。您需要解决冲突并提交结果。",
|
||||
"repositoryUpToDate": "您的仓库是最新的。",
|
||||
"commitsAhead": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
|
||||
"commitsAhead_plural": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
|
||||
"commitsBehind": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
|
||||
"commitsBehind_plural": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
|
||||
"commitsAheadAndBehind1": "您的存储库落后远程仓库__count__次提交",
|
||||
"commitsAheadAndBehind1_plural": "您的存储库落后远程仓库__count__次提交",
|
||||
"commitsAheadAndBehind2": "领先远程仓库__count__次提交。",
|
||||
"commitsAheadAndBehind2_plural": "领先远程仓库__count__次提交。",
|
||||
"commitsAheadAndBehind3": "您必须先拉取远程提交,然后才能进行推送。",
|
||||
"commitsAheadAndBehind3_plural": "您必须先拉取远程提交,然后才能进行推送。",
|
||||
"refreshCommitHistory": "刷新提交历史",
|
||||
"refreshChanges": "刷新更改"
|
||||
}
|
||||
}
|
||||
},
|
||||
"typedInput": {
|
||||
@ -408,10 +752,12 @@
|
||||
"str": "文字列",
|
||||
"num": "数字",
|
||||
"re": "正则表达式",
|
||||
"bool": "布尔",
|
||||
"bool": "布尔值",
|
||||
"json": "JSON",
|
||||
"bin": "二进制流",
|
||||
"date": "时间戳"
|
||||
"date": "时间戳",
|
||||
"jsonata": "表达式",
|
||||
"env": "环境变量"
|
||||
}
|
||||
},
|
||||
"editableList": {
|
||||
@ -423,8 +769,10 @@
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "功能",
|
||||
"functionReference": "功能reference",
|
||||
"insert": "插入",
|
||||
"title": "JSONata表达式编辑器",
|
||||
"test": "测试",
|
||||
"data": "示例消息",
|
||||
"result": "结果",
|
||||
"format": "格式表达方法",
|
||||
@ -438,14 +786,228 @@
|
||||
"eval": "评估表达式错误:\n __message__"
|
||||
}
|
||||
},
|
||||
"jsEditor": {
|
||||
"title": "JavaScript编辑器"
|
||||
},
|
||||
"textEditor": {
|
||||
"title": "文本编辑器"
|
||||
},
|
||||
"jsonEditor": {
|
||||
"title": "JSON编辑器",
|
||||
"format": "格式化JSON"
|
||||
"format": "格式化JSON",
|
||||
"rawMode": "编辑 JSON",
|
||||
"uiMode": "Visual编辑器",
|
||||
"insertAbove": "在上方插入",
|
||||
"insertBelow": "在下方插入",
|
||||
"addItem": "添加项目",
|
||||
"copyPath": "复制路径到项目",
|
||||
"expandItems": "展开项目",
|
||||
"collapseItems": "收合项目",
|
||||
"duplicate": "重复",
|
||||
"error": {
|
||||
"invalidJSON": "无效的JSON: "
|
||||
}
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "Markdown编辑器",
|
||||
"expand": "展开",
|
||||
"format": "格式化为markdown",
|
||||
"heading1": "标题 1",
|
||||
"heading2": "标题 2",
|
||||
"heading3": "标题 3",
|
||||
"bold": "粗体",
|
||||
"italic": "斜体",
|
||||
"code": "代码",
|
||||
"ordered-list": "排序的列表",
|
||||
"unordered-list": "非排序的列表",
|
||||
"quote": "引用",
|
||||
"link": "链接",
|
||||
"horizontal-rule": "水平线",
|
||||
"toggle-preview": "切换预览"
|
||||
},
|
||||
"bufferEditor": {
|
||||
"title": "缓冲区编辑器",
|
||||
"modeString": "作为UTF-8字符串处理",
|
||||
"modeArray": "作为JSON数组处理",
|
||||
"modeDesc": "<h3>缓冲区编辑器</h3><p>缓冲区类型被存储为字节值的JSON数组。编辑器将尝试将输入的数值解析为JSON数组。如果它不是有效的JSON,它将被视为UTF-8字符串,并被转换为单个字符代码点的数组。</p><p>例如,<code>Hello World</code>的值会被转换为JSON数组:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
|
||||
},
|
||||
"projects": {
|
||||
"config-git": "配置Git客户端",
|
||||
"welcome": {
|
||||
"hello": "你好! 我们已经将“项目”引入了Node-RED。",
|
||||
"desc0": "这是一种用于管理流程文件的新方法,并且包括对流程的版本控制。",
|
||||
"desc1": "首先,您可以创建您的第一个项目或从git存储库克隆现有项目。",
|
||||
"desc2": "如果不确定,可以暂时跳过此步骤。您仍然可以随时通过“项目”菜单创建第一个项目。",
|
||||
"create": "建立专案",
|
||||
"clone": "克隆仓库",
|
||||
"openExistingProject": "打开现有项目",
|
||||
"not-right-now": "不是现在"
|
||||
},
|
||||
"git-config": {
|
||||
"setup": "设置您的版本控制客户端",
|
||||
"desc0": "Node-RED使用开源工具Git进行版本控制。它跟踪对项目文件的更改,并允许您将其推送到远程存储库。",
|
||||
"desc1": "提交一组更改时,Git会使用用户名和电子邮件地址记录谁进行了更改。用户名可以是您想要的任何名称-不必是您的真实姓名。",
|
||||
"desc2": "您的Git客户端已经配置了以下详细信息。",
|
||||
"desc3": "您可以稍后在设置对话框的'Git config'标签下更改这些设置。",
|
||||
"username": "用户名",
|
||||
"email": "电子邮件"
|
||||
},
|
||||
"project-details": {
|
||||
"create": "创建你的项目",
|
||||
"desc0": "项目被维护为Git仓库。与他人一起共享您的流程",
|
||||
"desc1": "您可以创建多个项目,并通过编辑器在它们之间快速切换。",
|
||||
"desc2": "首先,您的项目需要一个名称和一个可选的描述。",
|
||||
"already-exists": "项目已存在",
|
||||
"must-contain": "只能包含A-Z 0-9 _ -",
|
||||
"project-name": "项目名",
|
||||
"desc": "描述",
|
||||
"opt": "可选的"
|
||||
},
|
||||
"clone-project": {
|
||||
"clone": "克隆一个项目",
|
||||
"desc0": "如果您已经有一个包含项目的git仓库,则可以对其进行克隆以开始使用。",
|
||||
"already-exists": "项目已存在",
|
||||
"must-contain": "只能包含A-Z 0-9 _ -",
|
||||
"project-name": "项目名",
|
||||
"no-info-in-url": "网址中不要包含用户名/密码",
|
||||
"git-url": "Git仓库的url",
|
||||
"protocols": "https://, ssh:// or file://",
|
||||
"auth-failed": "认证失败",
|
||||
"username": "用户名",
|
||||
"passwd": "秘密啊",
|
||||
"ssh-key": "SSH密钥",
|
||||
"passphrase": "密码短语",
|
||||
"ssh-key-desc": "在通过ssh克隆仓库之前,必须添加SSH密钥才能访问它。",
|
||||
"ssh-key-add": "添加一个ssh密钥",
|
||||
"credential-key": "证书加密密钥",
|
||||
"cant-get-ssh-key": "错误! 无法获取所选的SSH密钥路径。",
|
||||
"already-exists2": "已存在",
|
||||
"git-error": "git错误",
|
||||
"connection-failed": "连接失败",
|
||||
"not-git-repo": "不是一个git仓库",
|
||||
"repo-not-found": "未发现仓库"
|
||||
},
|
||||
"default-files": {
|
||||
"create": "创建您的项目文件",
|
||||
"desc0": "一个包含您的流程文件,Readme文件和package.json文件的项目。",
|
||||
"desc1": "它可以包含您要在Git仓库中维护的任何其他文件。",
|
||||
"desc2": "您现有的流程和凭证文件将被复制到项目中。",
|
||||
"flow-file": "流程文件",
|
||||
"credentials-file": "证书文件"
|
||||
},
|
||||
"encryption-config": {
|
||||
"setup": "设置证书文件的加密",
|
||||
"desc0": "您的流程证书文件可以被加密以确保其内容安全。",
|
||||
"desc1": "如果要将这些证书存储在公共Git存储库中,则必须通过提供密钥短语来对它们进行加密。",
|
||||
"desc2": "您的流程证书文件当前未加密。",
|
||||
"desc3": "这意味着任何有权访问该文件的人都可以读取其内容,例如密码和访问令牌。",
|
||||
"desc4": "如果要将这些证书存储在公共Git仓库中,则必须通过提供密钥短语来对它们进行加密。",
|
||||
"desc5": "当前,使用设置文件中的credentialSecret属性作为密钥来加密流程证书文件。",
|
||||
"desc6": "您的流程证书文件当前使用系统生成的密钥加密。您应该为此项目提供一个新的密钥。",
|
||||
"desc7": "密钥将与项目文件分开存储。您将需要提供在另一个Node-RED实例中使用该项目的密钥。",
|
||||
"credentials": "证书",
|
||||
"enable": "启用加密",
|
||||
"disable": "禁用加密",
|
||||
"disabled": "禁用的",
|
||||
"copy": "复制现有密钥",
|
||||
"use-custom": "使用自定义密钥",
|
||||
"desc8": "证书文件不会被加密,其内容很容易阅读",
|
||||
"create-project-files": "创建项目文件",
|
||||
"create-project": "创建项目",
|
||||
"already-exists": "已存在",
|
||||
"git-error": "git错误",
|
||||
"git-auth-error": "git认证错误"
|
||||
},
|
||||
"create-success": {
|
||||
"success": "您已经成功创建了第一个项目!",
|
||||
"desc0": "现在,您可以像往常一样继续使用Node-RED。",
|
||||
"desc1": "侧栏中的“信息”标签显示了您当前的活动项目。名称旁边的按钮可用于访问项目设置视图。",
|
||||
"desc2": "侧栏中的“历史记录”标签可用于查看项目中已更改的文件并提交。它向您显示了提交的完整历史记录,并允许您将更改推送到远程存储库。"
|
||||
},
|
||||
"create": {
|
||||
"projects": "项目",
|
||||
"already-exists": "项目已存在",
|
||||
"must-contain": "只能包含A-Z 0-9 _ -",
|
||||
"no-info-in-url": "网址中不要包含用户名/密码",
|
||||
"open": "打开项目",
|
||||
"create": "创建项目",
|
||||
"clone": "克隆仓库",
|
||||
"project-name": "项目名",
|
||||
"desc": "描述",
|
||||
"opt": "可选的",
|
||||
"flow-file": "流程文件",
|
||||
"credentials": "证书",
|
||||
"enable-encryption": "启用加密",
|
||||
"disable-encryption": "禁用加密",
|
||||
"encryption-key": "加密密钥",
|
||||
"desc0": "用来保护您的凭证的短语",
|
||||
"desc1": "凭证文件不会被加密,其内容很容易阅读",
|
||||
"git-url": "Git存储库URL",
|
||||
"protocols": "https://, ssh:// or file://",
|
||||
"auth-failed": "验证失败",
|
||||
"username": "用户名",
|
||||
"password": "密码",
|
||||
"ssh-key": "SSH密钥",
|
||||
"passphrase": "密码短语",
|
||||
"desc2": "在通过ssh克隆存储库之前,必须添加SSH密钥才能访问它。",
|
||||
"add-ssh-key": "添加一个ssh密钥",
|
||||
"credentials-encryption-key": "证书加密密钥",
|
||||
"already-exists-2": "已存在",
|
||||
"git-error": "git错误",
|
||||
"con-failed": "连接失败",
|
||||
"not-git": "不是git仓库",
|
||||
"no-resource": "找不到存储库",
|
||||
"cant-get-ssh-key-path": "错误!无法获取所选的SSH密钥路径。",
|
||||
"unexpected_error": "意外的错误"
|
||||
},
|
||||
"delete": {
|
||||
"confirm": "您确定要删除此项目吗?"
|
||||
},
|
||||
"create-project-list": {
|
||||
"search": "搜索您的项目",
|
||||
"current": "当前的"
|
||||
},
|
||||
"require-clean": {
|
||||
"confirm": "<p>您有未部署的更改,这些更改将丢失。</p><p>您要继续吗?</p>"
|
||||
},
|
||||
"send-req": {
|
||||
"auth-req": "存储库需要认证",
|
||||
"username": "用户名",
|
||||
"password": "秘密",
|
||||
"passphrase": "密码短语",
|
||||
"retry": "重试",
|
||||
"update-failed": "无法更新身份验证",
|
||||
"unhandled": "未处理的错误响应"
|
||||
},
|
||||
"create-branch-list": {
|
||||
"invalid": "无效的分支",
|
||||
"create": "创建分支",
|
||||
"current": "当前的"
|
||||
},
|
||||
"create-default-file-set": {
|
||||
"no-active": "没有活动项目就无法创建默认文件集",
|
||||
"no-empty": "无法在非空项目上创建默认文件集",
|
||||
"git-error": "git错误"
|
||||
},
|
||||
"errors": {
|
||||
"no-username-email": "您的Git客户端未配置用户名/电子邮件。",
|
||||
"unexpected": "发生了一个意料之外的问题",
|
||||
"code": "代码"
|
||||
}
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "属性",
|
||||
"envProperties": "环境变量",
|
||||
"description": "描述",
|
||||
"appearance": "外观",
|
||||
"preview": "UI预览",
|
||||
"defaultValue": "默认值"
|
||||
},
|
||||
"languages": {
|
||||
"de": "德语",
|
||||
"en-US": "英文",
|
||||
"ja": "日语",
|
||||
"ko": "韩文",
|
||||
"zh-CN": "简体中文"
|
||||
}
|
||||
}
|
||||
|
@ -214,5 +214,53 @@
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "将ISO 8601格式的字符串`timestamp`转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。如果该字符串的格式不正确,则抛出错误。"
|
||||
},
|
||||
"$env": {
|
||||
"args": "arg",
|
||||
"desc": "返回环境变量的值。\n\n这是Node-RED定义的函数。"
|
||||
},
|
||||
"$eval": {
|
||||
"args": "expr [, context]",
|
||||
"desc": "使用当前上下文来作为评估依据,分析并评估字符串`expr`,其中包含文字JSON或JSONata表达式。"
|
||||
},
|
||||
"$formatInteger": {
|
||||
"args": "number, picture",
|
||||
"desc": "将“数字”转换为字符串,并将其格式化为“图片”字符串指定的整数表示形式。图片字符串参数定义了数字的格式,并具有与XPath F&O 3.1 规范中的fn:format-integer相同的语法。"
|
||||
},
|
||||
"$parseInteger": {
|
||||
"args": "string, picture",
|
||||
"desc": "使用“图片”字符串指定的格式将“字符串”参数的内容解析为整数(作为JSON数字)。图片字符串参数与$formatInteger格式相同。."
|
||||
},
|
||||
"$error": {
|
||||
"args": "[str]",
|
||||
"desc": "引发错误并显示一条消息。 可选的`str`将替代$error()函数评估的默认消息。"
|
||||
},
|
||||
"$assert": {
|
||||
"args": "arg, str",
|
||||
"desc": "如果`arg`为真,则该函数返回。 如果arg为假,则抛出带有str的异常作为异常消息。"
|
||||
},
|
||||
"$single": {
|
||||
"args": "array, function",
|
||||
"desc": "返回满足参数function谓语的array参数中的唯一值 (比如:传递值时,函数返回布尔值“true”)。如果匹配值的数量不唯一时,则抛出异常。\n\n应在以下签名中提供函数:`function(value [,index [,array []]])`其中value是数组的每个输入,index是该值的位置,整个数组作为第三个参数传递。"
|
||||
},
|
||||
"$encodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "通过用表示字符的UTF-8编码的一个,两个,三个或四个转义序列替换某些字符的每个实例,对统一资源定位符(URL)组件进行编码。\n\n示例:`$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
|
||||
},
|
||||
"$encodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "通过用表示字符的UTF-8编码的一个,两个,三个或四个转义序列替换某些字符的每个实例,对统一资源定位符(URL)进行编码。\n\n示例: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`"
|
||||
},
|
||||
"$decodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "解码以前由encodeUrlComponent创建的统一资源定位器(URL)组件。 \n\n示例: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`"
|
||||
},
|
||||
"$decodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "解码先前由encodeUrl创建的统一资源定位符(URL)。 \n\n示例: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`"
|
||||
},
|
||||
"$distinct": {
|
||||
"args": "array",
|
||||
"desc": "返回一个数组,其中重复的值已从`数组`中删除"
|
||||
}
|
||||
}
|
||||
|
945
packages/node_modules/@node-red/editor-client/locales/zh-TW/editor.json
vendored
Normal file
@ -0,0 +1,945 @@
|
||||
{
|
||||
"common": {
|
||||
"label": {
|
||||
"name": "名稱",
|
||||
"ok": "確認",
|
||||
"done": "完成",
|
||||
"cancel": "取消",
|
||||
"delete": "刪除",
|
||||
"close": "關閉",
|
||||
"load": "讀取",
|
||||
"save": "保存",
|
||||
"import": "匯入",
|
||||
"export": "匯出",
|
||||
"back": "返回",
|
||||
"next": "下一步",
|
||||
"clone": "複製專案",
|
||||
"cont": "Continue"
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
"defaultName": "流程__number__",
|
||||
"editFlow": "編輯流程: __name__",
|
||||
"confirmDelete": "確認刪除",
|
||||
"delete": "確定想要刪除 '__label__'?",
|
||||
"dropFlowHere": "把流程放到這裡",
|
||||
"addFlow": "新增流程",
|
||||
"listFlows": "流程列表",
|
||||
"status": "狀態",
|
||||
"enabled": "有效",
|
||||
"disabled": "無效",
|
||||
"info": "詳細描述",
|
||||
"selectNodes": "點擊節點用於選擇",
|
||||
"tip": "詳細描述支援Markdown羽量級標記語言,並將出現在資訊標籤中。"
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
"view": {
|
||||
"view": "顯示",
|
||||
"grid": "格線",
|
||||
"showGrid": "顯示格線",
|
||||
"snapGrid": "對齊格線",
|
||||
"gridSize": "格線尺寸",
|
||||
"textDir": "文本方向",
|
||||
"defaultDir": "默認方向",
|
||||
"ltr": "從左到右",
|
||||
"rtl": "從右到左",
|
||||
"auto": "上下文",
|
||||
"language": "Language",
|
||||
"browserDefault": "Browser default"
|
||||
},
|
||||
"sidebar": {
|
||||
"show": "顯示側邊欄"
|
||||
},
|
||||
"palette": {
|
||||
"show": "Show palette"
|
||||
},
|
||||
"settings": "設置",
|
||||
"userSettings": "使用者設置",
|
||||
"nodes": "節點",
|
||||
"displayStatus": "顯示節點狀態",
|
||||
"displayConfig": "修改節點配置",
|
||||
"import": "匯入",
|
||||
"export": "匯出",
|
||||
"search": "搜尋流程",
|
||||
"searchInput": "搜尋流程",
|
||||
"subflows": "子流程",
|
||||
"createSubflow": "新建子流程",
|
||||
"selectionToSubflow": "將選擇部分更改為子流程",
|
||||
"flows": "流程",
|
||||
"add": "增加",
|
||||
"rename": "重新命名",
|
||||
"delete": "刪除",
|
||||
"keyboardShortcuts": "鍵盤快速鍵",
|
||||
"login": "登入",
|
||||
"logout": "退出",
|
||||
"editPalette": "節點管理",
|
||||
"other": "其他",
|
||||
"showTips": "顯示小提示",
|
||||
"help": "Node-RED website",
|
||||
"projects": "專案",
|
||||
"projects-new": "新專案",
|
||||
"projects-open": "開啟專案",
|
||||
"projects-settings": "專案設定",
|
||||
"showNodeLabelDefault": "顯示新添加節點的標籤",
|
||||
"clipboard": "剪貼簿",
|
||||
"library": "庫",
|
||||
"examples": "範例"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"toggle-navigator": "切換導航器",
|
||||
"zoom-out": "縮小",
|
||||
"zoom-reset": "重置縮放",
|
||||
"zoom-in": "放大"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "作為__name__登入",
|
||||
"username": "帳號",
|
||||
"password": "密碼",
|
||||
"login": "登入",
|
||||
"loginFailed": "登入失敗",
|
||||
"notAuthorized": "未授權",
|
||||
"errors": {
|
||||
"settings": "設置資訊需要登入後才能訪問",
|
||||
"deploy": "改動需要登入後才能部署",
|
||||
"notAuthorized": "此操作需要登入後才能執行"
|
||||
}
|
||||
},
|
||||
"notification": {
|
||||
"warning": "<strong>警告</strong>: __message__",
|
||||
"warnings": {
|
||||
"undeployedChanges": "節點中存在未部署的更改",
|
||||
"nodeActionDisabled": "節點動作在子流程中被禁用",
|
||||
"nodeActionDisabledSubflow": "子流程中禁用了節點操作",
|
||||
"missing-types": "流程由於缺少節點類型而停止。請檢查日誌的詳細資訊",
|
||||
"safe-mode": "<p>流程在安全模式下停止。</p><p>您可以修改流程並部署更改以重新啟動。</p>",
|
||||
"restartRequired": "Node-RED必須重新啟動,以啟用升級的模組",
|
||||
"credentials_load_failed": "<p>流程由於無法解密證書而停止。</p> <p>流程證書文件已加密,但是項目的加密密鑰丟失或無效。</p>",
|
||||
"credentials_load_failed_reset": "<p>證書無法解密</p><p>流程證書文件已加密,但是項目的加密密鑰丟失或無效。</p><p>流程證書文件將在下一次部署時重置。任何現有的流程證書將被清除。</p>",
|
||||
"missing_flow_file": "<p>找不到項目流程文件。</p><p>該項目未配置流程文件。</p>",
|
||||
"missing_package_file": "<p>找不到項目包文件。</p><p>項目缺少package.json文件。</p>",
|
||||
"project_empty": "<p>該項目為空。</p><p>是否要創建一組默認的項目文件?<br/>否則,您將不得不在編輯器外部手動將文件添加到項目中。</p>",
|
||||
"project_not_found": "<p>找不到項目的'__project__'</p>",
|
||||
"git_merge_conflict": "<p>自動合併更改失敗。</p><p>修復未合併的衝突,然後提交結果。</p>"
|
||||
},
|
||||
"error": "<strong>Error</strong>: __message__",
|
||||
"errors": {
|
||||
"lostConnection": "丟失與伺服器的連接,重新連接...",
|
||||
"lostConnectionReconnect": "丟失與伺服器的連接,__time__秒後重新連接",
|
||||
"lostConnectionTry": "現在嘗試",
|
||||
"cannotAddSubflowToItself": "無法向其自身添加子流程",
|
||||
"cannotAddCircularReference": "無法添加子流程 - 迴圈引用",
|
||||
"unsupportedVersion": "您正在使用不受支持的Node.js版本<br/>請升級到最新版本的Node.js LTS",
|
||||
"failedToAppendNode": "<p>加載'__module__'失敗</p><p>__error__</p>"
|
||||
},
|
||||
"project": {
|
||||
"change-branch": "轉到本地分支'__project__'",
|
||||
"merge-abort": "Git合併中止",
|
||||
"loaded": "已加載項目'__project__'",
|
||||
"updated": "已更新項目'__project__'",
|
||||
"pull": "已重新加載項目'__project__'",
|
||||
"revert": "項目“__project__”已還原",
|
||||
"merge-complete": "Git合併完成",
|
||||
"setupCredentials": "設定證書",
|
||||
"setupProjectFiles": "設置項目文件",
|
||||
"no": "不了,謝謝",
|
||||
"createDefault": "創建默認項目文件",
|
||||
"mergeConflict": "顯示合併衝突"
|
||||
},
|
||||
"label": {
|
||||
"manage-project-dep": "管理項目依賴性",
|
||||
"setup-cred": "設定憑證",
|
||||
"setup-project": "設置項目文件",
|
||||
"create-default-package": "創建默認的包文件",
|
||||
"no-thanks": "不了,謝謝",
|
||||
"create-default-project": "創建默認項目文件",
|
||||
"show-merge-conflicts": "顯示合併衝突"
|
||||
}
|
||||
},
|
||||
"clipboard": {
|
||||
"clipboard": "剪貼簿",
|
||||
"nodes": "節點",
|
||||
"node": "__count__ 節點",
|
||||
"node_plural": "__count__ 多個節點",
|
||||
"configNode": "__count__ 節點組態",
|
||||
"configNode_plural": "__count__ 多節點組態",
|
||||
"flow": "__count__ 流程",
|
||||
"flow_plural": "__count__ 多流程",
|
||||
"subflow": "__count__ 子流程",
|
||||
"subflow_plural": "__count__ 多子流程",
|
||||
"pasteNodes": "在這裡粘貼節點",
|
||||
"selectFile": "匯入所選檔案",
|
||||
"importNodes": "匯入節點",
|
||||
"exportNodes": "匯出節點至剪貼簿",
|
||||
"download": "下載",
|
||||
"importUnrecognised": "匯入了無法識別的類型:",
|
||||
"importUnrecognised_plural": "匯入了無法識別的類型:",
|
||||
"nodesExported": "節點匯出到了剪貼簿",
|
||||
"nodesImported": "已匯入:",
|
||||
"nodeCopied": "已複製__count__個節點",
|
||||
"nodeCopied_plural": "已複製__count__個節點",
|
||||
"invalidFlow": "無效的流程: __message__",
|
||||
"export": {
|
||||
"selected": "已選擇的節點",
|
||||
"current": "現在的節點",
|
||||
"all": "所有流程",
|
||||
"compact": "緊湊",
|
||||
"formatted": "已格式化",
|
||||
"copy": "匯出到剪貼簿",
|
||||
"export": "匯出到庫",
|
||||
"exportAs": "匯出為",
|
||||
"overwrite": "取代",
|
||||
"exists": "<p><b>\"__file__\"</b> 已經存在.</p><p>是否要取代?</p>"
|
||||
},
|
||||
"import": {
|
||||
"import": "匯入到",
|
||||
"newFlow": "新流程",
|
||||
"errors": {
|
||||
"notArray": "輸入的不是JSON數組",
|
||||
"itemNotObject": "輸入的流程無效-項目__index__不是節點對象",
|
||||
"missingId": "輸入的流程無效-項__index__缺少“ id”屬性",
|
||||
"missingType": "輸入的流程無效-項__index__缺少“類型”屬性"
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "已複製路徑",
|
||||
"copyMessageValue": "已複製數值",
|
||||
"copyMessageValue_truncated": "已複製捨棄的數值",
|
||||
"selectNodes": "選擇上面的文本並複製到剪貼簿"
|
||||
},
|
||||
"deploy": {
|
||||
"deploy": "部署",
|
||||
"full": "全面",
|
||||
"fullDesc": "在工作區中部署所有內容",
|
||||
"modifiedFlows": "已修改的流程",
|
||||
"modifiedFlowsDesc": "只部署包含已更改節點的流程",
|
||||
"modifiedNodes": "已更改的節點",
|
||||
"modifiedNodesDesc": "只部署已經更改的節點",
|
||||
"restartFlows": "重新啟動流程",
|
||||
"restartFlowsDesc": "重新啟動當前部署的流程",
|
||||
"successfulDeploy": "部署成功",
|
||||
"successfulRestart": "成功重啟流程",
|
||||
"deployFailed": "部署失敗: __message__",
|
||||
"unusedConfigNodes": "您有一些未使用的配置節點",
|
||||
"unusedConfigNodesLink": "點擊此處查看它們",
|
||||
"errors": {
|
||||
"noResponse": "伺服器沒有回應"
|
||||
},
|
||||
"confirm": {
|
||||
"button": {
|
||||
"ignore": "忽略",
|
||||
"confirm": "確認部署",
|
||||
"review": "查看更改",
|
||||
"cancel": "取消",
|
||||
"merge": "合併",
|
||||
"overwrite": "忽略 & 部署"
|
||||
},
|
||||
"undeployedChanges": "您有未部署的更改。\n\n離開此頁面將丟失這些更改。",
|
||||
"improperlyConfigured": "工作區包含一些未正確配置的節點:",
|
||||
"unknown": "工作區包含一些未知的節點類型:",
|
||||
"confirm": "你確定要部署嗎?",
|
||||
"doNotWarn": "不要再對此發出警告",
|
||||
"conflict": "伺服器正在運行較新的一組流程。",
|
||||
"backgroundUpdate": "伺服器上的流程已更新。",
|
||||
"conflictChecking": "檢查是否可以自動合併更改",
|
||||
"conflictAutoMerge": "此更改不包括衝突,可以自動合併",
|
||||
"conflictManualMerge": "這些更改包括了在部署之前必須解決的衝突。",
|
||||
"plusNMore": "+更多的__count__"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
"title": "事件日誌",
|
||||
"view": "查看日誌"
|
||||
},
|
||||
"diff": {
|
||||
"unresolvedCount": "__count__個未解決的衝突",
|
||||
"unresolvedCount_plural": "__count__個未解決的衝突",
|
||||
"globalNodes": "全局節點",
|
||||
"flowProperties": "流程屬性",
|
||||
"type": {
|
||||
"added": "已添加",
|
||||
"changed": "已更改",
|
||||
"unchanged": "未更改",
|
||||
"deleted": "已刪除",
|
||||
"flowDeleted": "已刪除流程",
|
||||
"flowAdded": "已添加流程",
|
||||
"movedTo": "移動至__id__",
|
||||
"movedFrom": "從__id__移動"
|
||||
},
|
||||
"nodeCount": "__count__個節點",
|
||||
"nodeCount_plural": "__count__個節點",
|
||||
"local": "本地",
|
||||
"remote": "遠端",
|
||||
"reviewChanges": "查看變更",
|
||||
"noBinaryFileShowed": "無法顯示二進製文件內容",
|
||||
"viewCommitDiff": "查看提交更改",
|
||||
"compareChanges": "比較變更",
|
||||
"saveConflict": "保存衝突解決",
|
||||
"conflictHeader": "已解決<span>__unresolved__</span>中的<span>__resolved__</span>個衝突",
|
||||
"commonVersionError": "通用版本不包含有效的JSON:",
|
||||
"oldVersionError": "舊版本不包含有效的JSON:",
|
||||
"newVersionError": "新版本不包含有效的JSON:"
|
||||
},
|
||||
"subflow": {
|
||||
"editSubflowInstance": "編輯子流程實例:__name__",
|
||||
"editSubflow": "編輯流程範本: __name__",
|
||||
"edit": "編輯流程範本",
|
||||
"subflowInstances": "這個子流程範本有__count__個實例",
|
||||
"subflowInstances_plural": "這個子流程範本有__count__個實例",
|
||||
"editSubflowProperties": "編輯屬性",
|
||||
"input": "輸入:",
|
||||
"output": "輸出:",
|
||||
"status": "狀態節點",
|
||||
"deleteSubflow": "刪除子流程",
|
||||
"info": "詳細描述",
|
||||
"category": "類別",
|
||||
"env": {
|
||||
"restore": "恢復為默認子流程",
|
||||
"remove": "類別刪除環境變量"
|
||||
},
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>無法創建子流程</strong>: 未選擇節點",
|
||||
"multipleInputsToSelection": "<strong>無法創建子流程</strong>: 多個輸入到了選擇"
|
||||
},
|
||||
"format": "標記格式"
|
||||
},
|
||||
"editor": {
|
||||
"configEdit": "編輯",
|
||||
"configAdd": "添加",
|
||||
"configUpdate": "更新",
|
||||
"configDelete": "刪除",
|
||||
"nodesUse": "__count__個節點使用此配置",
|
||||
"nodesUse_plural": "__count__個節點使用此配置",
|
||||
"addNewConfig": "添加新的__type__配置",
|
||||
"editNode": "編輯__type__節點",
|
||||
"editConfig": "編輯__type__配置",
|
||||
"addNewType": "添加新的__type__節點",
|
||||
"nodeProperties": "節點屬性",
|
||||
"label": "Label",
|
||||
"portLabels": "埠標籤",
|
||||
"labelInputs": "輸入",
|
||||
"labelOutputs": "輸出",
|
||||
"settingIcon": "Icon",
|
||||
"noDefaultLabel": "無",
|
||||
"defaultLabel": "使用默認標籤",
|
||||
"searchIcons": "搜尋 icons",
|
||||
"useDefault": "使用默認",
|
||||
"description": "描述",
|
||||
"show": "顯示",
|
||||
"hide": "隱藏",
|
||||
"errors": {
|
||||
"scopeChange": "更改範圍將使其他流程中的節點無法使用",
|
||||
"invalidProperties": "無效的屬性:"
|
||||
}
|
||||
},
|
||||
"keyboard": {
|
||||
"title": "鍵盤快速鍵",
|
||||
"keyboard": "鍵盤",
|
||||
"filterActions": "篩選動作",
|
||||
"shortcut": "快捷鍵",
|
||||
"scope": "範圍",
|
||||
"unassigned": "未分配",
|
||||
"global": "全局",
|
||||
"workspace": "工作區",
|
||||
"selectAll": "選擇所有節點",
|
||||
"selectAllConnected": "選擇所有連接的節點",
|
||||
"addRemoveNode": "從選擇中添加/刪除節點",
|
||||
"editSelected": "編輯選定節點",
|
||||
"deleteSelected": "刪除選定節點或連結",
|
||||
"importNode": "匯入節點",
|
||||
"exportNode": "匯出節點",
|
||||
"nudgeNode": "移動所選節點(1px)",
|
||||
"moveNode": "移動所選節點(20px)",
|
||||
"toggleSidebar": "切換側邊欄",
|
||||
"togglePalette": "切換調色板",
|
||||
"copyNode": "複製所選節點",
|
||||
"cutNode": "剪切所選節點",
|
||||
"pasteNode": "粘貼節點",
|
||||
"undoChange": "撤銷上次執行的更改",
|
||||
"searchBox": "打開搜索框",
|
||||
"managePalette": "管理面板"
|
||||
},
|
||||
"library": {
|
||||
"library": "庫",
|
||||
"openLibrary": "打開庫...",
|
||||
"saveToLibrary": "保存到庫...",
|
||||
"typeLibrary": "__type__型別程式庫",
|
||||
"unnamedType": "無名__type__",
|
||||
"exportedToLibrary": "節點導出到庫",
|
||||
"dialogSaveOverwrite": "一個叫做__libraryName__的__libraryType__已經存在,您需要覆蓋麼?",
|
||||
"invalidFilename": "無效的檔案名",
|
||||
"savedNodes": "保存的節點",
|
||||
"savedType": "已保存__type__",
|
||||
"saveFailed": "保存失敗: __message__",
|
||||
"types": {
|
||||
"local": "本地",
|
||||
"examples": "例子"
|
||||
},
|
||||
"exportToLibrary": "將節點匯出到庫",
|
||||
"filename": "檔案名",
|
||||
"folder": "資料夾",
|
||||
"filenamePlaceholder": "文件",
|
||||
"fullFilenamePlaceholder": "a/b/文件",
|
||||
"folderPlaceholder": "a/b",
|
||||
"breadcrumb": "庫"
|
||||
},
|
||||
"palette": {
|
||||
"noInfo": "無可用資訊",
|
||||
"filter": "過濾節點",
|
||||
"search": "搜索模組",
|
||||
"addCategory": "添加新的...",
|
||||
"label": {
|
||||
"subflows": "子流程",
|
||||
"input": "輸入",
|
||||
"output": "輸出",
|
||||
"function": "功能",
|
||||
"social": "社交",
|
||||
"storage": "存儲",
|
||||
"analysis": "分析",
|
||||
"advanced": "高級"
|
||||
},
|
||||
"actions": {
|
||||
"collapse-all": "收起所有類別",
|
||||
"expand-all": "展開所有類別"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "添加到面板中的節點:",
|
||||
"nodeAdded_plural": "添加到面板中的多個節點",
|
||||
"nodeRemoved": "從面板中刪除的節點:",
|
||||
"nodeRemoved_plural": "從面板中刪除的多個節點:",
|
||||
"nodeEnabled": "啟用節點:",
|
||||
"nodeEnabled_plural": "啟用多個節點:",
|
||||
"nodeDisabled": "禁用節點:",
|
||||
"nodeDisabled_plural": "禁用多個節點:",
|
||||
"nodeUpgraded": "節點模組__module__升級到__version__版本"
|
||||
},
|
||||
"editor": {
|
||||
"title": "面板管理",
|
||||
"palette": "Palette",
|
||||
"times": {
|
||||
"seconds": "秒前",
|
||||
"minutes": "分前",
|
||||
"minutesV": "__count__分前",
|
||||
"hoursV": "__count__小時前",
|
||||
"hoursV_plural": "__count__小時前",
|
||||
"daysV": "__count__天前",
|
||||
"daysV_plural": "__count__天前",
|
||||
"weeksV": "__count__周前",
|
||||
"weeksV_plural": "__count__周前",
|
||||
"monthsV": "__count__月前",
|
||||
"monthsV_plural": "__count__月前",
|
||||
"yearsV": "__count__年前",
|
||||
"yearsV_plural": "__count__年前",
|
||||
"yearMonthsV": "__y__年, __count__月前",
|
||||
"yearMonthsV_plural": "__y__年, __count__月前",
|
||||
"yearsMonthsV": "__y__年, __count__月前",
|
||||
"yearsMonthsV_plural": "__y__年, __count__月前"
|
||||
},
|
||||
"nodeCount": "__label__個節點",
|
||||
"nodeCount_plural": "__label__個節點",
|
||||
"moduleCount": "__count__個可用模組",
|
||||
"moduleCount_plural": "__count__個可用模組",
|
||||
"inuse": "使用中",
|
||||
"enableall": "全部啟用",
|
||||
"disableall": "全部禁用",
|
||||
"enable": "啟用",
|
||||
"disable": "禁用",
|
||||
"remove": "移除",
|
||||
"update": "更新至__version__版本",
|
||||
"updated": "已更新",
|
||||
"install": "安裝",
|
||||
"installed": "已安裝",
|
||||
"conflict": "conflict",
|
||||
"conflictTip": "<p>無法安裝此模塊,因為它包含已安裝的<br/>節點類型</p><p>與<code>__module__</code>衝突</p>",
|
||||
"loading": "載入目錄...",
|
||||
"tab-nodes": "節點",
|
||||
"tab-install": "安裝",
|
||||
"sort": "排序:",
|
||||
"sortAZ": "a-z順序",
|
||||
"sortRecent": "日期順序",
|
||||
"more": "增加__count__個",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "無法載入節點目錄。<br>查看瀏覽器控制台瞭解更多資訊",
|
||||
"installFailed": "無法安裝: __module__<br>__message__<br>查看日誌瞭解更多資訊",
|
||||
"removeFailed": "無法刪除: __module__<br>__message__<br>查看日誌瞭解更多資訊",
|
||||
"updateFailed": "無法更新: __module__<br>__message__<br>查看日誌瞭解更多資訊",
|
||||
"enableFailed": "無法啟用: __module__<br>__message__<br>查看日誌瞭解更多資訊",
|
||||
"disableFailed": "無法禁用: __module__<br>__message__<br>查看日誌瞭解更多資訊"
|
||||
},
|
||||
"confirm": {
|
||||
"install": {
|
||||
"body": "在安裝之前,請閱讀節點的文檔,某些節點的依賴關係不能自動解決,可能需要重新啟動Node-RED。",
|
||||
"title": "安裝節點"
|
||||
},
|
||||
"remove": {
|
||||
"body": "刪除節點將從Node-RED卸載它。節點可能會繼續使用資源,直到重新啟動Node-RED。",
|
||||
"title": "刪除節點"
|
||||
},
|
||||
"update": {
|
||||
"body": "更新節點將需要重新啟動Node-RED來完成更新,該過程必須由手動完成。",
|
||||
"title": "更新節點"
|
||||
},
|
||||
"cannotUpdate": {
|
||||
"body": "此節點的更新可用,但不會安裝在面板管理器可以更新的位置。<br/><br/>請參閱有關如何更新此節點的文檔。"
|
||||
},
|
||||
"button": {
|
||||
"review": "打開節點資訊",
|
||||
"install": "安裝",
|
||||
"remove": "刪除",
|
||||
"update": "更新"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sidebar": {
|
||||
"info": {
|
||||
"name": "節點信息",
|
||||
"tabName": "名稱",
|
||||
"label": "信息",
|
||||
"node": "節點",
|
||||
"type": "類型",
|
||||
"module": "Module",
|
||||
"id": "ID",
|
||||
"status": "狀態",
|
||||
"enabled": "啟用",
|
||||
"disabled": "禁用",
|
||||
"subflow": "子流程",
|
||||
"instances": "實例",
|
||||
"properties": "屬性",
|
||||
"info": "信息",
|
||||
"desc": "描述",
|
||||
"blank": "空白",
|
||||
"null": "空",
|
||||
"showMore": "展開",
|
||||
"showLess": "收起",
|
||||
"flow": "流程",
|
||||
"selection": "選擇",
|
||||
"nodes": "__count__ 個節點",
|
||||
"flowDesc": "流程描述",
|
||||
"subflowDesc": "子流程描述",
|
||||
"nodeHelp": "節點幫助",
|
||||
"none": "無",
|
||||
"arrayItems": "__count__個項目",
|
||||
"showTips": "您可以從設置面板啟用提示資訊"
|
||||
},
|
||||
"config": {
|
||||
"name": "配置節點",
|
||||
"label": "配置",
|
||||
"global": "所有流程",
|
||||
"none": "無",
|
||||
"subflows": "子流程",
|
||||
"flows": "流程",
|
||||
"filterUnused": "未使用",
|
||||
"filterAll": "所有",
|
||||
"filtered": "__count__ 個隱藏"
|
||||
},
|
||||
"context": {
|
||||
"name": "上下文數據",
|
||||
"label": "上下文",
|
||||
"none": "未選擇",
|
||||
"refresh": "刷新以加載",
|
||||
"empty": "空",
|
||||
"node": "節點",
|
||||
"flow": "流程",
|
||||
"global": "全局的",
|
||||
"deleteConfirm": "你確定要刪除這個項目嗎?",
|
||||
"autoRefresh": "自動刷新"
|
||||
},
|
||||
"palette": {
|
||||
"name": "節點管理",
|
||||
"label": "節點"
|
||||
},
|
||||
"project": {
|
||||
"label": "項目",
|
||||
"name": "名稱",
|
||||
"description": "描述",
|
||||
"dependencies": "依賴",
|
||||
"settings": "設置",
|
||||
"noSummaryAvailable": "無可用摘要",
|
||||
"editDescription": "編輯專案描述",
|
||||
"editDependencies": "編輯項目依賴",
|
||||
"editReadme": "Edit README.md",
|
||||
"showProjectSettings": "顯示項目設置",
|
||||
"projectSettings": {
|
||||
"title": "項目設定",
|
||||
"edit": "編輯",
|
||||
"none": "None",
|
||||
"install": "安裝",
|
||||
"removeFromProject": "從項目中刪除",
|
||||
"addToProject": "添加到項目",
|
||||
"files": "文件",
|
||||
"package": "包",
|
||||
"flow": "流程",
|
||||
"credentials": "證書",
|
||||
"packageCreate": "保存更改後將創建文件",
|
||||
"fileNotExist": "文件不存在",
|
||||
"selectFile": "選擇文件",
|
||||
"invalidEncryptionKey": "無效的加密密鑰",
|
||||
"encryptionEnabled": "啟用加密",
|
||||
"encryptionDisabled": "禁用加密",
|
||||
"setTheEncryptionKey": "設置加密密鑰",
|
||||
"resetTheEncryptionKey": "重置加密密鑰",
|
||||
"changeTheEncryptionKey": "更改加密密鑰",
|
||||
"currentKey": "當前密鑰",
|
||||
"newKey": "新密鑰",
|
||||
"credentialsAlert": "這將刪除所有現有證書",
|
||||
"versionControl": "版本控制",
|
||||
"branches": "分支",
|
||||
"noBranches": "沒有分支",
|
||||
"deleteConfirm": "您確定要刪除本地分支'__name__'嗎?這不能被撤消。",
|
||||
"unmergedConfirm": "本地分支'__name__'具有未合併的更改,這些更改將丟失。你確定要刪除嗎?",
|
||||
"deleteUnmergedBranch": "刪除未合併的分支",
|
||||
"gitRemotes": "Git遠程倉庫",
|
||||
"addRemote": "添加遠程倉庫",
|
||||
"addRemote2": "添加遠程倉庫",
|
||||
"remoteName": "遠程倉庫名",
|
||||
"nameRule": "必須僅包含A-Z 0-9 _ -",
|
||||
"url": "URL",
|
||||
"urlRule": "https://, ssh:// or file://",
|
||||
"urlRule2": "網址中不要包含用戶名/密碼",
|
||||
"noRemotes": "沒有遠程倉庫",
|
||||
"deleteRemoteConfrim": "確定要刪除遠程倉庫'__name__'嗎?",
|
||||
"deleteRemote": "刪除遠程倉庫"
|
||||
},
|
||||
"userSettings": {
|
||||
"committerDetail": "提交者詳細信息",
|
||||
"committerTip": "保留空白以使用系統默認值",
|
||||
"userName": "用戶名",
|
||||
"email": "電子郵件",
|
||||
"sshKeys": "SSH密鑰",
|
||||
"sshKeysTip": "允許您創建到遠程git存儲庫的安全連接。",
|
||||
"add": "添加密鑰",
|
||||
"addSshKey": "添加SSH密鑰",
|
||||
"addSshKeyTip": "生成新的公鑰/私鑰對",
|
||||
"name": "名字",
|
||||
"nameRule": "必須僅包含A-Z 0-9 _ -",
|
||||
"passphrase": "密碼短語",
|
||||
"passphraseShort": "密碼短語太短",
|
||||
"optional": "可選的",
|
||||
"cancel": "取消",
|
||||
"generate": "產生密鑰",
|
||||
"noSshKeys": "沒有SSH密鑰",
|
||||
"copyPublicKey": "將公鑰複製到剪貼板",
|
||||
"delete": "刪除密鑰",
|
||||
"gitConfig": "Git配置",
|
||||
"deleteConfirm": "您確定要刪除SSH密鑰__name__嗎? 這不能被撤消。"
|
||||
},
|
||||
"versionControl": {
|
||||
"unstagedChanges": "未暫存的更改",
|
||||
"stagedChanges": "已暫存的更改",
|
||||
"unstageChange": "取消暫存更改",
|
||||
"stageChange": "暫存更改",
|
||||
"unstageAllChange": "取消暫存所有更改",
|
||||
"stageAllChange": "暫存所有更改",
|
||||
"commitChanges": "提交變更",
|
||||
"resolveConflicts": "解決衝突",
|
||||
"head": "HEAD",
|
||||
"staged": "以暫存",
|
||||
"unstaged": "未暫存",
|
||||
"local": "本地的",
|
||||
"remote": "遠程的",
|
||||
"revert": "您確定要將更改恢復為'__file__'嗎? 這不能被撤消。",
|
||||
"revertChanges": "還原變更",
|
||||
"localChanges": "當地變化",
|
||||
"none": "None",
|
||||
"conflictResolve": "解決所有衝突。 提交更改以完成合併。",
|
||||
"localFiles": "本地文件",
|
||||
"all": "所有的",
|
||||
"unmergedChanges": "未合併的更改",
|
||||
"abortMerge": "合併中止",
|
||||
"commit": "提交",
|
||||
"changeToCommit": "提交變更",
|
||||
"commitPlaceholder": "輸入您的提交信息",
|
||||
"cancelCapital": "取消",
|
||||
"commitCapital": "提交",
|
||||
"commitHistory": "提交歷史",
|
||||
"branch": "分支:",
|
||||
"moreCommits": "更多提交",
|
||||
"changeLocalBranch": "變更當地分支",
|
||||
"createBranchPlaceholder": "查找或創建分支",
|
||||
"upstream": "上游的",
|
||||
"localOverwrite": "您有可通过切换分支覆盖的本地更改。您必须先提交或撤销那些更改。",
|
||||
"manageRemoteBranch": "管理遠程分支",
|
||||
"unableToAccess": "無法訪問遠程存儲庫",
|
||||
"retry": "重試",
|
||||
"setUpstreamBranch": "設置為上游分支",
|
||||
"createRemoteBranchPlaceholder": "查找或創建遠程分支",
|
||||
"trackedUpstreamBranch": "創建的分支將被設置為跟踪的上游分支。",
|
||||
"selectUpstreamBranch": "分支將被創建。 在下面選擇以將其設置為被跟踪的上游分支。",
|
||||
"pushFailed": "Push失敗,因為遠程具有更多的最新提交。請先進行pull與merge,然後再嘗試push。",
|
||||
"push": "push",
|
||||
"pull": "pull",
|
||||
"unablePull": "<p>無法提取遠程更改;您未進行的暫存本地更改將被覆蓋。</p><p>提交更改,然後重試。</p>",
|
||||
"showUnstagedChanges": "顯示未分階段的更改",
|
||||
"connectionFailed": "無法連接到遠程存儲庫:",
|
||||
"pullUnrelatedHistory": "<p>遠程服務器具有不相關的提交歷史記錄。</p><p>您確定要將更改保存到本地存儲庫中嗎?</p>",
|
||||
"pullChanges": "Pull變更",
|
||||
"history": "歷史",
|
||||
"projectHistory": "項目歷史",
|
||||
"daysAgo": "__count__天前",
|
||||
"daysAgo_plural": "__count__天前",
|
||||
"hoursAgo": "__count__小時前",
|
||||
"hoursAgo_plural": "__count__小時前",
|
||||
"minsAgo": "__count__分鐘前",
|
||||
"minsAgo_plural": "__count__分鐘前",
|
||||
"secondsAgo": "秒前",
|
||||
"notTracking": "您的本地分支當前未跟踪遠程分支。",
|
||||
"statusUnmergedChanged": "您的存儲庫中有未合併的更改。您需要解決衝突並提交結果。",
|
||||
"repositoryUpToDate": "您的存儲庫是最新的。",
|
||||
"commitsAhead": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。",
|
||||
"commitsAhead_plural": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。",
|
||||
"commitsBehind": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。",
|
||||
"commitsBehind_plural": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。",
|
||||
"commitsAheadAndBehind1": "您的倉庫落後遠程倉庫__count__次提交",
|
||||
"commitsAheadAndBehind1_plural": "您的倉庫落後遠程倉庫__count__次提交",
|
||||
"commitsAheadAndBehind2": "領先遠程倉庫__count__次提交。",
|
||||
"commitsAheadAndBehind2_plural": "領先遠程倉庫__count__次提交。",
|
||||
"commitsAheadAndBehind3": "您必須先pull遠程提交,然後再進行push。",
|
||||
"commitsAheadAndBehind3_plural": "您必須先pull遠程提交,然後再進行push。",
|
||||
"refreshCommitHistory": "刷新提交歷史",
|
||||
"refreshChanges": "刷新更改"
|
||||
}
|
||||
}
|
||||
},
|
||||
"typedInput": {
|
||||
"type": {
|
||||
"str": "文字列",
|
||||
"num": "數字",
|
||||
"re": "規則運算式",
|
||||
"bool": "布林",
|
||||
"json": "JSON",
|
||||
"bin": "二進位流",
|
||||
"date": "時間戳記",
|
||||
"jsonata": "expression",
|
||||
"env": "env variable"
|
||||
}
|
||||
},
|
||||
"editableList": {
|
||||
"add": "添加"
|
||||
},
|
||||
"search": {
|
||||
"empty": "找不到匹配",
|
||||
"addNode": "添加一個節點..."
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "功能",
|
||||
"functionReference": "Function reference",
|
||||
"insert": "插入",
|
||||
"title": "JSONata運算式編輯器",
|
||||
"test": "Test",
|
||||
"data": "示例消息",
|
||||
"result": "結果",
|
||||
"format": "格式表達方法",
|
||||
"compatMode": "相容模式啟用",
|
||||
"compatModeDesc": "<h3>JSONata的相容模式</h3><p> 目前的運算式仍然參考<code>msg</code>,所以將以相容性模式進行評估。請更新運算式,使其不使用<code>msg</code>,因為此模式將在將來刪除。</p><p> 當JSONata支持首次添加到Node-RED時,它需要運算式引用<code>msg</code>物件。例如<code>msg.payload</code>將用於訪問有效負載。</p><p> 這樣便不再需要運算式直接針對消息進行評估。要訪問有效負載,運算式應該只是<code>payload</code>.</p>",
|
||||
"noMatch": "無匹配結果",
|
||||
"errors": {
|
||||
"invalid-expr": "無效的JSONata運算式:\n __message__",
|
||||
"invalid-msg": "無效的示例JSON消息:\n __message__",
|
||||
"context-unsupported": "無法測試上下文函數\n $flowContext 或 $globalContext",
|
||||
"eval": "評估運算式錯誤:\n __message__"
|
||||
}
|
||||
},
|
||||
"jsEditor": {
|
||||
"title": "JavaScript 編輯器"
|
||||
},
|
||||
"textEditor": {
|
||||
"title": "Text 編輯器"
|
||||
},
|
||||
"jsonEditor": {
|
||||
"title": "JSON編輯器",
|
||||
"format": "格式化JSON"
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "Markdown 編輯器",
|
||||
"format": "F使用markdown格式化",
|
||||
"heading1": "Heading 1",
|
||||
"heading2": "Heading 2",
|
||||
"heading3": "Heading 3",
|
||||
"bold": "粗體",
|
||||
"italic": "斜體",
|
||||
"code": "程式碼",
|
||||
"ordered-list": "編號清單",
|
||||
"unordered-list": "符號清單",
|
||||
"quote": "引用",
|
||||
"link": "連結",
|
||||
"horizontal-rule": "分隔線",
|
||||
"toggle-preview": "預覽"
|
||||
},
|
||||
"bufferEditor": {
|
||||
"title": "緩衝區編輯器",
|
||||
"modeString": "作為UTF-8字串處理",
|
||||
"modeArray": "作為JSON陣列處理",
|
||||
"modeDesc": "<h3>緩衝區編輯器</h3><p>緩衝區類型被存儲為位元組值的JSON陣列。編輯器將嘗試將輸入的數值解析為JSON陣列。如果它不是有效的JSON,它將被視為UTF-8字串,並被轉換為單個字元代碼點的陣列。</p><p>例如,<code>Hello World</code>的值會被轉換為JSON陣列:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
|
||||
},
|
||||
"projects": {
|
||||
"config-git": "配置Git客戶端",
|
||||
"welcome": {
|
||||
"hello": "你好! 我們已經將“項目”引入了Node-RED。",
|
||||
"desc0": "這是一種用於管理流程文件的新方法,並且包括對流程的版本控制。",
|
||||
"desc1": "首先,您可以創建您的第一個項目或從git存儲庫克隆現有項目。",
|
||||
"desc2": "如果不確定,可以暫時跳過此步驟。 您仍然可以隨時通過“項目”菜單創建第一個項目。",
|
||||
"create": "創建項目",
|
||||
"clone": "克隆存儲庫",
|
||||
"openExistingProject": "打開現有項目",
|
||||
"not-right-now": "不是現在"
|
||||
},
|
||||
"git-config": {
|
||||
"setup": "設置您的版本控制客戶端",
|
||||
"desc0": "Node-RED使用開源工具Git進行版本控制。 它跟踪對項目文件的更改,並允許您將其推送到遠程存儲庫。",
|
||||
"desc1": "提交一組更改時,Git會使用用戶名和電子郵件地址記錄誰進行了更改。 用戶名可以是您想要的任何名稱-不必是您的真實姓名。",
|
||||
"desc2": "您的Git客戶端已經配置了以下詳細信息。",
|
||||
"desc3": "您可以稍後在設置對話框的“ Git config”標籤下更改這些設置。",
|
||||
"username": "用戶名",
|
||||
"email": "電子郵件"
|
||||
},
|
||||
"project-details": {
|
||||
"create": "創建您的項目",
|
||||
"desc0": "項目被維護為Git存儲庫。 與他人共享您的流程並進行協作更容易。",
|
||||
"desc1": "您可以創建多個項目,並通過編輯器在它們之間快速切換。",
|
||||
"desc2": "首先,您的項目需要一個名稱和一個可選的描述。",
|
||||
"already-exists": "項目已存在",
|
||||
"must-contain": "必須僅包含A-Z 0-9 _ -",
|
||||
"project-name": "項目名",
|
||||
"desc": "描述",
|
||||
"opt": "可選的"
|
||||
},
|
||||
"clone-project": {
|
||||
"clone": "克隆項目",
|
||||
"desc0": "如果您已經有一個包含項目的git存儲庫,則可以對其進行克隆以開始使用。",
|
||||
"already-exists": "項目已經存在",
|
||||
"must-contain": "必須僅包含A-Z 0-9 _ -",
|
||||
"project-name": "項目名",
|
||||
"no-info-in-url": "網址中不要包含用戶名/密碼",
|
||||
"git-url": "Git存儲庫URL",
|
||||
"protocols": "https://, ssh:// or file://",
|
||||
"auth-failed": "驗證失敗",
|
||||
"username": "用戶名",
|
||||
"passwd": "密碼",
|
||||
"ssh-key": "SSH密鑰",
|
||||
"passphrase": "密碼短語",
|
||||
"ssh-key-desc": "在通過ssh克隆存儲庫之前,必須添加SSH密鑰才能訪問它。",
|
||||
"ssh-key-add": "添加一個ssh密鑰",
|
||||
"credential-key": "證書加密密鑰",
|
||||
"cant-get-ssh-key": "錯誤! 無法獲取所選的SSH密鑰路徑。",
|
||||
"already-exists2": "已存在",
|
||||
"git-error": "git錯誤",
|
||||
"connection-failed": "連接失敗",
|
||||
"not-git-repo": "不是一個git倉庫",
|
||||
"repo-not-found": "未發現倉庫"
|
||||
},
|
||||
"default-files": {
|
||||
"create": "創建您的項目文件",
|
||||
"desc0": "一個項目包含您的流程文件,自述文件和package.json文件。",
|
||||
"desc1": "它可以包含您要在Git存儲庫中維護的任何其他文件。",
|
||||
"desc2": "您現有的流程和證書文件將被複製到項目中。",
|
||||
"flow-file": "流文件",
|
||||
"credentials-file": "證書文件"
|
||||
},
|
||||
"encryption-config": {
|
||||
"setup": "設置證書文件的加密",
|
||||
"desc0": "您的流程證書文件可以被加密以確保其內容安全。",
|
||||
"desc1": "如果要將這些證書存儲在公共Git存儲庫中,則必須通過提供密鑰短語來對它們進行加密。",
|
||||
"desc2": "您的流程證書文件當前未加密。",
|
||||
"desc3": "這意味著任何有權訪問該文件的人都可以讀取其內容,例如密碼和訪問令牌。",
|
||||
"desc4": "如果要將這些證書存儲在公共Git存儲庫中,則必須通過提供密鑰短語來對它們進行加密。",
|
||||
"desc5": "當前,使用設置文件中的credentialSecret屬性作為密鑰來加密流憑據文件。",
|
||||
"desc6": "您的流程證書文件當前使用系統生成的密鑰加密。 您應該為此項目提供一個新的密鑰。",
|
||||
"desc7": "密鑰將與項目文件分開存儲。 您將需要提供在另一個Node-RED實例中使用該項目的密鑰。",
|
||||
"credentials": "證書",
|
||||
"enable": "啟用加密",
|
||||
"disable": "禁用加密",
|
||||
"disabled": "禁用的",
|
||||
"copy": "複製現有密鑰",
|
||||
"use-custom": "使用自定義密鑰",
|
||||
"desc8": "憑證文件不會被加密,其內容很容易閱讀",
|
||||
"create-project-files": "創建項目文件",
|
||||
"create-project": "創建項目",
|
||||
"already-exists": "已存在",
|
||||
"git-error": "git錯誤",
|
||||
"git-auth-error": "git認證錯誤"
|
||||
},
|
||||
"create-success": {
|
||||
"success": "您已經成功創建了第一個項目!",
|
||||
"desc0": "現在,您可以像往常一樣繼續使用Node-RED。",
|
||||
"desc1": "側欄中的“信息”標籤顯示了您當前的活動項目。名稱旁邊的按鈕可用於訪問項目設置視圖。",
|
||||
"desc2": "側欄中的“歷史記錄”標籤可用於查看項目中已更改的文件並提交。 它向您顯示了提交的完整歷史記錄,並允許您將更改推送到遠程存儲庫。"
|
||||
},
|
||||
"create": {
|
||||
"projects": "項目",
|
||||
"already-exists": "項目已存在",
|
||||
"must-contain": "必須僅包含A-Z 0-9 _ -",
|
||||
"no-info-in-url": "網址中不要包含用戶名/密碼",
|
||||
"open": "打開項目",
|
||||
"create": "創建項目",
|
||||
"clone": "克隆倉庫",
|
||||
"project-name": "項目名",
|
||||
"desc": "描述",
|
||||
"opt": "可選的",
|
||||
"flow-file": "流程文件",
|
||||
"credentials": "證書",
|
||||
"enable-encryption": "啟用加密",
|
||||
"disable-encryption": "禁用加密",
|
||||
"encryption-key": "加密的密鑰",
|
||||
"desc0": "用來保護您的憑證的短語",
|
||||
"desc1": "憑證文件不會被加密,其內容很容易閱讀",
|
||||
"git-url": "Git倉庫的URL",
|
||||
"protocols": "https://, ssh:// or file://",
|
||||
"auth-failed": "驗證失敗",
|
||||
"username": "用戶名",
|
||||
"password": "密碼",
|
||||
"ssh-key": "SSH密鑰",
|
||||
"passphrase": "密碼短語",
|
||||
"desc2": "在通過ssh克隆存儲庫之前,必須添加SSH密鑰才能訪問它。",
|
||||
"add-ssh-key": "添加一個ssh密鑰",
|
||||
"credentials-encryption-key": "憑證加密密鑰",
|
||||
"already-exists-2": "已存在",
|
||||
"git-error": "git錯誤",
|
||||
"con-failed": "連接失敗",
|
||||
"not-git": "不是git倉庫",
|
||||
"no-resource": "找不到存儲庫",
|
||||
"cant-get-ssh-key-path": "錯誤! 無法獲取所選的SSH密鑰路徑。",
|
||||
"unexpected_error": "意外的錯誤"
|
||||
},
|
||||
"delete": {
|
||||
"confirm": "您確定要刪除此項目嗎?"
|
||||
},
|
||||
"create-project-list": {
|
||||
"search": "搜索您的項目",
|
||||
"current": "當前的"
|
||||
},
|
||||
"require-clean": {
|
||||
"confirm": "<p>您有未部署的更改,這些更改將丟失。</p><p>您要繼續嗎?</p>"
|
||||
},
|
||||
"send-req": {
|
||||
"auth-req": "存儲庫需要認證",
|
||||
"username": "用戶名",
|
||||
"password": "密碼",
|
||||
"passphrase": "密碼短語",
|
||||
"retry": "重試",
|
||||
"update-failed": "無法更新身份驗證",
|
||||
"unhandled": "未處理的錯誤響應"
|
||||
},
|
||||
"create-branch-list": {
|
||||
"invalid": "無效的分支",
|
||||
"create": "創建分支",
|
||||
"current": "當前的"
|
||||
},
|
||||
"create-default-file-set": {
|
||||
"no-active": "沒有活動項目就無法創建默認文件集",
|
||||
"no-empty": "無法在非空項目上創建默認文件集",
|
||||
"git-error": "git error"
|
||||
},
|
||||
"errors": {
|
||||
"no-username-email": "您的Git客戶端未配置用戶名/電子郵件。",
|
||||
"unexpected": "發生了一個意料之外的問題",
|
||||
"code": "代碼"
|
||||
}
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "屬性",
|
||||
"description": "描述",
|
||||
"appearance": "外觀",
|
||||
"env": "環境變量"
|
||||
}
|
||||
}
|
23
packages/node_modules/@node-red/editor-client/locales/zh-TW/infotips.json
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"info": {
|
||||
"tip0" : "您可以用 {{core:delete-selection}} 刪除選擇的節點或連結。",
|
||||
"tip1" : "{{core:search}} 可以在流程內搜索節點。",
|
||||
"tip2": "{{core:toggle-sidebar}} 可以顯示或隱藏邊側欄。",
|
||||
"tip3": "您可以在 {{core:manage-palette}} 中管理節點的控制台。",
|
||||
"tip4": "側邊欄中會列出流程中所有的配置節點。您可以通過功能表或者 {{core:show-config-tab}} 來訪問這些節點。",
|
||||
"tip5": "您可以在設定中選擇顯示或隱藏這些提示。",
|
||||
"tip6": "您可以用[left] [up] [down] [right]鍵來移動被選中的節點。按住[shift]可以更快地移動節點。",
|
||||
"tip7": "把節點拖到連接上可以向連接中插入節點。",
|
||||
"tip8": "您可以用 {{core:show-export-dialog}} 來匯出被選中的節點或標籤頁中的流程。",
|
||||
"tip9": "您可以將流程的json文字檔拖入編輯方塊或 {{core:show-import-dialog}} 來導入流程。",
|
||||
"tip10": "按住[shift]後按一下並拖動節點可以將該節點的多個連接一併移動到其他節點的埠。",
|
||||
"tip11": "{{core:show-info-tab}} 可以顯示「資訊」標籤頁。 {{core:show-debug-tab}} 可以顯示「調試」標籤頁。",
|
||||
"tip12": "按住[ctrl]的同時點擊工作介面可以在節點的對話欄中快速添加節點。",
|
||||
"tip13": "按住[ctrl]的同時點擊節點的埠或後續節點可以快速連接多個節點。",
|
||||
"tip14": "按住[shift]的同時點擊節點會選中所有被連接的節點。",
|
||||
"tip15": "按住[ctrl]的同時點擊節點可以在選中或取消選中節點。",
|
||||
"tip16": "{{core:show-previous-tab}} 和 {{core:show-next-tab}} 可以切換標籤頁。",
|
||||
"tip17": "您可以在節點的屬性配置畫面中通過 {{core:confirm-edit-tray}} 來更改設置,或者用 {{core:cancel-edit-tray}} 來取消更改。",
|
||||
"tip18": "您可以通過點擊 {{core:edit-selected-node}} 來顯示被選中節點的屬性設置畫面。"
|
||||
}
|
||||
}
|
218
packages/node_modules/@node-red/editor-client/locales/zh-TW/jsonata.json
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg",
|
||||
"desc": "通過以下的類型轉換規則將參數*arg*轉換成字串:\n\n - 字串不轉換。\n -函數轉換成空的字串。\n - JSON的值無法用數字表示所以用無限大或者NaN(非數)表示。\n - 用’JSON.stringify’函數將其他值轉換成JSON字串。"
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
"desc": "輸出字串’str’的字數。如果’str’不是字串,拋出錯誤。"
|
||||
},
|
||||
"$substring": {
|
||||
"args": "str, start[, length]",
|
||||
"desc": "輸出`start`位置後的的首次出現的包括`str`的子字串。 如果`length`被指定,那麼的字串中將只包括前`length`個文字。如果`start`是負數則輸出從`str`末尾開始的`length`個文字"
|
||||
},
|
||||
"$substringBefore": {
|
||||
"args": "str, chars",
|
||||
"desc": "輸出’str’中首次出現的’chars’之前的子字串,如果’str’中不包括’chars’則輸出’str’。"
|
||||
},
|
||||
"$substringAfter": {
|
||||
"args": "str, chars",
|
||||
"desc": "輸出’str’中首次出現的’chars’之後的子字串,如果’str’中不包括’chars’則輸出’str’。"
|
||||
},
|
||||
"$uppercase": {
|
||||
"args": "str",
|
||||
"desc": "`將’str’中的所有字母變為大寫後輸出。"
|
||||
},
|
||||
"$lowercase": {
|
||||
"args": "str",
|
||||
"desc": "將’str’中的所有字母變為小寫後輸出。"
|
||||
},
|
||||
"$trim": {
|
||||
"args": "str",
|
||||
"desc": "將以下步驟應用於`str`來去除所有空白文字並實現標準化。\n\n – 將全部tab定位字元、Enter鍵、換行字元用空白代替。\n- 將連續的空白文字變成一個空白文字。\n- 消除開頭和末尾的空白文字。\n\n如果`str`沒有被指定(即在無輸入參數的情況下調用本函數),將上下文的值作為`str`來使用。 如果`str` 不是字串則拋出錯誤。"
|
||||
},
|
||||
"$contains": {
|
||||
"args": "str, pattern",
|
||||
"desc": "字串`str` 和 `pattern`匹配的話輸出`true`,不匹配的情況下輸出 `false`。 不指定`str`的情況下(比如用一個參數調用本函數時)、將上下文的值作為`str`來使用。參數 `pattern`可以為字串或正則表達。"
|
||||
},
|
||||
"$split": {
|
||||
"args": "str[, separator][, limit]",
|
||||
"desc": "將參數`str`分解成由子字串組成的陣列。 如果`str`不是字串拋出錯誤。可以省略的參數 `separator`中指定字串`str`的分隔符號。分隔符號可以是文字或規則運算式。在不指定`separator`的情況下、將分隔符號看作空的字串並把`str`拆分成由單個字母組成的陣列。如果`separator`不是字串則拋出錯誤。在可省略的參數`limit`中指定分割後的子字串的最大個數。超出個數的子字串將被捨棄。如果`limit`沒有被指定,`str` 將不考慮子字串的個數而將字串完全分隔。如果`limit`是負數則拋出錯誤。"
|
||||
},
|
||||
"$join": {
|
||||
"args": "array[, separator]",
|
||||
"desc": "用可以省略的參數 `separator`來把多個字元串連接。如果`array`不是字串則拋出錯誤。 如果沒有指定`separator`,則用空字串來連接字元(即字串之間沒有`separator`)。 如果`separator`不是字元則拋出錯誤。"
|
||||
},
|
||||
"$match": {
|
||||
"args": "str, pattern [, limit]",
|
||||
"desc": "對字串`str`使用規則運算式`pattern`並輸出與`str`相匹配的部分資訊。"
|
||||
},
|
||||
"$replace": {
|
||||
"args": "str, pattern, replacement [, limit]",
|
||||
"desc": "在字串`str`中搜索`pattern`並用`replacement`來替換。\n\n可選參數`limit`用來指定替換次數的上限。"
|
||||
},
|
||||
"$now": {
|
||||
"args": "",
|
||||
"desc": "生成ISO 8601互換格式的時刻,並作為字串輸出。"
|
||||
},
|
||||
"$base64encode": {
|
||||
"args": "string",
|
||||
"desc": "將ASCII格式的字串轉換為Base 64格式。將字串中的文字視作二進位形式的資料處理。包含URI編碼在內的字串文字必須在0x00到0xFF的範圍內,否則不會被支持。"
|
||||
},
|
||||
"$base64decode": {
|
||||
"args": "string",
|
||||
"desc": "用UTF-8內碼表將Base 64形式二進位值轉換為字串。"
|
||||
},
|
||||
"$number": {
|
||||
"args": "arg",
|
||||
"desc": "用下述的規則將參數 `arg`轉換為數值。:\n\n – 數值不做轉換。\n – 將字串中合法的JSON數値表示轉換成數値。\n – 其他形式的值則拋出錯誤。"
|
||||
},
|
||||
"$abs": {
|
||||
"args": "number",
|
||||
"desc": "輸出參數`number`的絕對值。"
|
||||
},
|
||||
"$floor": {
|
||||
"args": "number",
|
||||
"desc": "輸出比`number`的值小的最大整數。"
|
||||
},
|
||||
"$ceil": {
|
||||
"args": "number",
|
||||
"desc": "輸出比`number`的值大的最小整數。"
|
||||
},
|
||||
"$round": {
|
||||
"args": "number [, precision]",
|
||||
"desc": "輸出四捨五入後的參數`number`。可省略的參數 `precision`指定四捨五入後小數點下的位數。"
|
||||
},
|
||||
"$power": {
|
||||
"args": "base, exponent",
|
||||
"desc": "輸出底數`base`的`exponent`次冪。"
|
||||
},
|
||||
"$sqrt": {
|
||||
"args": "number",
|
||||
"desc": "輸出參數 `number`的平方根。"
|
||||
},
|
||||
"$random": {
|
||||
"args": "",
|
||||
"desc": "輸出比0大,比1小的偽亂數。"
|
||||
},
|
||||
"$millis": {
|
||||
"args": "",
|
||||
"desc": "返回從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數。在同一個運算式的測試中所有對`$millis()`的調用將會返回相同的值。"
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "輸出陣列`array`的總和。如果`array`不是數值則拋出錯誤。"
|
||||
},
|
||||
"$max": {
|
||||
"args": "array",
|
||||
"desc": "輸出陣列`array`的最大值。如果`array`不是數值則拋出錯誤。"
|
||||
},
|
||||
"$min": {
|
||||
"args": "array",
|
||||
"desc": "輸出陣列`array`的最小值。如果`array`不是數值則拋出錯誤。。"
|
||||
},
|
||||
"$average": {
|
||||
"args": "array",
|
||||
"desc": "輸出陣列`array`的平均數。如果`array`不是數值則拋出錯誤。。"
|
||||
},
|
||||
"$boolean": {
|
||||
"args": "arg",
|
||||
"desc": "用下述規則將資料轉換成布林值。:\n\n - 不轉換布林值`Boolean`。\n – 將空的字串`string`轉換為`false`\n – 將不為空的字串`string`轉換為`true`\n – 將為0的數位`number`轉換成`false`\n –將不為0的數位`number`轉換成`true`\n –將`null`轉換成`false`\n –將空的陣列`array`轉換成`false`\n –如果陣列`array`中含有可以轉換成`true`的要素則轉換成`true`\n –如果`array`中沒有可轉換成`true`的要素則轉換成`false`\n – 空的物件`object`轉換成`false`\n – 非空的物件`object`轉換成`true`\n –將函數`function`轉換成`false`"
|
||||
},
|
||||
"$not": {
|
||||
"args": "arg",
|
||||
"desc": "輸出做反轉運算後的布林值。首先將`arg`轉換為布林值。"
|
||||
},
|
||||
"$exists": {
|
||||
"args": "arg",
|
||||
"desc": "如果算式`arg`的值存在則輸出`true`。如果算式的值不存在(比如指向不存在區域的引用)則輸出`false`。"
|
||||
},
|
||||
"$count": {
|
||||
"args": "array",
|
||||
"desc": "輸出陣列中的元素數。"
|
||||
},
|
||||
"$append": {
|
||||
"args": "array, array",
|
||||
"desc": "將兩個陣列連接。"
|
||||
},
|
||||
"$sort": {
|
||||
"args": "array [, function]",
|
||||
"desc": "輸出排序後的陣列`array`。\n\n如果使用了比較函數`function`,則下述兩個參數需要被指定。\n\n`function(left, right)`\n\n該比較函數是為了比較left和right兩個值而被排序演算法調用的。如果使用者希望left的值被置於right的值之後,那麼該函數必須輸出布林值`true`來表示位置交換。而在不需要位置交換時函數必須輸出`false`。"
|
||||
},
|
||||
"$reverse": {
|
||||
"args": "array",
|
||||
"desc": "輸出倒序後的陣列`array`。"
|
||||
},
|
||||
"$shuffle": {
|
||||
"args": "array",
|
||||
"desc": "輸出隨機排序後的陣列 `array`。"
|
||||
},
|
||||
"$zip": {
|
||||
"args": "array, ...",
|
||||
"desc": "將陣列中的值按索引順序打包後輸出。"
|
||||
},
|
||||
"$keys": {
|
||||
"args": "object",
|
||||
"desc": "輸出由物件內的鍵組成的陣列。如果參數是物件的陣列則輸出由所有物件中的鍵去重後組成的佇列。"
|
||||
},
|
||||
"$lookup": {
|
||||
"args": "object, key",
|
||||
"desc": "輸出對象中與參數`key`對應的值。如果第一個參數`object`是陣列,那麼陣列中所有的物件都將被搜索並輸出這些物件中與參數`key`對應的值。"
|
||||
},
|
||||
"$spread": {
|
||||
"args": "object",
|
||||
"desc": "將物件中的鍵值對分隔成每個要素中只含有一個鍵值對的陣列。如果參數`object`是陣列,那麼返回值的陣列中包含所有物件中的鍵值對。"
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "將輸入陣列`objects`中所有的鍵值對合併到一個`object`中並返回。如果輸入陣列的要素中含有重複的鍵,則返回的`object`中將只包含陣列中最後出現要素的值。如果輸入陣列中包括物件以外的元素,則拋出錯誤。"
|
||||
},
|
||||
"$sift": {
|
||||
"args": "object, function",
|
||||
"desc": "輸出參數`object`中符合`function`的鍵值對。\n\n`function`必須含有下述參數。\n\n`function(value [, key [, object]])`"
|
||||
},
|
||||
"$each": {
|
||||
"args": "object, function",
|
||||
"desc": "將函數`function`應用於`object`中的所有鍵值對並輸出由所有返回值組成的陣列。"
|
||||
},
|
||||
"$map": {
|
||||
"args": "array, function",
|
||||
"desc": "將函數`function`應用於陣列`array`中所有的值並輸出由返回值組成的陣列。\n\n`function`中必須含有下述參數。\n\n`function(value [, index [, array]])`"
|
||||
},
|
||||
"$filter": {
|
||||
"args": "array, function",
|
||||
"desc": "輸出陣列`array`中符合函數`function`條件的值組成的陣列。\n\n`function`必須包括下述參數。\n\n`function(value [, index [, array]])`"
|
||||
},
|
||||
"$reduce": {
|
||||
"args": "array, function [, init]",
|
||||
"desc": "將`function`依次應用於陣列中的各要素值。 其中,前一個要素值的計算結果將參與到下一次的函數運算中。。\n\n函數`function`接受兩個參數並作為中綴標記法中的操作符。\n\n可省略的參數`init`將作為運算的初始值。"
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string",
|
||||
"desc": "獲取流上下文(流等級的上下文,可以讓所有節點共用)的屬性。"
|
||||
},
|
||||
"$globalContext": {
|
||||
"args": "string",
|
||||
"desc": "獲取全域上下文的屬性。"
|
||||
},
|
||||
"$pad": {
|
||||
"args": "string, width [, char]",
|
||||
"desc": "根據需要,向字串`string`的副本中填充文字使該字串的字數達到`width`的絕對值並返回填充文字後的字串。\n\n如果`width`的值為正,則向字串`string`的右側填充文字,如果`width`為負,則向字串`string`的左側填充文字。\n\n可選參數`char`用來指定填充的文字。如果未指定該參數,則填充空白文字。"
|
||||
},
|
||||
"$fromMillis": {
|
||||
"args": "number",
|
||||
"desc": "將表示從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數的數值轉換成ISO 8601形式時間戳記的字串。"
|
||||
},
|
||||
"$formatNumber": {
|
||||
"args": "number, picture [, options]",
|
||||
"desc": "將`number`轉換成具有`picture`所指定的數值格式的字串。\n\n此函數的功能與XPath F&O 3.1規格中定義的XPath/XQuery函數的fn:format-number功能相一致。參數`picture`用於指定數值的轉換格式,其語法與fn:format-number中的定義一致。\n\n可選的第三參數`options`用來覆蓋預設的局部環境格式,如小數點分隔符號。如果指定該參數,那麼該參數必須是包含name/value對的物件,並且name/value對必須符合XPath F&O 3.1規格中記述的數值格式。"
|
||||
},
|
||||
"$formatBase": {
|
||||
"args": "number [, radix]",
|
||||
"desc": "將`number`變換為以參數`radix`的值為基數形式的字串。如果不指定`radix`的值,則默認基數為10。指定的`radix`值必須在2~36之間,否則拋出錯誤。"
|
||||
},
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "將ISO 8601格式的字串`timestamp`轉換為從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數。如果該字串的格式不正確,則拋出錯誤。"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "1.0.0-beta.2",
|
||||
"version": "1.0.3",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -1,4 +1,4 @@
|
||||
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="nrjavascript"});
|
||||
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n# Node-RED Specific Funcs\nsnippet nodes\n node.send(${1:msg})\nsnippet clone\n RED.util.cloneMessage(${1:msg})\nsnippet nodel\n node.log($1)\nsnippet nodew\n node.warn($1)\nsnippet nodee\n node.error($1)\nsnippet noded\n node.debug($1)\nsnippet done\n node.done($1)\nsnippet flowg\n flow.get($1)\nsnippet flows\n flow.set($1, $2)\nsnippet globalg\n global.get($1)\nsnippet globals\n global.set($1, $2)\n',t.scope="nrjavascript"});
|
||||
(function() {
|
||||
ace.require(["ace/snippets/nrjavascript"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
@ -6,4 +6,3 @@ ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippet
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -1 +1 @@
|
||||
<svg width="40" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M18 5v12H7v26h11v12l14-25z" fill="#fff"/></svg>
|
||||
<svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="M18 5v12H7v26h11v12l14-25z" fill="#fff"/></svg>
|
||||
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 143 B |
@ -1 +1 @@
|
||||
<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><path d="M25 16h7c.58 0 1-.42 1-1v-2c0-.58-.42-1-1-1h-7c-.58 0-1 .42-1 1v2c0 .58.42 1 1 1zM8 28h7c.58 0 1-.42 1-1v-2c0-.58-.42-1-1-1H8c-.58 0-1 .42-1 1v2c0 .58.42 1 1 1zm-.416 11C5.624 39 4 37.375 4 35.416V4.582C4 2.622 5.625 1 7.584 1h24.832C34.376 1 36 2.623 36 4.582v30.834C36 37.376 34.375 39 32.416 39zM32 27H19c0 2.19-1.81 4-4 4H7v4.416c0 .35.235.584.584.584h24.832c.35 0 .584-.235.584-.584v-8.417zm1-2v-6h-8c-2.19 0-4-1.81-4-4h-1c-4.333-.002-8.667.004-13 0v6h8c2.19 0 4 1.81 4 4h13zm0-16V4.582c0-.35-.235-.582-.584-.582H7.584C7.234 4 7 4.233 7 4.582v8.417c4.333.002 8.667.001 13 .001h1c0-2.19 1.81-4 4-4z" color="#000" fill="#333"/></svg>
|
||||
<svg width="40" height="40" viewBox="0, 0, 40, 40" xmlns="http://www.w3.org/2000/svg"><path d="M25 16h7c.58 0 1-.42 1-1v-2c0-.58-.42-1-1-1h-7c-.58 0-1 .42-1 1v2c0 .58.42 1 1 1zM8 28h7c.58 0 1-.42 1-1v-2c0-.58-.42-1-1-1H8c-.58 0-1 .42-1 1v2c0 .58.42 1 1 1zm-.416 11C5.624 39 4 37.375 4 35.416V4.582C4 2.622 5.625 1 7.584 1h24.832C34.376 1 36 2.623 36 4.582v30.834C36 37.376 34.375 39 32.416 39zM32 27H19c0 2.19-1.81 4-4 4H7v4.416c0 .35.235.584.584.584h24.832c.35 0 .584-.235.584-.584v-8.417zm1-2v-6h-8c-2.19 0-4-1.81-4-4h-1c-4.333-.002-8.667.004-13 0v6h8c2.19 0 4 1.81 4 4h13zm0-16V4.582c0-.35-.235-.582-.584-.582H7.584C7.234 4 7 4.233 7 4.582v8.417c4.333.002 8.667.001 13 .001h1c0-2.19 1.81-4 4-4z" color="#000" fill="#333"/></svg>
|
||||
|
Before Width: | Height: | Size: 708 B After Width: | Height: | Size: 732 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M14.16 27.38l1.555-.144c.132.731.383 1.261.755 1.591.371.33.848.494 1.429.494.497 0 .931-.114 1.303-.341.377-.228.686-.53.926-.908.24-.383.44-.899.602-1.546a8.122 8.122 0 0 0 .233-2.3 3.732 3.732 0 0 1-1.33 1.258 3.605 3.605 0 0 1-1.815.476c-1.09 0-2.013-.395-2.768-1.186s-1.133-1.834-1.133-3.128c0-1.336.393-2.411 1.178-3.226.79-.815 1.78-1.223 2.966-1.223.856 0 1.638.231 2.345.692.713.462 1.253 1.12 1.618 1.978.372.85.557 2.085.557 3.702 0 1.684-.182 3.026-.548 4.027-.365.994-.91 1.752-1.636 2.274-.719.52-1.563.781-2.534.781-1.03 0-1.872-.284-2.525-.853-.654-.576-1.046-1.381-1.178-2.418zm6.624-5.815c0-.928-.249-1.666-.746-2.21-.492-.546-1.085-.819-1.78-.819-.719 0-1.345.294-1.878.881s-.8 1.348-.8 2.283c0 .839.252 1.522.755 2.05.51.52 1.135.781 1.878.781.75 0 1.363-.26 1.843-.782.485-.527.728-1.255.728-2.184zM4.858 10.466c0-1.558.158-2.81.476-3.757.324-.952.8-1.686 1.429-2.201.635-.516 1.432-.773 2.39-.773.708 0 1.328.143 1.861.431.533.282.974.692 1.321 1.231.348.534.62 1.187.818 1.96.198.767.297 1.803.297 3.11 0 1.545-.16 2.794-.477 3.747-.317.947-.794 1.68-1.429 2.202-.629.515-1.426.773-2.39.773-1.27 0-2.268-.456-2.993-1.366-.869-1.097-1.303-2.882-1.303-5.357zm1.662 0c0 2.163.252 3.604.755 4.323.51.713 1.136 1.07 1.879 1.07.743 0 1.366-.36 1.87-1.079.508-.719.763-2.157.763-4.314 0-2.169-.255-3.61-.764-4.323-.503-.713-1.132-1.07-1.887-1.07-.743 0-1.336.315-1.78.944-.557.803-.836 2.286-.836 4.45z" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M14.16 27.38l1.555-.144c.132.731.383 1.261.755 1.591.371.33.848.494 1.429.494.497 0 .931-.114 1.303-.341.377-.228.686-.53.926-.908.24-.383.44-.899.602-1.546a8.122 8.122 0 0 0 .233-2.3 3.732 3.732 0 0 1-1.33 1.258 3.605 3.605 0 0 1-1.815.476c-1.09 0-2.013-.395-2.768-1.186s-1.133-1.834-1.133-3.128c0-1.336.393-2.411 1.178-3.226.79-.815 1.78-1.223 2.966-1.223.856 0 1.638.231 2.345.692.713.462 1.253 1.12 1.618 1.978.372.85.557 2.085.557 3.702 0 1.684-.182 3.026-.548 4.027-.365.994-.91 1.752-1.636 2.274-.719.52-1.563.781-2.534.781-1.03 0-1.872-.284-2.525-.853-.654-.576-1.046-1.381-1.178-2.418zm6.624-5.815c0-.928-.249-1.666-.746-2.21-.492-.546-1.085-.819-1.78-.819-.719 0-1.345.294-1.878.881s-.8 1.348-.8 2.283c0 .839.252 1.522.755 2.05.51.52 1.135.781 1.878.781.75 0 1.363-.26 1.843-.782.485-.527.728-1.255.728-2.184zM4.858 10.466c0-1.558.158-2.81.476-3.757.324-.952.8-1.686 1.429-2.201.635-.516 1.432-.773 2.39-.773.708 0 1.328.143 1.861.431.533.282.974.692 1.321 1.231.348.534.62 1.187.818 1.96.198.767.297 1.803.297 3.11 0 1.545-.16 2.794-.477 3.747-.317.947-.794 1.68-1.429 2.202-.629.515-1.426.773-2.39.773-1.27 0-2.268-.456-2.993-1.366-.869-1.097-1.303-2.882-1.303-5.357zm1.662 0c0 2.163.252 3.604.755 4.323.51.713 1.136 1.07 1.879 1.07.743 0 1.366-.36 1.87-1.079.508-.719.763-2.157.763-4.314 0-2.169-.255-3.61-.764-4.323-.503-.713-1.132-1.07-1.887-1.07-.743 0-1.336.315-1.78.944-.557.803-.836 2.286-.836 4.45z" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M13.27 29.15l6.733-8.143h-6.235V19.3h8.8v1.559l-6.69 8.09h6.892v1.707h-9.5zm4.909-10.125zM6.577 12.58q0 .827.604 1.304.605.478 1.432.478 1.007 0 1.95-.467 1.59-.774 1.59-2.534V9.824q-.349.222-.9.37-.552.15-1.082.213l-1.155.148q-1.04.138-1.56.435-.88.498-.88 1.59zM11.2 8.721q.657-.085.88-.551.127-.255.127-.732 0-.975-.7-1.41-.689-.445-1.983-.445-1.495 0-2.12.805-.35.446-.456 1.326H5.167q.053-2.1 1.357-2.916 1.315-.827 3.043-.827 2.004 0 3.255.763 1.24.764 1.24 2.375v6.542q0 .297.117.477.127.18.52.18.127 0 .286-.01.159-.021.34-.053v1.41q-.446.127-.68.16-.233.031-.636.031-.986 0-1.43-.7-.234-.37-.33-1.05-.583.764-1.675 1.326t-2.407.562q-1.58 0-2.587-.954-.996-.965-.996-2.407 0-1.58.986-2.45.986-.869 2.587-1.07zm-1.58-4.75z" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M13.27 29.15l6.733-8.143h-6.235V19.3h8.8v1.559l-6.69 8.09h6.892v1.707h-9.5zm4.909-10.125zM6.577 12.58q0 .827.604 1.304.605.478 1.432.478 1.007 0 1.95-.467 1.59-.774 1.59-2.534V9.824q-.349.222-.9.37-.552.15-1.082.213l-1.155.148q-1.04.138-1.56.435-.88.498-.88 1.59zM11.2 8.721q.657-.085.88-.551.127-.255.127-.732 0-.975-.7-1.41-.689-.445-1.983-.445-1.495 0-2.12.805-.35.446-.456 1.326H5.167q.053-2.1 1.357-2.916 1.315-.827 3.043-.827 2.004 0 3.255.763 1.24.764 1.24 2.375v6.542q0 .297.117.477.127.18.52.18.127 0 .286-.01.159-.021.34-.053v1.41q-.446.127-.68.16-.233.031-.636.031-.986 0-1.43-.7-.234-.37-.33-1.05-.583.764-1.675 1.326t-2.407.562q-1.58 0-2.587-.954-.996-.965-.996-2.407 0-1.58.986-2.45.986-.869 2.587-1.07zm-1.58-4.75z" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 822 B After Width: | Height: | Size: 846 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M18.8 33.9c3.328 0 4.776-2.603 4.776-7.066s-1.448-7.066-4.776-7.066-4.776 2.603-4.776 7.066S15.473 33.9 18.8 33.9zm0-1.429c-2.192 0-3.073-1.781-3.073-4.522v-2.23c0-2.741.88-4.523 3.073-4.523s3.073 1.782 3.073 4.522v2.231c0 2.74-.88 4.522-3.073 4.522zm-6.306 1.194v-1.429H8.892V20.002H6.328l-3.621 3.386.959 1.038 3.445-3.21h.137v11.02H3.333v1.429zm11.2-17.7v-1.429h-3.602V2.302h-2.564l-3.621 3.386.959 1.038 3.445-3.21h.137v11.02h-3.915v1.429zM7.5 16.2c3.327 0 4.776-2.603 4.776-7.066S10.828 2.068 7.5 2.068 2.725 4.67 2.725 9.134 4.173 16.2 7.5 16.2zm0-1.429c-2.193 0-3.074-1.781-3.074-4.522V8.02c0-2.741.881-4.523 3.074-4.523s3.073 1.782 3.073 4.522v2.231c0 2.74-.881 4.522-3.073 4.522z" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M18.8 33.9c3.328 0 4.776-2.603 4.776-7.066s-1.448-7.066-4.776-7.066-4.776 2.603-4.776 7.066S15.473 33.9 18.8 33.9zm0-1.429c-2.192 0-3.073-1.781-3.073-4.522v-2.23c0-2.741.88-4.523 3.073-4.523s3.073 1.782 3.073 4.522v2.231c0 2.74-.88 4.522-3.073 4.522zm-6.306 1.194v-1.429H8.892V20.002H6.328l-3.621 3.386.959 1.038 3.445-3.21h.137v11.02H3.333v1.429zm11.2-17.7v-1.429h-3.602V2.302h-2.564l-3.621 3.386.959 1.038 3.445-3.21h.137v11.02h-3.915v1.429zM7.5 16.2c3.327 0 4.776-2.603 4.776-7.066S10.828 2.068 7.5 2.068 2.725 4.67 2.725 9.134 4.173 16.2 7.5 16.2zm0-1.429c-2.193 0-3.074-1.781-3.074-4.522V8.02c0-2.741.881-4.523 3.074-4.523s3.073 1.782 3.073 4.522v2.231c0 2.74-.881 4.522-3.073 4.522z" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 805 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M9.96 21.98a5 5 0 1 1 6.11-7.917zm3.035-13.973c-5.512 0-10 4.488-10 10s4.488 9.998 10 9.998 10-4.486 10-9.998-4.488-10-10-10zm0 1.816c4.53 0 8.182 3.655 8.182 8.184s-3.652 8.182-8.182 8.182-8.181-3.653-8.181-8.182 3.652-8.184 8.181-8.184z" color="#000" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M9.96 21.98a5 5 0 1 1 6.11-7.917zm3.035-13.973c-5.512 0-10 4.488-10 10s4.488 9.998 10 9.998 10-4.486 10-9.998-4.488-10-10-10zm0 1.816c4.53 0 8.182 3.655 8.182 8.184s-3.652 8.182-8.182 8.182-8.181-3.653-8.181-8.182 3.652-8.184 8.181-8.184z" color="#000" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 368 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M14.33 27.19q2.916-.136 4.024-2.131.58-1.024.58-2.37 0-2.132-1.569-3.24-.904-.648-3.035-1.228zM8.55 10.736q0 1.688 1.108 2.643 1.125.955 3.018 1.33V6.695q-2.234.085-3.189 1.364-.937 1.279-.937 2.677zm-3.07.205q0-2.592 1.893-4.672 1.91-2.08 5.337-2.115V1.887h1.62V4.12q3.393.239 5.2 2.012 1.825 1.757 1.91 4.655h-2.984q-.119-1.296-.699-2.233-1.074-1.723-3.427-1.808v8.287q3.956 1.108 5.371 2.08 2.302 1.603 2.302 4.74 0 4.536-2.95 6.446-1.637 1.057-4.723 1.398v3.308h-1.62v-3.308q-4.962-.324-6.735-3.513-.972-1.722-.972-4.655h3.018q.136 2.336.733 3.41 1.057 1.927 3.922 2.166v-9.293q-3.683-.699-5.44-2.336Q5.48 13.84 5.48 10.941z" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M14.33 27.19q2.916-.136 4.024-2.131.58-1.024.58-2.37 0-2.132-1.569-3.24-.904-.648-3.035-1.228zM8.55 10.736q0 1.688 1.108 2.643 1.125.955 3.018 1.33V6.695q-2.234.085-3.189 1.364-.937 1.279-.937 2.677zm-3.07.205q0-2.592 1.893-4.672 1.91-2.08 5.337-2.115V1.887h1.62V4.12q3.393.239 5.2 2.012 1.825 1.757 1.91 4.655h-2.984q-.119-1.296-.699-2.233-1.074-1.723-3.427-1.808v8.287q3.956 1.108 5.371 2.08 2.302 1.603 2.302 4.74 0 4.536-2.95 6.446-1.637 1.057-4.723 1.398v3.308h-1.62v-3.308q-4.962-.324-6.735-3.513-.972-1.722-.972-4.655h3.018q.136 2.336.733 3.41 1.057 1.927 3.922 2.166v-9.293q-3.683-.699-5.44-2.336Q5.48 13.84 5.48 10.941z" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 745 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-337.103 -913.25) scale(1.2585)" fill="#444" stroke-width=".795"><circle cx="284.36" cy="733.68" r="1.5" color="#000" style="isolation:auto;mix-blend-mode:normal"/><circle cx="284.33" cy="740.74" r="1.5" color="#000" style="isolation:auto;mix-blend-mode:normal"/><path d="M276.18 727.78l4.396-1.565v18.515c-.711 2.606-2.922 4.394-5.812 5.812l-4.135 1.974-.559-1.192 3.353-1.639c1.459-.724 2.689-1.87 2.869-4.955z" fill-rule="evenodd"/></g></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-337.103 -913.25) scale(1.2585)" fill="#444" stroke-width=".795"><circle cx="284.36" cy="733.68" r="1.5" color="#000" style="isolation:auto;mix-blend-mode:normal"/><circle cx="284.33" cy="740.74" r="1.5" color="#000" style="isolation:auto;mix-blend-mode:normal"/><path d="M276.18 727.78l4.396-1.565v18.515c-.711 2.606-2.922 4.394-5.812 5.812l-4.135 1.974-.559-1.192 3.353-1.639c1.459-.724 2.689-1.87 2.869-4.955z" fill-rule="evenodd"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 556 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M15 5.225v-1.92h2.24q.608 0 1.216.288.608.256 1.12.8.48.512.8 1.312.32.768.32 1.792v5.824q0 .832.224 1.536t.608 1.216q.352.48.832.768.48.256.992.256v2.176q-.512 0-.992.256t-.832.736q-.384.48-.608 1.184t-.224 1.568v5.792q0 1.024-.32 1.792-.32.8-.8 1.312-.512.544-1.12.8-.608.288-1.216.288H15v-1.92h1.6q.48 0 .768-.256.288-.224.48-.64.16-.384.224-.896.064-.48.064-.96v-5.824q0-1.216.352-2.016.32-.8.768-1.28.448-.512.928-.736.448-.224.736-.256v-.096q-.288-.064-.736-.32-.48-.256-.928-.768t-.768-1.28q-.352-.8-.352-1.92V7.977q0-.512-.064-.992-.064-.512-.224-.896-.192-.384-.48-.608-.288-.256-.768-.256zm-3.648 0v-1.92h-2.24q-.608 0-1.216.288-.608.256-1.12.8-.48.512-.8 1.312-.32.768-.32 1.792v5.824q0 .832-.224 1.536t-.608 1.216q-.352.48-.832.768-.48.256-.992.256v2.176q.512 0 .992.256t.832.736q.384.48.608 1.184t.224 1.568v5.792q0 1.024.32 1.792.32.8.8 1.312.512.544 1.12.8.608.288 1.216.288h2.24v-1.92h-1.6q-.48 0-.768-.256-.288-.224-.48-.64-.16-.384-.224-.896-.064-.48-.064-.96v-5.824q0-1.216-.352-2.016-.32-.8-.768-1.28-.448-.512-.928-.736-.448-.224-.736-.256v-.096q.288-.064.736-.32.48-.256.928-.768t.768-1.28q.352-.8.352-1.92V7.977q0-.512.064-.992.064-.512.224-.896.192-.384.48-.608.288-.256.768-.256z" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M15 5.225v-1.92h2.24q.608 0 1.216.288.608.256 1.12.8.48.512.8 1.312.32.768.32 1.792v5.824q0 .832.224 1.536t.608 1.216q.352.48.832.768.48.256.992.256v2.176q-.512 0-.992.256t-.832.736q-.384.48-.608 1.184t-.224 1.568v5.792q0 1.024-.32 1.792-.32.8-.8 1.312-.512.544-1.12.8-.608.288-1.216.288H15v-1.92h1.6q.48 0 .768-.256.288-.224.48-.64.16-.384.224-.896.064-.48.064-.96v-5.824q0-1.216.352-2.016.32-.8.768-1.28.448-.512.928-.736.448-.224.736-.256v-.096q-.288-.064-.736-.32-.48-.256-.928-.768t-.768-1.28q-.352-.8-.352-1.92V7.977q0-.512-.064-.992-.064-.512-.224-.896-.192-.384-.48-.608-.288-.256-.768-.256zm-3.648 0v-1.92h-2.24q-.608 0-1.216.288-.608.256-1.12.8-.48.512-.8 1.312-.32.768-.32 1.792v5.824q0 .832-.224 1.536t-.608 1.216q-.352.48-.832.768-.48.256-.992.256v2.176q.512 0 .992.256t.832.736q.384.48.608 1.184t.224 1.568v5.792q0 1.024.32 1.792.32.8.8 1.312.512.544 1.12.8.608.288 1.216.288h2.24v-1.92h-1.6q-.48 0-.768-.256-.288-.224-.48-.64-.16-.384-.224-.896-.064-.48-.064-.96v-5.824q0-1.216-.352-2.016-.32-.8-.768-1.28-.448-.512-.928-.736-.448-.224-.736-.256v-.096q.288-.064.736-.32.48-.256.928-.768t.768-1.28q.352-.8.352-1.92V7.977q0-.512.064-.992.064-.512.224-.896.192-.384.48-.608.288-.256.768-.256z" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M2 19h5v5H2zm16.099-3.304v-5.659h-2.654v5.66l-5.309-2.004-.901 2.404L14.543 18l-3.255 4.557 2.254 1.553 3.255-4.808 3.455 4.808 2.054-1.553L19 18l5.46-1.903-1.002-2.404z" color="#000" fill="#444444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M2 19h5v5H2zm16.099-3.304v-5.659h-2.654v5.66l-5.309-2.004-.901 2.404L14.543 18l-3.255 4.557 2.254 1.553 3.255-4.808 3.455 4.808 2.054-1.553L19 18l5.46-1.903-1.002-2.404z" color="#000" fill="#444444"/></svg>
|
||||
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 302 B |
@ -1 +1 @@
|
||||
<svg width="26" height="36" xmlns="http://www.w3.org/2000/svg"><path d="M11 5v5.77a7.542 7.542 0 0 0-5.234 5.25L1 16c-1.432 1.397-1.232 2.722 0 4l4.75-.078a7.542 7.542 0 0 0 5.22 5.297L11 31c1.316 1.303 2.649 1.363 4 0l.009-5.775A7.542 7.542 0 0 0 20.228 20H25c1.261-1.294 1.404-2.623 0-4l-4.774-.01a7.542 7.542 0 0 0-5.23-5.22L15 5c-1.3-1.273-2.63-1.393-4 0zm2 7.499c3.05 0 5.5 2.45 5.5 5.5s-2.45 5.5-5.5 5.5-5.5-2.45-5.5-5.5 2.45-5.5 5.5-5.5z" color="#000" fill="#444"/></svg>
|
||||
<svg width="26" height="36" viewBox="0, 0, 26, 36" xmlns="http://www.w3.org/2000/svg"><path d="M11 5v5.77a7.542 7.542 0 0 0-5.234 5.25L1 16c-1.432 1.397-1.232 2.722 0 4l4.75-.078a7.542 7.542 0 0 0 5.22 5.297L11 31c1.316 1.303 2.649 1.363 4 0l.009-5.775A7.542 7.542 0 0 0 20.228 20H25c1.261-1.294 1.404-2.623 0-4l-4.774-.01a7.542 7.542 0 0 0-5.23-5.22L15 5c-1.3-1.273-2.63-1.393-4 0zm2 7.499c3.05 0 5.5 2.45 5.5 5.5s-2.45 5.5-5.5 5.5-5.5-2.45-5.5-5.5 2.45-5.5 5.5-5.5z" color="#000" fill="#444"/></svg>
|
||||
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 502 B |
@ -14,7 +14,8 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
RED.history = (function() {
|
||||
var undo_history = [];
|
||||
var undoHistory = [];
|
||||
var redoHistory = [];
|
||||
|
||||
function undoEvent(ev) {
|
||||
var i;
|
||||
@ -22,52 +23,81 @@ RED.history = (function() {
|
||||
var node;
|
||||
var subflow;
|
||||
var modifiedTabs = {};
|
||||
var inverseEv;
|
||||
if (ev) {
|
||||
if (ev.t == 'multi') {
|
||||
inverseEv = {
|
||||
t: 'multi',
|
||||
events: []
|
||||
};
|
||||
len = ev.events.length;
|
||||
for (i=len-1;i>=0;i--) {
|
||||
undoEvent(ev.events[i]);
|
||||
var r = undoEvent(ev.events[i]);
|
||||
inverseEv.events.push(r);
|
||||
}
|
||||
} else if (ev.t == 'replace') {
|
||||
inverseEv = {
|
||||
t: 'replace',
|
||||
config: RED.nodes.createCompleteNodeSet(),
|
||||
changed: {},
|
||||
rev: RED.nodes.version()
|
||||
};
|
||||
RED.nodes.clear();
|
||||
var imported = RED.nodes.import(ev.config);
|
||||
imported[0].forEach(function(n) {
|
||||
if (ev.changed[n.id]) {
|
||||
n.changed = true;
|
||||
inverseEv.changed[n.id] = true;
|
||||
}
|
||||
})
|
||||
|
||||
RED.nodes.version(ev.rev);
|
||||
} else if (ev.t == 'add') {
|
||||
inverseEv = {
|
||||
t: "delete",
|
||||
};
|
||||
if (ev.nodes) {
|
||||
inverseEv.nodes = [];
|
||||
for (i=0;i<ev.nodes.length;i++) {
|
||||
node = RED.nodes.node(ev.nodes[i]);
|
||||
if (node.z) {
|
||||
modifiedTabs[node.z] = true;
|
||||
}
|
||||
inverseEv.nodes.push(node);
|
||||
RED.nodes.remove(ev.nodes[i]);
|
||||
}
|
||||
}
|
||||
if (ev.links) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
inverseEv.links.push(ev.links[i]);
|
||||
RED.nodes.removeLink(ev.links[i]);
|
||||
}
|
||||
}
|
||||
if (ev.workspaces) {
|
||||
inverseEv.workspaces = [];
|
||||
for (i=0;i<ev.workspaces.length;i++) {
|
||||
var workspaceOrder = RED.nodes.getWorkspaceOrder();
|
||||
ev.workspaces[i]._index = workspaceOrder.indexOf(ev.workspaces[i].id);
|
||||
inverseEv.workspaces.push(ev.workspaces[i]);
|
||||
RED.nodes.removeWorkspace(ev.workspaces[i].id);
|
||||
RED.workspaces.remove(ev.workspaces[i]);
|
||||
}
|
||||
}
|
||||
if (ev.subflows) {
|
||||
inverseEv.subflows = [];
|
||||
for (i=0;i<ev.subflows.length;i++) {
|
||||
inverseEv.subflows.push(ev.subflows[i]);
|
||||
RED.nodes.removeSubflow(ev.subflows[i]);
|
||||
RED.workspaces.remove(ev.subflows[i]);
|
||||
}
|
||||
}
|
||||
if (ev.subflow) {
|
||||
inverseEv.subflow = {};
|
||||
if (ev.subflow.instances) {
|
||||
inverseEv.subflow.instances = [];
|
||||
ev.subflow.instances.forEach(function(n) {
|
||||
inverseEv.subflow.instances.push(n);
|
||||
var node = RED.nodes.node(n.id);
|
||||
if (node) {
|
||||
node.changed = n.changed;
|
||||
@ -83,21 +113,30 @@ RED.history = (function() {
|
||||
}
|
||||
}
|
||||
if (ev.removedLinks) {
|
||||
inverseEv.createdLinks = [];
|
||||
for (i=0;i<ev.removedLinks.length;i++) {
|
||||
inverseEv.createdLinks.push(ev.removedLinks[i]);
|
||||
RED.nodes.addLink(ev.removedLinks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (ev.t == "delete") {
|
||||
inverseEv = {
|
||||
t: "add"
|
||||
};
|
||||
if (ev.workspaces) {
|
||||
inverseEv.workspaces = [];
|
||||
for (i=0;i<ev.workspaces.length;i++) {
|
||||
inverseEv.workspaces.push(ev.workspaces[i]);
|
||||
RED.nodes.addWorkspace(ev.workspaces[i],ev.workspaces[i]._index);
|
||||
RED.workspaces.add(ev.workspaces[i],undefined,ev.workspaces[i]._index);
|
||||
delete ev.workspaces[i]._index;
|
||||
}
|
||||
}
|
||||
if (ev.subflows) {
|
||||
inverseEv.subflows = [];
|
||||
for (i=0;i<ev.subflows.length;i++) {
|
||||
inverseEv.subflows.push(ev.subflows[i]);
|
||||
RED.nodes.addSubflow(ev.subflows[i]);
|
||||
}
|
||||
}
|
||||
@ -126,8 +165,11 @@ RED.history = (function() {
|
||||
}
|
||||
}
|
||||
if (ev.subflow) {
|
||||
inverseEv.subflow = {};
|
||||
if (ev.subflow.hasOwnProperty('instances')) {
|
||||
inverseEv.subflow.instances = [];
|
||||
ev.subflow.instances.forEach(function(n) {
|
||||
inverseEv.subflow.instances.push(n);
|
||||
var node = RED.nodes.node(n.id);
|
||||
if (node) {
|
||||
node.changed = n.changed;
|
||||
@ -152,14 +194,25 @@ RED.history = (function() {
|
||||
});
|
||||
}
|
||||
if (ev.nodes) {
|
||||
inverseEv.nodes = [];
|
||||
for (i=0;i<ev.nodes.length;i++) {
|
||||
RED.nodes.add(ev.nodes[i]);
|
||||
modifiedTabs[ev.nodes[i].z] = true;
|
||||
inverseEv.nodes.push(ev.nodes[i].id);
|
||||
}
|
||||
}
|
||||
if (ev.links) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
RED.nodes.addLink(ev.links[i]);
|
||||
inverseEv.links.push(ev.links[i]);
|
||||
}
|
||||
}
|
||||
if (ev.createdLinks) {
|
||||
inverseEv.removedLinks = [];
|
||||
for (i=0;i<ev.createdLinks.length;i++) {
|
||||
inverseEv.removedLinks.push(ev.createdLinks[i]);
|
||||
RED.nodes.removeLink(ev.createdLinks[i]);
|
||||
}
|
||||
}
|
||||
if (ev.changes) {
|
||||
@ -179,8 +232,14 @@ RED.history = (function() {
|
||||
|
||||
}
|
||||
} else if (ev.t == "move") {
|
||||
inverseEv = {
|
||||
t: 'move',
|
||||
nodes: []
|
||||
};
|
||||
for (i=0;i<ev.nodes.length;i++) {
|
||||
var n = ev.nodes[i];
|
||||
var rn = {n: n.n, ox: n.n.x, oy: n.n.y, dirty: true, moved: n.moved};
|
||||
inverseEv.nodes.push(rn);
|
||||
n.n.x = n.ox;
|
||||
n.n.y = n.oy;
|
||||
n.n.dirty = true;
|
||||
@ -188,18 +247,28 @@ RED.history = (function() {
|
||||
}
|
||||
// A move could have caused a link splice
|
||||
if (ev.links) {
|
||||
inverseEv.removedLinks = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
inverseEv.removedLinks.push(ev.links[i]);
|
||||
RED.nodes.removeLink(ev.links[i]);
|
||||
}
|
||||
}
|
||||
if (ev.removedLinks) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.removedLinks.length;i++) {
|
||||
inverseEv.links.push(ev.removedLinks[i]);
|
||||
RED.nodes.addLink(ev.removedLinks[i]);
|
||||
}
|
||||
}
|
||||
} else if (ev.t == "edit") {
|
||||
inverseEv = {
|
||||
t: "edit",
|
||||
changes: {}
|
||||
};
|
||||
inverseEv.node = ev.node;
|
||||
for (i in ev.changes) {
|
||||
if (ev.changes.hasOwnProperty(i)) {
|
||||
inverseEv.changes[i] = ev.node[i];
|
||||
if (ev.node._def.defaults && ev.node._def.defaults[i] && ev.node._def.defaults[i].type) {
|
||||
// This is a config node property
|
||||
var currentConfigNode = RED.nodes.node(ev.node[i]);
|
||||
@ -219,22 +288,29 @@ RED.history = (function() {
|
||||
$("#red-ui-workspace").toggleClass("red-ui-workspace-disabled",!!ev.node.disabled);
|
||||
}
|
||||
if (ev.subflow) {
|
||||
inverseEv.subflow = {};
|
||||
if (ev.subflow.hasOwnProperty('inputCount')) {
|
||||
inverseEv.subflow.inputCount = ev.node.in.length;
|
||||
if (ev.node.in.length > ev.subflow.inputCount) {
|
||||
inverseEv.subflow.inputs = ev.node.in.slice(ev.subflow.inputCount);
|
||||
ev.node.in.splice(ev.subflow.inputCount);
|
||||
} else if (ev.subflow.inputs.length > 0) {
|
||||
ev.node.in = ev.node.in.concat(ev.subflow.inputs);
|
||||
}
|
||||
}
|
||||
if (ev.subflow.hasOwnProperty('outputCount')) {
|
||||
inverseEv.subflow.outputCount = ev.node.out.length;
|
||||
if (ev.node.out.length > ev.subflow.outputCount) {
|
||||
inverseEv.subflow.outputs = ev.node.out.slice(ev.subflow.outputCount);
|
||||
ev.node.out.splice(ev.subflow.outputCount);
|
||||
} else if (ev.subflow.outputs.length > 0) {
|
||||
ev.node.out = ev.node.out.concat(ev.subflow.outputs);
|
||||
}
|
||||
}
|
||||
if (ev.subflow.hasOwnProperty('instances')) {
|
||||
inverseEv.subflow.instances = [];
|
||||
ev.subflow.instances.forEach(function(n) {
|
||||
inverseEv.subflow.instances.push(n);
|
||||
var node = RED.nodes.node(n.id);
|
||||
if (node) {
|
||||
node.changed = n.changed;
|
||||
@ -258,9 +334,11 @@ RED.history = (function() {
|
||||
var outputMap;
|
||||
if (ev.outputMap) {
|
||||
outputMap = {};
|
||||
inverseEv.outputMap = {};
|
||||
for (var port in ev.outputMap) {
|
||||
if (ev.outputMap.hasOwnProperty(port) && ev.outputMap[port] !== "-1") {
|
||||
outputMap[ev.outputMap[port]] = port;
|
||||
inverseEv.outputMap[ev.outputMap[port]] = port;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -268,39 +346,107 @@ RED.history = (function() {
|
||||
RED.editor.validateNode(ev.node);
|
||||
}
|
||||
if (ev.links) {
|
||||
inverseEv.createdLinks = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
RED.nodes.addLink(ev.links[i]);
|
||||
inverseEv.createdLinks.push(ev.links[i]);
|
||||
}
|
||||
}
|
||||
if (ev.createdLinks) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.createdLinks.length;i++) {
|
||||
RED.nodes.removeLink(ev.createdLinks[i]);
|
||||
inverseEv.links.push(ev.createdLinks[i]);
|
||||
}
|
||||
}
|
||||
ev.node.dirty = true;
|
||||
ev.node.changed = ev.changed;
|
||||
} else if (ev.t == "createSubflow") {
|
||||
inverseEv = {
|
||||
t: "deleteSubflow",
|
||||
activeWorkspace: ev.activeWorkspace,
|
||||
dirty: RED.nodes.dirty()
|
||||
};
|
||||
if (ev.nodes) {
|
||||
inverseEv.movedNodes = [];
|
||||
var z = ev.activeWorkspace;
|
||||
RED.nodes.filterNodes({z:ev.subflow.subflow.id}).forEach(function(n) {
|
||||
n.x += ev.subflow.offsetX;
|
||||
n.y += ev.subflow.offsetY;
|
||||
n.z = ev.activeWorkspace;
|
||||
n.dirty = true;
|
||||
inverseEv.movedNodes.push(n.id);
|
||||
RED.nodes.moveNodeToTab(n, z);
|
||||
});
|
||||
inverseEv.subflows = [];
|
||||
for (i=0;i<ev.nodes.length;i++) {
|
||||
inverseEv.subflows.push(RED.nodes.node(ev.nodes[i]));
|
||||
RED.nodes.remove(ev.nodes[i]);
|
||||
}
|
||||
}
|
||||
if (ev.links) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
inverseEv.links.push(ev.links[i]);
|
||||
RED.nodes.removeLink(ev.links[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inverseEv.subflow = ev.subflow;
|
||||
RED.nodes.removeSubflow(ev.subflow.subflow);
|
||||
RED.workspaces.remove(ev.subflow.subflow);
|
||||
|
||||
if (ev.removedLinks) {
|
||||
inverseEv.createdLinks = [];
|
||||
for (i=0;i<ev.removedLinks.length;i++) {
|
||||
inverseEv.createdLinks.push(ev.removedLinks[i]);
|
||||
RED.nodes.addLink(ev.removedLinks[i]);
|
||||
}
|
||||
}
|
||||
} else if (ev.t == "deleteSubflow") {
|
||||
inverseEv = {
|
||||
t: "createSubflow",
|
||||
activeWorkspace: ev.activeWorkspace,
|
||||
dirty: RED.nodes.dirty(),
|
||||
};
|
||||
if (ev.subflow) {
|
||||
RED.nodes.addSubflow(ev.subflow.subflow);
|
||||
inverseEv.subflow = ev.subflow;
|
||||
}
|
||||
if (ev.subflows) {
|
||||
inverseEv.nodes = [];
|
||||
for (i=0;i<ev.subflows.length;i++) {
|
||||
RED.nodes.add(ev.subflows[i]);
|
||||
inverseEv.nodes.push(ev.subflows[i].id);
|
||||
}
|
||||
}
|
||||
if (ev.movedNodes) {
|
||||
ev.movedNodes.forEach(function(nid) {
|
||||
nn = RED.nodes.node(nid);
|
||||
nn.x -= ev.subflow.offsetX;
|
||||
nn.y -= ev.subflow.offsetY;
|
||||
nn.dirty = true;
|
||||
RED.nodes.moveNodeToTab(nn, ev.subflow.subflow.id);
|
||||
});
|
||||
}
|
||||
if (ev.links) {
|
||||
inverseEv.links = [];
|
||||
for (i=0;i<ev.links.length;i++) {
|
||||
inverseEv.links.push(ev.links[i]);
|
||||
RED.nodes.addLink(ev.links[i]);
|
||||
}
|
||||
}
|
||||
if (ev.createdLinks) {
|
||||
inverseEv.removedLinks = [];
|
||||
for (i=0;i<ev.createdLinks.length;i++) {
|
||||
inverseEv.removedLinks.push(ev.createdLinks[i]);
|
||||
RED.nodes.removeLink(ev.createdLinks[i]);
|
||||
}
|
||||
}
|
||||
} else if (ev.t == "reorder") {
|
||||
inverseEv = {
|
||||
t: 'reorder',
|
||||
order: RED.nodes.getWorkspaceOrder()
|
||||
};
|
||||
if (ev.order) {
|
||||
RED.workspaces.order(ev.order);
|
||||
}
|
||||
@ -320,6 +466,8 @@ RED.history = (function() {
|
||||
RED.workspaces.refresh();
|
||||
RED.sidebar.config.refresh();
|
||||
RED.subflow.refresh();
|
||||
|
||||
return inverseEv;
|
||||
}
|
||||
|
||||
}
|
||||
@ -327,28 +475,42 @@ RED.history = (function() {
|
||||
return {
|
||||
//TODO: this function is a placeholder until there is a 'save' event that can be listened to
|
||||
markAllDirty: function() {
|
||||
for (var i=0;i<undo_history.length;i++) {
|
||||
undo_history[i].dirty = true;
|
||||
for (var i=0;i<undoHistory.length;i++) {
|
||||
undoHistory[i].dirty = true;
|
||||
}
|
||||
},
|
||||
list: function() {
|
||||
return undo_history
|
||||
return undoHistory;
|
||||
},
|
||||
depth: function() {
|
||||
return undo_history.length;
|
||||
return undoHistory.length;
|
||||
},
|
||||
push: function(ev) {
|
||||
undo_history.push(ev);
|
||||
undoHistory.push(ev);
|
||||
redoHistory = [];
|
||||
},
|
||||
pop: function() {
|
||||
var ev = undo_history.pop();
|
||||
undoEvent(ev);
|
||||
var ev = undoHistory.pop();
|
||||
var rev = undoEvent(ev);
|
||||
if (rev) {
|
||||
redoHistory.push(rev);
|
||||
}
|
||||
},
|
||||
peek: function() {
|
||||
return undo_history[undo_history.length-1];
|
||||
return undoHistory[undoHistory.length-1];
|
||||
},
|
||||
clear: function() {
|
||||
undo_history = [];
|
||||
undoHistory = [];
|
||||
redoHistory = [];
|
||||
},
|
||||
redo: function() {
|
||||
var ev = redoHistory.pop();
|
||||
if (ev) {
|
||||
var uev = undoEvent(ev);
|
||||
if (uev) {
|
||||
undoHistory.push(uev);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,19 @@ RED.i18n = (function() {
|
||||
}
|
||||
|
||||
},
|
||||
lang: function() {
|
||||
// Gets the active message catalog language. This is based on what
|
||||
// locale the editor is using and what languages are available.
|
||||
//
|
||||
var preferredLangs = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
|
||||
var knownLangs = RED.settings.theme("languages")||["en-US"];
|
||||
for (var i=0;i<preferredLangs.length;i++) {
|
||||
if (knownLangs.indexOf(preferredLangs[i]) > -1) {
|
||||
return preferredLangs[i]
|
||||
}
|
||||
}
|
||||
return 'end-US'
|
||||
},
|
||||
loadNodeCatalog: function(namespace,done) {
|
||||
var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
|
||||
var toLoad = languageList.length;
|
||||
|
@ -30,7 +30,8 @@
|
||||
"backspace": "core:delete-config-selection",
|
||||
"delete": "core:delete-config-selection",
|
||||
"ctrl-a": "core:select-all-config-nodes",
|
||||
"ctrl-z": "core:undo"
|
||||
"ctrl-z": "core:undo",
|
||||
"ctrl-y": "core:redo"
|
||||
},
|
||||
"red-ui-workspace": {
|
||||
"backspace": "core:delete-selection",
|
||||
@ -40,8 +41,17 @@
|
||||
"ctrl-x": "core:cut-selection-to-internal-clipboard",
|
||||
"ctrl-v": "core:paste-from-internal-clipboard",
|
||||
"ctrl-z": "core:undo",
|
||||
"ctrl-y": "core:redo",
|
||||
"ctrl-a": "core:select-all-nodes",
|
||||
"shift-?": "core:show-help",
|
||||
"w": "core:scroll-view-up",
|
||||
"d": "core:scroll-view-right",
|
||||
"s": "core:scroll-view-down",
|
||||
"a": "core:scroll-view-left",
|
||||
"shift-w": "core:step-view-up",
|
||||
"shift-d": "core:step-view-right",
|
||||
"shift-s": "core:step-view-down",
|
||||
"shift-a": "core:step-view-left",
|
||||
"up": "core:move-selection-up",
|
||||
"right": "core:move-selection-right",
|
||||
"down": "core:move-selection-down",
|
||||
|
@ -301,6 +301,17 @@ RED.nodes = (function() {
|
||||
return {links:removedLinks,nodes:removedNodes};
|
||||
}
|
||||
|
||||
function moveNodeToTab(node, z) {
|
||||
if (nodeTabMap[node.z]) {
|
||||
delete nodeTabMap[node.z][node.id];
|
||||
}
|
||||
if (!nodeTabMap[z]) {
|
||||
nodeTabMap[z] = {};
|
||||
}
|
||||
nodeTabMap[z][node.id] = node;
|
||||
node.z = z;
|
||||
}
|
||||
|
||||
function removeLink(l) {
|
||||
var index = links.indexOf(l);
|
||||
if (index != -1) {
|
||||
@ -324,7 +335,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
function removeWorkspace(id) {
|
||||
delete workspaces[id];
|
||||
delete nodeTabMap[ws.id];
|
||||
delete nodeTabMap[id];
|
||||
workspacesOrder.splice(workspacesOrder.indexOf(id),1);
|
||||
|
||||
var removedNodes = [];
|
||||
@ -381,21 +392,25 @@ RED.nodes = (function() {
|
||||
category: sf.category || "subflows",
|
||||
inputs: sf.in.length,
|
||||
outputs: sf.out.length,
|
||||
color: "#da9",
|
||||
color: sf.color || "#DDAA99",
|
||||
label: function() { return this.name||RED.nodes.subflow(sf.id).name },
|
||||
labelStyle: function() { return this.name?"red-ui-flow-node-label-italic":""; },
|
||||
paletteLabel: function() { return RED.nodes.subflow(sf.id).name },
|
||||
inputLabels: function(i) { return sf.inputLabels?sf.inputLabels[i]:null },
|
||||
outputLabels: function(i) { return sf.outputLabels?sf.outputLabels[i]:null },
|
||||
oneditprepare: function() {
|
||||
RED.subflow.buildEditForm("subflow",this);
|
||||
RED.subflow.buildPropertiesForm(this);
|
||||
},
|
||||
oneditresize: function(size) {
|
||||
var rows = $("#dialog-form>div:not(.node-input-env-container-row)");
|
||||
// var rows = $(".dialog-form>div:not(.node-input-env-container-row)");
|
||||
var height = size.height;
|
||||
for (var i=0; i<rows.size(); i++) {
|
||||
height -= $(rows[i]).outerHeight(true);
|
||||
}
|
||||
var editorRow = $("#dialog-form>div.node-input-env-container-row");
|
||||
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
||||
$("#node-input-env-container").editableList('height',height-80);
|
||||
// for (var i=0; i<rows.size(); i++) {
|
||||
// height -= $(rows[i]).outerHeight(true);
|
||||
// }
|
||||
// var editorRow = $("#dialog-form>div.node-input-env-container-row");
|
||||
// height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
||||
$("ol.red-ui-editor-subflow-env-list").editableList('height',height);
|
||||
},
|
||||
set:{
|
||||
module: "node-red"
|
||||
@ -494,19 +509,33 @@ RED.nodes = (function() {
|
||||
node[d] = n[d];
|
||||
}
|
||||
}
|
||||
if(exportCreds && n.credentials) {
|
||||
if (exportCreds) {
|
||||
var credentialSet = {};
|
||||
node.credentials = {};
|
||||
for (var cred in n._def.credentials) {
|
||||
if (n._def.credentials.hasOwnProperty(cred)) {
|
||||
if (n._def.credentials[cred].type == 'password') {
|
||||
if (/^subflow:/.test(node.type) && n.credentials) {
|
||||
// A subflow instance node can have arbitrary creds
|
||||
for (var sfCred in n.credentials) {
|
||||
if (n.credentials.hasOwnProperty(sfCred)) {
|
||||
if (!n.credentials._ ||
|
||||
n.credentials["has_"+cred] != n.credentials._["has_"+cred] ||
|
||||
(n.credentials["has_"+cred] && n.credentials[cred])) {
|
||||
n.credentials["has_"+sfCred] != n.credentials._["has_"+sfCred] ||
|
||||
(n.credentials["has_"+sfCred] && n.credentials[sfCred])) {
|
||||
credentialSet[sfCred] = n.credentials[sfCred];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (n.credentials) {
|
||||
node.credentials = {};
|
||||
// All other nodes have a well-defined list of possible credentials
|
||||
for (var cred in n._def.credentials) {
|
||||
if (n._def.credentials.hasOwnProperty(cred)) {
|
||||
if (n._def.credentials[cred].type == 'password') {
|
||||
if (!n.credentials._ ||
|
||||
n.credentials["has_"+cred] != n.credentials._["has_"+cred] ||
|
||||
(n.credentials["has_"+cred] && n.credentials[cred])) {
|
||||
credentialSet[cred] = n.credentials[cred];
|
||||
}
|
||||
} else if (n.credentials[cred] != null && (!n.credentials._ || n.credentials[cred] != n.credentials._[cred])) {
|
||||
credentialSet[cred] = n.credentials[cred];
|
||||
}
|
||||
} else if (n.credentials[cred] != null && (!n.credentials._ || n.credentials[cred] != n.credentials._[cred])) {
|
||||
credentialSet[cred] = n.credentials[cred];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -557,7 +586,7 @@ RED.nodes = (function() {
|
||||
return node;
|
||||
}
|
||||
|
||||
function convertSubflow(n) {
|
||||
function convertSubflow(n, exportCreds) {
|
||||
var node = {};
|
||||
node.id = n.id;
|
||||
node.type = n.type;
|
||||
@ -568,6 +597,25 @@ RED.nodes = (function() {
|
||||
node.out = [];
|
||||
node.env = n.env;
|
||||
|
||||
if (exportCreds) {
|
||||
var credentialSet = {};
|
||||
// A subflow node can have arbitrary creds
|
||||
for (var sfCred in n.credentials) {
|
||||
if (n.credentials.hasOwnProperty(sfCred)) {
|
||||
if (!n.credentials._ ||
|
||||
n.credentials["has_"+sfCred] != n.credentials._["has_"+sfCred] ||
|
||||
(n.credentials["has_"+sfCred] && n.credentials[sfCred])) {
|
||||
credentialSet[sfCred] = n.credentials[sfCred];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Object.keys(credentialSet).length > 0) {
|
||||
node.credentials = credentialSet;
|
||||
}
|
||||
}
|
||||
|
||||
node.color = n.color;
|
||||
|
||||
n.in.forEach(function(p) {
|
||||
var nIn = {x:p.x,y:p.y,wires:[]};
|
||||
var wires = links.filter(function(d) { return d.source === p });
|
||||
@ -681,7 +729,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
for (i in subflows) {
|
||||
if (subflows.hasOwnProperty(i)) {
|
||||
nns.push(convertSubflow(subflows[i]));
|
||||
nns.push(convertSubflow(subflows[i], exportCredentials));
|
||||
}
|
||||
}
|
||||
for (i in configNodes) {
|
||||
@ -833,7 +881,7 @@ RED.nodes = (function() {
|
||||
var m = /^subflow:(.+)$/.exec(newNodes[i].type);
|
||||
if (m) {
|
||||
var subflowId = m[1];
|
||||
var parent = getSubflow(newNodes[i].z || activeWorkspace);
|
||||
var parent = getSubflow(activeWorkspace);
|
||||
if (parent) {
|
||||
var err;
|
||||
if (subflowId === parent.id) {
|
||||
@ -1182,6 +1230,7 @@ RED.nodes = (function() {
|
||||
var nodeTypeArrayReferences = {
|
||||
"catch":"scope",
|
||||
"status":"scope",
|
||||
"complete": "scope",
|
||||
"link in":"links",
|
||||
"link out":"links"
|
||||
}
|
||||
@ -1283,8 +1332,13 @@ RED.nodes = (function() {
|
||||
function filterNodes(filter) {
|
||||
var result = [];
|
||||
var searchSet = nodes;
|
||||
if (filter.hasOwnProperty("z") && Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
|
||||
searchSet = Object.values(nodeTabMap[filter.z]);
|
||||
var doZFilter = false;
|
||||
if (filter.hasOwnProperty("z")) {
|
||||
if (Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
|
||||
searchSet = Object.values(nodeTabMap[filter.z]);
|
||||
} else {
|
||||
doZFilter = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (var n=0;n<searchSet.length;n++) {
|
||||
@ -1292,6 +1346,9 @@ RED.nodes = (function() {
|
||||
if (filter.hasOwnProperty("type") && node.type !== filter.type) {
|
||||
continue;
|
||||
}
|
||||
if (doZFilter && node.z !== filter.z) {
|
||||
continue;
|
||||
}
|
||||
result.push(node);
|
||||
}
|
||||
return result;
|
||||
@ -1466,6 +1523,8 @@ RED.nodes = (function() {
|
||||
remove: removeNode,
|
||||
clear: clear,
|
||||
|
||||
moveNodeToTab: moveNodeToTab,
|
||||
|
||||
addLink: addLink,
|
||||
removeLink: removeLink,
|
||||
|
||||
|
@ -418,8 +418,6 @@ var RED = (function() {
|
||||
RED.notify(RED._("palette.event.nodeUpgraded", {module:msg.module,version:msg.version}),"success");
|
||||
RED.nodes.registry.setModulePendingUpdated(msg.module,msg.version);
|
||||
}
|
||||
// Refresh flow library to ensure any examples are updated
|
||||
RED.library.loadFlowLibrary();
|
||||
});
|
||||
RED.comms.subscribe("event-log/#", function(topic,payload) {
|
||||
var id = topic.substring(9);
|
||||
@ -455,8 +453,12 @@ var RED = (function() {
|
||||
null
|
||||
]});
|
||||
menuOptions.push(null);
|
||||
menuOptions.push({id:"menu-item-import",label:RED._("menu.label.import"),onselect:"core:show-import-dialog"});
|
||||
menuOptions.push({id:"menu-item-export",label:RED._("menu.label.export"),onselect:"core:show-export-dialog"});
|
||||
if (RED.settings.theme("menu.menu-item-import-library", true)) {
|
||||
menuOptions.push({id: "menu-item-import", label: RED._("menu.label.import"), onselect: "core:show-import-dialog"});
|
||||
}
|
||||
if (RED.settings.theme("menu.menu-item-export-library", true)) {
|
||||
menuOptions.push({id: "menu-item-export", label: RED._("menu.label.export"), onselect: "core:show-export-dialog"});
|
||||
}
|
||||
menuOptions.push(null);
|
||||
menuOptions.push({id:"menu-item-search",label:RED._("menu.label.search"),onselect:"core:search"});
|
||||
menuOptions.push(null);
|
||||
@ -479,7 +481,9 @@ var RED = (function() {
|
||||
menuOptions.push({id:"menu-item-user-settings",label:RED._("menu.label.settings"),onselect:"core:show-user-settings"});
|
||||
menuOptions.push(null);
|
||||
|
||||
menuOptions.push({id:"menu-item-keyboard-shortcuts",label:RED._("menu.label.keyboardShortcuts"),onselect:"core:show-help"});
|
||||
if (RED.settings.theme("menu.menu-item-keyboard-shortcuts", true)) {
|
||||
menuOptions.push({id: "menu-item-keyboard-shortcuts", label: RED._("menu.label.keyboardShortcuts"), onselect: "core:show-help"});
|
||||
}
|
||||
menuOptions.push({id:"menu-item-help",
|
||||
label: RED.settings.theme("menu.menu-item-help.label",RED._("menu.label.help")),
|
||||
href: RED.settings.theme("menu.menu-item-help.url","http://nodered.org/docs")
|
||||
|
@ -56,8 +56,9 @@ RED.settings = (function () {
|
||||
if (key === "auth-tokens") {
|
||||
return JSON.parse(localStorage.getItem(key));
|
||||
} else {
|
||||
var v;
|
||||
try {
|
||||
var v = RED.utils.getMessageProperty(userSettings,key);
|
||||
v = RED.utils.getMessageProperty(userSettings,key);
|
||||
if (v === undefined) {
|
||||
v = defaultIfUndefined;
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
* - addItem(itemData)
|
||||
* - insertItemAt : function(data,index) - add an item at the specified index
|
||||
* - removeItem(itemData)
|
||||
* - getItemAt(index)
|
||||
* - indexOf(itemData)
|
||||
* - width(width)
|
||||
* - height(height)
|
||||
* - items()
|
||||
@ -186,7 +188,11 @@
|
||||
}
|
||||
},
|
||||
_destroy: function() {
|
||||
this.topContainer.remove();
|
||||
if (this.topContainer) {
|
||||
var tc = this.topContainer;
|
||||
delete this.topContainer;
|
||||
tc.remove();
|
||||
}
|
||||
},
|
||||
_refreshFilter: function() {
|
||||
var that = this;
|
||||
@ -232,6 +238,23 @@
|
||||
this.uiHeight = desiredHeight;
|
||||
this._resize();
|
||||
},
|
||||
getItemAt: function(index) {
|
||||
var items = this.items();
|
||||
if (index >= 0 && index < items.length) {
|
||||
return $(items[index]).data('data');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
},
|
||||
indexOf: function(data) {
|
||||
var items = this.items();
|
||||
for (var i=0;i<items.length;i++) {
|
||||
if ($(items[i]).data('data') === data) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
},
|
||||
insertItemAt: function(data,index) {
|
||||
var that = this;
|
||||
data = data || {};
|
||||
|
@ -224,9 +224,9 @@ RED.menu = (function() {
|
||||
if (!alreadySet && opt.onselect) {
|
||||
triggerAction(opt.id,state);
|
||||
}
|
||||
}
|
||||
if (!alreadySet) {
|
||||
RED.settings.set(opt.setting||("menu-"+opt.id), state);
|
||||
if (!opt.local && !alreadySet) {
|
||||
RED.settings.set(opt.setting||("menu-"+opt.id), state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ RED.menu = (function() {
|
||||
|
||||
function addItem(id,opt) {
|
||||
var item = createMenuItem(opt);
|
||||
if (opt.group) {
|
||||
if (opt !== null && opt.group) {
|
||||
var groupItems = $("#"+id+"-submenu").children(".red-ui-menu-group-"+opt.group);
|
||||
if (groupItems.length === 0) {
|
||||
item.appendTo("#"+id+"-submenu");
|
||||
|
@ -131,6 +131,11 @@ RED.popover = (function() {
|
||||
existingPopover.close(true);
|
||||
}
|
||||
target.data("red-ui-popover",res)
|
||||
if (options.tooltip) {
|
||||
div.on("mousedown", function(evt) {
|
||||
closePopup(true);
|
||||
});
|
||||
}
|
||||
if (instant) {
|
||||
div.show();
|
||||
} else {
|
||||
@ -253,6 +258,71 @@ RED.popover = (function() {
|
||||
content: label,
|
||||
delay: { show: 750, hide: 50 }
|
||||
});
|
||||
},
|
||||
panel: function(content) {
|
||||
var panel = $('<div class="red-ui-editor-dialog red-ui-popover-panel"></div>');
|
||||
panel.css({ display: "none" });
|
||||
panel.appendTo(document.body);
|
||||
content.appendTo(panel);
|
||||
var closeCallback;
|
||||
|
||||
function hide() {
|
||||
$(document).off("mousedown.red-ui-popover-panel-close");
|
||||
panel.hide();
|
||||
panel.css({
|
||||
height: "auto"
|
||||
});
|
||||
panel.remove();
|
||||
}
|
||||
function show(options) {
|
||||
var closeCallback = options.onclose;
|
||||
var target = options.target;
|
||||
var align = options.align || "left";
|
||||
|
||||
var pos = target.offset();
|
||||
var targetWidth = target.width();
|
||||
var targetHeight = target.height();
|
||||
var panelHeight = panel.height();
|
||||
var panelWidth = panel.width();
|
||||
|
||||
var top = (targetHeight+pos.top);
|
||||
if (top+panelHeight > $(window).height()) {
|
||||
top -= (top+panelHeight)-$(window).height() + 5;
|
||||
}
|
||||
if (top < 0) {
|
||||
panelHeight.height(panelHeight+top)
|
||||
top = 0;
|
||||
}
|
||||
if (align === "left") {
|
||||
panel.css({
|
||||
top: top+"px",
|
||||
left: (pos.left)+"px",
|
||||
});
|
||||
} else if(align === "right") {
|
||||
panel.css({
|
||||
top: top+"px",
|
||||
left: (pos.left-panelWidth)+"px",
|
||||
});
|
||||
}
|
||||
panel.slideDown(100);
|
||||
|
||||
$(document).on("mousedown.red-ui-popover-panel-close", function(event) {
|
||||
if(!$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) {
|
||||
if (closeCallback) {
|
||||
closeCallback();
|
||||
}
|
||||
hide();
|
||||
}
|
||||
// if ($(event.target).closest(target).length) {
|
||||
// event.preventDefault();
|
||||
// }
|
||||
})
|
||||
}
|
||||
return {
|
||||
container: panel,
|
||||
show:show,
|
||||
hide:hide
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,9 @@
|
||||
RED.tabs = (function() {
|
||||
|
||||
var defaultTabIcon = "fa fa-lemon-o";
|
||||
var dragActive = false;
|
||||
var dblClickTime;
|
||||
var dblClickArmed = false;
|
||||
|
||||
function createTabs(options) {
|
||||
var tabs = {};
|
||||
@ -201,12 +204,21 @@ RED.tabs = (function() {
|
||||
}
|
||||
|
||||
function onTabClick(evt) {
|
||||
evt.preventDefault();
|
||||
if (dragActive) {
|
||||
return
|
||||
}
|
||||
if (dblClickTime && Date.now()-dblClickTime < 400) {
|
||||
dblClickTime = 0;
|
||||
dblClickArmed = true;
|
||||
return onTabDblClick.call(this,evt);
|
||||
}
|
||||
dblClickTime = Date.now();
|
||||
|
||||
var currentTab = ul.find("li.red-ui-tab.active");
|
||||
var thisTab = $(this).parent();
|
||||
var fireSelectionChanged = false;
|
||||
if (options.onselect) {
|
||||
if (evt.metaKey) {
|
||||
if (evt.metaKey || evt.ctrlKey) {
|
||||
if (thisTab.hasClass("selected")) {
|
||||
thisTab.removeClass("selected");
|
||||
if (thisTab[0] !== currentTab[0]) {
|
||||
@ -267,7 +279,6 @@ RED.tabs = (function() {
|
||||
if (fireSelectionChanged) {
|
||||
selectionChanged();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateScroll() {
|
||||
@ -289,7 +300,6 @@ RED.tabs = (function() {
|
||||
}
|
||||
function onTabDblClick(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if (evt.metaKey || evt.shiftKey) {
|
||||
return;
|
||||
}
|
||||
@ -418,7 +428,11 @@ RED.tabs = (function() {
|
||||
|
||||
}
|
||||
|
||||
ul.find("li.red-ui-tab a").on("click",onTabClick).on("dblclick",onTabDblClick);
|
||||
ul.find("li.red-ui-tab a")
|
||||
.on("mouseup",onTabClick)
|
||||
.on("click", function(evt) {evt.preventDefault(); })
|
||||
.on("dblclick", function(evt) {evt.stopPropagation(); evt.preventDefault(); })
|
||||
|
||||
setTimeout(function() {
|
||||
updateTabWidths();
|
||||
},0);
|
||||
@ -524,8 +538,9 @@ RED.tabs = (function() {
|
||||
RED.popover.tooltip($(pinnedLink), tab.name, tab.action);
|
||||
|
||||
}
|
||||
link.on("click",onTabClick);
|
||||
link.on("dblclick",onTabDblClick);
|
||||
link.on("mouseup",onTabClick);
|
||||
link.on("click", function(evt) { evt.preventDefault(); })
|
||||
link.on("dblclick", function(evt) { evt.stopPropagation(); evt.preventDefault(); })
|
||||
|
||||
|
||||
if (tab.closeable) {
|
||||
@ -560,6 +575,8 @@ RED.tabs = (function() {
|
||||
axis:"x",
|
||||
distance: 20,
|
||||
start: function(event,ui) {
|
||||
if (dblClickArmed) { dblClickArmed = false; return false }
|
||||
dragActive = true;
|
||||
originalTabOrder = [];
|
||||
tabElements = [];
|
||||
ul.children().each(function(i) {
|
||||
@ -615,6 +632,7 @@ RED.tabs = (function() {
|
||||
}
|
||||
},
|
||||
stop: function(event,ui) {
|
||||
dragActive = false;
|
||||
ul.children().css({position:"relative",left:"",transition:""});
|
||||
if (!li.hasClass('active')) {
|
||||
li.css({zIndex:""});
|
||||
|
@ -39,8 +39,8 @@
|
||||
var baseClass = this.options.baseClass || "red-ui-button";
|
||||
var enabledIcon = this.options.enabledIcon || "fa-check-square-o";
|
||||
var disabledIcon = this.options.disabledIcon || "fa-square-o";
|
||||
var enabledLabel = this.options.enabledLabel || RED._("editor:workspace.enabled");
|
||||
var disabledLabel = this.options.disabledLabel || RED._("editor:workspace.disabled");
|
||||
var enabledLabel = this.options.hasOwnProperty('enabledLabel') ? this.options.enabledLabel : RED._("editor:workspace.enabled");
|
||||
var disabledLabel = this.options.hasOwnProperty('disabledLabel') ? this.options.disabledLabel : RED._("editor:workspace.disabled");
|
||||
|
||||
this.element.css("display","none");
|
||||
this.element.on("focus", function() {
|
||||
|
@ -410,7 +410,7 @@
|
||||
return;
|
||||
}
|
||||
if (container.hasClass("expanded")) {
|
||||
done && done();
|
||||
if (done) { done() }
|
||||
return;
|
||||
}
|
||||
if (!container.hasClass("built") && (item.deferBuild || typeof item.children === 'function')) {
|
||||
@ -435,7 +435,7 @@
|
||||
spinner.remove();
|
||||
}
|
||||
}
|
||||
done && done();
|
||||
if (done) { done() }
|
||||
that._trigger("childrenloaded",null,item)
|
||||
}
|
||||
if (typeof item.children === 'function') {
|
||||
@ -457,7 +457,7 @@
|
||||
} else {
|
||||
item.treeList.childList.slideDown('fast');
|
||||
}
|
||||
done && done();
|
||||
if (done) { done() }
|
||||
}
|
||||
container.addClass("expanded");
|
||||
}
|
||||
|
@ -81,7 +81,7 @@
|
||||
}
|
||||
},
|
||||
re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.svg"},
|
||||
date: {value:"date",label:"timestamp",hasValue:false},
|
||||
date: {value:"date",label:"timestamp",icon:"fa fa-clock-o",hasValue:false},
|
||||
jsonata: {
|
||||
value: "jsonata",
|
||||
label: "expression",
|
||||
@ -164,6 +164,84 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
cred:{
|
||||
value:"cred",
|
||||
label:"credential",
|
||||
icon:"fa fa-lock",
|
||||
inputType: "password",
|
||||
valueLabel: function(container,value) {
|
||||
var that = this;
|
||||
container.css("pointer-events","none");
|
||||
this.elementDiv.hide();
|
||||
var buttons = $('<div>').css({
|
||||
position: "absolute",
|
||||
right:"6px",
|
||||
top: "6px",
|
||||
"pointer-events":"all"
|
||||
}).appendTo(container);
|
||||
var eyeButton = $('<button type="button" class="red-ui-button red-ui-button-small"></button>').css({
|
||||
width:"20px"
|
||||
}).appendTo(buttons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
var currentType = that.input.attr("type");
|
||||
if (currentType === "text") {
|
||||
that.input.attr("type","password");
|
||||
eyeCon.removeClass("fa-eye-slash").addClass("fa-eye");
|
||||
setTimeout(function() {
|
||||
that.input.focus();
|
||||
},50);
|
||||
} else {
|
||||
that.input.attr("type","text");
|
||||
eyeCon.removeClass("fa-eye").addClass("fa-eye-slash");
|
||||
setTimeout(function() {
|
||||
that.input.focus();
|
||||
},50);
|
||||
}
|
||||
}).hide();
|
||||
var eyeCon = $('<i class="fa fa-eye"></i>').css("margin-left","-1px").appendTo(eyeButton);
|
||||
|
||||
if (value === "__PWRD__") {
|
||||
var innerContainer = $('<div><i class="fa fa-asterisk"></i><i class="fa fa-asterisk"></i><i class="fa fa-asterisk"></i><i class="fa fa-asterisk"></i><i class="fa fa-asterisk"></i></div>').css({
|
||||
padding:"6px 6px",
|
||||
borderRadius:"4px"
|
||||
}).addClass("red-ui-typedInput-value-label-inactive").appendTo(container);
|
||||
var editButton = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-pencil"></i></button>').appendTo(buttons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
innerContainer.hide();
|
||||
container.css("background","none");
|
||||
container.css("pointer-events","none");
|
||||
that.input.val("");
|
||||
that.element.val("");
|
||||
that.elementDiv.show();
|
||||
editButton.hide();
|
||||
cancelButton.show();
|
||||
eyeButton.show();
|
||||
setTimeout(function() {
|
||||
that.input.focus();
|
||||
},50);
|
||||
});
|
||||
var cancelButton = $('<button type="button" class="red-ui-button red-ui-button-small"><i class="fa fa-times"></i></button>').css("margin-left","3px").appendTo(buttons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
innerContainer.show();
|
||||
container.css("background","");
|
||||
that.input.val("__PWRD__");
|
||||
that.element.val("__PWRD__");
|
||||
that.elementDiv.hide();
|
||||
editButton.show();
|
||||
cancelButton.hide();
|
||||
eyeButton.hide();
|
||||
that.input.attr("type","password");
|
||||
eyeCon.removeClass("fa-eye-slash").addClass("fa-eye");
|
||||
|
||||
}).hide();
|
||||
} else {
|
||||
container.css("background","none");
|
||||
container.css("pointer-events","none");
|
||||
this.elementDiv.show();
|
||||
eyeButton.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var nlsd = false;
|
||||
@ -220,6 +298,8 @@
|
||||
that.input.attr(d,m);
|
||||
});
|
||||
|
||||
this.defaultInputType = this.input.attr('type');
|
||||
|
||||
this.uiSelect.addClass("red-ui-typedInput-container");
|
||||
|
||||
this.element.attr('type','hidden');
|
||||
@ -298,7 +378,8 @@
|
||||
that.uiSelect.addClass('red-ui-typedInput-focus');
|
||||
});
|
||||
|
||||
this.optionExpandButton = $('<button tabindex="0" class="red-ui-typedInput-option-expand" style="display:inline-block"><i class="red-ui-typedInput-icon fa fa-ellipsis-h"></i></button>').appendTo(this.uiSelect);
|
||||
this.optionExpandButton = $('<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.options.default||this.typeList[0].value);
|
||||
}catch(err) {
|
||||
console.log(err.stack);
|
||||
@ -336,6 +417,17 @@
|
||||
menu.css({
|
||||
height: "auto"
|
||||
});
|
||||
|
||||
if (menu.opts.multiple) {
|
||||
var selected = [];
|
||||
menu.find('input[type="checkbox"]').each(function() {
|
||||
if ($(this).prop("checked")) {
|
||||
selected.push($(this).data('value'))
|
||||
}
|
||||
})
|
||||
menu.callback(selected);
|
||||
}
|
||||
|
||||
if (this.elementDiv.is(":visible")) {
|
||||
this.input.trigger("focus");
|
||||
} else if (this.optionSelectTrigger.is(":visible")){
|
||||
@ -344,10 +436,12 @@
|
||||
this.selectTrigger.trigger("focus");
|
||||
}
|
||||
},
|
||||
_createMenu: function(opts,callback) {
|
||||
_createMenu: function(menuOptions,opts,callback) {
|
||||
var that = this;
|
||||
var menu = $("<div>").addClass("red-ui-typedInput-options");
|
||||
opts.forEach(function(opt) {
|
||||
var menu = $("<div>").addClass("red-ui-typedInput-options red-ui-editor-dialog");
|
||||
menu.opts = opts;
|
||||
menu.callback = callback;
|
||||
menuOptions.forEach(function(opt) {
|
||||
if (typeof opt === 'string') {
|
||||
opt = {value:opt,label:opt};
|
||||
}
|
||||
@ -369,12 +463,20 @@
|
||||
if (!opt.icon && !opt.label) {
|
||||
op.text(opt.value);
|
||||
}
|
||||
var cb;
|
||||
if (opts.multiple) {
|
||||
cb = $('<input type="checkbox">').css("pointer-events","none").data('value',opt.value).prependTo(op).on("mousedown", function(evt) { evt.preventDefault() });
|
||||
}
|
||||
|
||||
op.on("click", function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
callback(opt.value);
|
||||
that._hideMenu(menu);
|
||||
if (!opts.multiple) {
|
||||
callback(opt.value);
|
||||
that._hideMenu(menu);
|
||||
} else {
|
||||
cb.prop("checked",!cb.prop("checked"));
|
||||
}
|
||||
});
|
||||
});
|
||||
menu.css({
|
||||
@ -398,9 +500,6 @@
|
||||
}
|
||||
evt.stopPropagation();
|
||||
})
|
||||
|
||||
|
||||
|
||||
return menu;
|
||||
|
||||
},
|
||||
@ -409,11 +508,22 @@
|
||||
this.disarmClick = false;
|
||||
return
|
||||
}
|
||||
if (menu.opts.multiple) {
|
||||
var selected = {};
|
||||
this.value().split(",").forEach(function(f) {
|
||||
selected[f] = true;
|
||||
})
|
||||
menu.find('input[type="checkbox"]').each(function() {
|
||||
$(this).prop("checked",selected[$(this).data('value')])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
var that = this;
|
||||
var pos = relativeTo.offset();
|
||||
var height = relativeTo.height();
|
||||
var menuHeight = menu.height();
|
||||
var top = (height+pos.top-3);
|
||||
var top = (height+pos.top);
|
||||
if (top+menuHeight > $(window).height()) {
|
||||
top -= (top+menuHeight)-$(window).height()+5;
|
||||
}
|
||||
@ -423,7 +533,7 @@
|
||||
}
|
||||
menu.css({
|
||||
top: top+"px",
|
||||
left: (2+pos.left)+"px",
|
||||
left: (pos.left)+"px",
|
||||
});
|
||||
menu.slideDown(100);
|
||||
this._delay(function() {
|
||||
@ -471,7 +581,7 @@
|
||||
this._getLabelWidth(this.selectTrigger, function(labelWidth) {
|
||||
that.elementDiv.css('left',labelWidth+"px");
|
||||
that.valueLabelContainer.css('left',labelWidth+"px");
|
||||
if (that.optionExpandButton.is(":visible")) {
|
||||
if (that.optionExpandButton.shown) {
|
||||
that.elementDiv.css('right',"22px");
|
||||
that.valueLabelContainer.css('right',"22px");
|
||||
} else {
|
||||
@ -496,7 +606,7 @@
|
||||
} else {
|
||||
that.optionSelectLabel.css({'left':'0'})
|
||||
that.optionSelectTrigger.css({'width':'calc( 100% - '+labelWidth+'px )'});
|
||||
if (!that.optionExpandButton.is(":visible")) {
|
||||
if (!that.optionExpandButton.shown) {
|
||||
that.elementDiv.css({'right':0});
|
||||
that.input.css({
|
||||
'border-top-right-radius': '4px',
|
||||
@ -511,25 +621,35 @@
|
||||
_updateOptionSelectLabel: function(o) {
|
||||
var opt = this.typeMap[this.propertyType];
|
||||
this.optionSelectLabel.empty();
|
||||
if (o.icon) {
|
||||
if (o.icon.indexOf("<") === 0) {
|
||||
$(o.icon).prependTo(this.optionSelectLabel);
|
||||
} else if (o.icon.indexOf("/") !== -1) {
|
||||
// url
|
||||
$('<img>',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel);
|
||||
if (this.typeMap[this.propertyType].valueLabel) {
|
||||
if (opt.multiple) {
|
||||
this.typeMap[this.propertyType].valueLabel.call(this,this.optionSelectLabel,o);
|
||||
} else {
|
||||
// icon class
|
||||
$('<i>',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel);
|
||||
this.typeMap[this.propertyType].valueLabel.call(this,this.optionSelectLabel,o.value);
|
||||
}
|
||||
} else if (!opt.multiple) {
|
||||
if (o.icon) {
|
||||
if (o.icon.indexOf("<") === 0) {
|
||||
$(o.icon).prependTo(this.optionSelectLabel);
|
||||
} else if (o.icon.indexOf("/") !== -1) {
|
||||
// url
|
||||
$('<img>',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel);
|
||||
} else {
|
||||
// icon class
|
||||
$('<i>',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel);
|
||||
}
|
||||
} else if (o.label) {
|
||||
this.optionSelectLabel.text(o.label);
|
||||
} else {
|
||||
this.optionSelectLabel.text(o.value);
|
||||
}
|
||||
if (opt.hasValue) {
|
||||
this.optionValue = o.value;
|
||||
this._resize();
|
||||
this.input.trigger('change',this.propertyType,this.value());
|
||||
}
|
||||
} else if (o.label) {
|
||||
this.optionSelectLabel.text(o.label);
|
||||
} else {
|
||||
this.optionSelectLabel.text(o.value);
|
||||
}
|
||||
if (opt.hasValue) {
|
||||
this.optionValue = o.value;
|
||||
this._resize();
|
||||
this.input.trigger('change',this.propertyType,this.value());
|
||||
this.optionSelectLabel.text(o.length+" selected");
|
||||
}
|
||||
},
|
||||
_destroy: function() {
|
||||
@ -558,7 +678,7 @@
|
||||
if (this.menu) {
|
||||
this.menu.remove();
|
||||
}
|
||||
this.menu = this._createMenu(this.typeList, function(v) { that.type(v) });
|
||||
this.menu = this._createMenu(this.typeList,{},function(v) { that.type(v) });
|
||||
if (currentType && !this.typeMap.hasOwnProperty(currentType)) {
|
||||
this.type(this.typeList[0].value);
|
||||
} else {
|
||||
@ -572,38 +692,51 @@
|
||||
this._resize();
|
||||
},
|
||||
value: function(value) {
|
||||
var that = this;
|
||||
var opt = this.typeMap[this.propertyType];
|
||||
if (!arguments.length) {
|
||||
var v = this.input.val();
|
||||
if (this.typeMap[this.propertyType].export) {
|
||||
v = this.typeMap[this.propertyType].export(v,this.optionValue)
|
||||
if (opt.export) {
|
||||
v = opt.export(v,this.optionValue)
|
||||
}
|
||||
return v;
|
||||
} else {
|
||||
var selectedOption;
|
||||
if (this.typeMap[this.propertyType].options) {
|
||||
for (var i=0;i<this.typeMap[this.propertyType].options.length;i++) {
|
||||
var op = this.typeMap[this.propertyType].options[i];
|
||||
if (typeof op === "string") {
|
||||
if (op === value) {
|
||||
selectedOption = this.activeOptions[op];
|
||||
var selectedOption = [];
|
||||
if (opt.options) {
|
||||
var checkValues = [value];
|
||||
if (opt.multiple) {
|
||||
selectedOption = [];
|
||||
checkValues = value.split(",");
|
||||
}
|
||||
checkValues.forEach(function(value) {
|
||||
for (var i=0;i<opt.options.length;i++) {
|
||||
var op = opt.options[i];
|
||||
if (typeof op === "string") {
|
||||
if (op === value || op === ""+value) {
|
||||
selectedOption.push(that.activeOptions[op]);
|
||||
break;
|
||||
}
|
||||
} else if (op.value === value) {
|
||||
selectedOption.push(op);
|
||||
break;
|
||||
}
|
||||
} else if (op.value === value) {
|
||||
selectedOption = op;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!selectedOption) {
|
||||
selectedOption = {value:""}
|
||||
}
|
||||
})
|
||||
this.input.val(value);
|
||||
this._updateOptionSelectLabel(selectedOption)
|
||||
if (!opt.multiple) {
|
||||
if (selectedOption.length === 0) {
|
||||
selectedOption = [{value:""}];
|
||||
}
|
||||
this._updateOptionSelectLabel(selectedOption[0])
|
||||
} else {
|
||||
this._updateOptionSelectLabel(selectedOption)
|
||||
}
|
||||
} else {
|
||||
this.input.val(value);
|
||||
}
|
||||
if (this.typeMap[this.propertyType].valueLabel) {
|
||||
this.valueLabelContainer.empty();
|
||||
this.typeMap[this.propertyType].valueLabel.call(this,this.valueLabelContainer,value);
|
||||
if (opt.valueLabel) {
|
||||
this.valueLabelContainer.empty();
|
||||
opt.valueLabel.call(this,this.valueLabelContainer,value);
|
||||
}
|
||||
}
|
||||
this.input.trigger('change',this.type(),value);
|
||||
}
|
||||
@ -621,7 +754,7 @@
|
||||
}
|
||||
this.selectLabel.empty();
|
||||
var image;
|
||||
if (opt.icon) {
|
||||
if (opt.icon && opt.showLabel !== false) {
|
||||
if (opt.icon.indexOf("<") === 0) {
|
||||
$(opt.icon).prependTo(this.selectLabel);
|
||||
}
|
||||
@ -634,9 +767,10 @@
|
||||
$('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
|
||||
}
|
||||
else {
|
||||
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(this.selectLabel);
|
||||
$('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if (opt.hasValue === false || (opt.showLabel !== false && !opt.icon)) {
|
||||
this.selectLabel.text(opt.label);
|
||||
}
|
||||
if (this.optionMenu) {
|
||||
@ -646,6 +780,7 @@
|
||||
if (opt.options) {
|
||||
if (this.optionExpandButton) {
|
||||
this.optionExpandButton.hide();
|
||||
this.optionExpandButton.shown = false;
|
||||
}
|
||||
if (this.optionSelectTrigger) {
|
||||
this.optionSelectTrigger.show();
|
||||
@ -668,36 +803,50 @@
|
||||
if (!that.activeOptions.hasOwnProperty(that.optionValue)) {
|
||||
that.optionValue = null;
|
||||
}
|
||||
this.optionMenu = this._createMenu(opt.options,function(v){
|
||||
that._updateOptionSelectLabel(that.activeOptions[v]);
|
||||
if (!opt.hasValue) {
|
||||
that.value(that.activeOptions[v].value)
|
||||
}
|
||||
});
|
||||
|
||||
var op;
|
||||
if (!opt.hasValue) {
|
||||
var currentVal = this.input.val();
|
||||
var validValue = false;
|
||||
for (var i=0;i<opt.options.length;i++) {
|
||||
op = opt.options[i];
|
||||
if (typeof op === "string" && op === currentVal) {
|
||||
that._updateOptionSelectLabel({value:currentVal});
|
||||
validValue = true;
|
||||
break;
|
||||
} else if (op.value === currentVal) {
|
||||
that._updateOptionSelectLabel(op);
|
||||
validValue = true;
|
||||
break;
|
||||
var currentVal = this.input.val();
|
||||
if (!opt.multiple) {
|
||||
for (var i=0;i<opt.options.length;i++) {
|
||||
op = opt.options[i];
|
||||
if (typeof op === "string" && op === currentVal) {
|
||||
that._updateOptionSelectLabel({value:currentVal});
|
||||
validValue = true;
|
||||
break;
|
||||
} else if (op.value === currentVal) {
|
||||
that._updateOptionSelectLabel(op);
|
||||
validValue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!validValue) {
|
||||
op = opt.options[0];
|
||||
if (typeof op === "string") {
|
||||
this.value(op);
|
||||
that._updateOptionSelectLabel({value:op});
|
||||
} else {
|
||||
this.value(op.value);
|
||||
that._updateOptionSelectLabel(op);
|
||||
if (!validValue) {
|
||||
op = opt.options[0];
|
||||
if (typeof op === "string") {
|
||||
this.value(op);
|
||||
that._updateOptionSelectLabel({value:op});
|
||||
} else {
|
||||
this.value(op.value);
|
||||
that._updateOptionSelectLabel(op);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Check to see if value is a valid csv of
|
||||
// options.
|
||||
var currentValues = {};
|
||||
currentVal.split(",").forEach(function(v) {
|
||||
if (v) {
|
||||
currentValues[v] = true;
|
||||
}
|
||||
});
|
||||
for (var i=0;i<opt.options.length;i++) {
|
||||
op = opt.options[i];
|
||||
delete currentValues[op.value||op];
|
||||
}
|
||||
if (!$.isEmptyObject(currentValues)) {
|
||||
// Invalid, set to default/empty
|
||||
this.value((opt.default||[]).join(","));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -733,12 +882,31 @@
|
||||
this.optionSelectTrigger.hide();
|
||||
}
|
||||
}
|
||||
this.optionMenu = this._createMenu(opt.options,opt,function(v){
|
||||
if (!opt.multiple) {
|
||||
that._updateOptionSelectLabel(that.activeOptions[v]);
|
||||
if (!opt.hasValue) {
|
||||
that.value(that.activeOptions[v].value)
|
||||
}
|
||||
} else {
|
||||
that._updateOptionSelectLabel(v);
|
||||
if (!opt.hasValue) {
|
||||
that.value(v.join(","))
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this._trigger("typechange",null,this.propertyType);
|
||||
this.input.trigger('change',this.propertyType,this.value());
|
||||
} else {
|
||||
if (this.optionSelectTrigger) {
|
||||
this.optionSelectTrigger.hide();
|
||||
}
|
||||
if (opt.inputType) {
|
||||
this.input.attr('type',opt.inputType)
|
||||
} else {
|
||||
this.input.attr('type',this.defaultInputType)
|
||||
}
|
||||
if (opt.hasValue === false) {
|
||||
this.oldValue = this.input.val();
|
||||
this.input.val("");
|
||||
@ -747,8 +915,8 @@
|
||||
} else if (opt.valueLabel) {
|
||||
this.valueLabelContainer.show();
|
||||
this.valueLabelContainer.empty();
|
||||
opt.valueLabel.call(this,this.valueLabelContainer,this.input.val());
|
||||
this.elementDiv.hide();
|
||||
opt.valueLabel.call(this,this.valueLabelContainer,this.input.val());
|
||||
} else {
|
||||
if (this.oldValue !== undefined) {
|
||||
this.input.val(this.oldValue);
|
||||
@ -758,17 +926,44 @@
|
||||
this.elementDiv.show();
|
||||
}
|
||||
if (this.optionExpandButton) {
|
||||
if (opt.expand && typeof opt.expand === 'function') {
|
||||
if (opt.expand) {
|
||||
if (opt.expand.icon) {
|
||||
this.optionExpandButtonIcon.removeClass().addClass("red-ui-typedInput-icon fa "+opt.expand.icon)
|
||||
} else {
|
||||
this.optionExpandButtonIcon.removeClass().addClass("red-ui-typedInput-icon fa fa-ellipsis-h")
|
||||
}
|
||||
this.optionExpandButton.shown = true;
|
||||
this.optionExpandButton.show();
|
||||
this.optionExpandButton.off('click');
|
||||
this.optionExpandButton.on('click',function(evt) {
|
||||
evt.preventDefault();
|
||||
opt.expand.call(that);
|
||||
if (typeof opt.expand === 'function') {
|
||||
opt.expand.call(that);
|
||||
} else {
|
||||
var container = $('<div>');
|
||||
var content = opt.expand.content.call(that,container);
|
||||
var panel = RED.popover.panel(container);
|
||||
panel.container.css({
|
||||
width:that.valueLabelContainer.width()
|
||||
});
|
||||
if (opt.expand.minWidth) {
|
||||
panel.container.css({
|
||||
minWidth: opt.expand.minWidth+"px"
|
||||
});
|
||||
}
|
||||
panel.show({
|
||||
target:that.optionExpandButton,
|
||||
onclose:content.onclose,
|
||||
align: "right"
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.optionExpandButton.shown = false;
|
||||
this.optionExpandButton.hide();
|
||||
}
|
||||
}
|
||||
this._trigger("typechange",null,this.propertyType);
|
||||
this.input.trigger('change',this.propertyType,this.value());
|
||||
}
|
||||
if (!image) {
|
||||
|
@ -334,8 +334,7 @@ RED.deploy = (function() {
|
||||
var invalidNodes = [];
|
||||
|
||||
RED.nodes.eachNode(function(node) {
|
||||
hasInvalid = hasInvalid || !node.valid;
|
||||
if (!node.valid) {
|
||||
if (!node.valid && !node.d) {
|
||||
invalidNodes.push(getNodeInfo(node));
|
||||
}
|
||||
if (node.type === "unknown") {
|
||||
@ -345,6 +344,7 @@ RED.deploy = (function() {
|
||||
}
|
||||
});
|
||||
hasUnknown = unknownNodes.length > 0;
|
||||
hasInvalid = invalidNodes.length > 0;
|
||||
|
||||
var unusedConfigNodes = [];
|
||||
RED.nodes.eachConfig(function(node) {
|
||||
|
@ -401,7 +401,7 @@ RED.diff = (function() {
|
||||
defaults:{},
|
||||
icon:"subflow.svg",
|
||||
category: "subflows",
|
||||
color: "#da9"
|
||||
color: "#DDAA99"
|
||||
},
|
||||
tab:currentConfig.subflows[subflowId]
|
||||
}
|
||||
@ -424,7 +424,7 @@ RED.diff = (function() {
|
||||
defaults:{},
|
||||
icon:"subflow.svg",
|
||||
category: "subflows",
|
||||
color: "#da9"
|
||||
color: "#DDAA99"
|
||||
},
|
||||
tab:newConfig.subflows[subflowId],
|
||||
newTab:newConfig.subflows[subflowId]
|
||||
@ -445,7 +445,7 @@ RED.diff = (function() {
|
||||
defaults:{},
|
||||
icon:"subflow.svg",
|
||||
category: "subflows",
|
||||
color: "#da9"
|
||||
color: "#DDAA99"
|
||||
},
|
||||
tab:remoteDiff.newConfig.subflows[subflowId],
|
||||
remoteTab: remoteDiff.newConfig.subflows[subflowId]
|
||||
@ -551,7 +551,7 @@ RED.diff = (function() {
|
||||
def = {
|
||||
icon:"subflow.svg",
|
||||
category: "subflows",
|
||||
color: "#da9",
|
||||
color: "#DDAA99",
|
||||
defaults:{name:{value:""}}
|
||||
}
|
||||
} else {
|
||||
@ -1029,9 +1029,9 @@ RED.diff = (function() {
|
||||
}
|
||||
|
||||
var localSelectDiv = $('<label>',{class:"red-ui-diff-selectbox",for:safeNodeId+"-local"}).on("click", function(e) { e.stopPropagation();}).appendTo(localDiv);
|
||||
var localRadio = $('<input>',{class:"red-ui-diff-selectbox-input",id:safeNodeId+"-local",type:'radio',value:"local",name:safeNodeId,class:className+"-local"}).data('node-id',node.id).on("change", changeHandler).appendTo(localSelectDiv);
|
||||
var localRadio = $('<input>',{class:"red-ui-diff-selectbox-input "+className+"-local",id:safeNodeId+"-local",type:'radio',value:"local",name:safeNodeId}).data('node-id',node.id).on("change", changeHandler).appendTo(localSelectDiv);
|
||||
var remoteSelectDiv = $('<label>',{class:"red-ui-diff-selectbox",for:safeNodeId+"-remote"}).on("click", function(e) { e.stopPropagation();}).appendTo(remoteDiv);
|
||||
var remoteRadio = $('<input>',{class:"red-ui-diff-selectbox-input",id:safeNodeId+"-remote",type:'radio',value:"remote",name:safeNodeId,class:className+"-remote"}).data('node-id',node.id).on("change", changeHandler).appendTo(remoteSelectDiv);
|
||||
var remoteRadio = $('<input>',{class:"red-ui-diff-selectbox-input "+className+"-remote",id:safeNodeId+"-remote",type:'radio',value:"remote",name:safeNodeId}).data('node-id',node.id).on("change", changeHandler).appendTo(remoteSelectDiv);
|
||||
if (state === 'local') {
|
||||
localRadio.prop('checked',true);
|
||||
} else if (state === 'remote') {
|
||||
|
@ -19,7 +19,6 @@
|
||||
*/
|
||||
RED.editor = (function() {
|
||||
|
||||
|
||||
var editStack = [];
|
||||
var editing_node = null;
|
||||
var editing_config_node = null;
|
||||
@ -203,6 +202,7 @@ RED.editor = (function() {
|
||||
function updateNodeProperties(node, outputMap) {
|
||||
node.resize = true;
|
||||
node.dirty = true;
|
||||
node.dirtyStatus = true;
|
||||
var removedLinks = [];
|
||||
if (node.ports) {
|
||||
if (outputMap) {
|
||||
@ -231,8 +231,12 @@ RED.editor = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
node.inputs = Math.min(1,Math.max(0,parseInt(node.inputs)));
|
||||
if (isNaN(node.inputs)) {
|
||||
node.inputs = 0;
|
||||
}
|
||||
if (node.inputs === 0) {
|
||||
removedLinks.concat(RED.nodes.filterLinks({target:node}));
|
||||
removedLinks = removedLinks.concat(RED.nodes.filterLinks({target:node}));
|
||||
}
|
||||
for (var l=0;l<removedLinks.length;l++) {
|
||||
RED.nodes.removeLink(removedLinks[l]);
|
||||
@ -486,8 +490,7 @@ RED.editor = (function() {
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
if (definition.credentials) {
|
||||
if (definition.credentials || /^subflow:/.test(definition.type)) {
|
||||
if (node.credentials) {
|
||||
populateCredentialsInputs(node, definition.credentials, node.credentials, prefix);
|
||||
completePrepare();
|
||||
@ -495,7 +498,9 @@ RED.editor = (function() {
|
||||
$.getJSON(getCredentialsURL(node.type, node.id), function (data) {
|
||||
node.credentials = data;
|
||||
node.credentials._ = $.extend(true,{},data);
|
||||
populateCredentialsInputs(node, definition.credentials, node.credentials, prefix);
|
||||
if (!/^subflow:/.test(definition.type)) {
|
||||
populateCredentialsInputs(node, definition.credentials, node.credentials, prefix);
|
||||
}
|
||||
completePrepare();
|
||||
});
|
||||
}
|
||||
@ -526,7 +531,7 @@ RED.editor = (function() {
|
||||
} else if (node.type.indexOf("subflow:")===0) {
|
||||
var subflow = RED.nodes.subflow(node.type.substring(8));
|
||||
label = RED._("subflow.editSubflowInstance",{name:RED.utils.sanitize(subflow.name)})
|
||||
} else {
|
||||
} else if (node._def !== undefined) {
|
||||
if (typeof node._def.paletteLabel !== "undefined") {
|
||||
try {
|
||||
label = RED.utils.sanitize((typeof node._def.paletteLabel === "function" ? node._def.paletteLabel.call(node._def) : node._def.paletteLabel)||"");
|
||||
@ -546,148 +551,7 @@ RED.editor = (function() {
|
||||
return label;
|
||||
}
|
||||
|
||||
function buildEnvForm(container, node) {
|
||||
var env_container = $('#node-input-env-container');
|
||||
env_container
|
||||
.css({
|
||||
'min-height':'150px',
|
||||
'min-width':'450px'
|
||||
})
|
||||
.editableList({
|
||||
addItem: function(container, i, opt) {
|
||||
var row = $('<div/>').appendTo(container);
|
||||
if (opt.parent) {
|
||||
$('<div/>', {
|
||||
class:"uneditable-input",
|
||||
style: "margin-left: 5px; width: calc(40% - 8px)",
|
||||
}).appendTo(row).text(opt.name);
|
||||
} else {
|
||||
$('<input/>', {
|
||||
class: "node-input-env-name",
|
||||
type: "text",
|
||||
style: "margin-left: 5px; width: calc(40% - 8px)",
|
||||
placeholder: RED._("common.label.name")
|
||||
}).attr("autocomplete","disable").appendTo(row).val(opt.name);
|
||||
}
|
||||
var valueField = $('<input/>',{
|
||||
class: "node-input-env-value",
|
||||
type: "text",
|
||||
style: "margin-left: 5px; width: calc(60% - 8px)"
|
||||
}).attr("autocomplete","disable").appendTo(row)
|
||||
|
||||
valueField.typedInput({default:'str',
|
||||
types:['str','num','bool','json','bin','env']
|
||||
});
|
||||
|
||||
valueField.typedInput('type', opt.parent?(opt.type||opt.parent.type):opt.type);
|
||||
valueField.typedInput('value', opt.parent?((opt.value !== undefined)?opt.value:opt.parent.value):opt.value);
|
||||
|
||||
var actionButton = $('<a/>',{href:"#",class:"red-ui-editableList-item-remove red-ui-button red-ui-button-small"}).appendTo(container);
|
||||
$('<i/>',{class:"fa "+(opt.parent?"fa-reply":"fa-remove")}).appendTo(actionButton);
|
||||
container.parent().addClass("red-ui-editableList-item-removable");
|
||||
if (opt.parent) {
|
||||
if ((opt.value !== undefined) && (opt.value !== opt.parent.value || opt.type !== opt.parent.type)) {
|
||||
actionButton.show();
|
||||
} else {
|
||||
actionButton.hide();
|
||||
}
|
||||
var restoreTip = RED.popover.tooltip(actionButton,RED._("subflow.env.restore"));
|
||||
valueField.on("change", function(evt) {
|
||||
var newType = valueField.typedInput('type');
|
||||
var newValue = valueField.typedInput('value');
|
||||
if (newType === opt.parent.type && newValue === opt.parent.value) {
|
||||
actionButton.hide();
|
||||
} else {
|
||||
actionButton.show();
|
||||
}
|
||||
})
|
||||
actionButton.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
restoreTip.close();
|
||||
valueField.typedInput('type', opt.parent.type);
|
||||
valueField.typedInput('value', opt.parent.value);
|
||||
})
|
||||
} else {
|
||||
var removeTip = RED.popover.tooltip(actionButton,RED._("subflow.env.remove"));
|
||||
actionButton.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
removeTip.close();
|
||||
container.parent().addClass("red-ui-editableList-item-deleting")
|
||||
container.fadeOut(300, function() {
|
||||
env_container.editableList('removeItem',opt);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
sortable: false,
|
||||
removable: false
|
||||
});
|
||||
var parentEnv = {};
|
||||
var envList = [];
|
||||
if (/^subflow:/.test(node.type)) {
|
||||
var subflowDef = RED.nodes.subflow(node.type.substring(8));
|
||||
if (subflowDef.env) {
|
||||
subflowDef.env.forEach(function(env) {
|
||||
var item = {
|
||||
name:env.name,
|
||||
parent: {
|
||||
type: env.type,
|
||||
value: env.value
|
||||
}
|
||||
}
|
||||
envList.push(item);
|
||||
parentEnv[env.name] = item;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (node.env) {
|
||||
for (var i = 0; i < node.env.length; i++) {
|
||||
var env = node.env[i];
|
||||
if (parentEnv.hasOwnProperty(env.name)) {
|
||||
parentEnv[env.name].type = env.type;
|
||||
parentEnv[env.name].value = env.value;
|
||||
} else {
|
||||
envList.push({
|
||||
name: env.name,
|
||||
type: env.type,
|
||||
value: env.value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
envList.forEach(function(env) {
|
||||
env_container.editableList('addItem', env);
|
||||
})
|
||||
}
|
||||
|
||||
function exportEnvList(list) {
|
||||
if (list) {
|
||||
var env = [];
|
||||
list.each(function(i) {
|
||||
var entry = $(this);
|
||||
var item = entry.data('data');
|
||||
var name = (item.parent?item.name:entry.find(".node-input-env-name").val()).trim();
|
||||
if (name !== "") {
|
||||
var valueInput = entry.find(".node-input-env-value");
|
||||
var value = valueInput.typedInput("value");
|
||||
var type = valueInput.typedInput("type");
|
||||
if (!item.parent || (item.parent.value !== value || item.parent.type !== type)) {
|
||||
var item = {
|
||||
name: name,
|
||||
type: type,
|
||||
value: value
|
||||
};
|
||||
env.push(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
return env;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function isSameEnv(env0, env1) {
|
||||
function isSameObj(env0, env1) {
|
||||
return (JSON.stringify(env0) === JSON.stringify(env1));
|
||||
}
|
||||
|
||||
@ -713,17 +577,21 @@ RED.editor = (function() {
|
||||
$(this).attr("data-i18n",keys.join(";"));
|
||||
});
|
||||
|
||||
if ((type === "subflow") || (type === "subflow-template")) {
|
||||
buildEnvForm(dialogForm, node);
|
||||
if (type === "subflow-template") {
|
||||
// This is the 'edit properties' dialog for a subflow template
|
||||
// TODO: this needs to happen later in the dialog open sequence
|
||||
// so that credentials can be loaded prior to building the form
|
||||
RED.subflow.buildEditForm(type,node);
|
||||
}
|
||||
|
||||
// Add dummy fields to prevent 'Enter' submitting the form in some
|
||||
// cases, and also prevent browser auto-fill of password
|
||||
// Add in reverse order as they are prepended...
|
||||
$('<input type="password" style="display: none;" />').prependTo(dialogForm);
|
||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||
// - the elements cannot be hidden otherwise Chrome will ignore them.
|
||||
// - the elements need to have id's that imply password/username
|
||||
$('<div style="position: absolute; top: -2000px;"><input id="red-ui-trap-password" type="password"/></div>').prependTo(dialogForm);
|
||||
$('<div style="position: absolute; top: -2000px;"><input id="red-ui-trap-username" type="text"/></div>').prependTo(dialogForm);
|
||||
dialogForm.on("submit", function(e) { e.preventDefault();});
|
||||
dialogForm.find('input').attr("autocomplete","disable");
|
||||
dialogForm.find('input').attr("autocomplete","off");
|
||||
return dialogForm;
|
||||
}
|
||||
|
||||
@ -736,10 +604,18 @@ RED.editor = (function() {
|
||||
var outputsDiv = $("#red-ui-editor-node-label-form-outputs");
|
||||
|
||||
var inputCount;
|
||||
if (node.type === 'subflow') {
|
||||
inputCount = node.in.length;
|
||||
var formInputs = $("#node-input-inputs").val();
|
||||
if (formInputs === undefined) {
|
||||
if (node.type === 'subflow') {
|
||||
inputCount = node.in.length;
|
||||
} else {
|
||||
inputCount = node.inputs || node._def.inputs || 0;
|
||||
}
|
||||
} else {
|
||||
inputCount = node.inputs || node._def.inputs || 0;
|
||||
inputCount = Math.min(1,Math.max(0,parseInt(formInputs)));
|
||||
if (isNaN(inputCount)) {
|
||||
inputCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var children = inputsDiv.children();
|
||||
@ -857,30 +733,8 @@ RED.editor = (function() {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function showIconPicker(container, node, iconPath, done) {
|
||||
var containerPos = container.offset();
|
||||
var pickerBackground = $('<div>').css({
|
||||
position: "absolute",top:0,bottom:0,left:0,right:0,zIndex:20
|
||||
}).appendTo("body");
|
||||
|
||||
var top = containerPos.top - 30;
|
||||
|
||||
if (top+280 > $( window ).height()) {
|
||||
top = $( window ).height() - 280;
|
||||
}
|
||||
var picker = $('<div class="red-ui-icon-picker">').css({
|
||||
top: top+"px",
|
||||
left: containerPos.left+"px",
|
||||
}).appendTo("#red-ui-editor");
|
||||
|
||||
var hide = function() {
|
||||
pickerBackground.remove();
|
||||
picker.remove();
|
||||
RED.keyboard.remove("escape");
|
||||
}
|
||||
RED.keyboard.add("*","escape",function(){hide()});
|
||||
pickerBackground.on("mousedown", hide);
|
||||
|
||||
function showIconPicker(container, backgroundColor, iconPath, faOnly, done) {
|
||||
var picker = $('<div class="red-ui-icon-picker">');
|
||||
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(picker);
|
||||
searchInput = $('<input type="text">').attr("placeholder",RED._("editor.searchIcons")).appendTo(searchDiv).searchBox({
|
||||
delay: 50,
|
||||
@ -908,46 +762,160 @@ RED.editor = (function() {
|
||||
var summary = $('<span>').appendTo(metaRow);
|
||||
var resetButton = $('<button type="button" class="red-ui-button red-ui-button-small">'+RED._("editor.useDefault")+'</button>').appendTo(metaRow).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
hide();
|
||||
iconPanel.hide();
|
||||
done(null);
|
||||
});
|
||||
var iconSets = RED.nodes.getIconSets();
|
||||
Object.keys(iconSets).forEach(function(moduleName) {
|
||||
var icons = iconSets[moduleName];
|
||||
if (icons.length > 0) {
|
||||
// selectIconModule.append($("<option></option>").val(moduleName).text(moduleName));
|
||||
var header = $('<div class="red-ui-icon-list-module"></div>').text(moduleName).appendTo(iconList);
|
||||
$('<i class="fa fa-cube"></i>').prependTo(header);
|
||||
icons.forEach(function(icon) {
|
||||
var iconDiv = $('<div>',{class:"red-ui-icon-list-icon"}).appendTo(iconList);
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconDiv);
|
||||
var colour = RED.utils.getNodeColor(node.type, node._def);
|
||||
var icon_url = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+icon;
|
||||
iconDiv.data('icon',icon_url);
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
if (!backgroundColor && faOnly) {
|
||||
iconList.addClass("red-ui-icon-list-dark");
|
||||
}
|
||||
setTimeout(function() {
|
||||
var iconSets = RED.nodes.getIconSets();
|
||||
Object.keys(iconSets).forEach(function(moduleName) {
|
||||
if (faOnly && (moduleName !== "font-awesome")) {
|
||||
return;
|
||||
}
|
||||
var icons = iconSets[moduleName];
|
||||
if (icons.length > 0) {
|
||||
// selectIconModule.append($("<option></option>").val(moduleName).text(moduleName));
|
||||
var header = $('<div class="red-ui-icon-list-module"></div>').text(moduleName).appendTo(iconList);
|
||||
$('<i class="fa fa-cube"></i>').prependTo(header);
|
||||
icons.forEach(function(icon) {
|
||||
var iconDiv = $('<div>',{class:"red-ui-icon-list-icon"}).appendTo(iconList);
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconDiv);
|
||||
var icon_url = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+icon;
|
||||
iconDiv.data('icon',icon_url);
|
||||
if (backgroundColor) {
|
||||
nodeDiv.css({
|
||||
'backgroundColor': backgroundColor
|
||||
});
|
||||
}
|
||||
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
|
||||
if (iconPath.module === moduleName && iconPath.file === icon) {
|
||||
iconDiv.addClass("selected");
|
||||
}
|
||||
iconDiv.on("mouseover", function() {
|
||||
summary.text(icon);
|
||||
if (iconPath.module === moduleName && iconPath.file === icon) {
|
||||
iconDiv.addClass("selected");
|
||||
}
|
||||
iconDiv.on("mouseover", function() {
|
||||
summary.text(icon);
|
||||
})
|
||||
iconDiv.on("mouseout", function() {
|
||||
summary.html(" ");
|
||||
})
|
||||
iconDiv.on("click", function() {
|
||||
iconPanel.hide();
|
||||
done(moduleName+"/"+icon);
|
||||
})
|
||||
})
|
||||
iconDiv.on("mouseout", function() {
|
||||
summary.html(" ");
|
||||
})
|
||||
iconDiv.on("click", function() {
|
||||
hide();
|
||||
done(moduleName+"/"+icon);
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
spinner.remove();
|
||||
},50);
|
||||
},300);
|
||||
var spinner = RED.utils.addSpinnerOverlay(iconList,true);
|
||||
var iconPanel = RED.popover.panel(picker);
|
||||
iconPanel.show({
|
||||
target: container
|
||||
})
|
||||
|
||||
|
||||
picker.slideDown(100);
|
||||
searchInput.trigger("focus");
|
||||
}
|
||||
|
||||
function createColorPicker(colorRow, color) {
|
||||
|
||||
var colorButton = $('<button type="button" class="red-ui-button red-ui-editor-node-appearance-button">').appendTo(colorRow);
|
||||
$('<i class="fa fa-caret-down"></i>').appendTo(colorButton);
|
||||
|
||||
var colorDisp = $('<div>',{class:"red-ui-search-result-node"}).appendTo(colorButton);
|
||||
|
||||
var selector = $("<input/>", {
|
||||
id: "red-ui-editor-node-color",
|
||||
type: "text",
|
||||
value: color
|
||||
}).css({
|
||||
marginLeft: "10px",
|
||||
width: "150px",
|
||||
}).appendTo(colorRow);
|
||||
|
||||
selector.on("change", function (e) {
|
||||
var color = selector.val();
|
||||
$(".red-ui-editor-node-appearance-button .red-ui-search-result-node").css({
|
||||
"background-color": color
|
||||
});
|
||||
});
|
||||
selector.trigger("change");
|
||||
colorButton.on("click", function (e) {
|
||||
var recommendedColors = [
|
||||
"#DDAA99",
|
||||
"#3FADB5", "#87A980", "#A6BBCF",
|
||||
"#AAAA66", "#C0C0C0", "#C0DEED",
|
||||
"#C7E9C0", "#D7D7A0", "#D8BFD8",
|
||||
"#DAC4B4", "#DEB887", "#DEBD5C",
|
||||
"#E2D96E", "#E6E0F8", "#E7E7AE",
|
||||
"#E9967A", "#F3B567", "#FDD0A2",
|
||||
"#FDF0C2", "#FFAAAA", "#FFCC66",
|
||||
"#FFF0F0", "#FFFFFF"
|
||||
].map(function(c) {
|
||||
var r = parseInt(c.substring(1, 3), 16) / 255;
|
||||
var g = parseInt(c.substring(3, 5), 16) / 255;
|
||||
var b = parseInt(c.substring(5, 7), 16) / 255;
|
||||
return {
|
||||
hex: c,
|
||||
r: r,
|
||||
g: g,
|
||||
b: b,
|
||||
l: 0.3 * r + 0.59 * g + 0.11 * b
|
||||
}
|
||||
});
|
||||
// Sort by luminosity.
|
||||
recommendedColors.sort(function (a, b) {
|
||||
return a.l - b.l;
|
||||
});
|
||||
|
||||
var numColors = recommendedColors.length;
|
||||
var width = 30;
|
||||
var height = 30;
|
||||
var margin = 2;
|
||||
var perRow = 6;
|
||||
var picker = $("<div/>", {
|
||||
class: "red-ui-color-picker"
|
||||
}).css({
|
||||
width: ((width+margin+margin)*perRow)+"px",
|
||||
height: Math.ceil(numColors/perRow)*(height+margin+margin)+"+px"
|
||||
});
|
||||
var count = 0;
|
||||
var row = null;
|
||||
recommendedColors.forEach(function (col) {
|
||||
if ((count % perRow) == 0) {
|
||||
row = $("<div/>").appendTo(picker);
|
||||
}
|
||||
var button = $("<button/>", {
|
||||
}).css({
|
||||
width: width+"px",
|
||||
height: height+"px",
|
||||
margin: margin+"px",
|
||||
backgroundColor: col.hex,
|
||||
"border-style": "solid",
|
||||
"border-width": "1px",
|
||||
"border-color": col.luma<0.92?col.hex:'#ccc'
|
||||
}).appendTo(row);
|
||||
button.on("click", function (e) {
|
||||
e.preventDefault();
|
||||
colorPanel.hide();
|
||||
selector.val(col.hex);
|
||||
selector.trigger("change");
|
||||
});
|
||||
count++;
|
||||
});
|
||||
var colorPanel = RED.popover.panel(picker);
|
||||
colorPanel.show({
|
||||
target: colorButton
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function buildAppearanceForm(container,node) {
|
||||
var dialogForm = $('<form class="dialog-form form-horizontal" autocomplete="off"></form>').appendTo(container);
|
||||
|
||||
@ -1026,13 +994,24 @@ RED.editor = (function() {
|
||||
}
|
||||
$("#node-input-show-label").prop("checked",node.l).trigger("change");
|
||||
|
||||
if (node.type === "subflow") {
|
||||
// subflow template can select its color
|
||||
var color = node.color ? node.color : "#DDAA99";
|
||||
var colorRow = $("<div/>", {
|
||||
class: "form-row"
|
||||
}).appendTo(dialogForm);
|
||||
$("<label/>").text(RED._("editor.color")).appendTo(colorRow);
|
||||
createColorPicker(colorRow, color);
|
||||
}
|
||||
|
||||
|
||||
// If a node has icon property in defaults, the icon of the node cannot be modified. (e.g, ui_button node in dashboard)
|
||||
if ((!node._def.defaults || !node._def.defaults.hasOwnProperty("icon"))) {
|
||||
var iconRow = $('<div class="form-row"></div>').appendTo(dialogForm);
|
||||
$('<label data-i18n="editor.settingIcon">').appendTo(iconRow);
|
||||
|
||||
var iconButton = $('<button type="button" class="red-ui-button" id="red-ui-editor-node-icon-button">').appendTo(iconRow);
|
||||
|
||||
var iconButton = $('<button type="button" class="red-ui-button red-ui-editor-node-appearance-button">').appendTo(iconRow);
|
||||
$('<i class="fa fa-caret-down"></i>').appendTo(iconButton);
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconButton);
|
||||
var colour = RED.utils.getNodeColor(node.type, node._def);
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,node);
|
||||
@ -1043,21 +1022,30 @@ RED.editor = (function() {
|
||||
iconButton.on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var iconPath;
|
||||
var icon = $("#red-ui-editor-node-icon").text()||"";
|
||||
var icon = $("#red-ui-editor-node-icon").val()||"";
|
||||
if (icon) {
|
||||
iconPath = RED.utils.separateIconPath(icon);
|
||||
} else {
|
||||
iconPath = RED.utils.getDefaultNodeIcon(node._def, node);
|
||||
}
|
||||
showIconPicker(iconRow,node,iconPath,function(newIcon) {
|
||||
$("#red-ui-editor-node-icon").text(newIcon||"");
|
||||
var backgroundColor = RED.utils.getNodeColor(node.type, node._def);
|
||||
if (node.type === "subflow") {
|
||||
backgroundColor = $("#red-ui-editor-node-color").val();
|
||||
}
|
||||
showIconPicker(iconButton,backgroundColor,iconPath,false,function(newIcon) {
|
||||
$("#red-ui-editor-node-icon").val(newIcon||"");
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,{type:node.type,icon:newIcon});
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
});
|
||||
});
|
||||
$('<div id="red-ui-editor-node-icon">').text(node.icon).appendTo(iconButton);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
$('<div class="form-row"><span data-i18n="editor.portLabels"></span></div>').appendTo(dialogForm);
|
||||
|
||||
var inputCount = node.inputs || node._def.inputs || 0;
|
||||
@ -1093,6 +1081,7 @@ RED.editor = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateLabels(editing_node, changes, outputMap) {
|
||||
var inputLabels = $("#red-ui-editor-node-label-form-inputs").children().find("input");
|
||||
var outputLabels = $("#red-ui-editor-node-label-form-outputs").children().find("input");
|
||||
@ -1336,11 +1325,13 @@ RED.editor = (function() {
|
||||
newValue = parseInt(newValue);
|
||||
}
|
||||
}
|
||||
if (editing_node._def.defaults[d].type) {
|
||||
if (newValue == "_ADD_") {
|
||||
newValue = "";
|
||||
}
|
||||
}
|
||||
if (editing_node[d] != newValue) {
|
||||
if (editing_node._def.defaults[d].type) {
|
||||
if (newValue == "_ADD_") {
|
||||
newValue = "";
|
||||
}
|
||||
// Change to a related config node
|
||||
var configNode = RED.nodes.node(editing_node[d]);
|
||||
if (configNode) {
|
||||
@ -1380,7 +1371,7 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
if (!editing_node._def.defaults || !editing_node._def.defaults.hasOwnProperty("icon")) {
|
||||
var icon = $("#red-ui-editor-node-icon").text()||""
|
||||
var icon = $("#red-ui-editor-node-icon").val()||""
|
||||
if (!isDefaultIcon) {
|
||||
if (icon !== editing_node.icon) {
|
||||
changes.icon = editing_node.icon;
|
||||
@ -1483,13 +1474,26 @@ RED.editor = (function() {
|
||||
|
||||
if (type === "subflow") {
|
||||
var old_env = editing_node.env;
|
||||
var new_env = exportEnvList($("#node-input-env-container").editableList("items"));
|
||||
if (!isSameEnv(old_env, new_env)) {
|
||||
var new_env = RED.subflow.exportSubflowInstanceEnv(editing_node);
|
||||
if (new_env && new_env.length > 0) {
|
||||
new_env.forEach(function(prop) {
|
||||
if (prop.type === "cred") {
|
||||
editing_node.credentials = editing_node.credentials || {_:{}};
|
||||
editing_node.credentials[prop.name] = prop.value;
|
||||
editing_node.credentials['has_'+prop.name] = (prop.value !== "");
|
||||
if (prop.value !== '__PWRD__') {
|
||||
changed = true;
|
||||
}
|
||||
delete prop.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!isSameObj(old_env, new_env)) {
|
||||
editing_node.env = new_env;
|
||||
changes.env = editing_node.env;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
var wasChanged = editing_node.changed;
|
||||
@ -1607,6 +1611,20 @@ RED.editor = (function() {
|
||||
buildEditForm(nodePropertiesTab.content,"dialog-form",type,ns,node);
|
||||
editorTabs.addTab(nodePropertiesTab);
|
||||
|
||||
if (/^subflow:/.test(node.type)) {
|
||||
var subflowPropertiesTab = {
|
||||
id: "editor-subflow-envProperties",
|
||||
label: RED._("editor-tab.envProperties"),
|
||||
name: RED._("editor-tab.envProperties"),
|
||||
content: $('<div>', {id:"editor-subflow-envProperties-content",class:"red-ui-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-list"
|
||||
};
|
||||
editorTabs.addTab(subflowPropertiesTab);
|
||||
// This tab is populated by the oneditprepare function of this
|
||||
// subflow. That ensures it is done *after* any credentials
|
||||
// have been loaded for the instance.
|
||||
}
|
||||
|
||||
if (!node._def.defaults || !node._def.defaults.hasOwnProperty('info')) {
|
||||
var descriptionTab = {
|
||||
id: "editor-tab-description",
|
||||
@ -1768,7 +1786,8 @@ RED.editor = (function() {
|
||||
RED.tray.resize();
|
||||
}
|
||||
},
|
||||
collapsible: true
|
||||
collapsible: true,
|
||||
menu: false
|
||||
});
|
||||
|
||||
var nodePropertiesTab = {
|
||||
@ -1875,7 +1894,6 @@ RED.editor = (function() {
|
||||
var configId = editing_config_node.id;
|
||||
var configAdding = adding;
|
||||
var configTypeDef = RED.nodes.getType(configType);
|
||||
|
||||
if (configTypeDef.oneditcancel) {
|
||||
// TODO: what to pass as this to call
|
||||
if (configTypeDef.oneditcancel) {
|
||||
@ -2212,7 +2230,7 @@ RED.editor = (function() {
|
||||
if (updateLabels(editing_node, changes, null)) {
|
||||
changed = true;
|
||||
}
|
||||
var icon = $("#red-ui-editor-node-icon").text()||"";
|
||||
var icon = $("#red-ui-editor-node-icon").val()||"";
|
||||
if ((editing_node.icon === undefined && icon !== "node-red/subflow.svg") ||
|
||||
(editing_node.icon !== undefined && editing_node.icon !== icon)) {
|
||||
changes.icon = editing_node.icon;
|
||||
@ -2234,6 +2252,44 @@ RED.editor = (function() {
|
||||
editing_node.category = newCategory;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
var oldColor = editing_node.color;
|
||||
var newColor = $("#red-ui-editor-node-color").val();
|
||||
if (oldColor !== newColor) {
|
||||
editing_node.color = newColor;
|
||||
changes.color = newColor;
|
||||
changed = true;
|
||||
RED.utils.clearNodeColorCache();
|
||||
if (editing_node.type === "subflow") {
|
||||
var nodeDefinition = RED.nodes.getType(
|
||||
"subflow:" + editing_node.id
|
||||
);
|
||||
nodeDefinition["color"] = newColor;
|
||||
}
|
||||
}
|
||||
|
||||
var old_env = editing_node.env;
|
||||
var new_env = RED.subflow.exportSubflowTemplateEnv($("#node-input-env-container").editableList("items"));
|
||||
|
||||
if (new_env && new_env.length > 0) {
|
||||
new_env.forEach(function(prop) {
|
||||
if (prop.type === "cred") {
|
||||
editing_node.credentials = editing_node.credentials || {_:{}};
|
||||
editing_node.credentials[prop.name] = prop.value;
|
||||
editing_node.credentials['has_'+prop.name] = (prop.value !== "");
|
||||
if (prop.value !== '__PWRD__') {
|
||||
changed = true;
|
||||
}
|
||||
delete prop.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!isSameObj(old_env, new_env)) {
|
||||
editing_node.env = new_env;
|
||||
changes.env = editing_node.env;
|
||||
changed = true;
|
||||
}
|
||||
RED.palette.refresh();
|
||||
|
||||
if (changed) {
|
||||
@ -2247,6 +2303,7 @@ RED.editor = (function() {
|
||||
id:n.id,
|
||||
changed:n.changed
|
||||
})
|
||||
n._def.color = editing_node.color;
|
||||
n.changed = true;
|
||||
n.dirty = true;
|
||||
updateNodeProperties(n);
|
||||
@ -2274,17 +2331,20 @@ RED.editor = (function() {
|
||||
],
|
||||
resize: function(size) {
|
||||
$(".red-ui-tray-content").height(size.height - 50);
|
||||
// var form = $(".red-ui-tray-content form").height(size.height - 50 - 40);
|
||||
var rows = $("#dialog-form>div:not(.node-input-env-container-row)");
|
||||
var height = size.height;
|
||||
for (var i=0; i<rows.size(); i++) {
|
||||
height -= $(rows[i]).outerHeight(true);
|
||||
var envContainer = $("#node-input-env-container");
|
||||
if (envContainer.length) {
|
||||
// var form = $(".red-ui-tray-content form").height(size.height - 50 - 40);
|
||||
var rows = $("#dialog-form>div:not(#subflow-env-tabs-content)");
|
||||
var height = size.height;
|
||||
for (var i=0; i<rows.size(); i++) {
|
||||
height -= $(rows[i]).outerHeight(true);
|
||||
}
|
||||
// var editorRow = $("#dialog-form>div.node-input-env-container-row");
|
||||
// height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
||||
$("#node-input-env-container").editableList('height',height-95);
|
||||
}
|
||||
var editorRow = $("#dialog-form>div.node-input-env-container-row");
|
||||
height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
|
||||
$("#node-input-env-container").editableList('height',height-60);
|
||||
},
|
||||
open: function(tray) {
|
||||
open: function(tray, done) {
|
||||
var trayFooter = tray.find(".red-ui-tray-footer");
|
||||
var trayFooterLeft = $("<div/>", {
|
||||
class: "red-ui-tray-footer-left"
|
||||
@ -2324,7 +2384,8 @@ RED.editor = (function() {
|
||||
RED.tray.resize();
|
||||
}
|
||||
},
|
||||
collapsible: true
|
||||
collapsible: true,
|
||||
menu: false
|
||||
});
|
||||
|
||||
var nodePropertiesTab = {
|
||||
@ -2334,7 +2395,6 @@ RED.editor = (function() {
|
||||
content: $('<div>', {class:"red-ui-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-cog"
|
||||
};
|
||||
buildEditForm(nodePropertiesTab.content,"dialog-form","subflow-template", undefined, editing_node);
|
||||
editorTabs.addTab(nodePropertiesTab);
|
||||
|
||||
var descriptionTab = {
|
||||
@ -2363,11 +2423,18 @@ RED.editor = (function() {
|
||||
buildAppearanceForm(appearanceTab.content,editing_node);
|
||||
editorTabs.addTab(appearanceTab);
|
||||
|
||||
$("#subflow-input-name").val(subflow.name);
|
||||
RED.text.bidi.prepareInput($("#subflow-input-name"));
|
||||
$.getJSON(getCredentialsURL("subflow", subflow.id), function (data) {
|
||||
subflow.credentials = data;
|
||||
subflow.credentials._ = $.extend(true,{},data);
|
||||
|
||||
trayBody.i18n();
|
||||
finishedBuilding = true;
|
||||
buildEditForm(nodePropertiesTab.content,"dialog-form","subflow-template", undefined, editing_node);
|
||||
$("#subflow-input-name").val(subflow.name);
|
||||
RED.text.bidi.prepareInput($("#subflow-input-name"));
|
||||
|
||||
trayBody.i18n();
|
||||
finishedBuilding = true;
|
||||
done();
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
if (RED.view.state() != RED.state.IMPORT_DRAGGING) {
|
||||
@ -2459,7 +2526,7 @@ RED.editor = (function() {
|
||||
editor.toolbar = customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
|
||||
if (options.expandable !== false) {
|
||||
var expandButton = $('<button type="button" class="red-ui-button" style="float: right;"><i class="fa fa-expand"></i></button>').appendTo(editor.toolbar);
|
||||
|
||||
RED.popover.tooltip(expandButton, RED._("markdownEditor.expand"));
|
||||
expandButton.on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var value = editor.getValue();
|
||||
@ -2486,6 +2553,7 @@ RED.editor = (function() {
|
||||
content: RED._("markdownEditor.format"),
|
||||
autoClose: 50
|
||||
});
|
||||
session.setUseWrapMode(true);
|
||||
}
|
||||
return editor;
|
||||
}
|
||||
@ -2518,6 +2586,8 @@ RED.editor = (function() {
|
||||
validateNode: validateNode,
|
||||
updateNodeProperties: updateNodeProperties, // TODO: only exposed for edit-undo
|
||||
|
||||
showIconPicker:showIconPicker,
|
||||
|
||||
/**
|
||||
* Show a type editor.
|
||||
* @param {string} type - the type to display
|
||||
@ -2530,7 +2600,7 @@ RED.editor = (function() {
|
||||
/**
|
||||
* Register a type editor.
|
||||
* @param {string} type - the type name
|
||||
* @param {object} options - the editor definition
|
||||
* @param {object} definition - the editor definition
|
||||
* @function
|
||||
* @memberof RED.editor
|
||||
*/
|
||||
|
@ -207,6 +207,7 @@
|
||||
}
|
||||
expressionEditor.getSession().setValue(v||"",-1);
|
||||
});
|
||||
funcSelect.change();
|
||||
|
||||
var tabs = RED.tabs.create({
|
||||
element: $("#red-ui-editor-type-expression-tabs"),
|
||||
|
@ -106,7 +106,7 @@
|
||||
options.push({id:"red-ui-editor-type-json-menu-duplicate", icon:"fa fa-copy", label:RED._("jsonEditor.duplicate"),onselect:function(){
|
||||
var newKey = item.key;
|
||||
if (item.parent.type === 'array') {
|
||||
newKey = parent.children.length;
|
||||
newKey = item.parent.children.length;
|
||||
} else {
|
||||
var m = /^(.*?)(-(\d+))?$/.exec(newKey);
|
||||
var usedKeys = {};
|
||||
@ -141,6 +141,7 @@
|
||||
})
|
||||
}});
|
||||
options.push({id:"red-ui-editor-type-json-menu-collapse-children",icon:"fa fa-angle-double-up", label:RED._('jsonEditor.collapseItems'),onselect:function(){
|
||||
item.treeList.collapse();
|
||||
item.children.forEach(function(child) {
|
||||
child.treeList.collapse();
|
||||
})
|
||||
@ -300,9 +301,9 @@
|
||||
var val = $('<input type="text" class="red-ui-editor-type-json-editor-value">').css({width:w+"px"}).val(""+valValue).insertAfter(valueLabel).typedInput({
|
||||
types:[
|
||||
'str','num','bool',
|
||||
{value:"null",label:"null",hasValue:false},
|
||||
{value:"array",label:"array",hasValue:false},
|
||||
{value:"object",label:"object",hasValue:false}
|
||||
{value:"null",label:RED._("common.type.null"),hasValue:false},
|
||||
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"},
|
||||
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}
|
||||
],
|
||||
default: valType
|
||||
});
|
||||
@ -326,10 +327,10 @@
|
||||
item.value = valValue;
|
||||
var valClass;
|
||||
switch(valType) {
|
||||
case 'str': item.children && (orphanedChildren = item.children); item.treeList.makeLeaf(true); item.type = "string"; valClass = "red-ui-debug-msg-type-string"; valValue = '"'+valValue+'"'; break;
|
||||
case 'num': item.children && (orphanedChildren = item.children); item.treeList.makeLeaf(true); item.type = "number"; valClass = "red-ui-debug-msg-type-number"; break;
|
||||
case 'bool': item.children && (orphanedChildren = item.children); item.treeList.makeLeaf(true); item.type = "boolean"; valClass = "red-ui-debug-msg-type-other"; item.value = (valValue === "true"); break;
|
||||
case 'null': item.children && (orphanedChildren = item.children); item.treeList.makeLeaf(true); item.type = "null"; valClass = "red-ui-debug-msg-type-null"; item.value = valValue = "null"; break;
|
||||
case 'str': if (item.children) { orphanedChildren = item.children } item.treeList.makeLeaf(true); item.type = "string"; valClass = "red-ui-debug-msg-type-string"; valValue = '"'+valValue+'"'; break;
|
||||
case 'num': if (item.children) { orphanedChildren = item.children } item.treeList.makeLeaf(true); item.type = "number"; valClass = "red-ui-debug-msg-type-number"; break;
|
||||
case 'bool': if (item.children) { orphanedChildren = item.children } item.treeList.makeLeaf(true); item.type = "boolean"; valClass = "red-ui-debug-msg-type-other"; item.value = (valValue === "true"); break;
|
||||
case 'null': if (item.children) { orphanedChildren = item.children } item.treeList.makeLeaf(true); item.type = "null"; valClass = "red-ui-debug-msg-type-null"; item.value = valValue = "null"; break;
|
||||
case 'object':
|
||||
item.treeList.makeParent(orphanedChildren);
|
||||
item.type = "object";
|
||||
@ -484,7 +485,7 @@
|
||||
} else if (activeTab === "json-raw") {
|
||||
result = expressionEditor.getValue();
|
||||
}
|
||||
onComplete && onComplete(result);
|
||||
if (onComplete) { onComplete(result) }
|
||||
RED.tray.close();
|
||||
}
|
||||
}
|
||||
@ -576,7 +577,7 @@
|
||||
} catch(err) {
|
||||
rootNode = null;
|
||||
list.treeList('data',[{
|
||||
label: "Invalid JSON: "+err.toString()
|
||||
label: RED._("jsonEditor.error.invalidJSON")+err.toString()
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
@ -32,13 +32,13 @@
|
||||
'<button type="button" class="red-ui-button" data-style="bq"><i class="fa fa-quote-left"></i></button>'+
|
||||
'<button type="button" class="red-ui-button" data-style="hr"><i class="fa fa-minus"></i></button>'+
|
||||
'<button type="button" class="red-ui-button" data-style="link"><i class="fa fa-link"></i></button>'+
|
||||
'</span>'
|
||||
'</span>'+
|
||||
'</div>';
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_markdown">'+
|
||||
'<div id="red-ui-editor-type-markdown-panels">'+
|
||||
'<div id="red-ui-editor-type-markdown-panel-editor" class="red-ui-panel">'+
|
||||
'<div style="height: 100%; margin: auto; max-width: 1000px;">'+
|
||||
'<div style="height: 100%; margin: auto;">'+
|
||||
'<div id="red-ui-editor-type-markdown-toolbar"></div>'+
|
||||
'<div class="node-text-editor" style="height: 100%" id="red-ui-editor-type-markdown"></div>'+
|
||||
'</div>'+
|
||||
|
@ -75,13 +75,16 @@ RED.palette.editor = (function() {
|
||||
});
|
||||
})
|
||||
}
|
||||
function installNodeModule(id,version,callback) {
|
||||
function installNodeModule(id,version,url,callback) {
|
||||
var requestBody = {
|
||||
module: id
|
||||
};
|
||||
if (version) {
|
||||
requestBody.version = version;
|
||||
}
|
||||
if (url) {
|
||||
requestBody.url = url;
|
||||
}
|
||||
$.ajax({
|
||||
url:"nodes",
|
||||
type: "POST",
|
||||
@ -622,7 +625,7 @@ RED.palette.editor = (function() {
|
||||
if ($(this).hasClass('disabled')) {
|
||||
return;
|
||||
}
|
||||
update(entry,loadedIndex[entry.name].version,container,function(err){});
|
||||
update(entry,loadedIndex[entry.name].version,loadedIndex[entry.name].pkg_url,container,function(err){});
|
||||
})
|
||||
|
||||
|
||||
@ -788,7 +791,7 @@ RED.palette.editor = (function() {
|
||||
initInstallTab();
|
||||
})
|
||||
|
||||
packageList = $('<ol>',{style:"position: absolute;top: 78px;bottom: 0;left: 0;right: 0px;"}).appendTo(installTab).editableList({
|
||||
packageList = $('<ol>',{style:"position: absolute;top: 79px;bottom: 0;left: 0;right: 0px;"}).appendTo(installTab).editableList({
|
||||
addButton: false,
|
||||
scrollOnAdd: false,
|
||||
addItem: function(container,i,object) {
|
||||
@ -872,7 +875,7 @@ RED.palette.editor = (function() {
|
||||
|
||||
$('<div id="red-ui-palette-module-install-shade" class="red-ui-palette-module-shade hide"><div class="red-ui-palette-module-shade-status"></div><img src="red/images/spin.svg" class="red-ui-palette-spinner"/></div>').appendTo(installTab);
|
||||
}
|
||||
function update(entry,version,container,done) {
|
||||
function update(entry,version,url,container,done) {
|
||||
if (RED.settings.theme('palette.editable') === false) {
|
||||
done(new Error('Palette not editable'));
|
||||
return;
|
||||
@ -898,7 +901,7 @@ RED.palette.editor = (function() {
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+entry.name+" "+version);
|
||||
installNodeModule(entry.name,version,function(xhr) {
|
||||
installNodeModule(entry.name,version,url,function(xhr) {
|
||||
spinner.remove();
|
||||
if (xhr) {
|
||||
if (xhr.responseJSON) {
|
||||
@ -1023,7 +1026,7 @@ RED.palette.editor = (function() {
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+entry.id+" "+entry.version);
|
||||
installNodeModule(entry.id,entry.version,function(xhr) {
|
||||
installNodeModule(entry.id,entry.version,entry.pkg_url,function(xhr) {
|
||||
spinner.remove();
|
||||
if (xhr) {
|
||||
if (xhr.responseJSON) {
|
||||
|
@ -17,7 +17,20 @@
|
||||
RED.palette = (function() {
|
||||
|
||||
var exclusion = ['config','unknown','deprecated'];
|
||||
var coreCategories = ['subflows', 'input', 'output', 'function', 'social', 'mobile', 'storage', 'analysis', 'advanced'];
|
||||
var coreCategories = [
|
||||
'subflows',
|
||||
'common',
|
||||
'function',
|
||||
'network',
|
||||
'input',
|
||||
'output',
|
||||
'sequence',
|
||||
'parser',
|
||||
'storage',
|
||||
'analysis',
|
||||
'social',
|
||||
'advanced'
|
||||
];
|
||||
|
||||
var categoryContainers = {};
|
||||
var sidebarControls;
|
||||
@ -37,6 +50,7 @@ RED.palette = (function() {
|
||||
var catDiv = $('<div id="red-ui-palette-container-'+category+'" class="red-ui-palette-category hide">'+
|
||||
'<div id="red-ui-palette-header-'+category+'" class="red-ui-palette-header"><i class="expanded fa fa-angle-down"></i><span>'+label+'</span></div>'+
|
||||
'<div class="red-ui-palette-content" id="red-ui-palette-base-category-'+category+'">'+
|
||||
'<div id="red-ui-palette-'+category+'"></div>'+
|
||||
'<div id="red-ui-palette-'+category+'-input"></div>'+
|
||||
'<div id="red-ui-palette-'+category+'-output"></div>'+
|
||||
'<div id="red-ui-palette-'+category+'-function"></div>'+
|
||||
@ -78,24 +92,45 @@ RED.palette = (function() {
|
||||
var lineHeight = 20;
|
||||
var portHeight = 10;
|
||||
|
||||
el.attr("data-palette-label",label);
|
||||
|
||||
label = RED.utils.sanitize(label);
|
||||
|
||||
|
||||
var words = label.split(/[ -]/);
|
||||
|
||||
var displayLines = [];
|
||||
|
||||
var currentLine = words[0];
|
||||
var currentLineWidth = RED.view.calculateTextWidth(currentLine, "red-ui-palette-label", 0);
|
||||
|
||||
for (var i=1;i<words.length;i++) {
|
||||
var newWidth = RED.view.calculateTextWidth(currentLine+" "+words[i], "red-ui-palette-label", 0);
|
||||
var currentLine = "";
|
||||
for (var i=0;i<words.length;i++) {
|
||||
var word = words[i];
|
||||
var sep = (i == 0) ? "" : " ";
|
||||
var newWidth = RED.view.calculateTextWidth(currentLine+sep+word, "red-ui-palette-label", 0);
|
||||
if (newWidth < nodeWidth) {
|
||||
currentLine += " "+words[i];
|
||||
currentLineWidth = newWidth;
|
||||
currentLine += sep +word;
|
||||
} else {
|
||||
displayLines.push(currentLine);
|
||||
currentLine = words[i];
|
||||
currentLineWidth = RED.view.calculateTextWidth(currentLine, "red-ui-palette-label", 0);
|
||||
if (i > 0) {
|
||||
displayLines.push(currentLine);
|
||||
}
|
||||
while (true) {
|
||||
var wordWidth = RED.view.calculateTextWidth(word, "red-ui-palette-label", 0);
|
||||
if (wordWidth >= nodeWidth) {
|
||||
// break word if too wide
|
||||
for(var j = word.length; j > 0; j--) {
|
||||
var s = word.substring(0, j);
|
||||
var width = RED.view.calculateTextWidth(s, "red-ui-palette-label", 0);
|
||||
if (width < nodeWidth) {
|
||||
displayLines.push(s);
|
||||
word = word.substring(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
currentLine = word;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
displayLines.push(currentLine);
|
||||
@ -152,20 +187,25 @@ RED.palette = (function() {
|
||||
function getPaletteNode(type) {
|
||||
return $(".red-ui-palette-node[data-palette-type='"+type+"']");
|
||||
}
|
||||
|
||||
|
||||
function escapeCategory(category) {
|
||||
return category.replace(/[ /.]/g,"_");
|
||||
}
|
||||
function addNodeType(nt,def) {
|
||||
if (getPaletteNode(nt).length) {
|
||||
return;
|
||||
}
|
||||
if (exclusion.indexOf(def.category)===-1) {
|
||||
var nodeCategory = def.category;
|
||||
|
||||
var originalCategory = def.category;
|
||||
var category = def.category.replace(/ /g,"_");
|
||||
if (exclusion.indexOf(nodeCategory)===-1) {
|
||||
|
||||
var originalCategory = nodeCategory;
|
||||
var category = escapeCategory(nodeCategory);
|
||||
var rootCategory = category.split("-")[0];
|
||||
|
||||
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
|
||||
|
||||
var label = /^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1];
|
||||
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)||"";
|
||||
@ -175,16 +215,14 @@ RED.palette = (function() {
|
||||
}
|
||||
|
||||
$('<div/>', {
|
||||
class: "red-ui-palette-label"
|
||||
+ (((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-label-right" : "")
|
||||
class: "red-ui-palette-label"+(((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-label-right" : "")
|
||||
}).appendTo(d);
|
||||
|
||||
|
||||
if (def.icon) {
|
||||
var icon_url = RED.utils.getNodeIcon(def);
|
||||
var iconContainer = $('<div/>', {
|
||||
class: "red-ui-palette-icon-container"
|
||||
+ (((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-icon-container-right" : "")
|
||||
class: "red-ui-palette-icon-container"+(((!def.align && def.inputs !== 0 && def.outputs === 0) || "right" === def.align) ? " red-ui-palette-icon-container-right" : "")
|
||||
}).appendTo(d);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
}
|
||||
@ -203,7 +241,7 @@ RED.palette = (function() {
|
||||
d.append(portIn);
|
||||
}
|
||||
|
||||
createCategory(def.category,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id);
|
||||
createCategory(nodeCategory,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id);
|
||||
|
||||
$("#red-ui-palette-"+category).append(d);
|
||||
|
||||
@ -241,7 +279,6 @@ RED.palette = (function() {
|
||||
RED.sidebar.info.set(helpText,RED._("sidebar.info.nodeHelp"));
|
||||
});
|
||||
var chart = $("#red-ui-workspace-chart");
|
||||
var chartOffset = chart.offset();
|
||||
var chartSVG = $("#red-ui-workspace-chart>svg").get(0);
|
||||
var activeSpliceLink;
|
||||
var mouseX;
|
||||
@ -262,11 +299,12 @@ RED.palette = (function() {
|
||||
},
|
||||
stop: function() { d3.select('.red-ui-flow-link-splice').classed('red-ui-flow-link-splice',false); if (spliceTimer) { clearTimeout(spliceTimer); spliceTimer = null;}},
|
||||
drag: function(e,ui) {
|
||||
ui.originalPosition.left = $('#' + e.target.id).offset().left;
|
||||
var paletteNode = getPaletteNode(nt);
|
||||
ui.originalPosition.left = paletteNode.offset().left;
|
||||
|
||||
if (def.inputs > 0 && def.outputs > 0) {
|
||||
mouseX = ui.position.left-paletteWidth+(ui.helper.width()/2) - chartOffset.left + chart.scrollLeft();
|
||||
mouseY = ui.position.top-paletteTop+(ui.helper.height()/2) - chartOffset.top + chart.scrollTop();
|
||||
mouseX = ui.position.left - paletteWidth + (ui.helper.width()/2) + chart.scrollLeft();
|
||||
mouseY = ui.position.top - paletteTop + (ui.helper.height()/2) + chart.scrollTop();
|
||||
if (!spliceTimer) {
|
||||
spliceTimer = setTimeout(function() {
|
||||
var nodes = [];
|
||||
@ -382,14 +420,10 @@ RED.palette = (function() {
|
||||
var portOutput = paletteNode.find(".red-ui-palette-port-output");
|
||||
|
||||
var paletteLabel = paletteNode.find(".red-ui-palette-label");
|
||||
paletteLabel.attr("class","red-ui-palette-label"
|
||||
+ (((!sf._def.align && sf.in.length !== 0 && sf.out.length === 0) || "right" === sf._def.align) ? " red-ui-palette-label-right" : "")
|
||||
);
|
||||
paletteLabel.attr("class","red-ui-palette-label" + (((!sf._def.align && sf.in.length !== 0 && sf.out.length === 0) || "right" === sf._def.align) ? " red-ui-palette-label-right" : ""));
|
||||
|
||||
var paletteIconContainer = paletteNode.find(".red-ui-palette-icon-container");
|
||||
paletteIconContainer.attr("class","red-ui-palette-icon-container"
|
||||
+ (((!sf._def.align && sf.in.length !== 0 && sf.out.length === 0) || "right" === sf._def.align) ? " red-ui-palette-icon-container-right" : "")
|
||||
);
|
||||
paletteIconContainer.attr("class","red-ui-palette-icon-container" + (((!sf._def.align && sf.in.length !== 0 && sf.out.length === 0) || "right" === sf._def.align) ? " red-ui-palette-icon-container-right" : ""));
|
||||
|
||||
if (portInput.length === 0 && sf.in.length > 0) {
|
||||
var portIn = document.createElement("div");
|
||||
@ -412,11 +446,11 @@ RED.palette = (function() {
|
||||
var currentCategory = paletteNode.data('category');
|
||||
var newCategory = (sf.category||"subflows");
|
||||
if (currentCategory !== newCategory) {
|
||||
var category = newCategory.replace(/ /g,"_");
|
||||
var category = escapeCategory(newCategory);
|
||||
createCategory(newCategory,category,category,"node-red");
|
||||
|
||||
var currentCategoryNode = paletteNode.closest(".red-ui-palette-category");
|
||||
var newCategoryNode = $("#palette-"+category);
|
||||
var newCategoryNode = $("#red-ui-palette-"+category);
|
||||
newCategoryNode.append(paletteNode);
|
||||
if (newCategoryNode.find(".red-ui-palette-node").length === 1) {
|
||||
categoryContainers[category].open();
|
||||
@ -429,17 +463,16 @@ RED.palette = (function() {
|
||||
currentCategoryNode.find("i").toggleClass("expanded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
paletteNode.css("backgroundColor", sf.color);
|
||||
});
|
||||
}
|
||||
|
||||
function filterChange(val) {
|
||||
var re = new RegExp(val.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'),'i');
|
||||
$("#red-ui-palette-container .red-ui-palette-node").each(function(i,el) {
|
||||
var currentLabel = $(el).find(".red-ui-palette-label").text();
|
||||
var currentLabel = $(el).attr("data-palette-label");
|
||||
var type = $(el).attr("data-palette-type");
|
||||
if (val === "" || re.test(type) || re.test(currentLabel)) {
|
||||
$(this).show();
|
||||
@ -535,20 +568,26 @@ RED.palette = (function() {
|
||||
sidebarControls.stop(false,true);
|
||||
sidebarControls.hide();
|
||||
})
|
||||
|
||||
var categoryList = coreCategories;
|
||||
var userCategories = [];
|
||||
if (RED.settings.paletteCategories) {
|
||||
categoryList = RED.settings.paletteCategories;
|
||||
userCategories = RED.settings.paletteCategories;
|
||||
} else if (RED.settings.theme('palette.categories')) {
|
||||
categoryList = RED.settings.theme('palette.categories');
|
||||
userCategories = RED.settings.theme('palette.categories');
|
||||
}
|
||||
if (!Array.isArray(categoryList)) {
|
||||
categoryList = coreCategories
|
||||
if (!Array.isArray(userCategories)) {
|
||||
userCategories = [];
|
||||
}
|
||||
categoryList.forEach(function(category){
|
||||
createCategoryContainer(category, category, "palette.label."+category);
|
||||
});
|
||||
|
||||
var addedCategories = {};
|
||||
userCategories.forEach(function(category){
|
||||
addedCategories[category] = true;
|
||||
createCategoryContainer(category, escapeCategory(category), "palette.label."+escapeCategory(category));
|
||||
});
|
||||
coreCategories.forEach(function(category){
|
||||
if (!addedCategories[category]) {
|
||||
createCategoryContainer(category, escapeCategory(category), "palette.label."+escapeCategory(category));
|
||||
}
|
||||
});
|
||||
|
||||
var paletteFooterButtons = $('<span class="button-group"></span>').appendTo("#red-ui-palette .red-ui-component-footer");
|
||||
var paletteCollapseAll = $('<button type="button" class="red-ui-footer-button"><i class="fa fa-angle-double-up"></i></button>').appendTo(paletteFooterButtons);
|
||||
@ -593,7 +632,6 @@ RED.palette = (function() {
|
||||
setTimeout(function() { $(window).trigger("resize"); } ,200);
|
||||
}
|
||||
|
||||
|
||||
function getCategories() {
|
||||
var categories = [];
|
||||
$("#red-ui-palette-container .red-ui-palette-category").each(function(i,d) {
|
||||
|
@ -160,7 +160,7 @@ RED.projects.settings = (function() {
|
||||
if (activeProject.description) {
|
||||
desc = marked(activeProject.description);
|
||||
} else {
|
||||
desc = '<span class="red-ui-help-info-none">'+'No description available'+'</span>';
|
||||
desc = '<span class="red-ui-help-info-none">' + RED._("sidebar.project.noDescriptionAvailable") + '</span>';
|
||||
}
|
||||
var description = addTargetToExternalLinks($('<span class="red-ui-text-bidi-aware" dir=\"'+RED.text.bidi.resolveBaseTextDir(desc)+'">'+desc+'</span>')).appendTo(container);
|
||||
description.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
||||
@ -222,7 +222,7 @@ RED.projects.settings = (function() {
|
||||
if (summary) {
|
||||
container.text(summary).removeClass('node-info-node');
|
||||
} else {
|
||||
container.text(RED._("sidebar.project.projectSettings.noSummaryAvailable")).addClass('red-ui-help-info-none');
|
||||
container.text(RED._("sidebar.project.noSummaryAvailable")).addClass('red-ui-help-info-none');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1938,8 +1938,9 @@ RED.projects = (function() {
|
||||
resultCallbackArgs = data;
|
||||
}
|
||||
}).fail(function(xhr,textStatus,err) {
|
||||
var responses;
|
||||
if (options.responses && options.responses[xhr.status]) {
|
||||
var responses = options.responses[xhr.status];
|
||||
responses = options.responses[xhr.status];
|
||||
if (typeof responses === 'function') {
|
||||
resultCallback = responses;
|
||||
resultCallbackArgs = {error:responses.statusText};
|
||||
|
@ -336,7 +336,7 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
var unstagedContent = $('<div class="red-ui-sidebar-vc-change-container"></div>').appendTo(localChanges.content);
|
||||
var header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.localFiles")+'</div>').appendTo(unstagedContent);
|
||||
stageAllButton = $('<button class="red-ui-button red-ui-button-small" style="float: right"><i class="fa fa-plus"></i> '+RED._("sidebar.project.versionControl.all")+'</button>')
|
||||
stageAllButton = $('<button class="red-ui-button red-ui-button-small" style="position: absolute; right: 5px; top: 5px;"><i class="fa fa-plus"></i> '+RED._("sidebar.project.versionControl.all")+'</button>')
|
||||
.appendTo(header)
|
||||
.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
@ -368,7 +368,7 @@ RED.sidebar.versionControl = (function() {
|
||||
unmergedContent = $('<div class="red-ui-sidebar-vc-change-container"></div>').appendTo(localChanges.content);
|
||||
|
||||
header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.unmergedChanges")+'</div>').appendTo(unmergedContent);
|
||||
bg = $('<div style="float: right"></div>').appendTo(header);
|
||||
bg = $('<div style="position: absolute; right: 5px; top: 5px;"></div>').appendTo(header);
|
||||
var abortMergeButton = $('<button class="red-ui-button red-ui-button-small" style="margin-right: 5px;">'+RED._("sidebar.project.versionControl.abortMerge")+'</button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
@ -433,7 +433,7 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
header = $('<div class="red-ui-sidebar-vc-change-header">'+RED._("sidebar.project.versionControl.changeToCommit")+'</div>').appendTo(stagedContent);
|
||||
|
||||
bg = $('<div style="float: right"></div>').appendTo(header);
|
||||
bg = $('<div style="position: absolute; right: 5px; top: 5px;"></div>').appendTo(header);
|
||||
var showCommitBox = function() {
|
||||
commitMessage.val("");
|
||||
submitCommitButton.prop("disabled",true);
|
||||
|
@ -125,6 +125,14 @@ RED.search = (function() {
|
||||
for (i=0;i<Math.min(results.length,25);i++) {
|
||||
searchResults.editableList('addItem',results[i])
|
||||
}
|
||||
if (results.length > 25) {
|
||||
searchResults.editableList('addItem', {
|
||||
more: {
|
||||
results: results,
|
||||
start: 25
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
searchResults.editableList('addItem',{});
|
||||
}
|
||||
@ -186,8 +194,27 @@ RED.search = (function() {
|
||||
evt.preventDefault();
|
||||
} else if (evt.keyCode === 13) {
|
||||
// Enter
|
||||
if (results.length > 0) {
|
||||
reveal(results[Math.max(0,selected)].node);
|
||||
children = searchResults.children();
|
||||
if ($(children[selected]).hasClass("red-ui-search-more")) {
|
||||
var object = $(children[selected]).find(".red-ui-editableList-item-content").data('data');
|
||||
if (object) {
|
||||
searchResults.editableList('removeItem',object);
|
||||
for (i=object.more.start;i<Math.min(results.length,object.more.start+25);i++) {
|
||||
searchResults.editableList('addItem',results[i])
|
||||
}
|
||||
if (results.length > object.more.start+25) {
|
||||
searchResults.editableList('addItem', {
|
||||
more: {
|
||||
results: results,
|
||||
start: object.more.start+25
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (results.length > 0) {
|
||||
reveal(results[Math.max(0,selected)].node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,12 +226,32 @@ RED.search = (function() {
|
||||
addButton: false,
|
||||
addItem: function(container,i,object) {
|
||||
var node = object.node;
|
||||
if (node === undefined) {
|
||||
$('<div>',{class:"red-ui-search-empty"}).text(RED._('search.empty')).appendTo(container);
|
||||
var div;
|
||||
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}));
|
||||
div.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
searchResults.editableList('removeItem',object);
|
||||
for (i=object.more.start;i<Math.min(results.length,object.more.start+25);i++) {
|
||||
searchResults.editableList('addItem',results[i])
|
||||
}
|
||||
if (results.length > object.more.start+25) {
|
||||
searchResults.editableList('addItem', {
|
||||
more: {
|
||||
results: results,
|
||||
start: object.more.start+25
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
} else if (node === undefined) {
|
||||
$('<div>',{class:"red-ui-search-empty"}).text(RED._('search.empty')).appendTo(container);
|
||||
} else {
|
||||
var def = node._def;
|
||||
var div = $('<a>',{href:'#',class:"red-ui-search-result"}).appendTo(container);
|
||||
div = $('<a>',{href:'#',class:"red-ui-search-result"}).appendTo(container);
|
||||
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(div);
|
||||
var colour = RED.utils.getNodeColor(node.type,def);
|
||||
|
@ -346,8 +346,8 @@ RED.sidebar.config = (function() {
|
||||
refreshConfigNodeList();
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'),"Show all config nodes");
|
||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'),"Show all unused config nodes");
|
||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllUnusedConfigNodes"));
|
||||
RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'), RED._("sidebar.config.showAllUnusedConfigNodes"));
|
||||
|
||||
}
|
||||
function show(id) {
|
||||
|
@ -21,6 +21,7 @@ RED.sidebar.context = (function() {
|
||||
var localCache = {};
|
||||
|
||||
var flowAutoRefresh;
|
||||
var nodeAutoRefresh;
|
||||
var nodeSection;
|
||||
// var subflowSection;
|
||||
var flowSection;
|
||||
@ -34,18 +35,6 @@ RED.sidebar.context = (function() {
|
||||
content = $("<div>").css({"position":"relative","height":"100%"});
|
||||
content.className = "red-ui-sidebar-context"
|
||||
|
||||
var header = $('<div class="red-ui-sidebar-header"></div>').appendTo(content);
|
||||
|
||||
var autoUpdate = RED.settings.get("editor.context.refresh",false);
|
||||
flowAutoRefresh = $('<input type="checkbox">').prop("checked",autoUpdate).appendTo(header).toggleButton({
|
||||
baseClass: "red-ui-sidebar-header-button",
|
||||
enabledLabel: RED._("sidebar.context.autoRefresh"),
|
||||
disabledLabel: RED._("sidebar.context.autoRefresh")
|
||||
}).on("change", function() {
|
||||
var value = $(this).prop("checked");
|
||||
RED.settings.set("editor.context.refresh",value);
|
||||
});
|
||||
|
||||
var footerToolbar = $('<div></div>');
|
||||
|
||||
var stackContainer = $("<div>",{class:"red-ui-sidebar-context-stack"}).appendTo(content);
|
||||
@ -55,10 +44,7 @@ RED.sidebar.context = (function() {
|
||||
|
||||
nodeSection = sections.add({
|
||||
title: RED._("sidebar.context.node"),
|
||||
collapsible: true,
|
||||
// onexpand: function() {
|
||||
// updateNode(currentNode,true);
|
||||
// }
|
||||
collapsible: true
|
||||
});
|
||||
nodeSection.expand();
|
||||
nodeSection.content.css({height:"100%"});
|
||||
@ -66,30 +52,27 @@ RED.sidebar.context = (function() {
|
||||
var table = $('<table class="red-ui-info-table"></table>').appendTo(nodeSection.content);
|
||||
nodeSection.table = $('<tbody>').appendTo(table);
|
||||
var bg = $('<div style="float: right"></div>').appendTo(nodeSection.header);
|
||||
$('<button class="red-ui-button red-ui-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
|
||||
var nodeAutoRefreshSetting = RED.settings.get("editor.context.nodeRefresh",false);
|
||||
nodeAutoRefresh = $('<input type="checkbox">').prop("checked",nodeAutoRefreshSetting).appendTo(bg).toggleButton({
|
||||
baseClass: "red-ui-sidebar-header-button red-ui-button-small",
|
||||
enabledLabel: "",
|
||||
disabledLabel: ""
|
||||
}).on("change", function() {
|
||||
var value = $(this).prop("checked");
|
||||
RED.settings.set("editor.context.flowRefresh",value);
|
||||
});
|
||||
RED.popover.tooltip(nodeAutoRefresh.next(),RED._("sidebar.context.autoRefresh"));
|
||||
|
||||
|
||||
var manualRefreshNode = $('<button class="red-ui-button red-ui-button-small" style="margin-left: 5px"><i class="fa fa-refresh"></i></button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
updateNode(currentNode, true);
|
||||
})
|
||||
RED.popover.tooltip(bg,RED._("sidebar.context.refrsh"));
|
||||
|
||||
// subflowSection = sections.add({
|
||||
// title: "Subflow",
|
||||
// collapsible: true
|
||||
// });
|
||||
// subflowSection.expand();
|
||||
// subflowSection.content.css({height:"100%"});
|
||||
// bg = $('<div style="float: right"></div>').appendTo(subflowSection.header);
|
||||
// $('<button class="red-ui-button red-ui-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
// .appendTo(bg)
|
||||
// .on("click", function(evt) {
|
||||
// evt.stopPropagation();
|
||||
// evt.preventDefault();
|
||||
// })
|
||||
// RED.popover.tooltip(bg,RED._("sidebar.context.refrsh"));
|
||||
// subflowSection.container.hide();
|
||||
RED.popover.tooltip(manualRefreshNode,RED._("sidebar.context.refrsh"));
|
||||
|
||||
flowSection = sections.add({
|
||||
title: RED._("sidebar.context.flow"),
|
||||
@ -101,14 +84,26 @@ RED.sidebar.context = (function() {
|
||||
var table = $('<table class="red-ui-info-table"></table>').appendTo(flowSection.content);
|
||||
flowSection.table = $('<tbody>').appendTo(table);
|
||||
bg = $('<div style="float: right"></div>').appendTo(flowSection.header);
|
||||
$('<button class="red-ui-button red-ui-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
|
||||
var flowAutoRefreshSetting = RED.settings.get("editor.context.flowRefresh",false);
|
||||
flowAutoRefresh = $('<input type="checkbox">').prop("checked",flowAutoRefreshSetting).appendTo(bg).toggleButton({
|
||||
baseClass: "red-ui-sidebar-header-button red-ui-button-small",
|
||||
enabledLabel: "",
|
||||
disabledLabel: ""
|
||||
}).on("change", function() {
|
||||
var value = $(this).prop("checked");
|
||||
RED.settings.set("editor.context.flowRefresh",value);
|
||||
});
|
||||
RED.popover.tooltip(flowAutoRefresh.next(),RED._("sidebar.context.autoRefresh"));
|
||||
|
||||
var manualRefreshFlow = $('<button class="red-ui-button red-ui-button-small" style="margin-left: 5px"><i class="fa fa-refresh"></i></button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
updateFlow(currentFlow, true);
|
||||
})
|
||||
RED.popover.tooltip(bg,RED._("sidebar.context.refrsh"));
|
||||
RED.popover.tooltip(manualRefreshFlow,RED._("sidebar.context.refrsh"));
|
||||
|
||||
globalSection = sections.add({
|
||||
title: RED._("sidebar.context.global"),
|
||||
@ -144,28 +139,6 @@ RED.sidebar.context = (function() {
|
||||
action: "core:show-context-tab"
|
||||
});
|
||||
|
||||
// var toggleLiveButton = $("#sidebar-context-toggle-live");
|
||||
// toggleLiveButton.on("click", function(evt) {
|
||||
// evt.preventDefault();
|
||||
// if ($(this).hasClass("selected")) {
|
||||
// $(this).removeClass("selected");
|
||||
// $(this).find("i").removeClass("fa-pause");
|
||||
// $(this).find("i").addClass("fa-play");
|
||||
// } else {
|
||||
// $(this).addClass("selected");
|
||||
// $(this).find("i").removeClass("fa-play");
|
||||
// $(this).find("i").addClass("fa-pause");
|
||||
// }
|
||||
// });
|
||||
// RED.popover.tooltip(toggleLiveButton, function() {
|
||||
// if (toggleLiveButton.hasClass("selected")) {
|
||||
// return "Pause live updates"
|
||||
// } else {
|
||||
// return "Start live updates"
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
RED.events.on("view:selection-changed", function(event) {
|
||||
var selectedNode = event.nodes && event.nodes.length === 1 && event.nodes[0];
|
||||
updateNode(selectedNode);
|
||||
@ -174,29 +147,18 @@ RED.sidebar.context = (function() {
|
||||
RED.events.on("workspace:change", function(event) {
|
||||
updateFlow(RED.nodes.workspace(event.workspace));
|
||||
})
|
||||
if (autoUpdate) {
|
||||
updateEntry(globalSection,"context/global","global");
|
||||
} else {
|
||||
$(globalSection.table).empty();
|
||||
$('<tr class="red-ui-help-info-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.refresh"></td></tr>').appendTo(globalSection.table).i18n();
|
||||
globalSection.timestamp.html(" ");
|
||||
}
|
||||
|
||||
$(globalSection.table).empty();
|
||||
$('<tr class="red-ui-help-info-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.refresh"></td></tr>').appendTo(globalSection.table).i18n();
|
||||
globalSection.timestamp.html(" ");
|
||||
}
|
||||
|
||||
function updateNode(node,force) {
|
||||
currentNode = node;
|
||||
if (force) {
|
||||
if (force || nodeAutoRefresh.prop("checked")) {
|
||||
if (node) {
|
||||
updateEntry(nodeSection,"context/node/"+node.id,node.id);
|
||||
// if (/^subflow:/.test(node.type)) {
|
||||
// subflowSection.container.show();
|
||||
// updateEntry(subflowSection,"context/flow/"+node.id,node.id);
|
||||
// } else {
|
||||
// subflowSection.container.hide();
|
||||
// }
|
||||
} else {
|
||||
// subflowSection.container.hide();
|
||||
updateEntry(nodeSection)
|
||||
}
|
||||
} else {
|
||||
|
@ -140,7 +140,7 @@ RED.sidebar.info = (function() {
|
||||
|
||||
var activeProject = RED.projects.getActiveProject();
|
||||
if (activeProject) {
|
||||
propRow = $('<tr class="red-ui-help-info-row"><td>Project</td><td></td></tr>').appendTo(tableBody);
|
||||
propRow = $('<tr class="red-ui-help-info-row"><td>'+ RED._("sidebar.project.name") + '</td><td></td></tr>').appendTo(tableBody);
|
||||
$(propRow.children()[1]).text(activeProject.name||"");
|
||||
$('<tr class="red-ui-help-property-expand blank"><td colspan="2"></td></tr>').appendTo(tableBody);
|
||||
var editProjectButton = $('<button class="red-ui-button red-ui-button-small" style="position:absolute;right:2px;"><i class="fa fa-ellipsis-h"></i></button>')
|
||||
|
@ -27,15 +27,7 @@ RED.touch.radialMenu = (function() {
|
||||
function createRadial(obj,pos,options) {
|
||||
isActive = true;
|
||||
try {
|
||||
touchMenu = d3.select("body").append("div")
|
||||
.style({
|
||||
position:"absolute",
|
||||
top: 0,
|
||||
left:0,
|
||||
bottom:0,
|
||||
right:0,
|
||||
"z-index": 1000
|
||||
})
|
||||
touchMenu = d3.select("body").append("div").classed("red-ui-editor-radial-menu",true)
|
||||
.on('touchstart',function() {
|
||||
hide();
|
||||
d3.event.preventDefault();
|
||||
@ -43,43 +35,27 @@ RED.touch.radialMenu = (function() {
|
||||
|
||||
var menu = touchMenu.append("div")
|
||||
.style({
|
||||
position: "absolute",
|
||||
top: (pos[1]-80)+"px",
|
||||
left:(pos[0]-80)+"px",
|
||||
"border-radius": "80px",
|
||||
width: "160px",
|
||||
height: "160px",
|
||||
background: "rgba(255,255,255,0.6)",
|
||||
border: "1px solid #666"
|
||||
top: (pos[1]-80)+"px",
|
||||
left:(pos[0]-80)+"px",
|
||||
});
|
||||
|
||||
var menuOpts = [];
|
||||
var createMenuOpt = function(x,y,opt) {
|
||||
opt.el = menu.append("div")
|
||||
opt.el = menu.append("div").classed("red-ui-editor-radial-menu-opt",true)
|
||||
.style({
|
||||
position: "absolute",
|
||||
top: (y+80-25)+"px",
|
||||
left:(x+80-25)+"px",
|
||||
"border-radius": "20px",
|
||||
width: "50px",
|
||||
height: "50px",
|
||||
background: "#fff",
|
||||
border: "2px solid #666",
|
||||
"text-align": "center",
|
||||
"line-height":"50px"
|
||||
});
|
||||
left:(x+80-25)+"px"
|
||||
})
|
||||
.classed("red-ui-editor-radial-menu-opt-disabled",!!opt.disabled)
|
||||
|
||||
opt.el.html(opt.name);
|
||||
|
||||
if (opt.disabled) {
|
||||
opt.el.style({"border-color":"#ccc",color:"#ccc"});
|
||||
}
|
||||
opt.x = x;
|
||||
opt.y = y;
|
||||
menuOpts.push(opt);
|
||||
|
||||
opt.el.on('touchstart',function() {
|
||||
opt.el.style("background","#999");
|
||||
opt.el.classed("red-ui-editor-radial-menu-opt-active",true)
|
||||
d3.event.preventDefault();
|
||||
d3.event.stopPropagation();
|
||||
});
|
||||
|
@ -118,8 +118,8 @@ RED.userSettings = (function() {
|
||||
},{
|
||||
title: "menu.label.view.grid",
|
||||
options: [
|
||||
{setting:"view-show-grid",oldSetting:"menu-menu-item-view-show-grid",label:"menu.label.view.showGrid",toggle:true,onchange:"core:toggle-show-grid"},
|
||||
{setting:"view-snap-grid",oldSetting:"menu-menu-item-view-snap-grid",label:"menu.label.view.snapGrid",toggle:true,onchange:"core:toggle-snap-grid"},
|
||||
{setting:"view-show-grid",oldSetting:"menu-menu-item-view-show-grid",label:"menu.label.view.showGrid", default: true, toggle:true,onchange:"core:toggle-show-grid"},
|
||||
{setting:"view-snap-grid",oldSetting:"menu-menu-item-view-snap-grid",label:"menu.label.view.snapGrid", default: true, toggle:true,onchange:"core:toggle-snap-grid"},
|
||||
{setting:"view-grid-size",label:"menu.label.view.gridSize",type:"number",default: 20, onchange:RED.view.gridSize}
|
||||
]
|
||||
},
|
||||
|
@ -912,6 +912,10 @@ RED.utils = (function() {
|
||||
}
|
||||
|
||||
var nodeColorCache = {};
|
||||
function clearNodeColorCache() {
|
||||
nodeColorCache = {};
|
||||
}
|
||||
|
||||
function getNodeColor(type, def) {
|
||||
var result = def.color;
|
||||
var paletteTheme = RED.settings.theme('palette.theme') || [];
|
||||
@ -1044,6 +1048,7 @@ RED.utils = (function() {
|
||||
getNodeIcon: getNodeIcon,
|
||||
getNodeLabel: getNodeLabel,
|
||||
getNodeColor: getNodeColor,
|
||||
clearNodeColorCache: clearNodeColorCache,
|
||||
addSpinnerOverlay: addSpinnerOverlay,
|
||||
decodeObject: decodeObject,
|
||||
parseContextKey: parseContextKey,
|
||||
|
@ -105,6 +105,8 @@ RED.view.tools = (function() {
|
||||
}
|
||||
}
|
||||
RED.view.redraw();
|
||||
} else {
|
||||
RED.view.scroll(dx*10,dy*10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +114,16 @@ RED.view.tools = (function() {
|
||||
init: function() {
|
||||
RED.actions.add("core:align-selection-to-grid", alignToGrid);
|
||||
|
||||
RED.actions.add("core:scroll-view-up", function() { RED.view.scroll(0,-RED.view.gridSize());});
|
||||
RED.actions.add("core:scroll-view-right", function() { RED.view.scroll(RED.view.gridSize(),0);});
|
||||
RED.actions.add("core:scroll-view-down", function() { RED.view.scroll(0,RED.view.gridSize());});
|
||||
RED.actions.add("core:scroll-view-left", function() { RED.view.scroll(-RED.view.gridSize(),0);});
|
||||
|
||||
RED.actions.add("core:step-view-up", function() { RED.view.scroll(0,-5*RED.view.gridSize());});
|
||||
RED.actions.add("core:step-view-right", function() { RED.view.scroll(5*RED.view.gridSize(),0);});
|
||||
RED.actions.add("core:step-view-down", function() { RED.view.scroll(0,5*RED.view.gridSize());});
|
||||
RED.actions.add("core:step-view-left", function() { RED.view.scroll(-5*RED.view.gridSize(),0);});
|
||||
|
||||
RED.actions.add("core:move-selection-up", function() { moveSelection(0,-1);});
|
||||
RED.actions.add("core:move-selection-right", function() { moveSelection(1,0);});
|
||||
RED.actions.add("core:move-selection-down", function() { moveSelection(0,1);});
|
||||
|
@ -291,6 +291,7 @@ RED.view = (function() {
|
||||
}
|
||||
RED.nodes.eachNode(function(n) {
|
||||
n.dirty = true;
|
||||
n.dirtyStatus = true;
|
||||
});
|
||||
updateSelection();
|
||||
updateActiveNodes();
|
||||
@ -358,7 +359,7 @@ RED.view = (function() {
|
||||
|
||||
var spliceLink = $(ui.helper).data("splice");
|
||||
if (spliceLink) {
|
||||
// TODO: DRY - droppable/nodeMouseDown/canvasMouseUp
|
||||
// TODO: DRY - droppable/nodeMouseDown/canvasMouseUp/showQuickAddDialog
|
||||
RED.nodes.removeLink(spliceLink);
|
||||
var link1 = {
|
||||
source:spliceLink.source,
|
||||
@ -406,6 +407,7 @@ RED.view = (function() {
|
||||
RED.actions.add("core:delete-selection",deleteSelection);
|
||||
RED.actions.add("core:edit-selected-node",editSelection);
|
||||
RED.actions.add("core:undo",RED.history.pop);
|
||||
RED.actions.add("core:redo",RED.history.redo);
|
||||
RED.actions.add("core:select-all-nodes",selectAll);
|
||||
RED.actions.add("core:zoom-in",zoomIn);
|
||||
RED.actions.add("core:zoom-out",zoomOut);
|
||||
@ -694,280 +696,8 @@ RED.view = (function() {
|
||||
}
|
||||
if (mouse_mode === 0 || mouse_mode === RED.state.QUICK_JOINING) {
|
||||
if (d3.event.metaKey || d3.event.ctrlKey) {
|
||||
point = d3.mouse(this);
|
||||
var ox = point[0];
|
||||
var oy = point[1];
|
||||
|
||||
if (RED.settings.get("editor").view['view-snap-grid']) {
|
||||
// eventLayer.append("circle").attr("cx",point[0]).attr("cy",point[1]).attr("r","2").attr('fill','red')
|
||||
point[0] = Math.round(point[0] / gridSize) * gridSize;
|
||||
point[1] = Math.round(point[1] / gridSize) * gridSize;
|
||||
// eventLayer.append("circle").attr("cx",point[0]).attr("cy",point[1]).attr("r","2").attr('fill','blue')
|
||||
}
|
||||
|
||||
d3.event.stopPropagation();
|
||||
var mainPos = $("#red-ui-main-container").position();
|
||||
|
||||
if (mouse_mode !== RED.state.QUICK_JOINING) {
|
||||
mouse_mode = RED.state.QUICK_JOINING;
|
||||
$(window).on('keyup',disableQuickJoinEventHandler);
|
||||
}
|
||||
quickAddActive = true;
|
||||
|
||||
if (ghostNode) {
|
||||
ghostNode.remove();
|
||||
}
|
||||
ghostNode = eventLayer.append("g").attr('transform','translate('+(point[0] - node_width/2)+','+(point[1] - node_height/2)+')');
|
||||
ghostNode.append("rect")
|
||||
.attr("class","red-ui-flow-node-placeholder")
|
||||
.attr("rx", 5)
|
||||
.attr("ry", 5)
|
||||
.attr("width",node_width)
|
||||
.attr("height",node_height)
|
||||
.attr("fill","none")
|
||||
// var ghostLink = ghostNode.append("svg:path")
|
||||
// .attr("class","red-ui-flow-link-link")
|
||||
// .attr("d","M 0 "+(node_height/2)+" H "+(gridSize * -2))
|
||||
// .attr("opacity",0);
|
||||
|
||||
var filter = undefined;
|
||||
if (drag_lines.length > 0) {
|
||||
if (drag_lines[0].virtualLink) {
|
||||
filter = {type:drag_lines[0].node.type === 'link in'?'link out':'link in'}
|
||||
} else if (drag_lines[0].portType === PORT_TYPE_OUTPUT) {
|
||||
filter = {input:true}
|
||||
} else {
|
||||
filter = {output:true}
|
||||
}
|
||||
|
||||
quickAddLink = {
|
||||
node: drag_lines[0].node,
|
||||
port: drag_lines[0].port,
|
||||
portType: drag_lines[0].portType,
|
||||
}
|
||||
if (drag_lines[0].virtualLink) {
|
||||
quickAddLink.virtualLink = true;
|
||||
}
|
||||
hideDragLines();
|
||||
}
|
||||
var rebuildQuickAddLink = function() {
|
||||
if (!quickAddLink) {
|
||||
return;
|
||||
}
|
||||
if (!quickAddLink.el) {
|
||||
quickAddLink.el = dragGroupLayer.append("svg:path").attr("class", "red-ui-flow-drag-line");
|
||||
}
|
||||
var numOutputs = (quickAddLink.portType === PORT_TYPE_OUTPUT)?(quickAddLink.node.outputs || 1):1;
|
||||
var sourcePort = quickAddLink.port;
|
||||
var portY = -((numOutputs-1)/2)*13 +13*sourcePort;
|
||||
var sc = (quickAddLink.portType === PORT_TYPE_OUTPUT)?1:-1;
|
||||
quickAddLink.el.attr("d",generateLinkPath(quickAddLink.node.x+sc*quickAddLink.node.w/2,quickAddLink.node.y+portY,point[0]-sc*node_width/2,point[1],sc));
|
||||
}
|
||||
if (quickAddLink) {
|
||||
rebuildQuickAddLink();
|
||||
}
|
||||
|
||||
|
||||
var lastAddedX;
|
||||
var lastAddedWidth;
|
||||
|
||||
RED.typeSearch.show({
|
||||
x:d3.event.clientX-mainPos.left-node_width/2 - (ox-point[0]),
|
||||
y:d3.event.clientY-mainPos.top+ node_height/2 + 5 - (oy-point[1]),
|
||||
filter: filter,
|
||||
move: function(dx,dy) {
|
||||
if (ghostNode) {
|
||||
var pos = d3.transform(ghostNode.attr("transform")).translate;
|
||||
ghostNode.attr("transform","translate("+(pos[0]+dx)+","+(pos[1]+dy)+")")
|
||||
point[0] += dx;
|
||||
point[1] += dy;
|
||||
rebuildQuickAddLink();
|
||||
}
|
||||
},
|
||||
cancel: function() {
|
||||
if (quickAddLink) {
|
||||
if (quickAddLink.el) {
|
||||
quickAddLink.el.remove();
|
||||
}
|
||||
quickAddLink = null;
|
||||
}
|
||||
quickAddActive = false;
|
||||
if (ghostNode) {
|
||||
ghostNode.remove();
|
||||
}
|
||||
resetMouseVars();
|
||||
updateSelection();
|
||||
hideDragLines();
|
||||
redraw();
|
||||
},
|
||||
add: function(type,keepAdding) {
|
||||
var result = addNode(type);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
if (keepAdding) {
|
||||
mouse_mode = RED.state.QUICK_JOINING;
|
||||
}
|
||||
|
||||
var nn = result.node;
|
||||
var historyEvent = result.historyEvent;
|
||||
nn.x = point[0];
|
||||
nn.y = point[1];
|
||||
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
||||
if (showLabel !== undefined && !/^link (in|out)$/.test(nn._def.type) && !nn._def.defaults.hasOwnProperty("l")) {
|
||||
nn.l = showLabel;
|
||||
}
|
||||
if (quickAddLink) {
|
||||
var drag_line = quickAddLink;
|
||||
var src = null,dst,src_port;
|
||||
if (drag_line.portType === PORT_TYPE_OUTPUT && (nn.inputs > 0 || drag_line.virtualLink) ) {
|
||||
src = drag_line.node;
|
||||
src_port = drag_line.port;
|
||||
dst = nn;
|
||||
} else if (drag_line.portType === PORT_TYPE_INPUT && (nn.outputs > 0 || drag_line.virtualLink)) {
|
||||
src = nn;
|
||||
dst = drag_line.node;
|
||||
src_port = 0;
|
||||
}
|
||||
|
||||
if (src !== null) {
|
||||
// Joining link nodes via virual wires. Need to update
|
||||
// the src and dst links property
|
||||
if (drag_line.virtualLink) {
|
||||
historyEvent = {
|
||||
t:'multi',
|
||||
events: [historyEvent]
|
||||
}
|
||||
var oldSrcLinks = $.extend(true,{},{v:src.links}).v
|
||||
var oldDstLinks = $.extend(true,{},{v:dst.links}).v
|
||||
src.links.push(dst.id);
|
||||
dst.links.push(src.id);
|
||||
src.dirty = true;
|
||||
dst.dirty = true;
|
||||
|
||||
historyEvent.events.push({
|
||||
t:'edit',
|
||||
node: src,
|
||||
dirty: RED.nodes.dirty(),
|
||||
changed: src.changed,
|
||||
changes: {
|
||||
links:oldSrcLinks
|
||||
}
|
||||
});
|
||||
historyEvent.events.push({
|
||||
t:'edit',
|
||||
node: dst,
|
||||
dirty: RED.nodes.dirty(),
|
||||
changed: dst.changed,
|
||||
changes: {
|
||||
links:oldDstLinks
|
||||
}
|
||||
});
|
||||
src.changed = true;
|
||||
dst.changed = true;
|
||||
} else {
|
||||
var link = {source: src, sourcePort:src_port, target: dst};
|
||||
RED.nodes.addLink(link);
|
||||
historyEvent.links = [link];
|
||||
}
|
||||
if (!keepAdding) {
|
||||
quickAddLink.el.remove();
|
||||
quickAddLink = null;
|
||||
if (mouse_mode === RED.state.QUICK_JOINING) {
|
||||
if (drag_line.portType === PORT_TYPE_OUTPUT && nn.outputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_OUTPUT}]);
|
||||
} else if (!quickAddLink && drag_line.portType === PORT_TYPE_INPUT && nn.inputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_INPUT}]);
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quickAddLink.node = nn;
|
||||
quickAddLink.port = 0;
|
||||
}
|
||||
} else {
|
||||
hideDragLines();
|
||||
resetMouseVars();
|
||||
}
|
||||
} else {
|
||||
if (!keepAdding) {
|
||||
if (mouse_mode === RED.state.QUICK_JOINING) {
|
||||
if (nn.outputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_OUTPUT}]);
|
||||
} else if (nn.inputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_INPUT}]);
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (nn.outputs > 0) {
|
||||
quickAddLink = {
|
||||
node: nn,
|
||||
port: 0,
|
||||
portType: PORT_TYPE_OUTPUT
|
||||
}
|
||||
} else if (nn.inputs > 0) {
|
||||
quickAddLink = {
|
||||
node: nn,
|
||||
port: 0,
|
||||
portType: PORT_TYPE_INPUT
|
||||
}
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RED.history.push(historyEvent);
|
||||
RED.nodes.add(nn);
|
||||
RED.editor.validateNode(nn);
|
||||
RED.nodes.dirty(true);
|
||||
// auto select dropped node - so info shows (if visible)
|
||||
clearSelection();
|
||||
nn.selected = true;
|
||||
moving_set.push({n:nn});
|
||||
updateActiveNodes();
|
||||
updateSelection();
|
||||
redraw();
|
||||
// At this point the newly added node will have a real width,
|
||||
// so check if the position needs nudging
|
||||
if (lastAddedX !== undefined) {
|
||||
var lastNodeRHEdge = lastAddedX + lastAddedWidth/2;
|
||||
var thisNodeLHEdge = nn.x - nn.w/2;
|
||||
var gap = thisNodeLHEdge - lastNodeRHEdge;
|
||||
if (gap != gridSize *2) {
|
||||
nn.x = nn.x + gridSize * 2 - gap;
|
||||
nn.dirty = true;
|
||||
nn.x = Math.ceil(nn.x / gridSize) * gridSize;
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
if (keepAdding) {
|
||||
if (lastAddedX === undefined) {
|
||||
// ghostLink.attr("opacity",1);
|
||||
setTimeout(function() {
|
||||
RED.typeSearch.refresh({filter:{input:true}});
|
||||
},100);
|
||||
}
|
||||
|
||||
lastAddedX = nn.x;
|
||||
lastAddedWidth = nn.w;
|
||||
|
||||
point[0] = nn.x + nn.w/2 + node_width/2 + gridSize * 2;
|
||||
ghostNode.attr('transform','translate('+(point[0] - node_width/2)+','+(point[1] - node_height/2)+')');
|
||||
rebuildQuickAddLink();
|
||||
} else {
|
||||
quickAddActive = false;
|
||||
ghostNode.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
updateActiveNodes();
|
||||
updateSelection();
|
||||
redraw();
|
||||
showQuickAddDialog(d3.mouse(this));
|
||||
}
|
||||
}
|
||||
if (mouse_mode === 0 && !(d3.event.metaKey || d3.event.ctrlKey)) {
|
||||
@ -988,6 +718,303 @@ RED.view = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function showQuickAddDialog(point,spliceLink) {
|
||||
var ox = point[0];
|
||||
var oy = point[1];
|
||||
|
||||
if (RED.settings.get("editor").view['view-snap-grid']) {
|
||||
// eventLayer.append("circle").attr("cx",point[0]).attr("cy",point[1]).attr("r","2").attr('fill','red')
|
||||
point[0] = Math.round(point[0] / gridSize) * gridSize;
|
||||
point[1] = Math.round(point[1] / gridSize) * gridSize;
|
||||
// eventLayer.append("circle").attr("cx",point[0]).attr("cy",point[1]).attr("r","2").attr('fill','blue')
|
||||
}
|
||||
|
||||
var mainPos = $("#red-ui-main-container").position();
|
||||
|
||||
if (mouse_mode !== RED.state.QUICK_JOINING) {
|
||||
mouse_mode = RED.state.QUICK_JOINING;
|
||||
$(window).on('keyup',disableQuickJoinEventHandler);
|
||||
}
|
||||
quickAddActive = true;
|
||||
|
||||
if (ghostNode) {
|
||||
ghostNode.remove();
|
||||
}
|
||||
ghostNode = eventLayer.append("g").attr('transform','translate('+(point[0] - node_width/2)+','+(point[1] - node_height/2)+')');
|
||||
ghostNode.append("rect")
|
||||
.attr("class","red-ui-flow-node-placeholder")
|
||||
.attr("rx", 5)
|
||||
.attr("ry", 5)
|
||||
.attr("width",node_width)
|
||||
.attr("height",node_height)
|
||||
.attr("fill","none")
|
||||
// var ghostLink = ghostNode.append("svg:path")
|
||||
// .attr("class","red-ui-flow-link-link")
|
||||
// .attr("d","M 0 "+(node_height/2)+" H "+(gridSize * -2))
|
||||
// .attr("opacity",0);
|
||||
|
||||
var filter;
|
||||
if (drag_lines.length > 0) {
|
||||
if (drag_lines[0].virtualLink) {
|
||||
filter = {type:drag_lines[0].node.type === 'link in'?'link out':'link in'}
|
||||
} else if (drag_lines[0].portType === PORT_TYPE_OUTPUT) {
|
||||
filter = {input:true}
|
||||
} else {
|
||||
filter = {output:true}
|
||||
}
|
||||
|
||||
quickAddLink = {
|
||||
node: drag_lines[0].node,
|
||||
port: drag_lines[0].port,
|
||||
portType: drag_lines[0].portType,
|
||||
}
|
||||
if (drag_lines[0].virtualLink) {
|
||||
quickAddLink.virtualLink = true;
|
||||
}
|
||||
hideDragLines();
|
||||
}
|
||||
if (spliceLink) {
|
||||
filter = {input:true, output:true}
|
||||
}
|
||||
|
||||
var rebuildQuickAddLink = function() {
|
||||
if (!quickAddLink) {
|
||||
return;
|
||||
}
|
||||
if (!quickAddLink.el) {
|
||||
quickAddLink.el = dragGroupLayer.append("svg:path").attr("class", "red-ui-flow-drag-line");
|
||||
}
|
||||
var numOutputs = (quickAddLink.portType === PORT_TYPE_OUTPUT)?(quickAddLink.node.outputs || 1):1;
|
||||
var sourcePort = quickAddLink.port;
|
||||
var portY = -((numOutputs-1)/2)*13 +13*sourcePort;
|
||||
var sc = (quickAddLink.portType === PORT_TYPE_OUTPUT)?1:-1;
|
||||
quickAddLink.el.attr("d",generateLinkPath(quickAddLink.node.x+sc*quickAddLink.node.w/2,quickAddLink.node.y+portY,point[0]-sc*node_width/2,point[1],sc));
|
||||
}
|
||||
if (quickAddLink) {
|
||||
rebuildQuickAddLink();
|
||||
}
|
||||
|
||||
|
||||
var lastAddedX;
|
||||
var lastAddedWidth;
|
||||
|
||||
RED.typeSearch.show({
|
||||
x:d3.event.clientX-mainPos.left-node_width/2 - (ox-point[0]),
|
||||
y:d3.event.clientY-mainPos.top+ node_height/2 + 5 - (oy-point[1]),
|
||||
filter: filter,
|
||||
move: function(dx,dy) {
|
||||
if (ghostNode) {
|
||||
var pos = d3.transform(ghostNode.attr("transform")).translate;
|
||||
ghostNode.attr("transform","translate("+(pos[0]+dx)+","+(pos[1]+dy)+")")
|
||||
point[0] += dx;
|
||||
point[1] += dy;
|
||||
rebuildQuickAddLink();
|
||||
}
|
||||
},
|
||||
cancel: function() {
|
||||
if (quickAddLink) {
|
||||
if (quickAddLink.el) {
|
||||
quickAddLink.el.remove();
|
||||
}
|
||||
quickAddLink = null;
|
||||
}
|
||||
quickAddActive = false;
|
||||
if (ghostNode) {
|
||||
ghostNode.remove();
|
||||
}
|
||||
resetMouseVars();
|
||||
updateSelection();
|
||||
hideDragLines();
|
||||
redraw();
|
||||
},
|
||||
add: function(type,keepAdding) {
|
||||
var result = addNode(type);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
if (keepAdding) {
|
||||
mouse_mode = RED.state.QUICK_JOINING;
|
||||
}
|
||||
|
||||
var nn = result.node;
|
||||
var historyEvent = result.historyEvent;
|
||||
nn.x = point[0];
|
||||
nn.y = point[1];
|
||||
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
||||
if (showLabel !== undefined && !/^link (in|out)$/.test(nn._def.type) && !nn._def.defaults.hasOwnProperty("l")) {
|
||||
nn.l = showLabel;
|
||||
}
|
||||
if (quickAddLink) {
|
||||
var drag_line = quickAddLink;
|
||||
var src = null,dst,src_port;
|
||||
if (drag_line.portType === PORT_TYPE_OUTPUT && (nn.inputs > 0 || drag_line.virtualLink) ) {
|
||||
src = drag_line.node;
|
||||
src_port = drag_line.port;
|
||||
dst = nn;
|
||||
} else if (drag_line.portType === PORT_TYPE_INPUT && (nn.outputs > 0 || drag_line.virtualLink)) {
|
||||
src = nn;
|
||||
dst = drag_line.node;
|
||||
src_port = 0;
|
||||
}
|
||||
|
||||
if (src !== null) {
|
||||
// Joining link nodes via virual wires. Need to update
|
||||
// the src and dst links property
|
||||
if (drag_line.virtualLink) {
|
||||
historyEvent = {
|
||||
t:'multi',
|
||||
events: [historyEvent]
|
||||
}
|
||||
var oldSrcLinks = $.extend(true,{},{v:src.links}).v
|
||||
var oldDstLinks = $.extend(true,{},{v:dst.links}).v
|
||||
src.links.push(dst.id);
|
||||
dst.links.push(src.id);
|
||||
src.dirty = true;
|
||||
dst.dirty = true;
|
||||
|
||||
historyEvent.events.push({
|
||||
t:'edit',
|
||||
node: src,
|
||||
dirty: RED.nodes.dirty(),
|
||||
changed: src.changed,
|
||||
changes: {
|
||||
links:oldSrcLinks
|
||||
}
|
||||
});
|
||||
historyEvent.events.push({
|
||||
t:'edit',
|
||||
node: dst,
|
||||
dirty: RED.nodes.dirty(),
|
||||
changed: dst.changed,
|
||||
changes: {
|
||||
links:oldDstLinks
|
||||
}
|
||||
});
|
||||
src.changed = true;
|
||||
dst.changed = true;
|
||||
} else {
|
||||
var link = {source: src, sourcePort:src_port, target: dst};
|
||||
RED.nodes.addLink(link);
|
||||
historyEvent.links = [link];
|
||||
}
|
||||
if (!keepAdding) {
|
||||
quickAddLink.el.remove();
|
||||
quickAddLink = null;
|
||||
if (mouse_mode === RED.state.QUICK_JOINING) {
|
||||
if (drag_line.portType === PORT_TYPE_OUTPUT && nn.outputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_OUTPUT}]);
|
||||
} else if (!quickAddLink && drag_line.portType === PORT_TYPE_INPUT && nn.inputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_INPUT}]);
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quickAddLink.node = nn;
|
||||
quickAddLink.port = 0;
|
||||
}
|
||||
} else {
|
||||
hideDragLines();
|
||||
resetMouseVars();
|
||||
}
|
||||
} else {
|
||||
if (!keepAdding) {
|
||||
if (mouse_mode === RED.state.QUICK_JOINING) {
|
||||
if (nn.outputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_OUTPUT}]);
|
||||
} else if (nn.inputs > 0) {
|
||||
showDragLines([{node:nn,port:0,portType:PORT_TYPE_INPUT}]);
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (nn.outputs > 0) {
|
||||
quickAddLink = {
|
||||
node: nn,
|
||||
port: 0,
|
||||
portType: PORT_TYPE_OUTPUT
|
||||
}
|
||||
} else if (nn.inputs > 0) {
|
||||
quickAddLink = {
|
||||
node: nn,
|
||||
port: 0,
|
||||
portType: PORT_TYPE_INPUT
|
||||
}
|
||||
} else {
|
||||
resetMouseVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spliceLink) {
|
||||
resetMouseVars();
|
||||
// TODO: DRY - droppable/nodeMouseDown/canvasMouseUp/showQuickAddDialog
|
||||
RED.nodes.removeLink(spliceLink);
|
||||
var link1 = {
|
||||
source:spliceLink.source,
|
||||
sourcePort:spliceLink.sourcePort,
|
||||
target: nn
|
||||
};
|
||||
var link2 = {
|
||||
source:nn,
|
||||
sourcePort:0,
|
||||
target: spliceLink.target
|
||||
};
|
||||
RED.nodes.addLink(link1);
|
||||
RED.nodes.addLink(link2);
|
||||
historyEvent.links = (historyEvent.links || []).concat([link1,link2]);
|
||||
historyEvent.removedLinks = [spliceLink];
|
||||
}
|
||||
RED.history.push(historyEvent);
|
||||
RED.nodes.add(nn);
|
||||
RED.editor.validateNode(nn);
|
||||
RED.nodes.dirty(true);
|
||||
// auto select dropped node - so info shows (if visible)
|
||||
clearSelection();
|
||||
nn.selected = true;
|
||||
moving_set.push({n:nn});
|
||||
updateActiveNodes();
|
||||
updateSelection();
|
||||
redraw();
|
||||
// At this point the newly added node will have a real width,
|
||||
// so check if the position needs nudging
|
||||
if (lastAddedX !== undefined) {
|
||||
var lastNodeRHEdge = lastAddedX + lastAddedWidth/2;
|
||||
var thisNodeLHEdge = nn.x - nn.w/2;
|
||||
var gap = thisNodeLHEdge - lastNodeRHEdge;
|
||||
if (gap != gridSize *2) {
|
||||
nn.x = nn.x + gridSize * 2 - gap;
|
||||
nn.dirty = true;
|
||||
nn.x = Math.ceil(nn.x / gridSize) * gridSize;
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
if (keepAdding) {
|
||||
if (lastAddedX === undefined) {
|
||||
// ghostLink.attr("opacity",1);
|
||||
setTimeout(function() {
|
||||
RED.typeSearch.refresh({filter:{input:true}});
|
||||
},100);
|
||||
}
|
||||
|
||||
lastAddedX = nn.x;
|
||||
lastAddedWidth = nn.w;
|
||||
|
||||
point[0] = nn.x + nn.w/2 + node_width/2 + gridSize * 2;
|
||||
ghostNode.attr('transform','translate('+(point[0] - node_width/2)+','+(point[1] - node_height/2)+')');
|
||||
rebuildQuickAddLink();
|
||||
} else {
|
||||
quickAddActive = false;
|
||||
ghostNode.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
updateActiveNodes();
|
||||
updateSelection();
|
||||
redraw();
|
||||
}
|
||||
|
||||
function canvasMouseMove() {
|
||||
var i;
|
||||
var node;
|
||||
@ -1134,8 +1161,8 @@ RED.view = (function() {
|
||||
if (moving_set.length === 1) {
|
||||
node = moving_set[0];
|
||||
spliceActive = node.n.hasOwnProperty("_def") &&
|
||||
node.n._def.inputs > 0 &&
|
||||
node.n._def.outputs > 0 &&
|
||||
((node.n.hasOwnProperty("inputs") && node.n.inputs > 0) || (!node.n.hasOwnProperty("inputs") && node.n._def.inputs > 0)) &&
|
||||
((node.n.hasOwnProperty("outputs") && node.n.outputs > 0) || (!node.n.hasOwnProperty("outputs") && node.n._def.outputs > 0)) &&
|
||||
RED.nodes.filterLinks({ source: node.n }).length === 0 &&
|
||||
RED.nodes.filterLinks({ target: node.n }).length === 0;
|
||||
}
|
||||
@ -1268,12 +1295,15 @@ RED.view = (function() {
|
||||
removedLinks.push(drag_lines[i].link)
|
||||
}
|
||||
}
|
||||
historyEvent = {
|
||||
t:"delete",
|
||||
links: removedLinks,
|
||||
dirty:RED.nodes.dirty()
|
||||
};
|
||||
RED.history.push(historyEvent);
|
||||
if (removedLinks.length > 0) {
|
||||
historyEvent = {
|
||||
t:"delete",
|
||||
links: removedLinks,
|
||||
dirty:RED.nodes.dirty()
|
||||
};
|
||||
RED.history.push(historyEvent);
|
||||
RED.nodes.dirty(true);
|
||||
}
|
||||
hideDragLines();
|
||||
}
|
||||
if (lasso) {
|
||||
@ -1465,6 +1495,7 @@ RED.view = (function() {
|
||||
var lastSelection = null;
|
||||
function updateSelection() {
|
||||
var selection = {};
|
||||
var activeWorkspace = RED.workspaces.active();
|
||||
|
||||
var workspaceSelection = RED.workspaces.selection();
|
||||
if (workspaceSelection.length === 0) {
|
||||
@ -1474,7 +1505,6 @@ RED.view = (function() {
|
||||
if (selected_link != null) {
|
||||
selection.link = selected_link;
|
||||
}
|
||||
var activeWorkspace = RED.workspaces.active();
|
||||
activeLinks = RED.nodes.filterLinks({
|
||||
source:{z:activeWorkspace},
|
||||
target:{z:activeWorkspace}
|
||||
@ -1592,7 +1622,7 @@ RED.view = (function() {
|
||||
var workspaceSelection = RED.workspaces.selection();
|
||||
if (workspaceSelection.length > 0) {
|
||||
var workspaceCount = 0;
|
||||
workspaceSelection.forEach(function(ws) { if (ws.type === 'tab') workspaceCount++ });
|
||||
workspaceSelection.forEach(function(ws) { if (ws.type === 'tab') { workspaceCount++ } });
|
||||
if (workspaceCount === RED.workspaces.count()) {
|
||||
// Cannot delete all workspaces
|
||||
return;
|
||||
@ -1633,7 +1663,7 @@ RED.view = (function() {
|
||||
var removedLinks = [];
|
||||
var removedSubflowOutputs = [];
|
||||
var removedSubflowInputs = [];
|
||||
var removedSubflowStatus = undefined;
|
||||
var removedSubflowStatus;
|
||||
var subflowInstances = [];
|
||||
|
||||
var startDirty = RED.nodes.dirty();
|
||||
@ -1721,7 +1751,7 @@ RED.view = (function() {
|
||||
],
|
||||
dirty:RED.nodes.dirty()
|
||||
}
|
||||
|
||||
RED.nodes.dirty(true);
|
||||
selected_link.source.changed = true;
|
||||
selected_link.target.changed = true;
|
||||
selected_link.target.links.splice(sourceIdIndex,1);
|
||||
@ -2509,16 +2539,18 @@ RED.view = (function() {
|
||||
var img = new Image();
|
||||
img.src = iconUrl;
|
||||
img.onload = function() {
|
||||
var largestEdge = Math.max(img.width,img.height);
|
||||
var scaleFactor = 1;
|
||||
if (largestEdge > 30) {
|
||||
scaleFactor = 30/largestEdge;
|
||||
if (!iconUrl.match(/\.svg$/)) {
|
||||
var largestEdge = Math.max(img.width,img.height);
|
||||
var scaleFactor = 1;
|
||||
if (largestEdge > 30) {
|
||||
scaleFactor = 30/largestEdge;
|
||||
}
|
||||
var width = img.width * scaleFactor;
|
||||
var height = img.height * scaleFactor;
|
||||
icon.attr("width",width);
|
||||
icon.attr("height",height);
|
||||
icon.attr("x",15-width/2);
|
||||
}
|
||||
var width = img.width * scaleFactor;
|
||||
var height = img.height * scaleFactor;
|
||||
icon.attr("width",width);
|
||||
icon.attr("height",height);
|
||||
icon.attr("x",15-width/2);
|
||||
icon.attr("xlink:href",iconUrl);
|
||||
icon.style("display",null);
|
||||
//if ("right" == d._def.align) {
|
||||
@ -2580,8 +2612,8 @@ RED.view = (function() {
|
||||
.on("mouseover",function(d){portMouseOver(d3.select(this),d,PORT_TYPE_INPUT,0);})
|
||||
.on("mouseout",function(d){portMouseOut(d3.select(this),d,PORT_TYPE_INPUT,0);});
|
||||
|
||||
outGroup.append("svg:text").attr("class","red-ui-flow-port-label").attr("x",20).attr("y",8).style("font-size","10px").text("output");
|
||||
outGroup.append("svg:text").attr("class","red-ui-flow-port-label red-ui-flow-port-index").attr("x",20).attr("y",24).text(function(d,i){ return i+1});
|
||||
outGroup.append("svg:text").attr("class","red-ui-flow-port-label").attr("x",20).attr("y",12).style("font-size","10px").text("output");
|
||||
outGroup.append("svg:text").attr("class","red-ui-flow-port-label red-ui-flow-port-index").attr("x",20).attr("y",28).text(function(d,i){ return i+1});
|
||||
|
||||
var subflowInputs = nodeLayer.selectAll(".red-ui-flow-subflow-port-input").data(activeSubflow.in,function(d,i){ return d.id;});
|
||||
subflowInputs.exit().remove();
|
||||
@ -3082,7 +3114,7 @@ RED.view = (function() {
|
||||
//thisNode.selectAll(".red-ui-flow-node-icon-shade-border-right").attr("d",function(d){return "M "+(d.w-30)+" 1 l 0 "+(d.h-2)});
|
||||
|
||||
var inputPorts = thisNode.selectAll(".red-ui-flow-port-input");
|
||||
if (isLink && showAllLinkPorts === -1 && !activeLinkNodes[d.id] && d.inputs === 0 && !inputPorts.empty()) {
|
||||
if ((!isLink || (showAllLinkPorts === -1 && !activeLinkNodes[d.id])) && d.inputs === 0 && !inputPorts.empty()) {
|
||||
inputPorts.remove();
|
||||
} else if (((isLink && (showAllLinkPorts===PORT_TYPE_INPUT||activeLinkNodes[d.id]))|| d.inputs === 1) && inputPorts.empty()) {
|
||||
var inputGroup = thisNode.append("g").attr("class","red-ui-flow-port-input");
|
||||
@ -3252,7 +3284,7 @@ RED.view = (function() {
|
||||
var statusClass = "red-ui-flow-node-status-"+(d.status.shape||"dot")+"-"+d.status.fill;
|
||||
thisNode.selectAll(".red-ui-flow-node-status").style("display","inline").attr("class","red-ui-flow-node-status "+statusClass);
|
||||
}
|
||||
if (d.status.text) {
|
||||
if (d.status.hasOwnProperty('text')) {
|
||||
thisNode.selectAll(".red-ui-flow-node-status-label").text(d.status.text);
|
||||
} else {
|
||||
thisNode.selectAll(".red-ui-flow-node-status-label").text("");
|
||||
@ -3290,6 +3322,10 @@ RED.view = (function() {
|
||||
redraw();
|
||||
focusView();
|
||||
d3.event.stopPropagation();
|
||||
if (d3.event.metaKey || d3.event.ctrlKey) {
|
||||
l.classed("red-ui-flow-link-splice",true);
|
||||
showQuickAddDialog(d3.mouse(this), selected_link);
|
||||
}
|
||||
})
|
||||
.on("touchstart",function(d) {
|
||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||
@ -3896,6 +3932,10 @@ RED.view = (function() {
|
||||
type: "compact",
|
||||
buttons: buttons
|
||||
})
|
||||
},
|
||||
scroll: function(x,y) {
|
||||
chart.scrollLeft(chart.scrollLeft()+x);
|
||||
chart.scrollTop(chart.scrollTop()+y)
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
@ -70,7 +70,7 @@ RED.workspaces = (function() {
|
||||
RED.view.state(RED.state.EDITING);
|
||||
var tabflowEditor;
|
||||
var trayOptions = {
|
||||
title: RED._("workspace.editFlow",{name:workspace.label}),
|
||||
title: RED._("workspace.editFlow",{name:RED.utils.sanitize(workspace.label)}),
|
||||
buttons: [
|
||||
{
|
||||
id: "node-dialog-delete",
|
||||
@ -157,17 +157,27 @@ RED.workspaces = (function() {
|
||||
tabflowEditor.resize();
|
||||
},
|
||||
open: function(tray) {
|
||||
var trayFooter = tray.find(".red-ui-tray-footer");
|
||||
var trayBody = tray.find('.red-ui-tray-body');
|
||||
var trayFooterLeft = $('<div class="red-ui-tray-footer-left"></div>').appendTo(trayFooter)
|
||||
|
||||
var dialogForm = $('<form id="dialog-form" class="form-horizontal"></form>').appendTo(trayBody);
|
||||
$('<div class="form-row">'+
|
||||
'<label for="node-input-name" data-i18n="[append]editor:common.label.name"><i class="fa fa-tag"></i> </label>'+
|
||||
'<input type="text" id="node-input-name">'+
|
||||
'<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">'+
|
||||
'</div>').appendTo(dialogForm);
|
||||
|
||||
$('<div class="form-row">'+
|
||||
'<label for="node-input-disabled" data-i18n="editor:workspace.status"></label>'+
|
||||
'<input type="checkbox" id="node-input-disabled"/>'+
|
||||
'</div>').appendTo(dialogForm);
|
||||
|
||||
if (!workspace.hasOwnProperty("disabled")) {
|
||||
workspace.disabled = false;
|
||||
}
|
||||
|
||||
$('<input id="node-input-disabled" type="checkbox">').prop("checked",workspace.disabled).appendTo(trayFooterLeft).toggleButton({
|
||||
enabledIcon: "fa-circle-thin",
|
||||
disabledIcon: "fa-ban",
|
||||
invertState: true
|
||||
})
|
||||
|
||||
|
||||
var row = $('<div class="form-row node-text-editor-row">'+
|
||||
'<label for="node-input-info" data-i18n="editor:workspace.info" style="width:300px;"></label>'+
|
||||
@ -196,16 +206,7 @@ RED.workspaces = (function() {
|
||||
})
|
||||
});
|
||||
|
||||
if (workspace.hasOwnProperty("disabled")) {
|
||||
$("#node-input-disabled").prop("checked",workspace.disabled);
|
||||
} else {
|
||||
workspace.disabled = false;
|
||||
}
|
||||
$("#node-input-disabled").toggleButton({
|
||||
enabledIcon: "fa-circle-thin",
|
||||
disabledIcon: "fa-ban",
|
||||
invertState: true
|
||||
})
|
||||
|
||||
|
||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||
dialogForm.on("submit", function(e) { e.preventDefault();});
|
||||
|
@ -73,8 +73,8 @@ RED.user = (function() {
|
||||
row.appendTo("#node-dialog-login-fields");
|
||||
}
|
||||
$('<div class="form-row" style="text-align: right; margin-top: 10px;"><span id="node-dialog-login-failed" style="line-height: 2em;float:left;" class="hide">'+RED._("user.loginFailed")+'</span><img src="red/images/spin.svg" style="height: 30px; margin-right: 10px; " class="login-spinner hide"/>'+
|
||||
(opts.cancelable?'<a href="#" id="node-dialog-login-cancel" style="margin-right: 20px;" tabIndex="'+(i+1)+'">'+RED._("common.label.cancel")+'</a>':'')+
|
||||
'<input type="submit" id="node-dialog-login-submit" style="width: auto;" tabIndex="'+(i+2)+'" value="'+RED._("user.login")+'"></div>').appendTo("#node-dialog-login-fields");
|
||||
(opts.cancelable?'<a href="#" id="node-dialog-login-cancel" class="red-ui-button" style="margin-right: 20px;" tabIndex="'+(i+1)+'">'+RED._("common.label.cancel")+'</a>':'')+
|
||||
'<input type="submit" id="node-dialog-login-submit" class="red-ui-button" style="width: auto;" tabIndex="'+(i+2)+'" value="'+RED._("user.login")+'"></div>').appendTo("#node-dialog-login-fields");
|
||||
|
||||
|
||||
$("#node-dialog-login-submit").button();
|
||||
@ -119,7 +119,7 @@ RED.user = (function() {
|
||||
var field = data.prompts[i];
|
||||
var row = $("<div/>",{class:"form-row",style:"text-align: center"}).appendTo("#node-dialog-login-fields");
|
||||
|
||||
var loginButton = $('<a href="#"></a>',{style: "padding: 10px"}).appendTo(row).on("click", function() {
|
||||
var loginButton = $('<a href="#" class="red-ui-button"></a>',{style: "padding: 10px"}).appendTo(row).on("click", function() {
|
||||
document.location = field.url;
|
||||
});
|
||||
if (field.image) {
|
||||
|
@ -52,6 +52,10 @@
|
||||
@include component-shadow;
|
||||
border-color: $popover-background;
|
||||
}
|
||||
textarea.ace_text-input {
|
||||
overflow: hidden;
|
||||
padding: 0px 1px !important;
|
||||
}
|
||||
|
||||
#red-ui-event-log-editor {
|
||||
.ace_scroller {
|
||||
|
@ -60,10 +60,12 @@
|
||||
.red-ui-icon-picker {
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: $primary-text-color;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
color: $primary-text-color;
|
||||
}
|
||||
|
||||
p {
|
||||
|
@ -160,6 +160,7 @@
|
||||
.red-ui-debug-msg-element {
|
||||
color: $debug-message-text-color;
|
||||
line-height: 1.3em;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
.red-ui-debug-msg-object-key {
|
||||
color: $debug-message-text-color-object-key;
|
||||
|
@ -79,6 +79,9 @@
|
||||
}
|
||||
|
||||
a {
|
||||
img {
|
||||
max-width: 14px;
|
||||
}
|
||||
.fa {
|
||||
width: 20px;
|
||||
margin-left: -25px;
|
||||
|
@ -190,6 +190,10 @@ button.red-ui-tray-resize-button {
|
||||
border-color: $form-input-border-error-color !important;
|
||||
}
|
||||
|
||||
.input-updated {
|
||||
border-color: $node-selected-color !important;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
clear: both;
|
||||
color: $form-text-color;
|
||||
@ -388,28 +392,26 @@ button.red-ui-button-small
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#red-ui-editor-node-icon-button {
|
||||
button.red-ui-button.red-ui-editor-node-appearance-button {
|
||||
position: relative;
|
||||
padding-left: 30px;
|
||||
width: calc(100% - 150px);
|
||||
height: 35px !important;
|
||||
text-align: left;
|
||||
padding: 0 6px 0 3px;
|
||||
>i {
|
||||
width: 15px;
|
||||
vertical-align: middle;
|
||||
padding-left: 2px;
|
||||
}
|
||||
.red-ui-search-result-node {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
vertical-align: middle;
|
||||
float: none;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
|
||||
}
|
||||
}
|
||||
#red-ui-editor-node-icon {
|
||||
margin-left: 10px;
|
||||
width: calc(100% - 163px);
|
||||
}
|
||||
|
||||
.red-ui-icon-picker {
|
||||
position: absolute;
|
||||
border: 1px solid $primary-border-color;
|
||||
box-shadow: 0 1px 6px -3px black;
|
||||
background: $secondary-background;
|
||||
z-Index: 21;
|
||||
display: none;
|
||||
select {
|
||||
box-sizing: border-box;
|
||||
margin: 3px;
|
||||
@ -421,6 +423,16 @@ button.red-ui-button-small
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
line-height: 0px;
|
||||
position: relative;
|
||||
&.red-ui-icon-list-dark {
|
||||
.red-ui-palette-icon-fa {
|
||||
color: $secondary-text-color;
|
||||
}
|
||||
.red-ui-palette-icon-container {
|
||||
background: $secondary-background;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.red-ui-icon-list-icon {
|
||||
display: inline-block;
|
||||
@ -428,6 +440,7 @@ button.red-ui-button-small
|
||||
padding: 4px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
|
||||
&:hover {
|
||||
background: $list-item-background-hover;
|
||||
}
|
||||
@ -579,3 +592,407 @@ button.red-ui-button-small
|
||||
button.red-ui-toggleButton.toggle {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
.red-ui-editor-subflow-env-ui-row {
|
||||
margin-right: 3px;
|
||||
>div {
|
||||
display: grid;
|
||||
grid-template-columns: 16px 40px 35% auto;
|
||||
}
|
||||
>div:first-child {
|
||||
font-size: 0.9em;
|
||||
color: $tertiary-text-color;
|
||||
margin: 3px 0 -4px;
|
||||
>div {
|
||||
padding-left: 3px;
|
||||
}
|
||||
}
|
||||
>div:last-child {
|
||||
>div {
|
||||
height: 40px;
|
||||
line-height: 30px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
// border-left: 2px dashed $secondary-border-color;
|
||||
// border-bottom: 2px dashed $secondary-border-color;
|
||||
// border: 1px dashed $secondary-border-color;
|
||||
border-right: none;
|
||||
&:not(:first-child) {
|
||||
padding: 3px;
|
||||
}
|
||||
// &:last-child {
|
||||
// border-right: 1px dashed $secondary-border-color;
|
||||
// }
|
||||
.placeholder-input {
|
||||
position: relative;
|
||||
padding: 0 3px;
|
||||
line-height: 24px;
|
||||
opacity: 0.8
|
||||
}
|
||||
.red-ui-typedInput-value-label,.red-ui-typedInput-option-label {
|
||||
select,.placeholder-input {
|
||||
margin: 3px;
|
||||
height: 26px;
|
||||
width: calc(100% - 10px);
|
||||
padding-left: 3px;
|
||||
}
|
||||
.placeholder-input {
|
||||
span:first-child {
|
||||
display:inline-block;
|
||||
height: 100%;
|
||||
width: 20px;
|
||||
text-align:center;
|
||||
border-right: 1px solid $secondary-border-color;
|
||||
background: $tertiary-background;
|
||||
}
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
margin-left: 8px;
|
||||
margin-top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
>div:nth-child(1) {
|
||||
border: none;
|
||||
padding: 2px;
|
||||
.red-ui-editableList-item-handle {
|
||||
position:relative;
|
||||
top: 0px;
|
||||
color: $tertiary-text-color;
|
||||
}
|
||||
}
|
||||
>div:nth-child(2) {
|
||||
margin: 4px;
|
||||
height: 32px;
|
||||
border: 1px dashed $secondary-border-color;
|
||||
text-align: center;
|
||||
a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 32px;
|
||||
&:hover {
|
||||
background: $secondary-background-hover;
|
||||
}
|
||||
i {
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
>div:nth-child(3) {
|
||||
position: relative;
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
span.red-ui-editor-subflow-env-lang-icon {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
background: $secondary-background;
|
||||
opacity: 0.8;
|
||||
width: 20px;
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
|
||||
}
|
||||
// .red-ui-editor-subflow-ui-grid {
|
||||
// width: 100%;
|
||||
// .red-ui-editableList-container {
|
||||
// border: none;
|
||||
// border-radius: 0;
|
||||
// }
|
||||
// .red-ui-editableList-container li {
|
||||
// border: none;
|
||||
// padding: 0;
|
||||
// &:not(:first-child) .red-ui-editableList-item-content >div:first-child >div {
|
||||
// border-top: none;
|
||||
// }
|
||||
// &.ui-sortable-helper {
|
||||
// border: 2px dashed $secondary-border-color;
|
||||
// .red-ui-editableList-item-content {
|
||||
// >div {
|
||||
// border: none;
|
||||
// opacity: 0.7
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// .red-ui-editableList-item-content {
|
||||
// >div>div {
|
||||
// display: inline-block;
|
||||
// box-sizing: border-box;
|
||||
// border-left: 1px dashed $secondary-border-color;
|
||||
// border-bottom: 1px dashed $secondary-border-color;
|
||||
// }
|
||||
// >div:first-child {
|
||||
// font-size: 0.9em;
|
||||
// display: grid;
|
||||
// grid-template-columns: 25px auto 20px;
|
||||
// >div {
|
||||
// border-top: 1px dashed $secondary-border-color;
|
||||
// padding: 1px;
|
||||
// }
|
||||
// >div:nth-child(3) {
|
||||
// border-top: none;
|
||||
// border-bottom: none;
|
||||
// // width: 20px;
|
||||
// }
|
||||
// }
|
||||
// >div:last-child {
|
||||
// display: grid;
|
||||
// grid-template-columns: 25px 140px auto 20px;
|
||||
// >div {
|
||||
// height: 48px;
|
||||
// line-height: 30px;
|
||||
// // display: inline-block;
|
||||
// // height: 48px;
|
||||
// // line-height: 30px;
|
||||
// // box-sizing: border-box;
|
||||
// //
|
||||
// // border-left: 2px dashed $secondary-border-color;
|
||||
// border-top: none;
|
||||
// // border-bottom: 2px dashed $secondary-border-color;
|
||||
// &:not(:first-child) {
|
||||
// padding: 6px 3px;
|
||||
// }
|
||||
// .placeholder-input {
|
||||
// position: relative;
|
||||
// padding: 0 3px;
|
||||
// line-height: 24px;
|
||||
// opacity: 0.8
|
||||
// }
|
||||
// .red-ui-typedInput-value-label,.red-ui-typedInput-option-label {
|
||||
// select,.placeholder-input {
|
||||
// margin: 3px;
|
||||
// height: 26px;
|
||||
// width: calc(100% - 10px);
|
||||
// padding-left: 3px;
|
||||
// }
|
||||
// input[type="checkbox"] {
|
||||
// margin-left: 8px;
|
||||
// margin-top: 0;
|
||||
// height: 100%;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// >div:nth-child(1) {
|
||||
// text-align: center;
|
||||
// a {
|
||||
// display: block;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// line-height: 45px;
|
||||
// &:hover {
|
||||
// background: $secondary-background-hover;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// >div:nth-child(2) {
|
||||
// input {
|
||||
// width: 100%;
|
||||
// }
|
||||
// // width: 140px;
|
||||
// }
|
||||
// >div:nth-child(3) {
|
||||
// position: relative;
|
||||
// .options-button {
|
||||
// position: absolute;
|
||||
// top: calc(50% - 10px);
|
||||
// margin-right: 2px;
|
||||
// right: 2px;
|
||||
// }
|
||||
// }
|
||||
// >div:nth-child(4) {
|
||||
// border-top: none;
|
||||
// border-bottom: none;
|
||||
// // width: 20px;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
.red-ui-editor-subflow-ui-edit-panel {
|
||||
padding-bottom: 3px;
|
||||
background: $primary-background;
|
||||
.red-ui-editableList-border {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid $secondary-border-color;
|
||||
}
|
||||
.red-ui-editableList-container {
|
||||
}
|
||||
.red-ui-editableList-addButton {
|
||||
margin-left: 2px;
|
||||
}
|
||||
.red-ui-editableList-header {
|
||||
background: $primary-background;
|
||||
display: grid;
|
||||
grid-template-columns: 50% 50%;
|
||||
color: $secondary-text-color;
|
||||
div:first-child {
|
||||
padding-left: 23px;
|
||||
}
|
||||
div:last-child {
|
||||
padding-left: 3px;
|
||||
}
|
||||
}
|
||||
.red-ui-editableList-container {
|
||||
padding: 0 1px;
|
||||
li {
|
||||
background: $secondary-background;
|
||||
// border-bottom: none;
|
||||
padding: 0;
|
||||
.red-ui-editableList-item-content {
|
||||
display: grid;
|
||||
grid-template-columns: 50% 50%;
|
||||
>div {
|
||||
position:relative;
|
||||
|
||||
}
|
||||
}
|
||||
input {
|
||||
margin-bottom: 0;
|
||||
border:none;
|
||||
width: 100%;
|
||||
border-right: 1px solid $secondary-border-color;
|
||||
|
||||
border-radius: 0;
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 1px inset $form-input-focus-color;
|
||||
}
|
||||
&:first-child {
|
||||
border-left: 1px solid $secondary-border-color;
|
||||
}
|
||||
}
|
||||
button.red-ui-typedInput-type-select, button.red-ui-typedInput-option-expand, button.red-ui-typedInput-option-trigger {
|
||||
border-radius: 0;
|
||||
height: 34px;
|
||||
}
|
||||
.red-ui-typedInput-container {
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
input.red-ui-typedInput-input {
|
||||
height: 34px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-editor-subflow-env-lang-icon {
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
border-top-right-radius:0;
|
||||
border-bottom-right-radius:0;
|
||||
}
|
||||
.red-ui-editableList-item-remove {
|
||||
right: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.node-input-env-locales-row {
|
||||
position: relative;
|
||||
top: -20px;
|
||||
float: right;
|
||||
select {
|
||||
padding: 2px;
|
||||
width: 160px;
|
||||
height: auto;
|
||||
min-width: 20px;
|
||||
line-height: 18px;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
.node-input-env-container-row {
|
||||
min-width: 470px;
|
||||
position: relative;
|
||||
.red-ui-editableList-item-content {
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
line-height: 32px;
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
>div:first-child {
|
||||
display: grid;
|
||||
padding-left: 5px;
|
||||
grid-template-columns: 40% auto 37px;
|
||||
> :first-child {
|
||||
width: calc(100% - 5px);
|
||||
}
|
||||
input {
|
||||
width: calc(100% - 5px);
|
||||
}
|
||||
}
|
||||
&.red-ui-editor-subflow-env-editable {
|
||||
>div:first-child {
|
||||
padding-left: 0;
|
||||
grid-template-columns: 24px 40% auto 37px;
|
||||
> a:first-child {
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
i.fa-angle-right {
|
||||
transition: all 0.2s linear;
|
||||
}
|
||||
&.expanded {
|
||||
i.fa-angle-right {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.red-ui-editableList-border .red-ui-editableList-header {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
|
||||
background: $tertiary-background;
|
||||
padding: 0;
|
||||
>div {
|
||||
display: grid;
|
||||
grid-template-columns: 24px 40% auto 37px;
|
||||
>div {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
.red-ui-editableList-container {
|
||||
padding: 0;
|
||||
.red-ui-editableList-item-handle {
|
||||
top: 25px;
|
||||
}
|
||||
.red-ui-editableList-item-remove {
|
||||
top: 25px;
|
||||
right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
#subflow-input-ui {
|
||||
// .form-row {
|
||||
// display: grid;
|
||||
// grid-template-columns: 120px auto;
|
||||
// label span {
|
||||
// display: inline-block;
|
||||
// width: 20px;
|
||||
// text-align: center;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@ -145,8 +145,8 @@ g.red-ui-flow-node-selected {
|
||||
border-color: $node-selected-color !important;
|
||||
border-style: dashed !important;
|
||||
stroke: $node-selected-color;
|
||||
stroke-width: 2;
|
||||
stroke-dasharray: 8, 3;
|
||||
stroke-width: 3;
|
||||
stroke-dasharray: 8, 4;
|
||||
}
|
||||
|
||||
.red-ui-flow-subflow .red-ui-flow-node {
|
||||
|
@ -150,7 +150,8 @@
|
||||
input[type="tel"],
|
||||
input[type="color"],
|
||||
div[contenteditable="true"],
|
||||
.uneditable-input {
|
||||
.uneditable-input,
|
||||
.placeholder-input {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
height: 34px;
|
||||
@ -190,7 +191,8 @@
|
||||
input[type="tel"],
|
||||
input[type="color"],
|
||||
div[contenteditable="true"],
|
||||
.uneditable-input {
|
||||
.uneditable-input,
|
||||
.placeholder-input {
|
||||
background-color: $form-input-background;
|
||||
border: 1px solid $form-input-border-color;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@
|
||||
font-size: 30px;
|
||||
line-height: 30px;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
|
||||
span {
|
||||
vertical-align: middle;
|
||||
@ -192,6 +193,7 @@
|
||||
color: $header-menu-color;
|
||||
padding: 3px 40px;
|
||||
img {
|
||||
max-width: 100%;
|
||||
margin-right: 10px;
|
||||
padding: 4px;
|
||||
border: 3px solid transparent;
|
||||
@ -271,3 +273,9 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 450px) {
|
||||
span.red-ui-header-logo > span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@ -119,10 +119,10 @@
|
||||
}
|
||||
|
||||
.red-ui-palette-node {
|
||||
display: inline-block;
|
||||
// display: inline-block;
|
||||
cursor: move;
|
||||
background: $secondary-background;
|
||||
margin: 5px auto;
|
||||
margin: 10px auto;
|
||||
height: 25px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid $node-border;
|
||||
@ -131,23 +131,16 @@
|
||||
width: 120px;
|
||||
background-size: contain;
|
||||
position: relative;
|
||||
&:first-child {
|
||||
margin-top: 10px;
|
||||
&:not(.red-ui-palette-node-config):first-child {
|
||||
margin-top: 15px;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 10px;
|
||||
&:not(.red-ui-palette-node-config):last-child {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
.red-ui-palette-node:hover {
|
||||
margin: 4px auto;
|
||||
border-color: $node-selected-color;
|
||||
border-width: 2px;
|
||||
&:first-child {
|
||||
margin-top: 9px;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
border-color: transparent;
|
||||
box-shadow: 0 0 0 2px $node-selected-color;
|
||||
}
|
||||
.red-ui-palette-port {
|
||||
position: absolute;
|
||||
|
@ -162,3 +162,15 @@
|
||||
background: none;
|
||||
color: $tertiary-text-color;
|
||||
}
|
||||
|
||||
|
||||
.red-ui-popover-panel {
|
||||
@include component-shadow;
|
||||
font-family: $primary-font;
|
||||
font-size: $primary-font-size;
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid $primary-border-color;
|
||||
background: $secondary-background;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
54
packages/node_modules/@node-red/editor-client/src/sass/radialMenu.scss
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License);
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
.red-ui-editor-radial-menu {
|
||||
font-size: $primary-font-size;
|
||||
font-family: $primary-font;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
z-index: 1000;
|
||||
|
||||
& > div {
|
||||
position: absolute;
|
||||
border-radius: 80px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
background: $shadow;
|
||||
border: 1px solid $primary-border-color;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-editor-radial-menu-opt {
|
||||
position: absolute;
|
||||
border-radius: 20px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: $secondary-background;
|
||||
border: 2px solid $primary-border-color;
|
||||
text-align: center;
|
||||
line-height:50px
|
||||
}
|
||||
|
||||
.red-ui-editor-radial-menu-opt-disabled {
|
||||
border-color: $tertiary-border-color;
|
||||
color: $tertiary-border-color;
|
||||
}
|
||||
.red-ui-editor-radial-menu-opt-active {
|
||||
background: $secondary-background-hover;
|
||||
}
|
@ -65,3 +65,5 @@
|
||||
@import "keyboard";
|
||||
|
||||
@import "debug";
|
||||
|
||||
@import "radialMenu";
|
||||
|
@ -35,15 +35,8 @@ ul.red-ui-sidebar-node-config-list {
|
||||
overflow: hidden;
|
||||
|
||||
&.selected {
|
||||
margin: 4px auto;
|
||||
border-color: $node-selected-color;
|
||||
border-width: 2px;
|
||||
&:first-child {
|
||||
margin-top: 9px;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
border-color: transparent;
|
||||
box-shadow: 0 0 0 2px $node-selected-color;
|
||||
}
|
||||
}
|
||||
.red-ui-palette-label {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
.red-ui-sidebar-context-stack {
|
||||
position: absolute;
|
||||
top: 42px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
@ -27,9 +27,22 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-info-table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
table.red-ui-info-table tr:not(.blank) td:first-child {
|
||||
width: 30%;
|
||||
}
|
||||
table.red-ui-info-table tr:not(.blank) td:last-child {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-sidebar-context-property {
|
||||
overflow-wrap: break-word;
|
||||
position: relative;
|
||||
.red-ui-debug-msg-tools {
|
||||
right: 0px;
|
||||
|
@ -56,118 +56,9 @@
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
button.red-ui-typedInput-type-select,
|
||||
button.red-ui-typedInput-option-expand,
|
||||
button.red-ui-typedInput-option-trigger
|
||||
{
|
||||
text-align: left;
|
||||
border: none;
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
padding: 0 1px 0 5px;
|
||||
display:inline-block;
|
||||
background: $form-button-background;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
color: $form-text-color;
|
||||
i.red-ui-typedInput-icon {
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
&.disabled {
|
||||
cursor: default;
|
||||
i.red-ui-typedInput-icon {
|
||||
color: $secondary-text-color-disabled;
|
||||
}
|
||||
}
|
||||
.red-ui-typedInput-type-label,.red-ui-typedInput-option-label {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
padding: 0 1px 0 5px;
|
||||
img {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.disabled):hover {
|
||||
text-decoration: none;
|
||||
background: $workspace-button-background-hover;
|
||||
}
|
||||
&:focus {
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
box-shadow: inset 0 0 0 1px $form-input-focus-color;
|
||||
}
|
||||
&:not(.disabled):active {
|
||||
background: $workspace-button-background-active;
|
||||
text-decoration: none;
|
||||
}
|
||||
&.red-ui-typedInput-full-width {
|
||||
width: 100%;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
&:before {
|
||||
content:'';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
button.red-ui-typedInput-option-expand {
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
button.red-ui-typedInput-option-trigger {
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 0 0 0 0;
|
||||
position:absolute;
|
||||
right: 0;
|
||||
.red-ui-typedInput-option-label {
|
||||
background:$form-button-background;
|
||||
color: $form-text-color;
|
||||
position:absolute;
|
||||
left:0;
|
||||
right:23px;
|
||||
top: 0;
|
||||
padding: 0 5px 0 8px;
|
||||
i.red-ui-typedInput-icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
.red-ui-typedInput-option-caret {
|
||||
top: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 17px;
|
||||
padding-left: 6px;
|
||||
&:before {
|
||||
content:'';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
&:focus .red-ui-typedInput-option-caret {
|
||||
box-shadow: inset 0 0 0 1px $form-input-focus-color;
|
||||
.red-ui-typedInput-value-label-inactive {
|
||||
background: $secondary-background-disabled;
|
||||
color: $secondary-text-color-disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,7 +71,9 @@
|
||||
max-height: 350px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid $primary-border-color;
|
||||
box-sizing: border-box;
|
||||
background: $secondary-background;
|
||||
white-space: nowrap;
|
||||
z-index: 2000;
|
||||
a {
|
||||
padding: 6px 18px 6px 6px;
|
||||
@ -200,8 +93,124 @@
|
||||
text-decoration: none;
|
||||
background: $workspace-button-background-active;
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
.red-ui-typedInput-icon {
|
||||
margin-right: 4px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
button.red-ui-typedInput-type-select,
|
||||
button.red-ui-typedInput-option-expand,
|
||||
button.red-ui-typedInput-option-trigger
|
||||
{
|
||||
text-align: left;
|
||||
border: none;
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
padding: 0 1px 0 5px;
|
||||
display:inline-block;
|
||||
background: $form-button-background;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
min-width: 23px;
|
||||
vertical-align: middle;
|
||||
color: $form-text-color;
|
||||
i.red-ui-typedInput-icon {
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
&.disabled {
|
||||
cursor: default;
|
||||
> i.red-ui-typedInput-icon {
|
||||
color: $secondary-text-color-disabled;
|
||||
}
|
||||
}
|
||||
.red-ui-typedInput-type-label,.red-ui-typedInput-option-label {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: 100%;
|
||||
padding: 0 1px 0 5px;
|
||||
img {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.disabled):hover {
|
||||
text-decoration: none;
|
||||
background: $workspace-button-background-hover;
|
||||
}
|
||||
&:focus {
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
box-shadow: inset 0 0 0 1px $form-input-focus-color;
|
||||
}
|
||||
&:not(.disabled):active {
|
||||
background: $workspace-button-background-active;
|
||||
text-decoration: none;
|
||||
}
|
||||
&.red-ui-typedInput-full-width {
|
||||
width: 100%;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
&:before {
|
||||
content:'';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
button.red-ui-typedInput-option-expand {
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
button.red-ui-typedInput-option-trigger {
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 0 0 0 0;
|
||||
position:absolute;
|
||||
right: 0;
|
||||
.red-ui-typedInput-option-label {
|
||||
background:$form-button-background;
|
||||
color: $form-text-color;
|
||||
position:absolute;
|
||||
left:0;
|
||||
right:23px;
|
||||
top: 0;
|
||||
padding: 0 5px 0 8px;
|
||||
i.red-ui-typedInput-icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
.red-ui-typedInput-option-caret {
|
||||
top: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 17px;
|
||||
padding-left: 5px;
|
||||
&:before {
|
||||
content:'';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
&:focus .red-ui-typedInput-option-caret {
|
||||
box-shadow: inset 0 0 0 1px $form-input-focus-color;
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,7 @@
|
||||
{
|
||||
'$abs':{ args:[ 'number' ]},
|
||||
'$append':{ args:[ 'array1', 'array2' ]},
|
||||
'$assert':{ args: [ 'arg', 'str' ]},
|
||||
'$average':{ args:[ 'array' ]},
|
||||
'$base64decode':{ args:[ ]},
|
||||
'$base64encode':{ args:[ ]},
|
||||
@ -116,8 +117,14 @@
|
||||
'$ceil':{ args:[ 'number' ]},
|
||||
'$contains':{ args:[ 'str', 'pattern' ]},
|
||||
'$count':{ args:[ 'array' ]},
|
||||
'$decodeUrl':{ args:[ 'str' ]},
|
||||
'$decodeUrlComponent':{ args:[ 'str' ]},
|
||||
'$distinct':{ args:[ 'array' ]},
|
||||
'$each':{ args:[ 'object', 'function' ]},
|
||||
'$encodeUrl':{ args: ['str'] },
|
||||
'$encodeUrlComponent':{ args:[ 'str' ]},
|
||||
'$env': { args:[ 'arg' ]},
|
||||
'$error':{ args:[ 'str' ]},
|
||||
'$eval': { args: ['expr', 'context']},
|
||||
'$exists':{ args:[ 'arg' ]},
|
||||
'$filter':{ args:[ 'array', 'function' ]},
|
||||
@ -151,18 +158,20 @@
|
||||
'$reverse':{ args:[ 'array' ]},
|
||||
'$round':{ args:[ 'number', 'precision' ]},
|
||||
'$shuffle':{ args:[ 'array' ]},
|
||||
'$sift':{ args:[ 'object', 'function' ]},
|
||||
'$sift':{ args: ['object', 'function'] },
|
||||
'$single':{ args: ['array', 'function'] },
|
||||
'$sort':{ args:[ 'array', 'function' ]},
|
||||
'$split':{ args:[ 'str', 'separator', 'limit' ]},
|
||||
'$spread':{ args:[ 'object' ]},
|
||||
'$sqrt':{ args:[ 'number' ]},
|
||||
'$string':{ args:[ 'arg' ]},
|
||||
'$string':{ args:[ 'arg', 'prettify' ]},
|
||||
'$substring':{ args:[ 'str', 'start', 'length' ]},
|
||||
'$substringAfter':{ args:[ 'str', 'chars' ]},
|
||||
'$substringBefore':{ args:[ 'str', 'chars' ]},
|
||||
'$sum':{ args:[ 'array' ]},
|
||||
'$toMillis':{args:['timestamp']}, // <-------------
|
||||
'$trim':{ args:[ 'str' ]},
|
||||
'$type':{ args:['value']},
|
||||
'$uppercase':{ args:[ 'str' ]},
|
||||
'$zip':{ args:[ 'array1' ]}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||
@ -20,7 +21,6 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<head>
|
||||
<title>{{ page.title }}</title>
|
||||
<link rel="icon" type="image/png" href="{{ page.favicon }}">
|
||||
<link rel="mask-icon" href="{{ page.tabicon }}" color="#8f0000">
|
||||
|
@ -30,16 +30,16 @@
|
||||
<!-- (with the 'node-input-' prefix). -->
|
||||
<!-- The available icon classes are defined Font Awesome Icons (FA Icons) -->
|
||||
<div class="form-row">
|
||||
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
|
||||
<input type="text" id="node-input-topic" placeholder="Topic">
|
||||
<label for="node-input-topic"><i class="fa fa-tasks"></i> <span data-i18n="common.label.topic"></span></label>
|
||||
<input type="text" id="node-input-topic" data-i18n="[placeholder]common.label.topic">
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<!-- By convention, most nodes have a 'name' property. The following div -->
|
||||
<!-- provides the necessary field. Should always be the last option -->
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<script type="text/x-red" data-template-name="inject">
|
||||
<script type="text/html" data-template-name="inject">
|
||||
<div class="form-row">
|
||||
<label for="node-input-payload"><i class="fa fa-envelope"></i> <span data-i18n="common.label.payload"></span></label>
|
||||
<input type="text" id="node-input-payload" style="width:70%">
|
||||
@ -138,11 +138,11 @@
|
||||
width: 100px;
|
||||
}
|
||||
.inject-time-days input {
|
||||
width: auto;
|
||||
vertical-align: baseline;
|
||||
width: auto !important;
|
||||
vertical-align: baseline !important;
|
||||
}
|
||||
.inject-time-times {
|
||||
width: 90px;
|
||||
width: 90px !important;
|
||||
}
|
||||
#inject-time-time {
|
||||
width: 75px;
|
||||
@ -156,7 +156,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('inject',{
|
||||
category: 'input',
|
||||
category: 'common',
|
||||
color:"#a6bbcf",
|
||||
defaults: {
|
||||
name: {value:""},
|