mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
2 Commits
fix-csv-te
...
outliner-c
Author | SHA1 | Date | |
---|---|---|---|
|
b65e4d5794 | ||
|
7599e865fd |
29
.github/scripts/update-node-red-docker.js
vendored
29
.github/scripts/update-node-red-docker.js
vendored
@@ -1,29 +0,0 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const newVersion = require("../../package.json").version;
|
||||
|
||||
if (process.env.GITHUB_REF !== "refs/tags/"+newVersion) {
|
||||
console.log(`GITHUB_REF doesn't match the package.json version: ${process.env.GITHUB_REF} !== ${newVersion}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!/^\d+\.\d+\.\d+$/.test(newVersion)) {
|
||||
console.log(`Not updating for a non-stable release - ${newVersion}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const currentVersion = require("../../../node-red-docker/package.json").version;
|
||||
|
||||
console.log(`Update from ${currentVersion} to ${newVersion}`)
|
||||
|
||||
updateFile(__dirname+"/../../../node-red-docker/package.json", currentVersion, newVersion);
|
||||
updateFile(__dirname+"/../../../node-red-docker/docker-custom/package.json", currentVersion, newVersion);
|
||||
updateFile(__dirname+"/../../../node-red-docker/README.md", currentVersion, newVersion);
|
||||
|
||||
console.log(`::set-env name=newVersion::${newVersion}`);
|
||||
|
||||
function updateFile(path,from,to) {
|
||||
let contents = fs.readFileSync(path,"utf8");
|
||||
contents = contents.replace(new RegExp(from.replace(/\./g,"\\."),"g"), to);
|
||||
fs.writeFileSync(path, contents);
|
||||
}
|
18
.github/scripts/update-node-red-website.js
vendored
18
.github/scripts/update-node-red-website.js
vendored
@@ -1,18 +0,0 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const newVersion = require("../../package.json").version;
|
||||
|
||||
if (process.env.GITHUB_REF !== "refs/tags/"+newVersion) {
|
||||
console.log(`GITHUB_REF doesn't match the package.json version: ${process.env.GITHUB_REF} !== ${newVersion}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!/^\d+\.\d+\.\d+$/.test(newVersion)) {
|
||||
console.log(`Not updating for a non-stable release - ${newVersion}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const path = __dirname+"/../../../node-red.github.io/index.html";
|
||||
let contents = fs.readFileSync(path, "utf8");
|
||||
contents = contents.replace(/<span class="node-red-latest-version">v\d+\.\d+\.\d+<\/span>/, `<span class="node-red-latest-version">v${newVersion}<\/span>` );
|
||||
fs.writeFileSync(path, contents);
|
59
.github/workflows/build.yml
vendored
59
.github/workflows/build.yml
vendored
@@ -1,59 +0,0 @@
|
||||
name: PublishDockerImage
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
name: 'Update node-red-docker image'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out node-red repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'node-red'
|
||||
- name: Check out node-red-docker repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'node-red/node-red-docker'
|
||||
path: 'node-red-docker'
|
||||
- name: Check out node-red.github.io repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'node-red/node-red.github.io'
|
||||
path: 'node-red.github.io'
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12'
|
||||
- run: node ./node-red/.github/scripts/update-node-red-docker.js
|
||||
- name: Create Docker Pull Request
|
||||
uses: peter-evans/create-pull-request@v2
|
||||
with:
|
||||
token: ${{ secrets.NR_REPO_TOKEN }}
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
path: 'node-red-docker'
|
||||
commit-message: 'Bump to ${{ env.newVersion }}'
|
||||
title: '🚀 Update to Node-RED ${{ env.newVersion }} release'
|
||||
body: |
|
||||
Updates the Node-RED Docker repo for the ${{ env.newVersion }} release.
|
||||
|
||||
Once this is merged, you will need to create a new release with the tag `v${{ env.newVersion }}`.
|
||||
|
||||
This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary
|
||||
- run: node ./node-red/.github/scripts/update-node-red-website.js
|
||||
- name: Create Website Pull Request
|
||||
uses: peter-evans/create-pull-request@v2
|
||||
with:
|
||||
token: ${{ secrets.NR_REPO_TOKEN }}
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
path: 'node-red.github.io'
|
||||
commit-message: 'Bump to ${{ env.newVersion }}'
|
||||
title: '🚀 Update to Node-RED ${{ env.newVersion }} release'
|
||||
body: |
|
||||
Updates the Node-RED Website repo for the ${{ env.newVersion }} release.
|
||||
|
||||
This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,5 +22,4 @@ packages/node_modules/@node-red/editor-client/public
|
||||
!test/**/node_modules
|
||||
docs
|
||||
!packages/node_modules/**/docs
|
||||
.vscode
|
||||
.nyc_output
|
||||
.vscode
|
15
.travis.yml
15
.travis.yml
@@ -1,21 +1,12 @@
|
||||
sudo: false
|
||||
addons:
|
||||
chrome: stable
|
||||
language: node_js
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "14"
|
||||
script:
|
||||
- ./node_modules/.bin/grunt && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
||||
# - scripts/install-ui-test-dependencies.sh && grunt test-ui
|
||||
before_script:
|
||||
- npm install -g coveralls
|
||||
- node_js: "12"
|
||||
script:
|
||||
- ./node_modules/.bin/grunt no-coverage
|
||||
- node_js: "10"
|
||||
script:
|
||||
- ./node_modules/.bin/grunt no-coverage
|
||||
- ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
||||
before_script:
|
||||
- npm install -g istanbul coveralls
|
||||
- node_js: "8"
|
||||
script:
|
||||
- ./node_modules/.bin/grunt no-coverage
|
||||
|
364
CHANGELOG.md
364
CHANGELOG.md
@@ -1,367 +1,3 @@
|
||||
### 1.2.8: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Ensure subflow help is picked up for palette tooltip Fixes #2834
|
||||
- Improve Ru locale (#2826) @alexk111
|
||||
- Fix scrollbars (#2825) @alexk111
|
||||
|
||||
Runtime
|
||||
|
||||
- Restrict project file access to inside the project directory
|
||||
- Validate user-provided language parameter before passing to i18n
|
||||
- Fix grunt release mkdir issue on Node.js 14 (#2827) @alexk111
|
||||
- Prevent crash when coreNodesDir is empty (#2831) @hardillb
|
||||
|
||||
Nodes
|
||||
|
||||
- Batch node: Fixing minor typo in node's documentation (#2848) @matthiasradde
|
||||
- Split node: Handle out of order messages as long as one of the messages has msg.parts.count set to the proper value (#2748) @s4ke
|
||||
|
||||
### 1.2.7: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Ensure subflow-scoped config nodes do not get moved on import Fixes #2789
|
||||
- Allow TypedInput to be disabled (#2752) @bartbutenaers
|
||||
- Allow userMenu to be explicitly enabled (#2805) @tfmf
|
||||
- Improvements to DE translation (#2192) @ketzu
|
||||
|
||||
|
||||
Runtime
|
||||
|
||||
- Handle `undefined` error passed to node.error (#2781) @johnwang71
|
||||
- Disable nyc coverage reporting on older node versions
|
||||
- Improve Editor API unit test coverage (#2777) @aaronmyatt
|
||||
|
||||
|
||||
Nodes
|
||||
|
||||
- Trigger: ensure timestamp option sends .now() at point of sending
|
||||
|
||||
|
||||
### 1.2.6: Maintenance Release
|
||||
|
||||
|
||||
Editor
|
||||
|
||||
- Update Japanese translations for 1.2.5 (#2764) @kazuhitoyokoi
|
||||
- Library: properly handle symlinked folders (#2768) @natcl
|
||||
|
||||
Runtime
|
||||
|
||||
- Support Windows paths when installing tarball by path name Fixes #2769
|
||||
- Fix unsecure command usage in GH Action
|
||||
|
||||
Nodes
|
||||
|
||||
- Update MQTT to latest to fix Node 8 URL breakage
|
||||
|
||||
|
||||
|
||||
|
||||
### 1.2.5: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Fix import of config nodes with unknown z property
|
||||
|
||||
Runtime
|
||||
|
||||
- Set ACTIONS_ALLOW_UNSECURE_COMMANDS in GH Action
|
||||
|
||||
### 1.2.4: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Support bigint types in Debug sidebar
|
||||
- Clear retained status of deleted nodes
|
||||
- Prevent needless retention of node status messages
|
||||
- Update projects dialogs to use TypedInput-cred input
|
||||
- Restore cursor position in TypedInput cred-mode
|
||||
- Ensure config nodes with invalid z are imported somewhere
|
||||
- Ensure user keyboard shortcuts override defaults Fixes #2753
|
||||
|
||||
Runtime
|
||||
|
||||
- Disable projects when flowFile passed into grunt dev
|
||||
- Add Russian Locale (#2761) (#2531) (@alexk111)
|
||||
- Add Japanese translation for http-in node (#2758) (@kazuhitoyokoi)
|
||||
|
||||
Nodes
|
||||
|
||||
- CSV: Fix CSV node repeating array output
|
||||
|
||||
### 1.2.3: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Disable 'use strict' checking in Function node Fixes #2743
|
||||
- Add gray/grey alternate options for status
|
||||
- Handle import errors on initial load and report to user
|
||||
- Only apply recovery tab on initial load Fixes #2731
|
||||
- Reinstate coveralls reporting to travis build
|
||||
- Update Japanese message catalogue for 1.2.3 release #2747 (@HiroyasuNishiyama)
|
||||
|
||||
Runtime
|
||||
|
||||
- Modify default settings comment (#2739)
|
||||
- Add mutex lock to saveSettings storage call Fixes #2736 (#2737)
|
||||
- Migrate to nyc instead of istanbul for code coverage
|
||||
- Move mosca to ui-test-dependencies
|
||||
- Remove " from npm install prefix option
|
||||
|
||||
### 1.2.2: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Prevent node z property getting set to 0 or ""
|
||||
- Only apply z-recovery logic to flow nodes
|
||||
- Fix api call to reload flows Fixes #2726
|
||||
- Remove bad z property from import config nodes
|
||||
|
||||
### 1.2.1: Maintenance Release
|
||||
|
||||
Runtime
|
||||
|
||||
- Fix race condition in .config file migration Fixes #2724
|
||||
|
||||
|
||||
### 1.2.0: Milestone Release
|
||||
|
||||
Editor
|
||||
|
||||
- Fix selection of link node not existing within active workspace #2722 (@HiroyasuNishiyama)
|
||||
- Fix import of merged flow
|
||||
- Fix width of upload button in Safari #2718 (@HiroyasuNishiyama)
|
||||
- Update Chinese translations #2719 (@JiyeYu)
|
||||
- Update Japanese translations needed for 1.2 #2710 (@kazuhitoyokoi)
|
||||
- Fix unexpected line break of sidebar tab name popover #2716 (@HiroyasuNishiyama)
|
||||
- i18n module refresh tooltip #2717 (@HiroyasuNishiyama)
|
||||
- Add better error message if context file gets corrupted
|
||||
- Update info text of function node #2714 (@HiroyasuNishiyama)
|
||||
- Use markdown editor if editText called with md mode
|
||||
- Prevent group actions when in non-default mouse mode
|
||||
|
||||
### 1.2.0-beta.1: Beta Release
|
||||
|
||||
Editor
|
||||
|
||||
- Detect importing duplicate nodes and help user resolve #2698
|
||||
- Allow sidebar tabs to be reordered #2655
|
||||
- Add tgz upload button to palette manager #2682
|
||||
- Add 'automatic' git workflow for projects #2035
|
||||
- Allow project version string to be edited
|
||||
- Sanitize unknown node type when displaying
|
||||
- Handle nodes with invalid z property Closes #2170
|
||||
- Outline: Ensure sf instance nodes update in outliner when import-replace sf
|
||||
- Outline: Ensure recovered nodes tab is added to outliner properly
|
||||
- Groups: Only recalculate group label offsets when needed
|
||||
- Groups: Reuse first group name/style when merging elements Fixes #2680
|
||||
- Groups: Fix copy/paste of node into active group Fixes #2686
|
||||
- ACE: Update ACE to 1.4.12-src-min-noconflict Fixes #1988
|
||||
- ACE: Add comment highlighting to JSONata and fix regex handling Closes #2701
|
||||
- ACE: Ensure errors in ACE NRJavaScript mode are on valid lines
|
||||
- Prevent Enter on search box from reloading page Fixes #2678
|
||||
- Allow toggleButton icons to be optional
|
||||
- Allow treeList to have a header component
|
||||
- Disable selection of FA icons when dbl clicking node
|
||||
|
||||
Runtime
|
||||
|
||||
- Add RED.hooks API for pluggable routing #2665
|
||||
- Add flows:* events and deprecate nodes-* events
|
||||
- Split .config.json into separate files #2794
|
||||
- Add support for file upload in /nodes api #2682
|
||||
- Add 'done' metric log for message tracing #2685 (@k-toumura)
|
||||
- Add mutex locking around /flow apis #2679
|
||||
- Default flowFilePretty to true if projects enabled
|
||||
- Replace Math.random with crypto.getBytes for session tokens
|
||||
- Fix `this` context when calling multiple event listeners Fixes #2692. #2693 (@mgroenhoff)
|
||||
- Add --userDir=/tmp/foo support to grunt dev
|
||||
- Skip loading node html if disableEditor set #2684
|
||||
- Update util.writeFile to write to tmp file before rename #2683
|
||||
- Fix getModuleFiles function to include path property #2705 (@t-kawamorita)
|
||||
- Update nodemon to latest so grunt dev task behaves
|
||||
- Improve jsdoc of util.getObjectProperty to clarify thrown error See #2703
|
||||
|
||||
Nodes
|
||||
|
||||
- Trigger: allow msg.delay to be used to set delay/loop interval #2707
|
||||
- Function: allow to send & log in its initialize code #2644 (@cinhcet)
|
||||
- MQTT: Update to MQTT 4.2.1 Closes #2694
|
||||
- Debug: Handle undefined value in Debug view of Array and Object Fixes #2696
|
||||
- Switch: Clarify empty rules in switch node documentation #2649 (@natcl) #2669 (@kazuhitoyokoi)
|
||||
- Updated core nodes to use Done callback #2653 (@k-toumura)
|
||||
- yaml, xml, json, html, http, template, range, link, status, catch, complete, inject
|
||||
|
||||
### 1.1.3: Maintenance Release
|
||||
|
||||
Editor
|
||||
- Fix vertical align of fa node icons Fixes #2670
|
||||
- Allow lasso selection to be restricted to active group
|
||||
- Make ctrl-click on nested group more intuitive
|
||||
- Fix copy/paste of nested groups
|
||||
- Add Set(iterable) polyfill for IE11
|
||||
- Support select-all inside active group
|
||||
- Improve performance of moving groups
|
||||
- Add additional check for git auth failure response Fixes #2656
|
||||
- german translation, wording (#2660) (#2666)
|
||||
- Remove filtering of duplicate fa icons
|
||||
- Show node help when switching node edit dialogs Fixes #2652
|
||||
- Ensure group theme picks up theme defaults properly Fixes #2651
|
||||
|
||||
Nodes
|
||||
- Clarify Switch node isEmpty help
|
||||
- HTTP In: handle application/cbor as binary
|
||||
|
||||
Runtime
|
||||
- Move runtime settings back to adminApi from editorApi Fixes #2662
|
||||
- Update Chinese message for debug node
|
||||
|
||||
### 1.1.2: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Fix all the touch screen issues Fixes #2647
|
||||
- Add RED.view.redrawStatus to avoid full redraw on update
|
||||
- Ensure node/group xrefs are consistent on import
|
||||
- Disable keyboard handler when dialogs are open
|
||||
- Ensure unknown nodes removed from outliner when node registers Fixes #2646
|
||||
|
||||
Runtime
|
||||
|
||||
- Allow Comms websocket auth to be done via token header Fixes #2642
|
||||
|
||||
### 1.1.1: Maintenance Release
|
||||
|
||||
Editor
|
||||
|
||||
- Set apiRootUrl for debug pop-out to load locales properly Fixes #2629, #2630
|
||||
- Update build-custom-theme to handle keyframes properly Fixes #2636
|
||||
- Remove hardcoded css and allow group to default from theme Fixes #2633
|
||||
- Add RED.view.DEBUG_SYNC_REDRAW to disable requestAnimationFrame References #2631
|
||||
- Fix up subflow port wiring
|
||||
- Ensure groups are removed when deleting subflows
|
||||
- Get group order right in history events to ensure proper handling
|
||||
- Prevent wiring to node with no corresponding port Fixes #2641
|
||||
- Avoid copying duplicate nodes to internal clipboard
|
||||
- Fix connecting wires to subflow status or io ports on touchscreen Fixes #2637
|
||||
|
||||
Runtime
|
||||
|
||||
- Authenticate websocket comms using user-provided token if present Fixes #2642
|
||||
|
||||
Nodes
|
||||
|
||||
- Delay: add words about independence of messages being delayed.
|
||||
- Debug: fix debug status to not loop, make migration more seamless, detect status type objects #2638
|
||||
- Debug: Update Japanese message for debug node #2645 (@kazuhitoyokoi)
|
||||
|
||||
### 1.1.0: Milestone Release
|
||||
|
||||
Editor
|
||||
|
||||
- Align node labels on FF
|
||||
- Fix node toggle button initial opacity
|
||||
- Make color/icon/label-pos pickers keyboard navigable
|
||||
- Default group label to be shown and improve toggle button
|
||||
- Fix clearing group label
|
||||
- Remove hardcoded css Fixes #2603
|
||||
- Fix node button mouse pointer css
|
||||
- Change node linebreak handling to use "\n "
|
||||
- Handle import of node with non-default number of outputs
|
||||
- Improve display of focussed form element
|
||||
- Fix typedInput error on empty subflow input types #2624 (@HiroyasuNishiyama)
|
||||
- Update JP message catalogue for subflow input type #2471 (@HiroyasuNishiyama)
|
||||
- Outliner - add empty item when last config node moved
|
||||
- Update zh-CN/zh-TW translations #2626 (@JiyeYu)
|
||||
- Add default shortcut for `core:show-help-tab`
|
||||
- Clear outline focus on config node sidebar panel
|
||||
- Tweak group margin to fit node status and look better
|
||||
- Fix reparenting nodes in outliner when they change
|
||||
|
||||
Runtime
|
||||
|
||||
- Add developer options - permits npm run build-dev #2628 (@Steve-Mcl)
|
||||
|
||||
Nodes
|
||||
- Add example flows for lots of core nodes #2585 #2550 #2549 (@HiroyasuNishiyama)
|
||||
- TCP: Fix tcp in node finishing packets when in streaming base64 receive mode.
|
||||
- Join: Clear timeout when msg.reset received Fixes #2471
|
||||
- Switch: JSONata expr does not require msg.parts.count
|
||||
- Inject: fix backwards migration of inject without topic
|
||||
|
||||
#### 1.1.0-beta.3: Beta Release
|
||||
|
||||
Editor
|
||||
|
||||
- Fix wiring nodes from input back to output
|
||||
- Fix sometimes unable to keyboard-move group to left/up
|
||||
- Fix group position in outliner
|
||||
- Handle unknown nodes with no icon
|
||||
- Prevent node creep when switching tabs
|
||||
|
||||
#### 1.1.0-beta.2: Beta Release
|
||||
|
||||
Editor
|
||||
|
||||
- Add UI tests to travis build #2593 #2616 #2617 #2619 (@kazuhitoyokoi)
|
||||
- Add Japanese translations for outliner, jsonata and runtime #2618 (@kazuhitoyokoi)
|
||||
- Fix deleting node in group after changing selection
|
||||
- Fixup padding of quick-add search box
|
||||
- Move config nodes under type-level hierarchy in outline
|
||||
- Emit nodes:change event for config node users list modified
|
||||
- Increase group margin to avoid clash with status text
|
||||
- Fix event order when quick-adding node to group
|
||||
- Switch RED.events.DEBUG messages to warn to get stacktraces
|
||||
- Fix empty item handling for subflows/config in outliner
|
||||
- Fix search indexing of group nodes
|
||||
- Avoid regenerating every node label on redraw
|
||||
- Fix handling of multi-line node label
|
||||
- Disable merge group menu for single item or non-group item #2611 (@HiroyasuNishiyama)
|
||||
- Merge pull request #2609 from node-red-hitachi/fix-remove-from-group
|
||||
- Fix position of empty group with multi-line label #2612 (@HiroyasuNishiyama)
|
||||
- Make treelist of subflow/config nodes initially have empty placeholder
|
||||
- Fix empty placeholder not shown on remove from group #2609 (@HiroyasuNishiyama)
|
||||
- Prevent conversion of circular structure #2607 (@HiroyasuNishiyama)
|
||||
- Handle null status text in the editor Fixes #2606
|
||||
- Massively reduce our dependency on d3 to render the view
|
||||
- EditableList/TreeList - defer adding elements to DOM
|
||||
- Prevent RED.stop being called multiple times if >1 signal received
|
||||
- Flag a node as removed when it is disabled
|
||||
- Some performance improvements for TreeList
|
||||
- Resize info/help sidebars whenever sidebar is opened
|
||||
- Add search defaults to outliner searchBox
|
||||
- Add search presets option to searchBox widget
|
||||
- Add RED.popover.menu as a new type of menu widget
|
||||
- Add support for is:XYZ search flags
|
||||
- Track subflow instances on the subflow node itself
|
||||
- Refresh outline filter whenever something changes Fixes #2601
|
||||
- Fix Help tab search box appearance
|
||||
- Rename Node Information to Information in sidebar
|
||||
- Do a sync-redraw after clearing to ensure clean state
|
||||
- Make catch/status/complete/link filter case-insensitive
|
||||
- Add 'add' option to touch radialMenu for quick-add dialog
|
||||
- Merge branch 'dev' of https://github.com/node-red/node-red into dev
|
||||
- ensure trigger node detects changes to number of outputs
|
||||
- Ignore whitespace when checking function setup/close code
|
||||
- Preserve event handlers when moving outliner items
|
||||
- Add tooltips to outliner buttons
|
||||
- Only validate nodes once they have all been imported
|
||||
- Ensure configNode.users is updated properly on import
|
||||
|
||||
Runtime
|
||||
|
||||
- Bump node-red-admin 0.2.6
|
||||
|
||||
Nodes
|
||||
|
||||
- WebSocket: Prevent charAt call on websocket listener #2610 ()
|
||||
- Debug: fix status to migrate old nodes to correct default mode.
|
||||
- Link: Fix Link node filter Fixes #2600
|
||||
|
||||
|
||||
#### 1.1.0-beta.1: Beta Release
|
||||
|
||||
Runtime
|
||||
|
74
Gruntfile.js
74
Gruntfile.js
@@ -20,16 +20,10 @@ var sass = require("node-sass");
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
var nodemonArgs = ["-V"];
|
||||
var nodemonArgs = ["-v"];
|
||||
var flowFile = grunt.option('flowFile');
|
||||
if (flowFile) {
|
||||
nodemonArgs.push(flowFile);
|
||||
process.env.NODE_RED_ENABLE_PROJECTS=false;
|
||||
}
|
||||
var userDir = grunt.option('userDir');
|
||||
if (userDir) {
|
||||
nodemonArgs.push("-u");
|
||||
nodemonArgs.push(userDir);
|
||||
}
|
||||
|
||||
var browserstack = grunt.option('browserstack');
|
||||
@@ -53,8 +47,8 @@ module.exports = function(grunt) {
|
||||
ui: 'bdd',
|
||||
reporter: 'spec'
|
||||
},
|
||||
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
||||
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
|
||||
all: { src: ['test/**/*_spec.js'] },
|
||||
core: { src: ["test/_spec.js","test/unit/**/*_spec.js"]},
|
||||
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
||||
},
|
||||
webdriver: {
|
||||
@@ -62,19 +56,19 @@ module.exports = function(grunt) {
|
||||
configFile: 'test/editor/wdio.conf.js'
|
||||
}
|
||||
},
|
||||
nyc: {
|
||||
mocha_istanbul: {
|
||||
options: {
|
||||
cwd: '.',
|
||||
include: ['packages/node_modules/**'],
|
||||
excludeNodeModules: false,
|
||||
exclude: ['packages/node_modules/@node-red/editor-client/**'],
|
||||
reporter: ['lcov', 'html','text-summary'],
|
||||
reportDir: 'coverage',
|
||||
all: true
|
||||
globals: ['expect'],
|
||||
timeout: 3000,
|
||||
ignoreLeaks: false,
|
||||
ui: 'bdd',
|
||||
reportFormats: ['lcov','html'],
|
||||
print: 'both',
|
||||
istanbulOptions: ['--no-default-excludes', '-i','**/packages/node_modules/**']
|
||||
},
|
||||
all: { cmd: false, args: ['grunt', 'simplemocha:all'] },
|
||||
core: { options: { exclude:['packages/node_modules/@node-red/editor-client/**', 'packages/node_modules/@node-red/nodes/**']},cmd: false, args: ['grunt', 'simplemocha:core'] },
|
||||
nodes: { cmd: false, args: ['grunt', 'simplemocha:nodes'] }
|
||||
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
||||
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
|
||||
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
||||
},
|
||||
jshint: {
|
||||
options: {
|
||||
@@ -458,7 +452,6 @@ module.exports = function(grunt) {
|
||||
'packages/node_modules/@node-red/runtime/lib/index.js',
|
||||
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||
'packages/node_modules/@node-red/runtime/lib/events.js',
|
||||
'packages/node_modules/@node-red/runtime/lib/hooks.js',
|
||||
'packages/node_modules/@node-red/util/**/*.js',
|
||||
'packages/node_modules/@node-red/editor-api/lib/index.js',
|
||||
'packages/node_modules/@node-red/editor-api/lib/auth/index.js'
|
||||
@@ -509,10 +502,12 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-sass');
|
||||
grunt.loadNpmTasks('grunt-nodemon');
|
||||
grunt.loadNpmTasks('grunt-contrib-compress');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-chmod');
|
||||
grunt.loadNpmTasks('grunt-jsonlint');
|
||||
grunt.loadNpmTasks('grunt-mocha-istanbul');
|
||||
if (fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
||||
grunt.loadNpmTasks('grunt-webdriver');
|
||||
}
|
||||
@@ -520,26 +515,6 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
||||
grunt.loadNpmTasks('grunt-npm-command');
|
||||
grunt.loadNpmTasks('grunt-mkdir');
|
||||
grunt.loadNpmTasks('grunt-simple-nyc');
|
||||
|
||||
grunt.registerMultiTask('nodemon', 'Runs a nodemon monitor of your node.js server.', function () {
|
||||
const nodemon = require('nodemon');
|
||||
this.async();
|
||||
const options = this.options();
|
||||
options.script = this.data.script;
|
||||
let callback;
|
||||
if (options.callback) {
|
||||
callback = options.callback;
|
||||
delete options.callback;
|
||||
} else {
|
||||
callback = function(nodemonApp) {
|
||||
nodemonApp.on('log', function (event) {
|
||||
console.log(event.colour);
|
||||
});
|
||||
};
|
||||
}
|
||||
callback(nodemon(options));
|
||||
});
|
||||
|
||||
grunt.registerMultiTask('attachCopyright', function() {
|
||||
var files = this.data.src;
|
||||
@@ -621,16 +596,11 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('default',
|
||||
'Builds editor content then runs code style checks and unit tests on all components',
|
||||
['build','verifyPackageDependencies','jshint:editor','nyc:all']);
|
||||
|
||||
grunt.registerTask('no-coverage',
|
||||
'Builds editor content then runs code style checks and unit tests on all components without code coverage',
|
||||
['build','verifyPackageDependencies','jshint:editor','simplemocha:all']);
|
||||
|
||||
['build','verifyPackageDependencies','jshint:editor','mocha_istanbul:all']);
|
||||
|
||||
grunt.registerTask('test-core',
|
||||
'Runs code style check and unit tests on core runtime code',
|
||||
['build','nyc:core']);
|
||||
['build','mocha_istanbul:core']);
|
||||
|
||||
grunt.registerTask('test-editor',
|
||||
'Runs code style check on editor code',
|
||||
@@ -648,16 +618,12 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('test-nodes',
|
||||
'Runs unit tests on core nodes',
|
||||
['build','nyc:nodes']);
|
||||
['build','mocha_istanbul:nodes']);
|
||||
|
||||
grunt.registerTask('build',
|
||||
'Builds editor content',
|
||||
['clean:build','jsonlint','concat:build','concat:vendor','copy:build','uglify:build','sass:build','attachCopyright']);
|
||||
|
||||
grunt.registerTask('build-dev',
|
||||
'Developer mode: build dev version',
|
||||
['clean:build','concat:build','concat:vendor','copy:build','sass:build','setDevEnv']);
|
||||
|
||||
grunt.registerTask('dev',
|
||||
'Developer mode: run node-red, watch for source changes and build/restart',
|
||||
['build','setDevEnv','concurrent:dev']);
|
||||
@@ -673,7 +639,7 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('coverage',
|
||||
'Run Istanbul code test coverage task',
|
||||
['build','nyc:all']);
|
||||
['build','mocha_istanbul:all']);
|
||||
|
||||
grunt.registerTask('docs',
|
||||
'Generates API documentation',
|
||||
|
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
Copyright JS Foundation and other contributors, http://js.foundation
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
|
@@ -67,4 +67,4 @@ It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-t
|
||||
|
||||
## Copyright and license
|
||||
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org under [the Apache 2.0 license](LICENSE).
|
||||
Copyright JS Foundation and other contributors, https://openjsf.org under [the Apache 2.0 license](LICENSE).
|
||||
|
@@ -1,5 +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.
|
||||
|
58
package.json
58
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "1.2.8",
|
||||
"version": "1.1.0-beta.1",
|
||||
"description": "Low-code programming for event-driven applications",
|
||||
"homepage": "http://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
@@ -13,8 +13,6 @@
|
||||
"start": "node packages/node_modules/node-red/red.js",
|
||||
"test": "grunt",
|
||||
"build": "grunt build",
|
||||
"dev": "grunt dev",
|
||||
"build-dev": "grunt build-dev",
|
||||
"docs": "grunt docs"
|
||||
},
|
||||
"contributors": [
|
||||
@@ -26,8 +24,7 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"ajv": "6.12.6",
|
||||
"async-mutex": "0.2.6",
|
||||
"ajv": "6.12.2",
|
||||
"basic-auth": "2.0.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.19.0",
|
||||
@@ -38,7 +35,7 @@
|
||||
"cookie-parser": "1.4.5",
|
||||
"cors": "2.8.5",
|
||||
"cron": "1.7.2",
|
||||
"denque": "1.5.0",
|
||||
"denque": "1.4.1",
|
||||
"express": "4.17.1",
|
||||
"express-session": "1.17.1",
|
||||
"fs-extra": "8.1.0",
|
||||
@@ -46,24 +43,24 @@
|
||||
"hash-sum": "2.0.0",
|
||||
"https-proxy-agent": "5.0.0",
|
||||
"i18next": "15.1.2",
|
||||
"iconv-lite": "0.6.2",
|
||||
"iconv-lite": "0.5.1",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "3.14.0",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"jsonata": "1.8.4",
|
||||
"jsonata": "1.8.3",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"media-typer": "1.1.0",
|
||||
"memorystore": "1.6.4",
|
||||
"mime": "2.4.7",
|
||||
"moment-timezone": "0.5.32",
|
||||
"mqtt": "4.2.6",
|
||||
"memorystore": "1.6.2",
|
||||
"mime": "2.4.6",
|
||||
"moment-timezone": "^0.5.31",
|
||||
"mqtt": "2.18.8",
|
||||
"multer": "1.4.2",
|
||||
"mustache": "4.1.0",
|
||||
"mustache": "4.0.1",
|
||||
"node-red-admin": "^0.2.6",
|
||||
"node-red-node-rbe": "^0.2.9",
|
||||
"node-red-node-sentiment": "^0.1.6",
|
||||
"node-red-node-tail": "^0.1.0",
|
||||
"nopt": "5.0.0",
|
||||
"nopt": "4.0.3",
|
||||
"oauth2orize": "1.11.0",
|
||||
"on-headers": "1.0.2",
|
||||
"passport": "0.4.1",
|
||||
@@ -72,8 +69,7 @@
|
||||
"raw-body": "2.4.1",
|
||||
"request": "2.88.0",
|
||||
"semver": "6.3.0",
|
||||
"tar": "6.0.5",
|
||||
"uglify-js": "3.12.4",
|
||||
"uglify-js": "3.9.4",
|
||||
"when": "3.7.8",
|
||||
"ws": "6.2.1",
|
||||
"xml2js": "0.4.23"
|
||||
@@ -82,38 +78,40 @@
|
||||
"bcrypt": "3.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dompurify": "2.2.6",
|
||||
"grunt": "1.3.0",
|
||||
"marked": "0.8.2",
|
||||
"dompurify": "2.0.11",
|
||||
"grunt": "~1.0.4",
|
||||
"grunt-chmod": "~1.1.1",
|
||||
"grunt-cli": "~1.3.2",
|
||||
"grunt-concurrent": "3.0.0",
|
||||
"grunt-concurrent": "~2.3.1",
|
||||
"grunt-contrib-clean": "~2.0.0",
|
||||
"grunt-contrib-compress": "1.6.0",
|
||||
"grunt-contrib-compress": "~1.5.0",
|
||||
"grunt-contrib-concat": "~1.0.1",
|
||||
"grunt-contrib-copy": "~1.0.0",
|
||||
"grunt-contrib-jshint": "~2.1.0",
|
||||
"grunt-contrib-uglify": "~4.0.1",
|
||||
"grunt-contrib-watch": "~1.1.0",
|
||||
"grunt-jsdoc": "2.4.1",
|
||||
"grunt-jsdoc-to-markdown": "5.0.0",
|
||||
"grunt-jsonlint": "2.1.3",
|
||||
"grunt-mkdir": "~1.1.0",
|
||||
"grunt-jsdoc": "^2.2.1",
|
||||
"grunt-jsdoc-to-markdown": "^4.0.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": "~3.1.0",
|
||||
"grunt-simple-mocha": "~0.4.1",
|
||||
"grunt-simple-nyc": "^3.0.1",
|
||||
"http-proxy": "1.18.1",
|
||||
"istanbul": "0.4.5",
|
||||
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
|
||||
"marked": "1.2.7",
|
||||
"minami": "1.2.3",
|
||||
"mocha": "^5.2.0",
|
||||
"node-red-node-test-helper": "^0.2.6",
|
||||
"mosca": "^2.8.3",
|
||||
"node-red-node-test-helper": "^0.2.5",
|
||||
"node-sass": "^4.14.1",
|
||||
"nodemon": "2.0.6",
|
||||
"should": "13.2.3",
|
||||
"should": "^8.4.0",
|
||||
"sinon": "1.17.7",
|
||||
"stoppable": "^1.1.0",
|
||||
"supertest": "5.0.0"
|
||||
"supertest": "3.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
|
@@ -21,17 +21,15 @@ var flows = require("./flows");
|
||||
var flow = require("./flow");
|
||||
var context = require("./context");
|
||||
var auth = require("../auth");
|
||||
var info = require("./settings");
|
||||
|
||||
var apiUtil = require("../util");
|
||||
|
||||
module.exports = {
|
||||
init: function(settings,runtimeAPI) {
|
||||
init: function(runtimeAPI) {
|
||||
flows.init(runtimeAPI);
|
||||
flow.init(runtimeAPI);
|
||||
nodes.init(runtimeAPI);
|
||||
context.init(runtimeAPI);
|
||||
info.init(settings,runtimeAPI);
|
||||
|
||||
var needsPermission = auth.needsPermission;
|
||||
|
||||
@@ -49,14 +47,7 @@ module.exports = {
|
||||
|
||||
// Nodes
|
||||
adminApp.get("/nodes",needsPermission("nodes.read"),nodes.getAll,apiUtil.errorHandler);
|
||||
|
||||
if (!settings.editorTheme || !settings.editorTheme.palette || settings.editorTheme.palette.upload !== false) {
|
||||
const multer = require('multer');
|
||||
const upload = multer({ storage: multer.memoryStorage() });
|
||||
adminApp.post("/nodes",needsPermission("nodes.write"),upload.single("tarball"),nodes.post,apiUtil.errorHandler);
|
||||
} else {
|
||||
adminApp.post("/nodes",needsPermission("nodes.write"),nodes.post,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);
|
||||
@@ -76,8 +67,6 @@ module.exports = {
|
||||
// adminApp.delete("/context/:scope(node|flow)/:id",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||
adminApp.delete("/context/:scope(node|flow)/:id/*",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||
|
||||
adminApp.get("/settings",needsPermission("settings.read"),info.runtimeSettings,apiUtil.errorHandler);
|
||||
|
||||
return adminApp;
|
||||
}
|
||||
}
|
||||
|
@@ -45,18 +45,8 @@ module.exports = {
|
||||
module: req.body.module,
|
||||
version: req.body.version,
|
||||
url: req.body.url,
|
||||
tarball: undefined,
|
||||
req: apiUtils.getRequestLogObject(req)
|
||||
}
|
||||
if (!runtimeAPI.settings.editorTheme || !runtimeAPI.settings.editorTheme.palette || runtimeAPI.settings.editorTheme.palette.upload !== false) {
|
||||
if (req.file) {
|
||||
opts.tarball = {
|
||||
name: req.file.originalname,
|
||||
size: req.file.size,
|
||||
buffer: req.file.buffer
|
||||
}
|
||||
}
|
||||
}
|
||||
runtimeAPI.nodes.addModule(opts).then(function(info) {
|
||||
res.json(info);
|
||||
}).catch(function(err) {
|
||||
|
@@ -1,72 +0,0 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
var apiUtils = require("../util");
|
||||
var runtimeAPI;
|
||||
var settings;
|
||||
var theme = require("../editor/theme");
|
||||
var clone = require("clone");
|
||||
|
||||
var i18n = require("@node-red/util").i18n
|
||||
|
||||
function extend(target, source) {
|
||||
var keys = Object.keys(source);
|
||||
var i = keys.length;
|
||||
while(i--) {
|
||||
var value = source[keys[i]]
|
||||
var type = typeof value;
|
||||
if (type === 'string' || type === 'number' || type === 'boolean' || Array.isArray(value)) {
|
||||
target[keys[i]] = value;
|
||||
} else if (value === null) {
|
||||
if (target.hasOwnProperty(keys[i])) {
|
||||
delete target[keys[i]];
|
||||
}
|
||||
} else {
|
||||
// Object
|
||||
if (target.hasOwnProperty(keys[i])) {
|
||||
target[keys[i]] = extend(target[keys[i]],value);
|
||||
} else {
|
||||
target[keys[i]] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: function(_settings,_runtimeAPI) {
|
||||
runtimeAPI = _runtimeAPI;
|
||||
settings = _settings;
|
||||
},
|
||||
runtimeSettings: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
}
|
||||
runtimeAPI.settings.getRuntimeSettings(opts).then(function(result) {
|
||||
if (!settings.disableEditor) {
|
||||
result.editorTheme = result.editorTheme||{};
|
||||
var themeSettings = theme.settings();
|
||||
if (themeSettings) {
|
||||
// result.editorTheme may already exist with the palette
|
||||
// disabled. Need to merge that into the receive settings
|
||||
result.editorTheme = extend(clone(themeSettings),result.editorTheme);
|
||||
}
|
||||
result.editorTheme.languages = i18n.availableLanguages("editor");
|
||||
}
|
||||
res.json(result);
|
||||
});
|
||||
},
|
||||
|
||||
}
|
@@ -123,57 +123,38 @@ AnonymousStrategy.prototype.authenticate = function(req) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function authenticateUserToken(req) {
|
||||
return new Promise( (resolve,reject) => {
|
||||
var token = null;
|
||||
var tokenHeader = Users.tokenHeader();
|
||||
if (Users.tokenHeader() === null) {
|
||||
// No custom user token provided. Fail the request
|
||||
reject();
|
||||
return;
|
||||
} else if (Users.tokenHeader() === 'authorization') {
|
||||
if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {
|
||||
token = req.headers.authorization.split(' ')[1];
|
||||
}
|
||||
} else {
|
||||
token = req.headers[Users.tokenHeader()];
|
||||
}
|
||||
if (token) {
|
||||
Users.tokens(token).then(function(user) {
|
||||
if (user) {
|
||||
resolve(user);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function TokensStrategy() {
|
||||
passport.Strategy.call(this);
|
||||
this.name = 'tokens';
|
||||
}
|
||||
util.inherits(TokensStrategy, passport.Strategy);
|
||||
TokensStrategy.prototype.authenticate = function(req) {
|
||||
authenticateUserToken(req).then(user => {
|
||||
this.success(user,{scope:user.permissions});
|
||||
}).catch(err => {
|
||||
this.fail(401);
|
||||
});
|
||||
var self = this;
|
||||
var token = null;
|
||||
if (Users.tokenHeader() === 'authorization') {
|
||||
if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {
|
||||
token = req.headers.authorization.split(' ')[1];
|
||||
}
|
||||
} else {
|
||||
token = req.headers[Users.tokenHeader()];
|
||||
}
|
||||
if (token) {
|
||||
Users.tokens(token).then(function(admin) {
|
||||
if (admin) {
|
||||
self.success(admin,{scope:admin.permissions});
|
||||
} else {
|
||||
self.fail(401);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.fail(401);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
bearerStrategy: bearerStrategy,
|
||||
clientPasswordStrategy: clientPasswordStrategy,
|
||||
passwordTokenExchange: passwordTokenExchange,
|
||||
anonymousStrategy: new AnonymousStrategy(),
|
||||
tokensStrategy: new TokensStrategy(),
|
||||
authenticateUserToken: authenticateUserToken
|
||||
tokensStrategy: new TokensStrategy()
|
||||
}
|
||||
|
@@ -14,7 +14,15 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
const crypto = require("crypto");
|
||||
function generateToken(length) {
|
||||
var c = "ABCDEFGHIJKLMNOPQRSTUZWXYZabcdefghijklmnopqrstuvwxyz1234567890";
|
||||
var token = [];
|
||||
for (var i=0;i<length;i++) {
|
||||
token.push(c[Math.floor(Math.random()*c.length)]);
|
||||
}
|
||||
return token.join("");
|
||||
}
|
||||
|
||||
|
||||
var storage;
|
||||
var sessionExpiryTime
|
||||
@@ -107,7 +115,7 @@ module.exports = {
|
||||
},
|
||||
create: function(user,client,scope) {
|
||||
return loadSessions().then(function() {
|
||||
var accessToken = crypto.randomBytes(128).toString('base64');
|
||||
var accessToken = generateToken(128);
|
||||
|
||||
var accessTokenExpiresAt = Date.now() + (sessionExpiryTime*1000);
|
||||
|
||||
|
@@ -61,7 +61,7 @@ var api = {
|
||||
authenticate: authenticate,
|
||||
default: getDefaultUser,
|
||||
tokens: getDefaultUser,
|
||||
tokenHeader: null
|
||||
tokenHeader: "authorization"
|
||||
}
|
||||
|
||||
function init(config) {
|
||||
@@ -111,8 +111,6 @@ function init(config) {
|
||||
api.tokens = config.tokens;
|
||||
if (config.tokenHeader && typeof config.tokenHeader === "string") {
|
||||
api.tokenHeader = config.tokenHeader.toLowerCase();
|
||||
} else {
|
||||
api.tokenHeader = "authorization";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,13 +16,11 @@
|
||||
|
||||
var ws = require("ws");
|
||||
var url = require("url");
|
||||
const crypto = require("crypto");
|
||||
|
||||
var log = require("@node-red/util").log; // TODO: separate module
|
||||
var Tokens;
|
||||
var Users;
|
||||
var Permissions;
|
||||
var Strategies;
|
||||
|
||||
var server;
|
||||
var settings;
|
||||
@@ -33,6 +31,8 @@ var activeConnections = [];
|
||||
|
||||
var anonymousUser;
|
||||
|
||||
var retained = {};
|
||||
|
||||
var heartbeatTimer;
|
||||
var lastSentTime;
|
||||
|
||||
@@ -44,7 +44,6 @@ function init(_server,_settings,_runtimeAPI) {
|
||||
Tokens.onSessionExpiry(handleSessionExpiry);
|
||||
Users = require("../auth/users");
|
||||
Permissions = require("../auth/permissions");
|
||||
Strategies = require("../auth/strategies");
|
||||
|
||||
}
|
||||
function handleSessionExpiry(session) {
|
||||
@@ -55,19 +54,26 @@ function handleSessionExpiry(session) {
|
||||
}
|
||||
})
|
||||
}
|
||||
function generateSession(length) {
|
||||
var c = "ABCDEFGHIJKLMNOPQRSTUZWXYZabcdefghijklmnopqrstuvwxyz1234567890";
|
||||
var token = [];
|
||||
for (var i=0;i<length;i++) {
|
||||
token.push(c[Math.floor(Math.random()*c.length)]);
|
||||
}
|
||||
return token.join("");
|
||||
}
|
||||
|
||||
function CommsConnection(ws, user) {
|
||||
this.session = crypto.randomBytes(32).toString('base64');
|
||||
function CommsConnection(ws) {
|
||||
this.session = generateSession(32);
|
||||
this.ws = ws;
|
||||
this.stack = [];
|
||||
this.user = user;
|
||||
this.user = null;
|
||||
this.lastSentTime = 0;
|
||||
var self = this;
|
||||
|
||||
log.audit({event: "comms.open"});
|
||||
log.trace("comms.open "+self.session);
|
||||
var preAuthed = !!user;
|
||||
var pendingAuth = !this.user && (settings.adminAuth != null);
|
||||
var pendingAuth = (settings.adminAuth != null);
|
||||
|
||||
if (!pendingAuth) {
|
||||
addActiveConnection(self);
|
||||
@@ -124,16 +130,8 @@ function CommsConnection(ws, user) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Users.tokens(msg.auth).then(function(user) {
|
||||
if (user) {
|
||||
self.user = user;
|
||||
log.audit({event: "comms.auth",user:self.user});
|
||||
completeConnection(user.permissions,msg.auth,true);
|
||||
} else {
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
completeConnection(null,null,false);
|
||||
}
|
||||
});
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
completeConnection(null,null,false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -193,8 +191,8 @@ function start() {
|
||||
var commsPath = settings.httpAdminRoot || "/";
|
||||
commsPath = (commsPath.slice(0,1) != "/" ? "/":"") + commsPath + (commsPath.slice(-1) == "/" ? "":"/") + "comms";
|
||||
wsServer = new ws.Server({ noServer: true });
|
||||
wsServer.on('connection',function(ws, request, user) {
|
||||
var commsConnection = new CommsConnection(ws, user);
|
||||
wsServer.on('connection',function(ws) {
|
||||
var commsConnection = new CommsConnection(ws);
|
||||
});
|
||||
wsServer.on('error', function(err) {
|
||||
log.warn(log._("comms.error-server",{message:err.toString()}));
|
||||
@@ -203,26 +201,8 @@ function start() {
|
||||
server.on('upgrade', function upgrade(request, socket, head) {
|
||||
const pathname = url.parse(request.url).pathname;
|
||||
if (pathname === commsPath) {
|
||||
if (Users.tokenHeader() !== null && request.headers[Users.tokenHeader()]) {
|
||||
// The user has provided custom token handling. For the websocket,
|
||||
// the token could be provided in two ways:
|
||||
// - as an http header (only possible with a reverse proxy setup)
|
||||
// - passed over the connected websock in an auth packet
|
||||
// If the header is present, verify the token. If not, use the auth
|
||||
// packet over the connected socket
|
||||
//
|
||||
Strategies.authenticateUserToken(request).then(user => {
|
||||
wsServer.handleUpgrade(request, socket, head, function done(ws) {
|
||||
wsServer.emit('connection', ws, request, user);
|
||||
});
|
||||
}).catch(err => {
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
socket.destroy();
|
||||
})
|
||||
return
|
||||
}
|
||||
wsServer.handleUpgrade(request, socket, head, function done(ws) {
|
||||
wsServer.emit('connection', ws, request, null);
|
||||
wsServer.emit('connection', ws, request);
|
||||
});
|
||||
}
|
||||
// Don't destroy the socket as other listeners may want to handle the
|
||||
|
@@ -103,7 +103,7 @@ module.exports = {
|
||||
editorApp.get('/credentials/:type/:id', needsPermission("credentials.read"),credentials.get,apiUtil.errorHandler);
|
||||
|
||||
// Settings
|
||||
// Main /settings route is an admin route - see lib/admin/settings.js
|
||||
editorApp.get("/settings",needsPermission("settings.read"),info.runtimeSettings,apiUtil.errorHandler);
|
||||
// User Settings
|
||||
editorApp.get("/settings/user",needsPermission("settings.read"),info.userSettings,apiUtil.errorHandler);
|
||||
// User Settings
|
||||
|
@@ -39,12 +39,9 @@ module.exports = {
|
||||
},
|
||||
get: function(req,res) {
|
||||
var namespace = req.params[0];
|
||||
var lngs = req.query.lng;
|
||||
namespace = namespace.replace(/\.json$/,"");
|
||||
var lang = req.query.lng || i18n.defaultLang; //apiUtil.determineLangFromHeaders(req.acceptsLanguages() || []);
|
||||
if (/[^a-z\-\*]/i.test(lang)) {
|
||||
res.json({});
|
||||
return;
|
||||
}
|
||||
var prevLang = i18n.i.language;
|
||||
// Trigger a load from disk of the language if it is not the default
|
||||
i18n.i.changeLanguage(lang, function(){
|
||||
|
@@ -137,7 +137,6 @@ module.exports = {
|
||||
req.body.hasOwnProperty('description') ||
|
||||
req.body.hasOwnProperty('dependencies')||
|
||||
req.body.hasOwnProperty('summary') ||
|
||||
req.body.hasOwnProperty('version') ||
|
||||
req.body.hasOwnProperty('files') ||
|
||||
req.body.hasOwnProperty('git')) {
|
||||
runtimeAPI.projects.updateProject(opts).then(function() {
|
||||
|
@@ -16,12 +16,56 @@
|
||||
var apiUtils = require("../util");
|
||||
var runtimeAPI;
|
||||
var sshkeys = require("./sshkeys");
|
||||
var theme = require("./theme");
|
||||
var clone = require("clone");
|
||||
|
||||
var i18n = require("@node-red/util").i18n
|
||||
|
||||
function extend(target, source) {
|
||||
var keys = Object.keys(source);
|
||||
var i = keys.length;
|
||||
while(i--) {
|
||||
var value = source[keys[i]]
|
||||
var type = typeof value;
|
||||
if (type === 'string' || type === 'number' || type === 'boolean' || Array.isArray(value)) {
|
||||
target[keys[i]] = value;
|
||||
} else if (value === null) {
|
||||
if (target.hasOwnProperty(keys[i])) {
|
||||
delete target[keys[i]];
|
||||
}
|
||||
} else {
|
||||
// Object
|
||||
if (target.hasOwnProperty(keys[i])) {
|
||||
target[keys[i]] = extend(target[keys[i]],value);
|
||||
} else {
|
||||
target[keys[i]] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: function(_runtimeAPI) {
|
||||
runtimeAPI = _runtimeAPI;
|
||||
sshkeys.init(runtimeAPI);
|
||||
},
|
||||
runtimeSettings: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
}
|
||||
runtimeAPI.settings.getRuntimeSettings(opts).then(function(result) {
|
||||
result.editorTheme = result.editorTheme||{};
|
||||
var themeSettings = theme.settings();
|
||||
if (themeSettings) {
|
||||
// result.editorTheme may already exist with the palette
|
||||
// disabled. Need to merge that into the receive settings
|
||||
result.editorTheme = extend(clone(themeSettings),result.editorTheme);
|
||||
}
|
||||
result.editorTheme.languages = i18n.availableLanguages("editor");
|
||||
res.json(result);
|
||||
});
|
||||
},
|
||||
userSettings: function(req, res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
|
@@ -99,7 +99,7 @@ function init(settings,_server,storage,runtimeAPI) {
|
||||
adminApp.use(corsHandler);
|
||||
}
|
||||
|
||||
var adminApiApp = require("./admin").init(settings, runtimeAPI);
|
||||
var adminApiApp = require("./admin").init(runtimeAPI);
|
||||
adminApp.use(adminApiApp);
|
||||
} else {
|
||||
adminApp = null;
|
||||
|
@@ -43,10 +43,6 @@ module.exports = {
|
||||
rejectHandler: function(req,res,err) {
|
||||
//TODO: why this when errorHandler also?!
|
||||
log.audit({event: "api.error",error:err.code||"unexpected_error",message:err.message||err.toString()},req);
|
||||
if (!err.code) {
|
||||
// by definition, an unexpected_error to log
|
||||
log.error(err);
|
||||
}
|
||||
var response = {
|
||||
code: err.code||"unexpected_error",
|
||||
message: err.message||err.toString()
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-api",
|
||||
"version": "1.2.8",
|
||||
"version": "1.1.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,18 +16,17 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "1.2.8",
|
||||
"@node-red/editor-client": "1.2.8",
|
||||
"@node-red/util": "1.1.0-beta.1",
|
||||
"@node-red/editor-client": "1.1.0-beta.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.19.0",
|
||||
"clone": "2.1.2",
|
||||
"cors": "2.8.5",
|
||||
"express-session": "1.17.1",
|
||||
"express": "4.17.1",
|
||||
"memorystore": "1.6.4",
|
||||
"mime": "2.4.7",
|
||||
"multer": "1.4.2",
|
||||
"mustache": "4.1.0",
|
||||
"memorystore": "1.6.2",
|
||||
"mime": "2.4.6",
|
||||
"mustache": "4.0.1",
|
||||
"oauth2orize": "1.11.0",
|
||||
"passport-http-bearer": "1.0.1",
|
||||
"passport-oauth2-client-password": "0.1.2",
|
||||
|
@@ -32,7 +32,7 @@
|
||||
"label" : {
|
||||
"view" : {
|
||||
"view" : "Ansicht",
|
||||
"grid" : "Raster",
|
||||
"grid" : "Gitter",
|
||||
"showGrid" : "Raster anzeigen",
|
||||
"snapGrid" : "Am Raster ausrichten",
|
||||
"gridSize" : "Rastergröße",
|
||||
|
@@ -22,8 +22,7 @@
|
||||
"color": "Color",
|
||||
"position": "Position",
|
||||
"enable": "Enable",
|
||||
"disable": "Disable",
|
||||
"upload": "Upload"
|
||||
"disable": "Disable"
|
||||
},
|
||||
"type": {
|
||||
"string": "string",
|
||||
@@ -42,8 +41,7 @@
|
||||
"loadNodeCatalogs": "Loading Node catalogs",
|
||||
"loadNodes": "Loading Nodes __count__",
|
||||
"loadFlows": "Loading Flows",
|
||||
"importFlows": "Adding Flows to workspace",
|
||||
"importError": "<p>Error adding flows</p><p>__message__</p>"
|
||||
"importFlows": "Adding Flows to workspace"
|
||||
},
|
||||
"workspace": {
|
||||
"defaultName": "Flow __number__",
|
||||
@@ -199,8 +197,6 @@
|
||||
"flow_plural": "__count__ flows",
|
||||
"subflow": "__count__ subflow",
|
||||
"subflow_plural": "__count__ subflows",
|
||||
"replacedNodes": "__count__ node replaced",
|
||||
"replacedNodes_plural": "__count__ nodes replaced",
|
||||
"pasteNodes": "Paste flow json or",
|
||||
"selectFile": "select a file to import",
|
||||
"importNodes": "Import nodes",
|
||||
@@ -208,8 +204,6 @@
|
||||
"download": "Download",
|
||||
"importUnrecognised": "Imported unrecognised type:",
|
||||
"importUnrecognised_plural": "Imported unrecognised types:",
|
||||
"importDuplicate": "Imported duplicate node:",
|
||||
"importDuplicate_plural": "Imported duplicate nodes:",
|
||||
"nodesExported": "Nodes exported to clipboard",
|
||||
"nodesImported": "Imported:",
|
||||
"nodeCopied": "__count__ node copied",
|
||||
@@ -218,9 +212,6 @@
|
||||
"groupCopied_plural": "__count__ groups copied",
|
||||
"groupStyleCopied": "Group style copied",
|
||||
"invalidFlow": "Invalid flow: __message__",
|
||||
"recoveredNodes": "Recovered Nodes",
|
||||
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
|
||||
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
|
||||
"export": {
|
||||
"selected":"selected nodes",
|
||||
"current":"current flow",
|
||||
@@ -235,19 +226,13 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "Import to",
|
||||
"importSelected": "Import selected",
|
||||
"importCopy": "Import copy",
|
||||
"viewNodes": "View nodes...",
|
||||
"newFlow": "new flow",
|
||||
"replace": "replace",
|
||||
"errors": {
|
||||
"notArray": "Input not a JSON Array",
|
||||
"itemNotObject": "Input not a valid flow - item __index__ not a node object",
|
||||
"missingId": "Input not a valid flow - item __index__ missing 'id' property",
|
||||
"missingType": "Input not a valid flow - item __index__ missing 'type' property"
|
||||
},
|
||||
"conflictNotification1": "Some of the nodes you are importing already exist in your workspace.",
|
||||
"conflictNotification2": "Select which nodes to import and whether to replace the existing nodes, or to import a copy of them."
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "Path copied",
|
||||
"copyMessageValue": "Value copied",
|
||||
@@ -384,7 +369,6 @@
|
||||
"locale": "Select UI Language",
|
||||
"icon": "Icon",
|
||||
"inputType": "Input type",
|
||||
"selectType": "select types...",
|
||||
"inputs" : {
|
||||
"input": "input",
|
||||
"select": "select",
|
||||
@@ -547,8 +531,6 @@
|
||||
"sortAZ": "a-z",
|
||||
"sortRecent": "recent",
|
||||
"more": "+ __count__ more",
|
||||
"upload": "Upload module tgz file",
|
||||
"refresh": "Refresh module list",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "<p>Failed to load node catalogue.</p><p>Check the browser console for more information</p>",
|
||||
"installFailed": "<p>Failed to install: __module__</p><p>__message__</p><p>Check the log for more information</p>",
|
||||
@@ -725,12 +707,6 @@
|
||||
"committerTip": "Leave blank to use system default",
|
||||
"userName": "Username",
|
||||
"email": "Email",
|
||||
"workflow": "Workflow",
|
||||
"workfowTip": "Choose your preferred git workflow",
|
||||
"workflowManual": "Manual",
|
||||
"workflowManualTip": "All changes must be manually committed under the 'history' sidebar",
|
||||
"workflowAuto": "Automatic",
|
||||
"workflowAutoTip": "Changes are committed automatically with every deploy",
|
||||
"sshKeys": "SSH Keys",
|
||||
"sshKeysTip": "Allows you to create secure connections to remote git repositories.",
|
||||
"add": "add key",
|
||||
@@ -1089,7 +1065,6 @@
|
||||
"en-US": "English",
|
||||
"ja": "Japanese",
|
||||
"ko": "Korean",
|
||||
"ru": "Russian",
|
||||
"zh-CN": "Chinese(Simplified)",
|
||||
"zh-TW": "Chinese(Traditional)"
|
||||
}
|
||||
|
@@ -20,10 +20,7 @@
|
||||
"fill": "塗りつぶし",
|
||||
"label": "ラベル",
|
||||
"color": "色",
|
||||
"position": "配置",
|
||||
"enable": "有効",
|
||||
"disable": "無効",
|
||||
"upload": "アップロード"
|
||||
"position": "配置"
|
||||
},
|
||||
"type": {
|
||||
"string": "文字列",
|
||||
@@ -42,8 +39,7 @@
|
||||
"loadNodeCatalogs": "ノードカタログを読み込み中",
|
||||
"loadNodes": "ノードを読み込み中 __count__",
|
||||
"loadFlows": "フローを読み込み中",
|
||||
"importFlows": "ワークスペースにフローを追加中",
|
||||
"importError": "<p>フロー追加エラー</p><p>__message__</p>"
|
||||
"importFlows": "ワークスペースにフローを追加中"
|
||||
},
|
||||
"workspace": {
|
||||
"defaultName": "フロー __number__",
|
||||
@@ -199,17 +195,13 @@
|
||||
"flow_plural": "__count__ 個のフロー",
|
||||
"subflow": "__count__ 個のサブフロー",
|
||||
"subflow_plural": "__count__ 個のサブフロー",
|
||||
"replacedNodes": "置換された __count__ 個のノード",
|
||||
"replacedNodes_plural": "置換された __count__ 個のノード",
|
||||
"pasteNodes": "JSON形式のフローデータを貼り付け",
|
||||
"selectFile": "読み込むファイルを選択",
|
||||
"importNodes": "フローをクリップボードから読み込み",
|
||||
"pasteNodes": "JSON形式のフローデータを貼り付けてください",
|
||||
"selectFile": "読み込むファイルを選択してください",
|
||||
"importNodes": "フローをクリップボートから読み込み",
|
||||
"exportNodes": "フローをクリップボードへ書き出し",
|
||||
"download": "ダウンロード",
|
||||
"importUnrecognised": "認識できない型が読み込まれました:",
|
||||
"importUnrecognised_plural": "認識できない型が読み込まれました:",
|
||||
"importDuplicate": "重複したノードを読み込みました:",
|
||||
"importDuplicate_plural": "重複したノードを読み込みました:",
|
||||
"nodesExported": "クリップボードへフローを書き出しました",
|
||||
"nodesImported": "読み込みました:",
|
||||
"nodeCopied": "__count__ 個のノードをコピーしました",
|
||||
@@ -218,9 +210,6 @@
|
||||
"groupCopied_plural": "__count__ 個のグループをコピーしました",
|
||||
"groupStyleCopied": "グループの形式をコピーしました",
|
||||
"invalidFlow": "不正なフロー: __message__",
|
||||
"recoveredNodes": "復旧したノード",
|
||||
"recoveredNodesInfo": "このフロー内のノードは読み込み時に、有効なフローIDがありませんでした。これらフローIDは、フローに追加されているため、復元または削除できます。",
|
||||
"recoveredNodesNotification": "<p>有効なフローIDを持たないノードが読み込まれました</p><p>これらノードは '__flowName__' という新しいフローへ追加されました。</p>",
|
||||
"export": {
|
||||
"selected": "選択したフロー",
|
||||
"current": "現在のタブ",
|
||||
@@ -235,19 +224,13 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "読み込み先",
|
||||
"importSelected": "選択したノードを読み込み",
|
||||
"importCopy": "コピーを読み込み",
|
||||
"viewNodes": "ノードを参照...",
|
||||
"newFlow": "新規のタブ",
|
||||
"replace": "置換",
|
||||
"errors": {
|
||||
"notArray": "JSON形式の配列ではありません",
|
||||
"itemNotObject": "不正なフロー - __index__ 番目の要素はノードオブジェクトではありません",
|
||||
"missingId": "不正なフロー - __index__ 番目の要素に'id'プロパティがありません",
|
||||
"missingType": "不正なフロー - __index__ 番目の要素に'type'プロパティがありません"
|
||||
},
|
||||
"conflictNotification1": "読み込もうとしているノードのいくつかは、既にワークスペース内に存在しています。",
|
||||
"conflictNotification2": "読み込むノードを選択し、また既存のノードを置き換えるか、もしくはそれらのコピーを読み込むかも選択してください。"
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "パスをコピーしました",
|
||||
"copyMessageValue": "値をコピーしました",
|
||||
@@ -384,7 +367,6 @@
|
||||
"locale": "UI言語の選択",
|
||||
"icon": "記号",
|
||||
"inputType": "入力形式",
|
||||
"selectType": "形式選択...",
|
||||
"inputs": {
|
||||
"input": "入力",
|
||||
"select": "メニュー",
|
||||
@@ -547,8 +529,6 @@
|
||||
"sortAZ": "辞書順",
|
||||
"sortRecent": "日付順",
|
||||
"more": "+ さらに __count__ 個",
|
||||
"upload": "モジュールのtgzファイルをアップロード",
|
||||
"refresh": "モジュールリスト更新",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "<p>ノードのカタログの読み込みに失敗しました。</p><p>詳細はブラウザのコンソールを確認してください。</p>",
|
||||
"installFailed": "<p>追加処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
|
||||
@@ -615,16 +595,7 @@
|
||||
"showTips": "設定からヒントを表示できます",
|
||||
"outline": "アウトライン",
|
||||
"empty": "空",
|
||||
"globalConfig": "グローバル設定ノード",
|
||||
"triggerAction": "アクションを実行",
|
||||
"find": "ワークスペース内を検索",
|
||||
"search": {
|
||||
"configNodes": "設定ノード",
|
||||
"unusedConfigNodes": "未使用の設定ノード",
|
||||
"invalidNodes": "不正なノード",
|
||||
"uknownNodes": "未知のノード",
|
||||
"unusedSubflows": "未使用のサブフロー"
|
||||
}
|
||||
"globalConfig": "グローバル設定ノード"
|
||||
},
|
||||
"help": {
|
||||
"name": "ヘルプ",
|
||||
@@ -725,12 +696,6 @@
|
||||
"committerTip": "システムのデフォルトを使用する場合、空白のままにしてください",
|
||||
"userName": "ユーザ名",
|
||||
"email": "メールアドレス",
|
||||
"workflow": "ワークフロー",
|
||||
"workfowTip": "望ましいgitワークフローを選択してください",
|
||||
"workflowManual": "手動",
|
||||
"workflowManualTip": "全ての変更は「履歴」サイドバー内で手動でコミットする必要があります",
|
||||
"workflowAuto": "自動",
|
||||
"workflowAutoTip": "変更はデプロイの度に自動的にコミットされます",
|
||||
"sshKeys": "SSH キー",
|
||||
"sshKeysTip": "gitリポジトリへのセキュアな接続を作成できます。",
|
||||
"add": "キーを追加",
|
||||
@@ -1089,7 +1054,6 @@
|
||||
"en-US": "英語",
|
||||
"ja": "日本語",
|
||||
"ko": "韓国語",
|
||||
"ru": "ロシア語",
|
||||
"zh-CN": "中国語(簡体)",
|
||||
"zh-TW": "中国語(繁体)"
|
||||
}
|
||||
|
4
packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json
vendored
Normal file → Executable file
4
packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json
vendored
Normal file → Executable file
@@ -266,9 +266,5 @@
|
||||
"$type": {
|
||||
"args": "value",
|
||||
"desc": "`value` の型を文字列として返します。もし `value` が未定義の場合、 `undefined` が返されます。"
|
||||
},
|
||||
"$moment": {
|
||||
"args": "[str]",
|
||||
"desc": "Momentライブラリを使用して日付オブジェクトを取得します。"
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"info": {
|
||||
"tip0" : "Вы можете удалить выбранные узлы или провода с {{core:delete-selection}}",
|
||||
"tip1" : "Ищите узлы с {{core:search}}",
|
||||
"tip2" : "{{core:toggle-sidebar}} показывает/скрывает эту боковою панель",
|
||||
"tip3" : "Вы можете управлять палитрой узлов с помощью {{core:manage-palette}}",
|
||||
"tip4" : "Узлы конфигурации потока перечисляются на боковой панели. Доступ к списку можно получить из меню или с помощью {{core:show-config-tab}}",
|
||||
"tip5" : "Эти советы можно включить/выключить через настройки",
|
||||
"tip6" : "Перемещайте выбранные узлы клавишами [влево] [вверх] [вниз] и [вправо]. Удерживайте [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}} откроет редактор первого узла в текущем выборе"
|
||||
}
|
||||
}
|
@@ -1,274 +0,0 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg[, prettify]",
|
||||
"desc": "Преобразует параметр `arg` в строку, используя следующие правила приведения:\n\n - Строки возвращаются как есть\n - Функции преобразуются в пустую строку\n - Числовая бесконечность и NaN выдают ошибку, поскольку они не могут быть представлены числом в JSON\n - Все остальные значения преобразуются в строку JSON с помощью функции `JSON.stringify`. Если значение `prettify` равно true, тогда будет сгенерирован \"отформатированный\" JSON. То есть каждое поле будет в отдельной строке, а строки будут иметь отступ в зависимости от глубины поля."
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
"desc": "Возвращает количество символов в строке `str`. Выдается ошибка, если `str` не является строкой."
|
||||
},
|
||||
"$substring": {
|
||||
"args": "str, start[, length]",
|
||||
"desc": "Возвращает строку, содержащую символы из первого параметра `str`, начиная с позиции `start` (отсчет с нуля). Если указан `length`, то подстрока будет содержать максимум `length` символов. Если `start` отрицателен, то это означает количество символов с конца `str`."
|
||||
},
|
||||
"$substringBefore": {
|
||||
"args": "str, chars",
|
||||
"desc": "Возвращает подстроку перед первым вхождением последовательности символов `chars` в строке `str`. Если `str` не содержит `chars`, то он возвращает `str`."
|
||||
},
|
||||
"$substringAfter": {
|
||||
"args": "str, chars",
|
||||
"desc": "Возвращает подстроку после первого вхождения последовательности символов `chars` в строке `str`. Если `str` не содержит `chars`, то он возвращает `str`."
|
||||
},
|
||||
"$uppercase": {
|
||||
"args": "str",
|
||||
"desc": "Возвращает строку со всеми символами `str`, преобразованными в верхний регистр."
|
||||
},
|
||||
"$lowercase": {
|
||||
"args": "str",
|
||||
"desc": "Возвращает строку со всеми символами `str`, преобразованными в нижний регистр."
|
||||
},
|
||||
"$trim": {
|
||||
"args": "str",
|
||||
"desc": "Нормализует и обрезает все пробельные символы в строке `str`, выполняя следующие шаги:\n\n - Все символы табуляции, возврата каретки и перевода строки заменяются пробелами.\n- Последовательности пробелов сокращаются до одного пробела.\n- Пробелы в начале и конце `str` удаляются.\n\n Если `str` не указан (то есть эта функция вызывается без аргументов), тогда значение контекста используется в качестве значения `str`. Выдается ошибка, если `str` не является строкой."
|
||||
},
|
||||
"$contains": {
|
||||
"args": "str, pattern",
|
||||
"desc": "Возвращает `true`, если строка `str` соответствует шаблону `pattern`, в противном случае возвращает `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`. Выдает ошибку, если входной массив содержит элемент, который не является строкой. Если `separator` не указан, то предполагается, что это пустая строка, то есть нет `separator` между подстроками. Выдает ошибку, если `separator` не является строкой."
|
||||
},
|
||||
"$match": {
|
||||
"args": "str, pattern [, limit]",
|
||||
"desc": "Применяет строку `str` к регулярному выражению `pattern` и возвращает массив объектов, каждый из которых содержит информацию о каждом совпадении внутри `str`."
|
||||
},
|
||||
"$replace": {
|
||||
"args": "str, pattern, replacement [, limit]",
|
||||
"desc": "Находит вхождения шаблона `pattern` в строке `str` и заменяет их на строку `replacement`.\n\nНеобязательный параметр `limit` - это максимальное количество замен."
|
||||
},
|
||||
"$now": {
|
||||
"args":"",
|
||||
"desc":"Создает отметку времени в формате, совместимом с ISO 8601, и возвращает ее как строку."
|
||||
},
|
||||
"$base64encode": {
|
||||
"args":"string",
|
||||
"desc":"Преобразует ASCII-строку в base-64 кодировку. Каждый символ в строке обрабатывается как байт двоичных данных. Для этого необходимо, чтобы все символы в строке находились в диапазоне от 0x00 до 0xFF, который включает все символы строк в URI-кодировке. Символы Юникода за пределами этого диапазона не поддерживаются."
|
||||
},
|
||||
"$base64decode": {
|
||||
"args":"string",
|
||||
"desc":"Преобразует байты в кодировке base-64 в строку, используя кодовую страницу Юникод UTF-8."
|
||||
},
|
||||
"$number": {
|
||||
"args": "arg",
|
||||
"desc": "Преобразует параметр `arg` в число с использованием следующих правил приведения:\n\n - Числа возвращаются как есть\n - Строки, которые содержат последовательность символов, представляющих допустимое в JSON число, преобразуются в это число\n - Все остальные значения вызывают ошибку."
|
||||
},
|
||||
"$abs": {
|
||||
"args":"number",
|
||||
"desc":"Возвращает абсолютное значение числа `number`."
|
||||
},
|
||||
"$floor": {
|
||||
"args":"number",
|
||||
"desc":"Возвращает значение числа `number`, округленное до ближайшего целого числа, которое меньше или равно `number`."
|
||||
},
|
||||
"$ceil": {
|
||||
"args":"number",
|
||||
"desc":"Возвращает значение числа `number`, округленное до ближайшего целого числа, которое больше или равно `number`."
|
||||
},
|
||||
"$round": {
|
||||
"args":"number [, precision]",
|
||||
"desc":"Возвращает значение числа `number`, округленное до количества десятичных знаков, указанных необязательным параметром `precision`."
|
||||
},
|
||||
"$power": {
|
||||
"args":"base, exponent",
|
||||
"desc":"Возвращает значение числа `base`, возведенное в степень `exponent`."
|
||||
},
|
||||
"$sqrt": {
|
||||
"args":"number",
|
||||
"desc":"Возвращает квадратный корень из значения числа `number`."
|
||||
},
|
||||
"$random": {
|
||||
"args":"",
|
||||
"desc":"Возвращает псевдослучайное число, которе больше или равно нулю и меньше единицы."
|
||||
},
|
||||
"$millis": {
|
||||
"args":"",
|
||||
"desc":"Возвращает число миллисекунд с начала Unix-эпохи (1 января 1970 года по Гринвичу) в виде числа. Все вызовы `$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 - Логические значения возвращаются как есть\n - пустая строка: `false`\n - непустая строка: `true`\n - число равное `0`: `false`\n - ненулевое число: `true`\n - `null` : `false`\n - пустой массив: `false`\n - массив, который содержит хотя бы один элемент, приводимый к `true`: `true`\n - массив, все элементы которого приводятся к `false`: `false`\n - пустой объект: `false`\n - непустой объект: `true`\n - функция: `false`"
|
||||
},
|
||||
"$not": {
|
||||
"args": "arg",
|
||||
"desc": "Возвращает логическое НЕ для аргумента. `arg` сначала приводится к логическому значению"
|
||||
},
|
||||
"$exists": {
|
||||
"args": "arg",
|
||||
"desc": "Возвращает логическое `true`, если выполнение выражения `arg` возвращает значение, или `false`, если выражение ничему не соответствует (например, путь к несуществующему полю)."
|
||||
},
|
||||
"$count": {
|
||||
"args": "array",
|
||||
"desc": "Возвращает количество элементов в массиве"
|
||||
},
|
||||
"$append": {
|
||||
"args": "array, array",
|
||||
"desc": "Присоединяет один массив к другому"
|
||||
},
|
||||
"$sort": {
|
||||
"args":"array [, function]",
|
||||
"desc":"Возвращает массив, содержащий все значения параметра `array`, но отсортированные по порядку.\n\nЕсли указан компаратор `function`, то это должна быть функция, которая принимает два параметра:\n\n`function(val1, val2)`\n\nЭту функцию вызывает алгоритм сортировки для сравнения двух значений: val1 и val2. Если значение val1 следует поместить после значения val2 в желаемом порядке сортировки, то функция должна возвращать логическое значение `true`, чтобы обозначить замену. В противном случае она должна вернуть `false`."
|
||||
},
|
||||
"$reverse": {
|
||||
"args":"array",
|
||||
"desc":"Возвращает массив, содержащий все значения из параметра `array`, но в обратном порядке."
|
||||
},
|
||||
"$shuffle": {
|
||||
"args":"array",
|
||||
"desc":"Возвращает массив, содержащий все значения из параметра `array`, но перемешанный в случайном порядке."
|
||||
},
|
||||
"$zip": {
|
||||
"args":"array, ...",
|
||||
"desc":"Возвращает свернутый (сжатый) массив, содержащий сгруппированные массивы значений из аргументов `array1` … `arrayN` по индексам 0, 1, 2...."
|
||||
},
|
||||
"$keys": {
|
||||
"args": "object",
|
||||
"desc": "Возвращает массив, содержащий ключи объекта. Если аргумент является массивом объектов, то возвращаемый массив содержит недублированный список всех ключей из всех объектов."
|
||||
},
|
||||
"$lookup": {
|
||||
"args": "object, key",
|
||||
"desc": "Возвращает значение, связанное с ключом в объекте. Если первый аргумент является массивом объектов, то просходит поиск по всем объектам в массиве, и возвращаются значения, связанные со всеми вхождениями ключа."
|
||||
},
|
||||
"$spread": {
|
||||
"args": "object",
|
||||
"desc": "Разбивает объект, содержащий пары ключ / значение, на массив объектов, каждый из которых имеет одну пару ключ / значение из входного объекта. Если параметр является массивом объектов, то результирующий массив содержит объект для каждой пары ключ / значение из каждого объекта предоставленного массива."
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "Объединяет массив объектов в один объект, содержащий все пары ключ / значение каждого из объектов входного массива. Если какой-либо из входных объектов содержит один и тот же ключ, возвращаемый объект будет содержать значение последнего в массиве. Вызывает ошибку, если входной массив содержит элемент, который не является объектом."
|
||||
},
|
||||
"$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Функция должна принимать два аргумента и вести себя как инфиксный оператор между каждым значением в массиве `array`. Сигнатура `function` должна иметь форму: `myfunc($accumulator, $value[, $index[, $array]])`\n\nНеобязательный параметр `init` используется в качестве начального значения в агрегации."
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string[, string]",
|
||||
"desc": "Извлекает свойство контекста потока.\n\nЭто функция от Node-RED."
|
||||
},
|
||||
"$globalContext": {
|
||||
"args": "string[, string]",
|
||||
"desc": "Извлекает свойство глобального контекста.\n\nЭто функция от Node-RED."
|
||||
},
|
||||
"$pad": {
|
||||
"args": "string, width [, char]",
|
||||
"desc": "Возвращает копию строки `string` с дополнительным заполнением, если необходимо, чтобы общее количество символов как минимум соответствовало абсолютному значению параметра `width`.\n\nЕсли `width` является положительным числом, то строка дополняется справа; если отрицательным, то дополняется слева.\n\nНеобязательный аргумент `char` указывает символ(ы) для заполнения. Если не указано, по умолчанию используется пробел."
|
||||
},
|
||||
"$fromMillis": {
|
||||
"args": "number",
|
||||
"desc": "Преобразует число, представляющее миллисекунды с начала Unix-эпохи (1 января 1970 года по Гринвичу), в строку отметки времени в формате ISO 8601."
|
||||
},
|
||||
"$formatNumber": {
|
||||
"args": "number, picture [, options]",
|
||||
"desc": "Преобразует число `number` в строку и форматирует ее в десятичное представление, как указано в строке `picture`.\n\nПоведение этой функции соответствует XPath/XQuery-функции fn:format-number, как определено в спецификация XPath F&O 3.1. Строка `picture` определяет, как форматируется число и имеет тот же синтаксис, что и fn:format-number.\n\nНеобязательный третий аргумент `options` используется для переопределения символов форматирования, специфичных для локали по умолчанию, таких как десятичный разделитель. Если аргумент указан, то это должен быть объект, содержащий пары имя/значение, указанные в разделе десятичного формата спецификации XPath F&O 3.1."
|
||||
},
|
||||
"$formatBase": {
|
||||
"args": "number [, radix]",
|
||||
"desc": "Преобразует число `number` в строку и форматирует ее в целое число, представленное в системе счисления, указанной аргументом `radix`. Если `radix` не указан, то по умолчанию используется десятичная. Значение 'radix` может быть от 2 до 36, в противном случае выдается ошибка."
|
||||
},
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "Преобразует строку `timestamp` в формате ISO 8601 в число миллисекунд с начала Unix-эпохи (1 января 1970 года по Гринвичу). Вызывает ошибку, если строка в неправильном формате."
|
||||
},
|
||||
"$env": {
|
||||
"args": "arg",
|
||||
"desc": "Возвращает значение переменной среды.\n\nЭто функция от Node-RED."
|
||||
},
|
||||
"$eval": {
|
||||
"args": "expr [, context]",
|
||||
"desc": "Анализирует и исполняет строку `expr`, которая содержит JSON или выражение JSONata, используя текущий контекст в качестве контекста для исполнения."
|
||||
},
|
||||
"$formatInteger": {
|
||||
"args": "number, picture",
|
||||
"desc": "Преобразует число `number` в строку и форматирует ее в целочисленное представление, как указано в строке `picture`. Строка `picture` определяет, как форматируется число и имеет тот же синтаксис, что и `fn:format-integer` из спецификации XPath F&O 3.1."
|
||||
},
|
||||
"$parseInteger": {
|
||||
"args": "string, picture",
|
||||
"desc": "Разбирает содержимое строки `string` в целое число (как число JSON), используя формат, указанный в строке `picture`. Строковый параметр `picture` имеет тот же формат, что и `$formatInteger`."
|
||||
},
|
||||
"$error": {
|
||||
"args": "[str]",
|
||||
"desc": "Вызывает ошибку с сообщением. Необязательная строка `str` заменяет сообщение по умолчанию $error() function evaluated`"
|
||||
},
|
||||
"$assert": {
|
||||
"args": "arg, str",
|
||||
"desc": "Если значение `arg` равно true, функция возвращает значение undefined. Если значение `arg` равно false, генерируется исключение с `str` в качестве сообщения об исключении."
|
||||
},
|
||||
"$single": {
|
||||
"args": "array, function",
|
||||
"desc": "Возвращает одно-единственное значение из массива `array`, которое удовлетворяет предикату `function` (то есть когда `function` возвращает логическое `true` при передаче значения). Выдает исключение, если число подходящих значений не одно.\n\nФункция должна соответствовать следующей сигнатуре: `function(value [, index [, array]])` где value - элемент массива, index - позиция этого значения, а весь массив передается в качестве третьего аргумента"
|
||||
},
|
||||
"$encodeUrl": {
|
||||
"args": "str",
|
||||
"desc": "Кодирует компонент Uniform Resource Locator (URL), заменяя каждый экземпляр определенных символов одной, двумя, тремя или четырьмя escape-последовательностями, представляющими кодировку UTF-8 символа.\n\nПример: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
|
||||
},
|
||||
"$encodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "Кодирует Uniform Resource Locator (URL), заменяя каждый экземпляр определенных символов одной, двумя, тремя или четырьмя escape-последовательностями, представляющими кодировку 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": "Декодирует компонент Uniform Resource Locator (URL), ранее созданный с помощью encodeUrlComponent.\n\nПример: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`"
|
||||
},
|
||||
"$decodeUrlComponent": {
|
||||
"args": "str",
|
||||
"desc": "Декодирует компонент Uniform Resource Locator (URL), ранее созданный с помощью encodeUrl. \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`"
|
||||
},
|
||||
"$moment": {
|
||||
"args": "[str]",
|
||||
"desc": "Получает date объект, используя библиотеку Moment."
|
||||
}
|
||||
}
|
@@ -14,16 +14,7 @@
|
||||
"back": "后退",
|
||||
"next": "下一个",
|
||||
"clone": "克隆项目",
|
||||
"cont": "继续",
|
||||
"style": "风格",
|
||||
"line": "大纲",
|
||||
"fill": "填充",
|
||||
"label": "标签",
|
||||
"color": "颜色",
|
||||
"position": "位置",
|
||||
"enable": "启用",
|
||||
"disable": "禁用",
|
||||
"upload": "上传"
|
||||
"cont": "继续"
|
||||
},
|
||||
"type": {
|
||||
"string": "字符串",
|
||||
@@ -37,18 +28,11 @@
|
||||
"null": "空"
|
||||
}
|
||||
},
|
||||
"event": {
|
||||
"loadPalette": "加载控制板",
|
||||
"loadNodeCatalogs": "加载节点目录",
|
||||
"loadNodes": "加载 __count__ 个节点",
|
||||
"loadFlows": "加载流程",
|
||||
"importFlows": "往工作区中加载流程"
|
||||
},
|
||||
"workspace": {
|
||||
"defaultName": "流程 __number__",
|
||||
"defaultName": "流程__number__",
|
||||
"editFlow": "编辑流程: __name__",
|
||||
"confirmDelete": "确认删除",
|
||||
"delete": "你确定要删除 __label__ ?",
|
||||
"delete": "你确定想删除 '__label__'?",
|
||||
"dropFlowHere": "把流程放到这里",
|
||||
"addFlow": "添加流程",
|
||||
"listFlows": "流程一览",
|
||||
@@ -107,12 +91,7 @@
|
||||
"projects-new": "新建",
|
||||
"projects-open": "打开",
|
||||
"projects-settings": "项目设定",
|
||||
"showNodeLabelDefault": "显示新添加的节点的标签",
|
||||
"groups": "组",
|
||||
"groupSelection": "选择组",
|
||||
"ungroupSelection": "取消选择组",
|
||||
"groupMergeSelection": "合并选择",
|
||||
"groupRemoveSelection": "从组中移除"
|
||||
"showNodeLabelDefault": "显示新添加的节点的标签"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
@@ -122,7 +101,7 @@
|
||||
"zoom-in": "放大"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "作为 __name__ 登陆",
|
||||
"loggedInAs": "作为__name__登陆",
|
||||
"username": "账号",
|
||||
"password": "密码",
|
||||
"login": "登陆",
|
||||
@@ -148,13 +127,13 @@
|
||||
"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>",
|
||||
"project_not_found": "<p>未找到项目'__project__'。</p>",
|
||||
"git_merge_conflict": "<p>自动合并更改失败。</p><p>修复未合并的冲突,然后提交结果。</p>"
|
||||
},
|
||||
"error": "<strong>错误</strong>: __message__",
|
||||
"errors": {
|
||||
"lostConnection": "丢失与服务器的连接,重新连接...",
|
||||
"lostConnectionReconnect": "丢失与服务器的连接, __time__ 秒后重新连接",
|
||||
"lostConnectionReconnect": "丢失与服务器的连接,__time__秒后重新连接",
|
||||
"lostConnectionTry": "现在尝试",
|
||||
"cannotAddSubflowToItself": "无法向其自身添加子流程",
|
||||
"cannotAddCircularReference": "无法添加子流程 - 循环引用",
|
||||
@@ -188,18 +167,14 @@
|
||||
"clipboard": {
|
||||
"clipboard": "剪贴板",
|
||||
"nodes": "节点",
|
||||
"node": "__count__ 个节点",
|
||||
"node_plural": "__count__ 个节点",
|
||||
"configNode": "__count__ 个配置节点",
|
||||
"configNode_plural": "__count__ 个配置节点",
|
||||
"group": "__count__ 个组",
|
||||
"group_plural": "__count__ 个组",
|
||||
"flow": "__count__ 个流程",
|
||||
"flow_plural": "__count__ 个流程",
|
||||
"subflow": "__count__ 个子流程",
|
||||
"subflow_plural": "__count__ 子流程",
|
||||
"replacedNodes": "__count__ 个节点被置换",
|
||||
"replacedNodes_plural": "__count__ 个节点被置换",
|
||||
"node": "__count__节点",
|
||||
"node_plural": "__count__节点",
|
||||
"configNode": "__count__配置节点",
|
||||
"configNode_plural": "__count__配置节点",
|
||||
"flow": "__count__流程",
|
||||
"flow_plural": "__count__流程",
|
||||
"subflow": "__count__子流程",
|
||||
"subflow_plural": "__count__子流程",
|
||||
"pasteNodes": "在这里粘贴节点",
|
||||
"selectFile": "选择要导入的文件",
|
||||
"importNodes": "导入节点",
|
||||
@@ -209,15 +184,9 @@
|
||||
"importUnrecognised_plural": "导入了无法识别的类型:",
|
||||
"nodesExported": "节点导出到了剪贴板",
|
||||
"nodesImported": "导入:",
|
||||
"nodeCopied": "已复制 __count__ 个节点",
|
||||
"nodeCopied_plural": "已复制 __count__ 个节点",
|
||||
"groupCopied": "复制 __count__ 个组",
|
||||
"groupCopied_plural": "已复制 __count__ 个groups",
|
||||
"groupStyleCopied": "已复制组风格",
|
||||
"nodeCopied": "已复制__count__个节点",
|
||||
"nodeCopied_plural": "已复制__count__个节点",
|
||||
"invalidFlow": "无效的流程: __message__",
|
||||
"recoveredNodes": "复原的节点",
|
||||
"recoveredNodesInfo": "导入节点时,此流上的节点缺少有效的流ID。 它们已被添加到此流中,您可以复原或删除它们。",
|
||||
"recoveredNodesNotification": "<p>导入的节点缺少有效的流ID</p><p>已将它们添加到名为 '__flowName__'的新流中。</p>",
|
||||
"export": {
|
||||
"selected": "已选择的节点",
|
||||
"current": "现在的节点",
|
||||
@@ -232,19 +201,13 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "导入到",
|
||||
"importSelected": "导入所选项",
|
||||
"importCopy": "导入副本",
|
||||
"viewNodes": "查看节点",
|
||||
"newFlow": "新流程",
|
||||
"replace": "置换",
|
||||
"errors": {
|
||||
"notArray": "输入的不是JSON数组",
|
||||
"itemNotObject": "输入的流无效 - 项目 __index__ 不是节点对象",
|
||||
"itemNotObject": "输入的流无效 - 项目__index__不是节点对象",
|
||||
"missingId": "输入的流无效-项 __index__ 缺少'id'属性",
|
||||
"missingType": "输入的流程无效-项 __index__ 缺少'类型'属性"
|
||||
},
|
||||
"conflictNotification1": "您要导入的某些节点已经存在于工作空间中。",
|
||||
"conflictNotification2": "选择要导入的节点,并确认要替换现有的节点还是导入它们的副本"
|
||||
"missingType": "输入的流程无效-项__index__缺少'类型'属性"
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "已复制路径",
|
||||
"copyMessageValue": "已复制数值",
|
||||
@@ -287,7 +250,7 @@
|
||||
"conflictChecking": "检查是否可以自动合并更改",
|
||||
"conflictAutoMerge": "此更改不包括冲突,可以自动合并",
|
||||
"conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。",
|
||||
"plusNMore": "+ __count__ 更多"
|
||||
"plusNMore": "+ __count__更多"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
@@ -324,11 +287,11 @@
|
||||
"newVersionError": "新版本不包含有效的JSON:"
|
||||
},
|
||||
"subflow": {
|
||||
"editSubflowInstance": "编辑子流实例: __name__",
|
||||
"editSubflow": "编辑流程模板: __name__",
|
||||
"editSubflowInstance": "编辑子流实例:__name__",
|
||||
"editSubflow": "编辑流程模板: __name__",
|
||||
"edit": "编辑流程模板",
|
||||
"subflowInstances": "这个子流程模板有 __count__ 个实例",
|
||||
"subflowInstances_plural": "这个子流程模板有 __count__ 个实例",
|
||||
"subflowInstances": "这个子流程模板有__count__个实例",
|
||||
"subflowInstances_plural": "这个子流程模板有__count__个实例",
|
||||
"editSubflowProperties": "编辑属性",
|
||||
"input": "输入:",
|
||||
"output": "输出:",
|
||||
@@ -345,24 +308,17 @@
|
||||
"multipleInputsToSelection": "<strong>无法创建子流程</strong>: 多个输入到了选择"
|
||||
}
|
||||
},
|
||||
"group": {
|
||||
"editGroup": "编辑组: __name__",
|
||||
"errors": {
|
||||
"cannotCreateDiffGroups": "无法使用来自不同组的节点创建组",
|
||||
"cannotAddSubflowPorts": "无法将子流程的端口添加到组"
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"configEdit": "编辑",
|
||||
"configAdd": "添加",
|
||||
"configUpdate": "更新",
|
||||
"configDelete": "删除",
|
||||
"nodesUse": "__count__ 个节点使用此配置",
|
||||
"nodesUse_plural": "__count__ 个节点使用此配置",
|
||||
"addNewConfig": "添加新的 __type__ 配置",
|
||||
"editNode": "编辑 __type__ 节点",
|
||||
"editConfig": "编辑 __type__ 配置",
|
||||
"addNewType": "添加新的 __type__ 节点",
|
||||
"nodesUse": "__count__个节点使用此配置",
|
||||
"nodesUse_plural": "__count__个节点使用此配置",
|
||||
"addNewConfig": "添加新的__type__配置",
|
||||
"editNode": "编辑__type__节点",
|
||||
"editConfig": "编辑__type__配置",
|
||||
"addNewType": "添加新的__type__节点",
|
||||
"nodeProperties": "节点属性",
|
||||
"label": "标签",
|
||||
"color": "颜色",
|
||||
@@ -381,7 +337,6 @@
|
||||
"locale": "选择界面语言",
|
||||
"icon": "图标",
|
||||
"inputType": "输入类型",
|
||||
"selectType": "选择类型...",
|
||||
"inputs": {
|
||||
"input": "输入",
|
||||
"select": "选择",
|
||||
@@ -396,8 +351,7 @@
|
||||
"bool": "布尔",
|
||||
"json": "JSON",
|
||||
"bin": "buffer",
|
||||
"env": "环境变量",
|
||||
"cred": "证书"
|
||||
"env": "环境变量"
|
||||
},
|
||||
"menu": {
|
||||
"input": "输入",
|
||||
@@ -427,7 +381,7 @@
|
||||
"scope": "范围",
|
||||
"unassigned": "未分配",
|
||||
"global": "全局",
|
||||
"workspace": "工作区",
|
||||
"workspace": "工作组",
|
||||
"selectAll": "选择所有节点",
|
||||
"selectAllConnected": "选择所有连接的节点",
|
||||
"addRemoveNode": "从选择中添加/删除节点",
|
||||
@@ -506,33 +460,33 @@
|
||||
"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__ 月前"
|
||||
"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__ 个可用模块",
|
||||
"nodeCount": "__label__个节点",
|
||||
"nodeCount_plural": "__label__个节点",
|
||||
"moduleCount": "__count__个可用模块",
|
||||
"moduleCount_plural": "__count__个可用模块",
|
||||
"inuse": "使用中",
|
||||
"enableall": "全部启用",
|
||||
"disableall": "全部禁用",
|
||||
"enable": "启用",
|
||||
"disable": "禁用",
|
||||
"remove": "移除",
|
||||
"update": "更新至 __version__ 版本",
|
||||
"update": "更新至__version__版本",
|
||||
"updated": "已更新",
|
||||
"install": "安装",
|
||||
"installed": "已安装",
|
||||
@@ -544,8 +498,7 @@
|
||||
"sort": "排序:",
|
||||
"sortAZ": "a-z顺序",
|
||||
"sortRecent": "日期顺序",
|
||||
"more": "增加 __count__ 个",
|
||||
"upload": "上传模块tgz文件",
|
||||
"more": "增加__count__个",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "无法加载节点目录。<br>查看浏览器控制台了解更多信息",
|
||||
"installFailed": "无法安装: __module__<br>__message__<br>查看日志了解更多信息",
|
||||
@@ -586,7 +539,6 @@
|
||||
"label": "信息",
|
||||
"node": "节点",
|
||||
"type": "类型",
|
||||
"group": "组",
|
||||
"module": "模组",
|
||||
"id": "ID",
|
||||
"status": "状态",
|
||||
@@ -608,30 +560,8 @@
|
||||
"subflowDesc": "子流程描述",
|
||||
"nodeHelp": "节点帮助",
|
||||
"none": "无",
|
||||
"arrayItems": "__count__ 个项目",
|
||||
"showTips": "您可以从设置面板启用提示信息",
|
||||
"outline": "大纲",
|
||||
"empty": "空的",
|
||||
"globalConfig": "全局配置节点",
|
||||
"triggerAction": "触发动作",
|
||||
"find": "在工作区中查找",
|
||||
"search": {
|
||||
"configNodes": "配置节点",
|
||||
"unusedConfigNodes": "未使用的配置节点",
|
||||
"invalidNodes": "无效的节点",
|
||||
"uknownNodes": "未知的节点",
|
||||
"unusedSubflows": "未使用的子流程"
|
||||
}
|
||||
},
|
||||
"help": {
|
||||
"name": "帮助",
|
||||
"label": "帮助",
|
||||
"search": "搜索帮助",
|
||||
"nodeHelp": "节点帮助",
|
||||
"showHelp": "显示帮助",
|
||||
"showInOutline": "在大纲中显示",
|
||||
"showTopics": "显示主题",
|
||||
"noHelp": "未选择帮助主题"
|
||||
"arrayItems": "__count__个项目",
|
||||
"showTips": "您可以从设置面板启用提示信息"
|
||||
},
|
||||
"config": {
|
||||
"name": "配置节点",
|
||||
@@ -684,9 +614,9 @@
|
||||
"removeFromProject": "从项目中删除",
|
||||
"addToProject": "添加到项目",
|
||||
"files": "文件",
|
||||
"package": "包",
|
||||
"flow": "流程",
|
||||
"credentials": "证书",
|
||||
"package": "包",
|
||||
"packageCreate": "保存更改后将创建文件",
|
||||
"fileNotExist": "文件不存在",
|
||||
"selectFile": "选择文件",
|
||||
@@ -698,7 +628,7 @@
|
||||
"changeTheEncryptionKey": "更改加密密钥",
|
||||
"currentKey": "当前密钥",
|
||||
"newKey": "新密钥",
|
||||
"credentialsAlert": "这将删除所有现有证书",
|
||||
"credentialsAlert": "这将删除所有现有凭证",
|
||||
"versionControl": "版本控制",
|
||||
"branches": "分支",
|
||||
"noBranches": "没有分支",
|
||||
@@ -722,12 +652,6 @@
|
||||
"committerTip": "保留空白以使用系统默认值",
|
||||
"userName": "用户名",
|
||||
"email": "电子邮件",
|
||||
"workflow": "工作流",
|
||||
"workfowTip": "选择您偏好的工作流",
|
||||
"workflowManual": "手动",
|
||||
"workflowManualTip": "所有更改都必须在“历史记录”侧边栏中手动提交",
|
||||
"workflowAuto": "自动",
|
||||
"workflowAutoTip": "每次部署后都会自动提交更改",
|
||||
"sshKeys": "SSH密钥",
|
||||
"sshKeysTip": "允许您创建到远程git存储库的安全连接。",
|
||||
"add": "添加密钥",
|
||||
@@ -744,7 +668,7 @@
|
||||
"copyPublicKey": "将公钥复制到剪贴板",
|
||||
"delete": "删除密钥",
|
||||
"gitConfig": "Git配置",
|
||||
"deleteConfirm": "您确定要删除SSH密钥 __name__ 吗?这不能被撤消。"
|
||||
"deleteConfirm": "您确定要删除SSH密钥__name__吗?这不能被撤消。"
|
||||
},
|
||||
"versionControl": {
|
||||
"unstagedChanges": "未暂存的变更",
|
||||
@@ -798,24 +722,24 @@
|
||||
"pullChanges": "拉取更改",
|
||||
"history": "历史",
|
||||
"projectHistory": "项目历史",
|
||||
"daysAgo": "__count__ 天前",
|
||||
"daysAgo_plural": "__count__ 天前",
|
||||
"hoursAgo": "__count__ 小时前",
|
||||
"hoursAgo_plural": "__count__ 小时前",
|
||||
"minsAgo": "__count__ 分钟前",
|
||||
"minsAgo_plural": "__count__ 分钟前",
|
||||
"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__ 次提交。",
|
||||
"commitsAhead": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
|
||||
"commitsAhead_plural": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
|
||||
"commitsBehind": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
|
||||
"commitsBehind_plural": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
|
||||
"commitsAheadAndBehind1": "您的存储库落后远程仓库__count__次提交",
|
||||
"commitsAheadAndBehind1_plural": "您的存储库落后远程仓库__count__次提交",
|
||||
"commitsAheadAndBehind2": "领先远程仓库__count__次提交。",
|
||||
"commitsAheadAndBehind2_plural": "领先远程仓库__count__次提交。",
|
||||
"commitsAheadAndBehind3": "您必须先拉取远程提交,然后才能进行推送。",
|
||||
"commitsAheadAndBehind3_plural": "您必须先拉取远程提交,然后才能进行推送。",
|
||||
"refreshCommitHistory": "刷新提交历史",
|
||||
@@ -833,8 +757,7 @@
|
||||
"bin": "二进制流",
|
||||
"date": "时间戳",
|
||||
"jsonata": "表达式",
|
||||
"env": "环境变量",
|
||||
"cred": "证书"
|
||||
"env": "环境变量"
|
||||
}
|
||||
},
|
||||
"editableList": {
|
||||
@@ -1054,8 +977,7 @@
|
||||
"passphrase": "密码短语",
|
||||
"retry": "重试",
|
||||
"update-failed": "无法更新身份验证",
|
||||
"unhandled": "未处理的错误响应",
|
||||
"host-key-verify-failed": "<p>主机密钥验证失败。</p><p>无法验证存储库主机密钥。请更新您的<code>known_hosts</code>文件,然后重试。</p>"
|
||||
"unhandled": "未处理的错误响应"
|
||||
},
|
||||
"create-branch-list": {
|
||||
"invalid": "无效的分支",
|
||||
|
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg",
|
||||
"desc": "通过以下的类型转换规则将参数 *arg* 转换成字符串:\n\n - 字符串不转换。\n -函数转换成空的字符串。\n - JSON的值无法用数字表示所以用无限大或者NaN(非数)表示。\n - 用 `JSON.stringify` 函数将其他值转换成JSON字符串。"
|
||||
"desc": "通过以下的类型转换规则将参数*arg*转换成字符串:\n\n - 字符串不转换。\n -函数转换成空的字符串。\n - JSON的值无法用数字表示所以用无限大或者NaN(非数)表示。\n - 用’JSON.stringify’函数将其他值转换成JSON字符串。"
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
"desc": "输出字符串 `str` 的字数。如果 `str` 不是字符串,抛出错误。"
|
||||
"desc": "输出字符串’str’的字数。如果’str’不是字符串,抛出错误。"
|
||||
},
|
||||
"$substring": {
|
||||
"args": "str, start[, length]",
|
||||
"desc": "输出 `start` 位置后的的首次出现的包括 `str` 的子字符串。 如果 `length` 被指定,那么的字符串中将只包括前 `length` 个文字。如果 `start` 是负数则输出从 `str` 末尾开始的 `length` 个文字"
|
||||
"desc": "输出`start`位置后的的首次出现的包括`str`的子字符串。 如果`length`被指定,那么的字符串中将只包括前`length`个文字。如果`start`是负数则输出从`str`末尾开始的`length`个文字"
|
||||
},
|
||||
"$substringBefore": {
|
||||
"args": "str, chars",
|
||||
@@ -17,11 +17,11 @@
|
||||
},
|
||||
"$substringAfter": {
|
||||
"args": "str, chars",
|
||||
"desc": "输出 `str` 中首次出现的 `chars` 之后的子字符串,如果 `str` 中不包括 `chars` 则输出 `str` 。"
|
||||
"desc": "输出’str’中首次出现的’chars’之后的子字符串,如果’str’中不包括’chars’则输出’str’。"
|
||||
},
|
||||
"$uppercase": {
|
||||
"args": "str",
|
||||
"desc": "将 `str` 中的所有字母变为大写后输出。"
|
||||
"desc": "`将’str’中的所有字母变为大写后输出。"
|
||||
},
|
||||
"$lowercase": {
|
||||
"args": "str",
|
||||
@@ -29,27 +29,27 @@
|
||||
},
|
||||
"$trim": {
|
||||
"args": "str",
|
||||
"desc": "将以下步骤应用于 `str` 来去除所有空白文字并实现标准化。\n\n – 将全部tab制表符、回车键、换行字符用空白代替。\n- 将连续的空白文字变成一个空白文字。\n- 消除开头和末尾的空白文字。\n\n如果 `str` 没有被指定(即在无输入参数的情况下调用本函数),将上下文的值作为 `str` 来使用。 如果 `str` 不是字符串则抛出错误。"
|
||||
"desc": "将以下步骤应用于`str`来去除所有空白文字并实现标准化。\n\n – 将全部tab制表符、回车键、换行字符用空白代替。\n- 将连续的空白文字变成一个空白文字。\n- 消除开头和末尾的空白文字。\n\n如果`str`没有被指定(即在无输入参数的情况下调用本函数),将上下文的值作为`str`来使用。 如果`str` 不是字符串则抛出错误。"
|
||||
},
|
||||
"$contains": {
|
||||
"args": "str, pattern",
|
||||
"desc": "字符串 `str` 和 `pattern` 匹配的话输出 `true` ,不匹配的情况下输出 `false` 。 不指定 `str` 的情况下(比如用一个参数调用本函数时)、将上下文的值作为 `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` 是负数则抛出错误。"
|
||||
"desc": "将参数`str`分解成由子字符串组成的数组。 如果`str`不是字符串抛出错误。可以省略的参数 `separator`中指定字符串`str`的分隔符。分隔符可以是文字或正则表达式。在不指定`separator`的情况下、将分隔符看作空的字符串并把`str`拆分成由单个字母组成的数组。如果`separator`不是字符串则抛出错误。在可省略的参数`limit`中指定分割后的子字符串的最大个数。超出个数的子字符串将被舍弃。如果`limit`没有被指定,`str` 将不考虑子字符串的个数而将字符串完全分隔。如果`limit`是负数则抛出错误。"
|
||||
},
|
||||
"$join": {
|
||||
"args": "array[, separator]",
|
||||
"desc": "用可以省略的参数 `separator` 来把多个字符串连接。如果 `array` 不是字符串则抛出错误。 如果没有指定 `separator` ,则用空字符串来连接字符(即字符串之间没有 `separator` )。 如果 `separator` 不是字符则抛出错误。"
|
||||
"desc": "用可以省略的参数 `separator`来把多个字符串连接。如果`array`不是字符串则抛出错误。 如果没有指定`separator`,则用空字符串来连接字符(即字符串之间没有`separator`)。 如果`separator`不是字符则抛出错误。"
|
||||
},
|
||||
"$match": {
|
||||
"args": "str, pattern [, limit]",
|
||||
"desc": "对字符串 `str` 使用正则表达式 `pattern` 并输出与 `str` 相匹配的部分信息。"
|
||||
"desc": "对字符串`str`使用正则表达式`pattern`并输出与`str`相匹配的部分信息。"
|
||||
},
|
||||
"$replace": {
|
||||
"args": "str, pattern, replacement [, limit]",
|
||||
"desc": "在字符串 `str` 中搜索 `pattern` 并用 `replacement` 来替换。\n\n可选参数 `limit` 用来指定替换次数的上限。"
|
||||
"desc": "在字符串`str`中搜索`pattern`并用`replacement`来替换。\n\n可选参数`limit`用来指定替换次数的上限。"
|
||||
},
|
||||
"$now": {
|
||||
"args": "",
|
||||
@@ -65,31 +65,31 @@
|
||||
},
|
||||
"$number": {
|
||||
"args": "arg",
|
||||
"desc": "用下述的规则将参数 `arg` 转换为数值。:\n\n – 数值不做转换。\n – 将字符串中合法的JSON数値表示转换成数値。\n – 其他形式的值则抛出错误。"
|
||||
"desc": "用下述的规则将参数 `arg`转换为数值。:\n\n – 数值不做转换。\n – 将字符串中合法的JSON数値表示转换成数値。\n – 其他形式的值则抛出错误。"
|
||||
},
|
||||
"$abs": {
|
||||
"args": "number",
|
||||
"desc": "输出参数 `number` 的绝对值。"
|
||||
"desc": "输出参数`number`的绝对值。"
|
||||
},
|
||||
"$floor": {
|
||||
"args": "number",
|
||||
"desc": "输出比 `number` 的值小的最大整数。"
|
||||
"desc": "输出比`number`的值小的最大整数。"
|
||||
},
|
||||
"$ceil": {
|
||||
"args": "number",
|
||||
"desc": "输出比 `number` 的值大的最小整数。"
|
||||
"desc": "输出比`number`的值大的最小整数。"
|
||||
},
|
||||
"$round": {
|
||||
"args": "number [, precision]",
|
||||
"desc": "输出四舍五入后的参数 `number` 。可省略的参数 `precision` 指定四舍五入后小数点下的位数。"
|
||||
"desc": "输出四舍五入后的参数`number`。可省略的参数 `precision`指定四舍五入后小数点下的位数。"
|
||||
},
|
||||
"$power": {
|
||||
"args": "base, exponent",
|
||||
"desc": "输出底数 `base` 的 `exponent` 次幂。"
|
||||
"desc": "输出底数`base`的`exponent`次幂。"
|
||||
},
|
||||
"$sqrt": {
|
||||
"args": "number",
|
||||
"desc": "输出参数 `number` 的平方根。"
|
||||
"desc": "输出参数 `number`的平方根。"
|
||||
},
|
||||
"$random": {
|
||||
"args": "",
|
||||
@@ -97,35 +97,35 @@
|
||||
},
|
||||
"$millis": {
|
||||
"args": "",
|
||||
"desc": "返回从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。在同一个表达式的测试中所有对 `$millis()` 的调用将会返回相同的值。"
|
||||
"desc": "返回从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。在同一个表达式的测试中所有对`$millis()`的调用将会返回相同的值。"
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "输出数组 `array` 的总和。如果 `array` 不是数值则抛出错误。"
|
||||
"desc": "输出数组`array`的总和。如果`array`不是数值则抛出错误。"
|
||||
},
|
||||
"$max": {
|
||||
"args": "array",
|
||||
"desc": "输出数组 `array` 的最大值。如果 `array` 不是数值则抛出错误。"
|
||||
"desc": "输出数组`array`的最大值。如果`array`不是数值则抛出错误。"
|
||||
},
|
||||
"$min": {
|
||||
"args": "array",
|
||||
"desc": "输出数组 `array` 的最小值。如果 `array` 不是数值则抛出错误。。"
|
||||
"desc": "输出数组`array`的最小值。如果`array`不是数值则抛出错误。。"
|
||||
},
|
||||
"$average": {
|
||||
"args": "array",
|
||||
"desc": "输出数组 `array` 的平均数。如果 `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` "
|
||||
"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` 转换为布尔值。"
|
||||
"desc": "输出做取反运算后的布尔值。首先将`arg`转换为布尔值。"
|
||||
},
|
||||
"$exists": {
|
||||
"args": "arg",
|
||||
"desc": "如果算式 `arg` 的值存在则输出 `true` 。如果算式的值不存在(比如指向不存在区域的引用)则输出 `false` 。"
|
||||
"desc": "如果算式`arg`的值存在则输出`true`。如果算式的值不存在(比如指向不存在区域的引用)则输出`false`。"
|
||||
},
|
||||
"$count": {
|
||||
"args": "array",
|
||||
@@ -137,15 +137,15 @@
|
||||
},
|
||||
"$sort": {
|
||||
"args": "array [, function]",
|
||||
"desc": "输出排序后的数组 `array` 。\n\n如果使用了比较函数 `function` ,则下述两个参数需要被指定。\n\n `function(left, right)` \n\n该比较函数是为了比较left和right两个值而被排序算法调用的。如果用户希望left的值被置于right的值之后,那么该函数必须输出布尔值 `true` 来表示位置交换。而在不需要位置交换时函数必须输出 `false` 。"
|
||||
"desc": "输出排序后的数组`array`。\n\n如果使用了比较函数`function`,则下述两个参数需要被指定。\n\n`function(left, right)`\n\n该比较函数是为了比较left和right两个值而被排序算法调用的。如果用户希望left的值被置于right的值之后,那么该函数必须输出布尔值`true`来表示位置交换。而在不需要位置交换时函数必须输出`false`。"
|
||||
},
|
||||
"$reverse": {
|
||||
"args": "array",
|
||||
"desc": "输出倒序后的数组 `array` 。"
|
||||
"desc": "输出倒序后的数组`array`。"
|
||||
},
|
||||
"$shuffle": {
|
||||
"args": "array",
|
||||
"desc": "输出随机排序后的数组 `array` 。"
|
||||
"desc": "输出随机排序后的数组 `array`。"
|
||||
},
|
||||
"$zip": {
|
||||
"args": "array, ...",
|
||||
@@ -157,35 +157,35 @@
|
||||
},
|
||||
"$lookup": {
|
||||
"args": "object, key",
|
||||
"desc": "输出对象中与参数 `key` 对应的值。如果第一个参数 `object` 是数组,那么数组中所有的对象都将被搜索并输出这些对象中与参数 `key` 对应的值。"
|
||||
"desc": "输出对象中与参数`key`对应的值。如果第一个参数`object`是数组,那么数组中所有的对象都将被搜索并输出这些对象中与参数`key`对应的值。"
|
||||
},
|
||||
"$spread": {
|
||||
"args": "object",
|
||||
"desc": "将对象中的键值对分隔成每个要素中只含有一个键值对的数组。如果参数 `object` 是数组,那么返回值的数组中包含所有对象中的键值对。"
|
||||
"desc": "将对象中的键值对分隔成每个要素中只含有一个键值对的数组。如果参数`object`是数组,那么返回值的数组中包含所有对象中的键值对。"
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "将输入数组 `objects` 中所有的键值对合并到一个 `object` 中并返回。如果输入数组的要素中含有重复的键,则返回的 `object` 中将只包含数组中最后出现要素的值。如果输入数组中包括对象以外的元素,则抛出错误。"
|
||||
"desc": "将输入数组`objects`中所有的键值对合并到一个`object`中并返回。如果输入数组的要素中含有重复的键,则返回的`object`中将只包含数组中最后出现要素的值。如果输入数组中包括对象以外的元素,则抛出错误。"
|
||||
},
|
||||
"$sift": {
|
||||
"args": "object, function",
|
||||
"desc": "输出参数 `object` 中符合 `function` 的键值对。\n\n `function` 必须含有下述参数。\n\n `function(value [, key [, object]])` "
|
||||
"desc": "输出参数`object`中符合`function`的键值对。\n\n`function`必须含有下述参数。\n\n`function(value [, key [, object]])`"
|
||||
},
|
||||
"$each": {
|
||||
"args": "object, function",
|
||||
"desc": "将函数 `function` 应用于 `object` 中的所有键值对并输出由所有返回值组成的数组。"
|
||||
"desc": "将函数`function`应用于`object`中的所有键值对并输出由所有返回值组成的数组。"
|
||||
},
|
||||
"$map": {
|
||||
"args": "array, function",
|
||||
"desc": "将函数 `function` 应用于数组 `array` 中所有的值并输出由返回值组成的数组。\n\n `function` 中必须含有下述参数。\n\n`function(value [, index [, array]])` "
|
||||
"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]])`"
|
||||
"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` 将作为运算的初始值。"
|
||||
"desc": "将`function`依次应用于数组中的各要素值。 其中,前一个要素值的计算结果将参与到下一次的函数运算中。。\n\n函数`function`接受两个参数并作为中缀表示法中的操作符。\n\n可省略的参数`init`将作为运算的初始值。"
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string",
|
||||
@@ -197,7 +197,7 @@
|
||||
},
|
||||
"$pad": {
|
||||
"args": "string, width [, char]",
|
||||
"desc": "根据需要,向字符串 `string` 的副本中填充文字使该字符串的字数达到 `width` 的绝对值并返回填充文字后的字符串。\n\n如果 `width` 的值为正,则向字符串 `string` 的右侧填充文字,如果 `width` 为负,则向字符串 `string` 的左侧填充文字。\n\n可选参数 `char` 用来指定填充的文字。如果未指定该参数,则填充空白文字。"
|
||||
"desc": "根据需要,向字符串`string`的副本中填充文字使该字符串的字数达到`width`的绝对值并返回填充文字后的字符串。\n\n如果`width`的值为正,则向字符串`string`的右侧填充文字,如果`width`为负,则向字符串`string`的左侧填充文字。\n\n可选参数`char`用来指定填充的文字。如果未指定该参数,则填充空白文字。"
|
||||
},
|
||||
"$fromMillis": {
|
||||
"args": "number",
|
||||
@@ -205,15 +205,15 @@
|
||||
},
|
||||
"$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规格中记述的数值格式。"
|
||||
"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之间,否则抛出错误。"
|
||||
"desc": "将`number`变换为以参数`radix`的值为基数形式的字符串。如果不指定`radix`的值,则默认基数为10。指定的`radix`值必须在2~36之间,否则抛出错误。"
|
||||
},
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "将ISO 8601格式的字符串 `timestamp` 转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。如果该字符串的格式不正确,则抛出错误。"
|
||||
"desc": "将ISO 8601格式的字符串`timestamp`转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。如果该字符串的格式不正确,则抛出错误。"
|
||||
},
|
||||
"$env": {
|
||||
"args": "arg",
|
||||
@@ -221,7 +221,7 @@
|
||||
},
|
||||
"$eval": {
|
||||
"args": "expr [, context]",
|
||||
"desc": "使用当前上下文来作为评估依据,分析并评估字符串 `expr` ,其中包含文字JSON或JSONata表达式。"
|
||||
"desc": "使用当前上下文来作为评估依据,分析并评估字符串`expr`,其中包含文字JSON或JSONata表达式。"
|
||||
},
|
||||
"$formatInteger": {
|
||||
"args": "number, picture",
|
||||
@@ -233,19 +233,19 @@
|
||||
},
|
||||
"$error": {
|
||||
"args": "[str]",
|
||||
"desc": "引发错误并显示一条消息。 可选的 `str` 将替代$error()函数评估的默认消息。"
|
||||
"desc": "引发错误并显示一条消息。 可选的`str`将替代$error()函数评估的默认消息。"
|
||||
},
|
||||
"$assert": {
|
||||
"args": "arg, str",
|
||||
"desc": "如果 `arg` 为真,则该函数返回。 如果arg为假,则抛出带有str的异常作为异常消息。"
|
||||
"desc": "如果`arg`为真,则该函数返回。 如果arg为假,则抛出带有str的异常作为异常消息。"
|
||||
},
|
||||
"$single": {
|
||||
"args": "array, function",
|
||||
"desc": "返回满足参数function谓语的array参数中的唯一值 (比如:传递值时,函数返回布尔值“true”)。如果匹配值的数量不唯一时,则抛出异常。\n\n应在以下签名中提供函数: `function(value [,index [,array []]])` 其中value是数组的每个输入,index是该值的位置,整个数组作为第三个参数传递。"
|
||||
"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\"`"
|
||||
"desc": "通过用表示字符的UTF-8编码的一个,两个,三个或四个转义序列替换某些字符的每个实例,对统一资源定位符(URL)组件进行编码。\n\n示例:`$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
|
||||
},
|
||||
"$encodeUrlComponent": {
|
||||
"args": "str",
|
||||
@@ -261,14 +261,10 @@
|
||||
},
|
||||
"$distinct": {
|
||||
"args": "array",
|
||||
"desc": "返回一个数组,其中重复的值已从 `数组` 中删除"
|
||||
"desc": "返回一个数组,其中重复的值已从`数组`中删除"
|
||||
},
|
||||
"$type": {
|
||||
"args": "value",
|
||||
"desc": "以字符串形式返回 `值` 的类型。 如果该 `值` 未定义,则将返回 `未定义` "
|
||||
},
|
||||
"$moment": {
|
||||
"args": "[str]",
|
||||
"desc": "使用Moment库获取日期对象。"
|
||||
"desc": "以字符串形式返回`值`的类型。 如果该`值`未定义,则将返回`未定义`"
|
||||
}
|
||||
}
|
||||
|
@@ -14,16 +14,7 @@
|
||||
"back": "返回",
|
||||
"next": "下一步",
|
||||
"clone": "複製專案",
|
||||
"cont": "繼續",
|
||||
"style": "風格",
|
||||
"line": "大綱",
|
||||
"fill": "填充",
|
||||
"label": "標籤",
|
||||
"color": "顏色",
|
||||
"position": "位置",
|
||||
"enable": "啟用",
|
||||
"disable": "禁用",
|
||||
"upload": "上傳"
|
||||
"cont": "Continue"
|
||||
},
|
||||
"type": {
|
||||
"string": "字符串",
|
||||
@@ -37,13 +28,6 @@
|
||||
"null": "空"
|
||||
}
|
||||
},
|
||||
"event": {
|
||||
"loadPalette": "加載控制板",
|
||||
"loadNodeCatalogs": "加載節點目錄",
|
||||
"loadNodes": "加載 __count__ 個節點",
|
||||
"loadFlows": "加載流程",
|
||||
"importFlows": "往工作區中加載流程"
|
||||
},
|
||||
"workspace": {
|
||||
"defaultName": "流程__number__",
|
||||
"editFlow": "編輯流程: __name__",
|
||||
@@ -107,12 +91,7 @@
|
||||
"projects-new": "新專案",
|
||||
"projects-open": "開啟專案",
|
||||
"projects-settings": "專案設定",
|
||||
"showNodeLabelDefault": "顯示新添加節點的標籤",
|
||||
"groups": "組",
|
||||
"groupSelection": "選擇組",
|
||||
"ungroupSelection": "取消選擇組",
|
||||
"groupMergeSelection": "合并選擇",
|
||||
"groupRemoveSelection": "從組中移除"
|
||||
"showNodeLabelDefault": "顯示新添加節點的標籤"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
@@ -122,7 +101,7 @@
|
||||
"zoom-in": "放大"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "作為 __name__ 登入",
|
||||
"loggedInAs": "作為__name__登入",
|
||||
"username": "帳號",
|
||||
"password": "密碼",
|
||||
"login": "登入",
|
||||
@@ -154,7 +133,7 @@
|
||||
"error": "<strong>Error</strong>: __message__",
|
||||
"errors": {
|
||||
"lostConnection": "丟失與伺服器的連接,重新連接...",
|
||||
"lostConnectionReconnect": "丟失與伺服器的連接,__time__ 秒後重新連接",
|
||||
"lostConnectionReconnect": "丟失與伺服器的連接,__time__秒後重新連接",
|
||||
"lostConnectionTry": "現在嘗試",
|
||||
"cannotAddSubflowToItself": "無法向其自身添加子流程",
|
||||
"cannotAddCircularReference": "無法添加子流程 - 迴圈引用",
|
||||
@@ -167,7 +146,7 @@
|
||||
"loaded": "已加載項目'__project__'",
|
||||
"updated": "已更新項目'__project__'",
|
||||
"pull": "已重新加載項目'__project__'",
|
||||
"revert": "項目'__project__'已還原",
|
||||
"revert": "項目“__project__”已還原",
|
||||
"merge-complete": "Git合併完成",
|
||||
"setupCredentials": "設定證書",
|
||||
"setupProjectFiles": "設置項目文件",
|
||||
@@ -192,14 +171,10 @@
|
||||
"node_plural": "__count__ 多個節點",
|
||||
"configNode": "__count__ 節點組態",
|
||||
"configNode_plural": "__count__ 多節點組態",
|
||||
"group": "__count__ 個組",
|
||||
"group_plural": "__count__ 個組",
|
||||
"flow": "__count__ 流程",
|
||||
"flow_plural": "__count__ 多流程",
|
||||
"subflow": "__count__ 子流程",
|
||||
"subflow_plural": "__count__ 多子流程",
|
||||
"replacedNodes": "__count__ 個節點被置換",
|
||||
"replacedNodes_plural": "__count__ 個節點被置換",
|
||||
"pasteNodes": "在這裡粘貼節點",
|
||||
"selectFile": "匯入所選檔案",
|
||||
"importNodes": "匯入節點",
|
||||
@@ -209,15 +184,9 @@
|
||||
"importUnrecognised_plural": "匯入了無法識別的類型:",
|
||||
"nodesExported": "節點匯出到了剪貼簿",
|
||||
"nodesImported": "已匯入:",
|
||||
"nodeCopied": "已複製 __count__ 個節點",
|
||||
"nodeCopied_plural": "已複製 __count__ 個節點",
|
||||
"groupCopied": "複製 __count__ 個組",
|
||||
"groupCopied_plural": "已複製 __count__ 個groups",
|
||||
"groupStyleCopied": "已複製組風格",
|
||||
"nodeCopied": "已複製__count__個節點",
|
||||
"nodeCopied_plural": "已複製__count__個節點",
|
||||
"invalidFlow": "無效的流程: __message__",
|
||||
"recoveredNodes": "復原的節點",
|
||||
"recoveredNodesInfo": "導入節點時,此流上的節點缺少有效的流ID。它們已被添加到此流中,您可以復原或刪除它們。",
|
||||
"recoveredNodesNotification": "<p>導入的節點缺少有效的流ID</p><p>已將它們添加到名為 '__flowName__'的新流中。</p>",
|
||||
"export": {
|
||||
"selected": "已選擇的節點",
|
||||
"current": "現在的節點",
|
||||
@@ -232,19 +201,13 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "匯入到",
|
||||
"importSelected": "導入所選項",
|
||||
"importCopy": "導入副本",
|
||||
"viewNodes": "查看節點",
|
||||
"newFlow": "新流程",
|
||||
"replace": "置換",
|
||||
"errors": {
|
||||
"notArray": "輸入的不是JSON數組",
|
||||
"itemNotObject": "輸入的流程無效-項目 __index__ 不是節點對象",
|
||||
"missingId": "輸入的流程無效-項 __index__ 缺少“ id”屬性",
|
||||
"missingType": "輸入的流程無效-項 __index__ 缺少“類型”屬性"
|
||||
},
|
||||
"conflictNotification1": "您要導入的某些節點已經存在於工作空間中。",
|
||||
"conflictNotification2": "選擇要導入的節點,並確認要替換現有的節點還是導入它們的副本"
|
||||
"itemNotObject": "輸入的流程無效-項目__index__不是節點對象",
|
||||
"missingId": "輸入的流程無效-項__index__缺少“ id”屬性",
|
||||
"missingType": "輸入的流程無效-項__index__缺少“類型”屬性"
|
||||
}
|
||||
},
|
||||
"copyMessagePath": "已複製路徑",
|
||||
"copyMessageValue": "已複製數值",
|
||||
@@ -287,7 +250,7 @@
|
||||
"conflictChecking": "檢查是否可以自動合併更改",
|
||||
"conflictAutoMerge": "此更改不包括衝突,可以自動合併",
|
||||
"conflictManualMerge": "這些更改包括了在部署之前必須解決的衝突。",
|
||||
"plusNMore": "+更多的 __count__"
|
||||
"plusNMore": "+更多的__count__"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
@@ -295,8 +258,8 @@
|
||||
"view": "查看日誌"
|
||||
},
|
||||
"diff": {
|
||||
"unresolvedCount": "__count__ 個未解決的衝突",
|
||||
"unresolvedCount_plural": "__count__ 個未解決的衝突",
|
||||
"unresolvedCount": "__count__個未解決的衝突",
|
||||
"unresolvedCount_plural": "__count__個未解決的衝突",
|
||||
"globalNodes": "全局節點",
|
||||
"flowProperties": "流程屬性",
|
||||
"type": {
|
||||
@@ -306,11 +269,11 @@
|
||||
"deleted": "已刪除",
|
||||
"flowDeleted": "已刪除流程",
|
||||
"flowAdded": "已添加流程",
|
||||
"movedTo": "移動至 __id__",
|
||||
"movedFrom": "從 __id__ 移動"
|
||||
"movedTo": "移動至__id__",
|
||||
"movedFrom": "從__id__移動"
|
||||
},
|
||||
"nodeCount": "__count__ 個節點",
|
||||
"nodeCount_plural": "__count__ 個節點",
|
||||
"nodeCount": "__count__個節點",
|
||||
"nodeCount_plural": "__count__個節點",
|
||||
"local": "本地",
|
||||
"remote": "遠端",
|
||||
"reviewChanges": "查看變更",
|
||||
@@ -324,11 +287,11 @@
|
||||
"newVersionError": "新版本不包含有效的JSON:"
|
||||
},
|
||||
"subflow": {
|
||||
"editSubflowInstance": "編輯子流程實例: __name__",
|
||||
"editSubflow": "編輯流程範本: __name__",
|
||||
"editSubflowInstance": "編輯子流程實例:__name__",
|
||||
"editSubflow": "編輯流程範本: __name__",
|
||||
"edit": "編輯流程範本",
|
||||
"subflowInstances": "這個子流程範本有 __count__ 個實例",
|
||||
"subflowInstances_plural": "這個子流程範本有 __count__ 個實例",
|
||||
"subflowInstances": "這個子流程範本有__count__個實例",
|
||||
"subflowInstances_plural": "這個子流程範本有__count__個實例",
|
||||
"editSubflowProperties": "編輯屬性",
|
||||
"input": "輸入:",
|
||||
"output": "輸出:",
|
||||
@@ -345,24 +308,17 @@
|
||||
"multipleInputsToSelection": "<strong>無法創建子流程</strong>: 多個輸入到了選擇"
|
||||
}
|
||||
},
|
||||
"group": {
|
||||
"editGroup": "編輯組: __name__",
|
||||
"errors": {
|
||||
"cannotCreateDiffGroups": "無法使用來自不同組的節點創建組",
|
||||
"cannotAddSubflowPorts": "無法將子流程的端口添加到組"
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"configEdit": "編輯",
|
||||
"configAdd": "添加",
|
||||
"configUpdate": "更新",
|
||||
"configDelete": "刪除",
|
||||
"nodesUse": "__count__ 個節點使用此配置",
|
||||
"nodesUse_plural": "__count__ 個節點使用此配置",
|
||||
"addNewConfig": "添加新的 __type__ 配置",
|
||||
"editNode": "編輯 __type__ 節點",
|
||||
"editConfig": "編輯 __type__ 配置",
|
||||
"addNewType": "添加新的 __type__ 節點",
|
||||
"nodesUse": "__count__個節點使用此配置",
|
||||
"nodesUse_plural": "__count__個節點使用此配置",
|
||||
"addNewConfig": "添加新的__type__配置",
|
||||
"editNode": "編輯__type__節點",
|
||||
"editConfig": "編輯__type__配置",
|
||||
"addNewType": "添加新的__type__節點",
|
||||
"nodeProperties": "節點屬性",
|
||||
"label": "Label",
|
||||
"color": "顏色",
|
||||
@@ -381,7 +337,6 @@
|
||||
"locale": "選擇界面語言",
|
||||
"icon": "圖標",
|
||||
"inputType": "輸入類型",
|
||||
"selectType": "選擇類型...",
|
||||
"inputs": {
|
||||
"input": "輸入",
|
||||
"select": "選擇",
|
||||
@@ -396,8 +351,7 @@
|
||||
"bool": "布爾",
|
||||
"json": "JSON",
|
||||
"bin": "buffer",
|
||||
"env": "環境變量",
|
||||
"cred": "證書"
|
||||
"env": "環境變量"
|
||||
},
|
||||
"menu": {
|
||||
"input": "輸入",
|
||||
@@ -451,13 +405,13 @@
|
||||
"library": "庫",
|
||||
"openLibrary": "打開庫...",
|
||||
"saveToLibrary": "保存到庫...",
|
||||
"typeLibrary": "__type__ 型別程式庫",
|
||||
"unnamedType": "無名 __type__",
|
||||
"typeLibrary": "__type__型別程式庫",
|
||||
"unnamedType": "無名__type__",
|
||||
"exportedToLibrary": "節點導出到庫",
|
||||
"dialogSaveOverwrite": "一個叫做 __libraryName__ 的 __libraryType__ 已經存在,您需要覆蓋麼?",
|
||||
"dialogSaveOverwrite": "一個叫做__libraryName__的__libraryType__已經存在,您需要覆蓋麼?",
|
||||
"invalidFilename": "無效的檔案名",
|
||||
"savedNodes": "保存的節點",
|
||||
"savedType": "已保存 __type__",
|
||||
"savedType": "已保存__type__",
|
||||
"saveFailed": "保存失敗: __message__",
|
||||
"newFolder": "新文件夾",
|
||||
"types": {
|
||||
@@ -506,33 +460,33 @@
|
||||
"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__ 月前"
|
||||
"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__ 個可用模組",
|
||||
"nodeCount": "__label__個節點",
|
||||
"nodeCount_plural": "__label__個節點",
|
||||
"moduleCount": "__count__個可用模組",
|
||||
"moduleCount_plural": "__count__個可用模組",
|
||||
"inuse": "使用中",
|
||||
"enableall": "全部啟用",
|
||||
"disableall": "全部禁用",
|
||||
"enable": "啟用",
|
||||
"disable": "禁用",
|
||||
"remove": "移除",
|
||||
"update": "更新至 __version__ 版本",
|
||||
"update": "更新至__version__版本",
|
||||
"updated": "已更新",
|
||||
"install": "安裝",
|
||||
"installed": "已安裝",
|
||||
@@ -544,8 +498,7 @@
|
||||
"sort": "排序:",
|
||||
"sortAZ": "a-z順序",
|
||||
"sortRecent": "日期順序",
|
||||
"more": "增加 __count__ 個",
|
||||
"upload": "上傳模塊tgz文件",
|
||||
"more": "增加__count__個",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "無法載入節點目錄。<br>查看瀏覽器控制臺瞭解更多資訊",
|
||||
"installFailed": "無法安裝: __module__<br>__message__<br>查看日誌瞭解更多資訊",
|
||||
@@ -586,7 +539,6 @@
|
||||
"label": "信息",
|
||||
"node": "節點",
|
||||
"type": "類型",
|
||||
"group": "組",
|
||||
"module": "Module",
|
||||
"id": "ID",
|
||||
"status": "狀態",
|
||||
@@ -608,30 +560,8 @@
|
||||
"subflowDesc": "子流程描述",
|
||||
"nodeHelp": "節點幫助",
|
||||
"none": "無",
|
||||
"arrayItems": "__count__ 個項目",
|
||||
"showTips": "您可以從設置面板啟用提示資訊",
|
||||
"outline": "大綱",
|
||||
"empty": "空的",
|
||||
"globalConfig": "全局配置節點",
|
||||
"triggerAction": "觸發動作",
|
||||
"find": "在工作區中查找",
|
||||
"search": {
|
||||
"configNodes": "配置節點",
|
||||
"unusedConfigNodes": "未使用的配置節點",
|
||||
"invalidNodes": "無效的節點",
|
||||
"uknownNodes": "未知的節點",
|
||||
"unusedSubflows": "未使用的子流程"
|
||||
}
|
||||
},
|
||||
"help": {
|
||||
"name": "幫助",
|
||||
"label": "幫助",
|
||||
"search": "搜索幫助",
|
||||
"nodeHelp": "節點幫助",
|
||||
"showHelp": "顯示幫助",
|
||||
"showInOutline": "在大綱中顯示",
|
||||
"showTopics": "顯示主題",
|
||||
"noHelp": "未選擇幫助主題"
|
||||
"arrayItems": "__count__個項目",
|
||||
"showTips": "您可以從設置面板啟用提示資訊"
|
||||
},
|
||||
"config": {
|
||||
"name": "配置節點",
|
||||
@@ -684,9 +614,9 @@
|
||||
"removeFromProject": "從項目中刪除",
|
||||
"addToProject": "添加到項目",
|
||||
"files": "文件",
|
||||
"package": "包",
|
||||
"flow": "流程",
|
||||
"credentials": "證書",
|
||||
"package": "包",
|
||||
"packageCreate": "保存更改後將創建文件",
|
||||
"fileNotExist": "文件不存在",
|
||||
"selectFile": "選擇文件",
|
||||
@@ -722,12 +652,6 @@
|
||||
"committerTip": "保留空白以使用系統默認值",
|
||||
"userName": "用戶名",
|
||||
"email": "電子郵件",
|
||||
"workflow": "工作流",
|
||||
"workfowTip": "選擇您偏好的工作流",
|
||||
"workflowManual": "手動",
|
||||
"workflowManualTip": "所有更改都必須在“歷史記錄”側邊欄中手動提交",
|
||||
"workflowAuto": "自動",
|
||||
"workflowAutoTip": "每次部署後都會自動提交更改",
|
||||
"sshKeys": "SSH密鑰",
|
||||
"sshKeysTip": "允許您創建到遠程git存儲庫的安全連接。",
|
||||
"add": "添加密鑰",
|
||||
@@ -744,7 +668,7 @@
|
||||
"copyPublicKey": "將公鑰複製到剪貼板",
|
||||
"delete": "刪除密鑰",
|
||||
"gitConfig": "Git配置",
|
||||
"deleteConfirm": "您確定要刪除SSH密鑰 __name__ 嗎? 這不能被撤消。"
|
||||
"deleteConfirm": "您確定要刪除SSH密鑰__name__嗎? 這不能被撤消。"
|
||||
},
|
||||
"versionControl": {
|
||||
"unstagedChanges": "未暫存的更改",
|
||||
@@ -798,24 +722,24 @@
|
||||
"pullChanges": "Pull變更",
|
||||
"history": "歷史",
|
||||
"projectHistory": "項目歷史",
|
||||
"daysAgo": "__count__ 天前",
|
||||
"daysAgo_plural": "__count__ 天前",
|
||||
"hoursAgo": "__count__ 小時前",
|
||||
"hoursAgo_plural": "__count__ 小時前",
|
||||
"minsAgo": "__count__ 分鐘前",
|
||||
"minsAgo_plural": "__count__ 分鐘前",
|
||||
"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__ 次提交。",
|
||||
"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": "刷新提交歷史",
|
||||
@@ -833,8 +757,7 @@
|
||||
"bin": "二進位流",
|
||||
"date": "時間戳記",
|
||||
"jsonata": "expression",
|
||||
"env": "env variable",
|
||||
"cred": "證書"
|
||||
"env": "env variable"
|
||||
}
|
||||
},
|
||||
"editableList": {
|
||||
@@ -1054,8 +977,7 @@
|
||||
"passphrase": "密碼短語",
|
||||
"retry": "重試",
|
||||
"update-failed": "無法更新身份驗證",
|
||||
"unhandled": "未處理的錯誤響應",
|
||||
"host-key-verify-failed": "<p>主機密鑰驗證失敗。</p><p>無法驗證存儲庫主機密鑰。請更新您的<code>known_hosts</code>文件,然後重試。</p>"
|
||||
"unhandled": "未處理的錯誤響應"
|
||||
},
|
||||
"create-branch-list": {
|
||||
"invalid": "無效的分支",
|
||||
|
@@ -266,9 +266,5 @@
|
||||
"$type": {
|
||||
"args": "value",
|
||||
"desc": "以字符串形式返回`值`的類型。 如果該`值`未定義,則將返回`未定義`"
|
||||
},
|
||||
"$moment": {
|
||||
"args": "[str]",
|
||||
"desc": "使用Moment庫獲取日期對象。"
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "1.2.8",
|
||||
"version": "1.1.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
; (function() {
|
||||
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) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@@ -76,12 +76,13 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
|
||||
(function() {
|
||||
this.setOptions = function(options) {
|
||||
this.options = {
|
||||
this.options = options || {
|
||||
// undef: true,
|
||||
// unused: true,
|
||||
esversion: 9,
|
||||
esnext: true,
|
||||
moz: true,
|
||||
devel: true,
|
||||
browser: false,
|
||||
browser: true,
|
||||
node: true,
|
||||
laxcomma: true,
|
||||
laxbreak: true,
|
||||
@@ -91,17 +92,8 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
maxerr: 100,
|
||||
expr: true,
|
||||
multistr: true,
|
||||
strict: false,
|
||||
sub: true,
|
||||
asi: true
|
||||
globalstrict: true
|
||||
};
|
||||
if (options) {
|
||||
for (var opt in options) {
|
||||
if (options.hasOwnProperty(opt)) {
|
||||
this.options[opt] = options.opt;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.doc.getValue() && this.deferredUpdate.schedule(100);
|
||||
};
|
||||
|
||||
@@ -127,8 +119,6 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
if (!value)
|
||||
return this.sender.emit("annotate", []);
|
||||
|
||||
var originalValue = value;
|
||||
|
||||
// [Node-RED] wrap the code in a function
|
||||
value = "async function __nodered__(msg) {\n"+value+"\n}";
|
||||
|
||||
@@ -148,7 +138,6 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
continue;
|
||||
var raw = error.raw;
|
||||
var type = "warning";
|
||||
var line = error.line - 2;
|
||||
|
||||
if (raw == "Missing semicolon.") {
|
||||
var str = error.evidence.substr(error.character);
|
||||
@@ -177,62 +166,9 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
type = "info";
|
||||
}
|
||||
|
||||
if (raw === "Unmatched '{a}'." && line === -1) {
|
||||
// This is an unmatched { error. It has incorrectly matched it
|
||||
// against the { in the added line. Need to find the next valid {
|
||||
// This code scans through the original code looking for the first '{'
|
||||
// that is not in a comment or string.
|
||||
// It will incorrectly find a '{' if it is inside a regex... but
|
||||
// at least the error will be shown somwhere. There are only
|
||||
// so many hours in the day to fix every tiny edge case of an
|
||||
// edge case.
|
||||
var inSingleComment = false;
|
||||
var inMultiComment = false;
|
||||
var inString = false;
|
||||
var stringQ;
|
||||
var lineNumber = 0;
|
||||
for (var pos = 0;pos<originalValue.length;pos++) {
|
||||
var c = originalValue[pos];
|
||||
if (c === "\\") {
|
||||
pos++;
|
||||
} else if (inSingleComment) {
|
||||
if (c === "\n") {
|
||||
lineNumber++;
|
||||
inSingleComment = false;
|
||||
}
|
||||
} else if (inMultiComment) {
|
||||
if (c === "*" && originalValue[pos+1] === "/") {
|
||||
pos++;
|
||||
inMultiComment = false;
|
||||
} else if (c === "\n") {
|
||||
lineNumber++;
|
||||
}
|
||||
} else if (inString) {
|
||||
if (c === stringQ) {
|
||||
inString = false;
|
||||
}
|
||||
} else if (c === "'" || c === "\"") {
|
||||
inString = true;
|
||||
stringQ = c;
|
||||
} else if (c === "/") {
|
||||
if (originalValue[pos+1] === "/") {
|
||||
inSingleComment = true;
|
||||
} else if (originalValue[pos+1] === "*") {
|
||||
inMultiComment = true;
|
||||
}
|
||||
} else if (c === "\n") {
|
||||
lineNumber++;
|
||||
} else if (c === "{") {
|
||||
// found it!
|
||||
break;
|
||||
}
|
||||
}
|
||||
line = lineNumber;
|
||||
}
|
||||
|
||||
errors.push({
|
||||
// [Node-RED] offset the row for the added line
|
||||
row: Math.max(0,line),
|
||||
row: error.line-2,
|
||||
column: error.character-1,
|
||||
text: error.reason,
|
||||
type: type,
|
||||
|
@@ -808,7 +808,17 @@ RED.nodes.fontAwesome = (function() {
|
||||
"fa-youtube": "\uf167",
|
||||
};
|
||||
|
||||
var iconList = Object.keys(iconMap);
|
||||
var iconList = [];
|
||||
var isUsed = {};
|
||||
Object.keys(iconMap).forEach(function(icon) {
|
||||
var unicode = iconMap[icon];
|
||||
// skip icons with a same unicode
|
||||
if (isUsed[unicode] !== true) {
|
||||
iconList.push(icon);
|
||||
isUsed[unicode] = true;
|
||||
}
|
||||
});
|
||||
isUsed = undefined;
|
||||
|
||||
return {
|
||||
getIconUnicode: function(name) {
|
||||
|
@@ -37,38 +37,22 @@ RED.history = (function() {
|
||||
inverseEv.events.push(r);
|
||||
}
|
||||
} else if (ev.t == 'replace') {
|
||||
if (ev.complete) {
|
||||
// This is a replace of everything. We can short-cut
|
||||
// the logic by clearing everyting first, then importing
|
||||
// the ev.config.
|
||||
// Used by RED.diff.mergeDiff
|
||||
inverseEv = {
|
||||
t: 'replace',
|
||||
config: RED.nodes.createCompleteNodeSet(),
|
||||
changed: {},
|
||||
rev: RED.nodes.version()
|
||||
};
|
||||
RED.nodes.clear();
|
||||
var imported = RED.nodes.import(ev.config);
|
||||
imported.nodes.forEach(function(n) {
|
||||
if (ev.changed[n.id]) {
|
||||
n.changed = true;
|
||||
inverseEv.changed[n.id] = true;
|
||||
}
|
||||
})
|
||||
|
||||
RED.nodes.version(ev.rev);
|
||||
} else {
|
||||
var importMap = {};
|
||||
ev.config.forEach(function(n) {
|
||||
importMap[n.id] = "replace";
|
||||
})
|
||||
var importedResult = RED.nodes.import(ev.config,{importMap: importMap})
|
||||
inverseEv = {
|
||||
t: 'replace',
|
||||
config: importedResult.removedNodes
|
||||
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",
|
||||
@@ -101,7 +85,7 @@ RED.history = (function() {
|
||||
}
|
||||
if (ev.groups) {
|
||||
inverseEv.groups = [];
|
||||
for (i = ev.groups.length - 1;i>=0;i--) {
|
||||
for (i=0;i<ev.groups.length;i++) {
|
||||
group = ev.groups[i];
|
||||
modifiedTabs[group.z] = true;
|
||||
// The order of groups is important
|
||||
@@ -230,7 +214,7 @@ RED.history = (function() {
|
||||
inverseEv.groups = [];
|
||||
var groupsToAdd = {};
|
||||
ev.groups.forEach(function(g) { groupsToAdd[g.id] = g; });
|
||||
for (i = ev.groups.length - 1;i>=0;i--) {
|
||||
for (i=0;i<ev.groups.length;i++) {
|
||||
RED.nodes.addGroup(ev.groups[i])
|
||||
modifiedTabs[ev.groups[i].z] = true;
|
||||
// The order of groups is important
|
||||
|
@@ -10,7 +10,6 @@
|
||||
"ctrl-escape": "core:cancel-edit-tray",
|
||||
"ctrl-d": "core:deploy-flows",
|
||||
"ctrl-g i": "core:show-info-tab",
|
||||
"ctrl-g h": "core:show-help-tab",
|
||||
"ctrl-g d": "core:show-debug-tab",
|
||||
"ctrl-g c": "core:show-config-tab",
|
||||
"ctrl-g x": "core:show-context-tab",
|
||||
|
@@ -16,7 +16,7 @@
|
||||
RED.nodes = (function() {
|
||||
|
||||
var node_defs = {};
|
||||
var nodes = {};
|
||||
var nodes = [];
|
||||
var nodeTabMap = {};
|
||||
|
||||
var configNodes = {};
|
||||
@@ -189,7 +189,6 @@ RED.nodes = (function() {
|
||||
})();
|
||||
|
||||
function getID() {
|
||||
// return Math.floor(Math.random()*15728640 + 1048576).toString(16)
|
||||
return (1+Math.random()*4294967295).toString(16);
|
||||
}
|
||||
|
||||
@@ -217,7 +216,7 @@ RED.nodes = (function() {
|
||||
});
|
||||
n.i = nextId+1;
|
||||
}
|
||||
nodes[n.id] = n;
|
||||
nodes.push(n);
|
||||
if (nodeTabMap[n.z]) {
|
||||
nodeTabMap[n.z][n.id] = n;
|
||||
} else {
|
||||
@@ -234,8 +233,12 @@ RED.nodes = (function() {
|
||||
function getNode(id) {
|
||||
if (id in configNodes) {
|
||||
return configNodes[id];
|
||||
} else if (id in nodes) {
|
||||
return nodes[id];
|
||||
} else {
|
||||
for (var n in nodes) {
|
||||
if (nodes[n].id == id) {
|
||||
return nodes[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -249,56 +252,58 @@ RED.nodes = (function() {
|
||||
delete configNodes[id];
|
||||
RED.events.emit('nodes:remove',node);
|
||||
RED.workspaces.refresh();
|
||||
} else if (id in nodes) {
|
||||
node = nodes[id];
|
||||
delete nodes[id]
|
||||
if (nodeTabMap[node.z]) {
|
||||
delete nodeTabMap[node.z][node.id];
|
||||
}
|
||||
removedLinks = links.filter(function(l) { return (l.source === node) || (l.target === node); });
|
||||
removedLinks.forEach(removeLink);
|
||||
var updatedConfigNode = false;
|
||||
for (var d in node._def.defaults) {
|
||||
if (node._def.defaults.hasOwnProperty(d)) {
|
||||
var property = node._def.defaults[d];
|
||||
if (property.type) {
|
||||
var type = registry.getNodeType(property.type);
|
||||
if (type && type.category == "config") {
|
||||
var configNode = configNodes[node[d]];
|
||||
if (configNode) {
|
||||
updatedConfigNode = true;
|
||||
if (configNode._def.exclusive) {
|
||||
removeNode(node[d]);
|
||||
removedNodes.push(configNode);
|
||||
} else {
|
||||
var users = configNode.users;
|
||||
users.splice(users.indexOf(node),1);
|
||||
} else {
|
||||
node = getNode(id);
|
||||
if (node) {
|
||||
nodes.splice(nodes.indexOf(node),1);
|
||||
if (nodeTabMap[node.z]) {
|
||||
delete nodeTabMap[node.z][node.id];
|
||||
}
|
||||
removedLinks = links.filter(function(l) { return (l.source === node) || (l.target === node); });
|
||||
removedLinks.forEach(removeLink);
|
||||
var updatedConfigNode = false;
|
||||
for (var d in node._def.defaults) {
|
||||
if (node._def.defaults.hasOwnProperty(d)) {
|
||||
var property = node._def.defaults[d];
|
||||
if (property.type) {
|
||||
var type = registry.getNodeType(property.type);
|
||||
if (type && type.category == "config") {
|
||||
var configNode = configNodes[node[d]];
|
||||
if (configNode) {
|
||||
updatedConfigNode = true;
|
||||
if (configNode._def.exclusive) {
|
||||
removeNode(node[d]);
|
||||
removedNodes.push(configNode);
|
||||
} else {
|
||||
var users = configNode.users;
|
||||
users.splice(users.indexOf(node),1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (node.type.indexOf("subflow:") === 0) {
|
||||
var subflowId = node.type.substring(8);
|
||||
var sf = RED.nodes.subflow(subflowId);
|
||||
if (sf) {
|
||||
sf.instances.splice(sf.instances.indexOf(node),1);
|
||||
if (node.type.indexOf("subflow:") === 0) {
|
||||
var subflowId = node.type.substring(8);
|
||||
var sf = RED.nodes.subflow(subflowId);
|
||||
if (sf) {
|
||||
sf.instances.splice(sf.instances.indexOf(node),1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (updatedConfigNode) {
|
||||
RED.workspaces.refresh();
|
||||
}
|
||||
try {
|
||||
if (node._def.oneditdelete) {
|
||||
node._def.oneditdelete.call(node);
|
||||
if (updatedConfigNode) {
|
||||
RED.workspaces.refresh();
|
||||
}
|
||||
} catch(err) {
|
||||
console.log("oneditdelete",node.id,node.type,err.toString());
|
||||
try {
|
||||
if (node._def.oneditdelete) {
|
||||
node._def.oneditdelete.call(node);
|
||||
}
|
||||
} catch(err) {
|
||||
console.log("oneditdelete",node.id,node.type,err.toString());
|
||||
}
|
||||
RED.events.emit('nodes:remove',node);
|
||||
}
|
||||
RED.events.emit('nodes:remove',node);
|
||||
}
|
||||
|
||||
|
||||
@@ -372,13 +377,10 @@ RED.nodes = (function() {
|
||||
workspacesOrder.splice(workspacesOrder.indexOf(id),1);
|
||||
var i;
|
||||
var node;
|
||||
// TODO: this should use nodeTabMap
|
||||
for (i in nodes) {
|
||||
if (nodes.hasOwnProperty(i)) {
|
||||
node = nodes[i];
|
||||
if (node.z == id) {
|
||||
removedNodes.push(node);
|
||||
}
|
||||
for (i=0;i<nodes.length;i++) {
|
||||
node = nodes[i];
|
||||
if (node.z == id) {
|
||||
removedNodes.push(node);
|
||||
}
|
||||
}
|
||||
for(i in configNodes) {
|
||||
@@ -485,19 +487,17 @@ RED.nodes = (function() {
|
||||
}
|
||||
|
||||
function subflowContains(sfid,nodeid) {
|
||||
for (var i in nodes) {
|
||||
if (nodes.hasOwnProperty(i)) {
|
||||
var node = nodes[i];
|
||||
if (node.z === sfid) {
|
||||
var m = /^subflow:(.+)$/.exec(node.type);
|
||||
if (m) {
|
||||
if (m[1] === nodeid) {
|
||||
for (var i=0;i<nodes.length;i++) {
|
||||
var node = nodes[i];
|
||||
if (node.z === sfid) {
|
||||
var m = /^subflow:(.+)$/.exec(node.type);
|
||||
if (m) {
|
||||
if (m[1] === nodeid) {
|
||||
return true;
|
||||
} else {
|
||||
var result = subflowContains(m[1],nodeid);
|
||||
if (result) {
|
||||
return true;
|
||||
} else {
|
||||
var result = subflowContains(m[1],nodeid);
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -553,9 +553,6 @@ RED.nodes = (function() {
|
||||
node.id = n.id;
|
||||
node.type = n.type;
|
||||
node.z = n.z;
|
||||
if (node.z === 0 || node.z === "") {
|
||||
delete node.z;
|
||||
}
|
||||
if (n.d === true) {
|
||||
node.d = true;
|
||||
}
|
||||
@@ -614,9 +611,7 @@ RED.nodes = (function() {
|
||||
node.y = n.y;
|
||||
node.w = n.w;
|
||||
node.h = n.h;
|
||||
// In 1.1.0, we have seen an instance of this array containing `undefined`
|
||||
// Until we know how that can happen, add a filter here to remove them
|
||||
node.nodes = node.nodes.filter(function(n) { return !!n }).map(function(n) { return n.id });
|
||||
node.nodes = node.nodes.map(function(n) { return n.id });
|
||||
}
|
||||
if (n._def.category != "config") {
|
||||
node.x = n.x;
|
||||
@@ -740,16 +735,6 @@ RED.nodes = (function() {
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
function createExportableSubflow(id) {
|
||||
var sf = getSubflow(id);
|
||||
var nodeSet = [sf];
|
||||
var sfNodeIds = Object.keys(nodeTabMap[sf.id]||{});
|
||||
for (var i=0, l=sfNodeIds.length; i<l; i++) {
|
||||
nodeSet.push(nodeTabMap[sf.id][sfNodeIds[i]]);
|
||||
}
|
||||
return createExportableNodeSet(nodeSet);
|
||||
}
|
||||
/**
|
||||
* Converts the current node selection to an exportable JSON Object
|
||||
**/
|
||||
@@ -839,10 +824,9 @@ RED.nodes = (function() {
|
||||
nns.push(convertNode(configNodes[i], exportCredentials));
|
||||
}
|
||||
}
|
||||
for (i in nodes) {
|
||||
if (nodes.hasOwnProperty(i)) {
|
||||
nns.push(convertNode(nodes[i], exportCredentials));
|
||||
}
|
||||
for (i=0;i<nodes.length;i++) {
|
||||
var node = nodes[i];
|
||||
nns.push(convertNode(node, exportCredentials));
|
||||
}
|
||||
return nns;
|
||||
}
|
||||
@@ -912,164 +896,11 @@ RED.nodes = (function() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function identifyImportConflicts(importedNodes) {
|
||||
var imported = {
|
||||
tabs: {},
|
||||
subflows: {},
|
||||
groups: {},
|
||||
configs: {},
|
||||
nodes: {},
|
||||
all: [],
|
||||
conflicted: {},
|
||||
zMap: {},
|
||||
}
|
||||
|
||||
importedNodes.forEach(function(n) {
|
||||
imported.all.push(n);
|
||||
if (n.type === "tab") {
|
||||
imported.tabs[n.id] = n;
|
||||
} else if (n.type === "subflow") {
|
||||
imported.subflows[n.id] = n;
|
||||
} else if (n.type === "group") {
|
||||
imported.groups[n.id] = n;
|
||||
} else if (n.hasOwnProperty("x") && n.hasOwnProperty("y")) {
|
||||
imported.nodes[n.id] = n;
|
||||
} else {
|
||||
imported.configs[n.id] = n;
|
||||
}
|
||||
var nodeZ = n.z || "__global__";
|
||||
imported.zMap[nodeZ] = imported.zMap[nodeZ] || [];
|
||||
imported.zMap[nodeZ].push(n)
|
||||
if (nodes[n.id] || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id]) {
|
||||
imported.conflicted[n.id] = n;
|
||||
}
|
||||
})
|
||||
return imported;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace the provided nodes.
|
||||
* This must contain complete Subflow defs or complete Flow Tabs.
|
||||
* It does not replace an individual node in the middle of a flow.
|
||||
*/
|
||||
function replaceNodes(newNodes) {
|
||||
var zMap = {};
|
||||
var newSubflows = {};
|
||||
var newConfigNodes = {};
|
||||
var removedNodes = [];
|
||||
// Figure out what we're being asked to replace - subflows/configNodes
|
||||
// TODO: config nodes
|
||||
newNodes.forEach(function(n) {
|
||||
if (n.type === "subflow") {
|
||||
newSubflows[n.id] = n;
|
||||
} else if (!n.hasOwnProperty('x') && !n.hasOwnProperty('y')) {
|
||||
newConfigNodes[n.id] = n;
|
||||
}
|
||||
if (n.z) {
|
||||
zMap[n.z] = zMap[n.z] || [];
|
||||
zMap[n.z].push(n);
|
||||
}
|
||||
})
|
||||
|
||||
// Filter out config nodes inside a subflow def that is being replaced
|
||||
var configNodeIds = Object.keys(newConfigNodes);
|
||||
configNodeIds.forEach(function(id) {
|
||||
var n = newConfigNodes[id];
|
||||
if (newSubflows[n.z]) {
|
||||
// This config node is in a subflow to be replaced.
|
||||
// - remove from the list as it'll get handled with the subflow
|
||||
delete newConfigNodes[id];
|
||||
}
|
||||
});
|
||||
// Rebuild the list of ids
|
||||
configNodeIds = Object.keys(newConfigNodes);
|
||||
|
||||
// ------------------------------
|
||||
// Replace subflow definitions
|
||||
//
|
||||
// For each of the subflows to be replaced:
|
||||
var newSubflowIds = Object.keys(newSubflows);
|
||||
newSubflowIds.forEach(function(id) {
|
||||
var n = newSubflows[id];
|
||||
// Get a snapshot of the existing subflow definition
|
||||
removedNodes = removedNodes.concat(createExportableSubflow(id));
|
||||
// Remove the old subflow definition - but leave the instances in place
|
||||
var removalResult = RED.subflow.removeSubflow(n.id, true);
|
||||
// Create the list of nodes for the new subflow def
|
||||
var subflowNodes = [n].concat(zMap[n.id]);
|
||||
// Import the new subflow - no clashes should occur as we've removed
|
||||
// the old version
|
||||
var result = importNodes(subflowNodes);
|
||||
newSubflows[id] = getSubflow(id);
|
||||
})
|
||||
|
||||
// Having replaced the subflow definitions, now need to update the
|
||||
// instance nodes.
|
||||
RED.nodes.eachNode(function(n) {
|
||||
if (/^subflow:/.test(n.type)) {
|
||||
var sfId = n.type.substring(8);
|
||||
if (newSubflows[sfId]) {
|
||||
// This is an instance of one of the replaced subflows
|
||||
// - update the new def's instances array to include this one
|
||||
newSubflows[sfId].instances.push(n);
|
||||
// - update the instance's _def to point to the new def
|
||||
n._def = RED.nodes.getType(n.type);
|
||||
// - set all the flags so the view refreshes properly
|
||||
n.dirty = true;
|
||||
n.changed = true;
|
||||
n._colorChanged = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
newSubflowIds.forEach(function(id) {
|
||||
var n = newSubflows[id];
|
||||
RED.events.emit("subflows:change",n);
|
||||
})
|
||||
// Just in case the imported subflow changed color.
|
||||
RED.utils.clearNodeColorCache();
|
||||
|
||||
// ------------------------------
|
||||
// Replace config nodes
|
||||
//
|
||||
configNodeIds.forEach(function(id) {
|
||||
removedNodes = removedNodes.concat(convertNode(getNode(id)));
|
||||
removeNode(id);
|
||||
importNodes([newConfigNodes[id]])
|
||||
});
|
||||
|
||||
return {
|
||||
removedNodes: removedNodes
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Options:
|
||||
* - generateIds - whether to replace all node ids
|
||||
* - addFlow - whether to import nodes to a new tab
|
||||
* - importToCurrent
|
||||
* - importMap - how to resolve any conflicts.
|
||||
* - id:import - import as-is
|
||||
* - id:copy - import with new id
|
||||
* - id:replace - import over the top of existing
|
||||
*/
|
||||
function importNodes(newNodesObj,options) { // createNewIds,createMissingWorkspace) {
|
||||
options = options || {
|
||||
generateIds: false,
|
||||
addFlow: false,
|
||||
}
|
||||
options.importMap = options.importMap || {};
|
||||
|
||||
var createNewIds = options.generateIds;
|
||||
var createMissingWorkspace = options.addFlow;
|
||||
function importNodes(newNodesObj,createNewIds,createMissingWorkspace) {
|
||||
var i;
|
||||
var n;
|
||||
var newNodes;
|
||||
var nodeZmap = {};
|
||||
var recoveryWorkspace;
|
||||
if (typeof newNodesObj === "string") {
|
||||
if (newNodesObj === "") {
|
||||
return;
|
||||
@@ -1094,59 +925,14 @@ RED.nodes = (function() {
|
||||
// copies of the flow would get loaded at the same time.
|
||||
// If the user hit deploy they would have saved those duplicates.
|
||||
var seenIds = {};
|
||||
var existingNodes = [];
|
||||
var nodesToReplace = [];
|
||||
|
||||
newNodes = newNodes.filter(function(n) {
|
||||
var id = n.id;
|
||||
if (seenIds[n.id]) {
|
||||
return false;
|
||||
}
|
||||
seenIds[n.id] = true;
|
||||
|
||||
if (!options.generateIds) {
|
||||
if (!options.importMap[id]) {
|
||||
// No conflict resolution for this node
|
||||
var existing = nodes[id] || configNodes[id] || workspaces[id] || subflows[id] || groups[id];
|
||||
if (existing) {
|
||||
existingNodes.push({existing:existing, imported:n});
|
||||
}
|
||||
} else if (options.importMap[id] === "replace") {
|
||||
nodesToReplace.push(n);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
|
||||
if (existingNodes.length > 0) {
|
||||
var errorMessage = RED._("clipboard.importDuplicate",{count:existingNodes.length});
|
||||
var nodeList = $("<ul>");
|
||||
var existingNodesCount = Math.min(5,existingNodes.length);
|
||||
for (var i=0;i<existingNodesCount;i++) {
|
||||
var conflict = existingNodes[i];
|
||||
$("<li>").text(
|
||||
conflict.existing.id+
|
||||
" [ "+conflict.existing.type+ ((conflict.imported.type !== conflict.existing.type)?" | "+conflict.imported.type:"")+" ]").appendTo(nodeList)
|
||||
}
|
||||
if (existingNodesCount !== existingNodes.length) {
|
||||
$("<li>").text(RED._("deploy.confirm.plusNMore",{count:existingNodes.length-existingNodesCount})).appendTo(nodeList)
|
||||
}
|
||||
var wrapper = $("<p>").append(nodeList);
|
||||
|
||||
var existingNodesError = new Error(errorMessage+wrapper.html());
|
||||
existingNodesError.code = "import_conflict";
|
||||
existingNodesError.importConfig = identifyImportConflicts(newNodes);
|
||||
throw existingNodesError;
|
||||
}
|
||||
var removedNodes;
|
||||
if (nodesToReplace.length > 0) {
|
||||
var replaceResult = replaceNodes(nodesToReplace);
|
||||
removedNodes = replaceResult.removedNodes;
|
||||
}
|
||||
|
||||
|
||||
var isInitialLoad = false;
|
||||
if (!initialLoad) {
|
||||
isInitialLoad = true;
|
||||
@@ -1155,7 +941,6 @@ RED.nodes = (function() {
|
||||
var unknownTypes = [];
|
||||
for (i=0;i<newNodes.length;i++) {
|
||||
n = newNodes[i];
|
||||
var id = n.id;
|
||||
// TODO: remove workspace in next release+1
|
||||
if (n.type != "workspace" &&
|
||||
n.type != "tab" &&
|
||||
@@ -1169,32 +954,11 @@ RED.nodes = (function() {
|
||||
if (n.z) {
|
||||
nodeZmap[n.z] = nodeZmap[n.z] || [];
|
||||
nodeZmap[n.z].push(n);
|
||||
} else if (isInitialLoad && n.hasOwnProperty('x') && n.hasOwnProperty('y') && !n.z) {
|
||||
// Hit the rare issue where node z values get set to 0.
|
||||
// Repair the flow - but we really need to track that down.
|
||||
if (!recoveryWorkspace) {
|
||||
recoveryWorkspace = {
|
||||
id: RED.nodes.id(),
|
||||
type: "tab",
|
||||
disabled: false,
|
||||
label: RED._("clipboard.recoveredNodes"),
|
||||
info: RED._("clipboard.recoveredNodesInfo")
|
||||
}
|
||||
addWorkspace(recoveryWorkspace);
|
||||
RED.workspaces.add(recoveryWorkspace);
|
||||
nodeZmap[recoveryWorkspace.id] = [];
|
||||
}
|
||||
n.z = recoveryWorkspace.id;
|
||||
nodeZmap[recoveryWorkspace.id].push(n);
|
||||
}
|
||||
|
||||
}
|
||||
if (!isInitialLoad && unknownTypes.length > 0) {
|
||||
var typeList = $("<ul>");
|
||||
unknownTypes.forEach(function(t) {
|
||||
$("<li>").text(t).appendTo(typeList);
|
||||
})
|
||||
typeList = typeList[0].outerHTML;
|
||||
var typeList = "<ul><li>"+unknownTypes.join("</li><li>")+"</li></ul>";
|
||||
RED.notify("<p>"+RED._("clipboard.importUnrecognised",{count:unknownTypes.length})+"</p>"+typeList,"error",false,10000);
|
||||
}
|
||||
|
||||
@@ -1227,22 +991,17 @@ RED.nodes = (function() {
|
||||
var workspace_map = {};
|
||||
var new_subflows = [];
|
||||
var subflow_map = {};
|
||||
var subflow_denylist = {};
|
||||
var subflow_blacklist = {};
|
||||
var node_map = {};
|
||||
var new_nodes = [];
|
||||
var new_links = [];
|
||||
var new_groups = [];
|
||||
var new_group_set = new Set();
|
||||
var nid;
|
||||
var def;
|
||||
var configNode;
|
||||
var missingWorkspace = null;
|
||||
var d;
|
||||
|
||||
if (recoveryWorkspace) {
|
||||
new_workspaces.push(recoveryWorkspace);
|
||||
}
|
||||
|
||||
// Find all tabs and subflow templates
|
||||
for (i=0;i<newNodes.length;i++) {
|
||||
n = newNodes[i];
|
||||
@@ -1254,10 +1013,7 @@ RED.nodes = (function() {
|
||||
if (defaultWorkspace == null) {
|
||||
defaultWorkspace = n;
|
||||
}
|
||||
if (activeWorkspace === 0) {
|
||||
activeWorkspace = n.id;
|
||||
}
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
if (createNewIds) {
|
||||
nid = getID();
|
||||
workspace_map[n.id] = nid;
|
||||
n.id = nid;
|
||||
@@ -1266,15 +1022,12 @@ RED.nodes = (function() {
|
||||
RED.workspaces.add(n);
|
||||
new_workspaces.push(n);
|
||||
} else if (n.type === "subflow") {
|
||||
var matchingSubflow;
|
||||
if (!options.importMap[n.id]) {
|
||||
matchingSubflow = checkForMatchingSubflow(n,nodeZmap[n.id]);
|
||||
}
|
||||
var matchingSubflow = checkForMatchingSubflow(n,nodeZmap[n.id]);
|
||||
if (matchingSubflow) {
|
||||
subflow_denylist[n.id] = matchingSubflow;
|
||||
subflow_blacklist[n.id] = matchingSubflow;
|
||||
} else {
|
||||
subflow_map[n.id] = n;
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
if (createNewIds) {
|
||||
nid = getID();
|
||||
n.id = nid;
|
||||
}
|
||||
@@ -1300,7 +1053,7 @@ RED.nodes = (function() {
|
||||
n.status.id = getID();
|
||||
}
|
||||
new_subflows.push(n);
|
||||
addSubflow(n,createNewIds || options.importMap[n.id] === "copy");
|
||||
addSubflow(n,createNewIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1320,9 +1073,9 @@ RED.nodes = (function() {
|
||||
def = registry.getNodeType(n.type);
|
||||
if (def && def.category == "config") {
|
||||
var existingConfigNode = null;
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
if (createNewIds) {
|
||||
if (n.z) {
|
||||
if (subflow_denylist[n.z]) {
|
||||
if (subflow_blacklist[n.z]) {
|
||||
continue;
|
||||
} else if (subflow_map[n.z]) {
|
||||
n.z = subflow_map[n.z].id;
|
||||
@@ -1341,28 +1094,23 @@ RED.nodes = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (options.importMap[n.id] !== "copy") {
|
||||
existingConfigNode = RED.nodes.node(n.id);
|
||||
if (existingConfigNode) {
|
||||
if (n.z && existingConfigNode.z !== n.z) {
|
||||
existingConfigNode = null;
|
||||
// Check the config nodes on n.z
|
||||
for (var cn in configNodes) {
|
||||
if (configNodes.hasOwnProperty(cn)) {
|
||||
if (configNodes[cn].z === n.z && compareNodes(configNodes[cn],n,false)) {
|
||||
existingConfigNode = configNodes[cn];
|
||||
node_map[n.id] = configNodes[cn];
|
||||
break;
|
||||
}
|
||||
existingConfigNode = RED.nodes.node(n.id);
|
||||
if (existingConfigNode) {
|
||||
if (n.z && existingConfigNode.z !== n.z) {
|
||||
existingConfigNode = null;
|
||||
// Check the config nodes on n.z
|
||||
for (var cn in configNodes) {
|
||||
if (configNodes.hasOwnProperty(cn)) {
|
||||
if (configNodes[cn].z === n.z && compareNodes(configNodes[cn],n,false)) {
|
||||
existingConfigNode = configNodes[cn];
|
||||
node_map[n.id] = configNodes[cn];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (n.z && !workspaces[n.z] && !subflow_map[n.z]) {
|
||||
n.z = activeWorkspace;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!existingConfigNode || existingConfigNode._def.exclusive) { //} || !compareNodes(existingConfigNode,n,true) || existingConfigNode.z !== n.z) {
|
||||
@@ -1374,9 +1122,6 @@ RED.nodes = (function() {
|
||||
users:[],
|
||||
_config:{}
|
||||
};
|
||||
if (!n.z) {
|
||||
delete configNode.z;
|
||||
}
|
||||
if (n.hasOwnProperty('d')) {
|
||||
configNode.d = n.d;
|
||||
}
|
||||
@@ -1396,7 +1141,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
configNode.label = def.label;
|
||||
configNode._def = def;
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
if (createNewIds) {
|
||||
configNode.id = getID();
|
||||
}
|
||||
node_map[n.id] = configNode;
|
||||
@@ -1436,8 +1181,8 @@ RED.nodes = (function() {
|
||||
if (n.hasOwnProperty('g')) {
|
||||
node.g = n.g;
|
||||
}
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
if (subflow_denylist[n.z]) {
|
||||
if (createNewIds) {
|
||||
if (subflow_blacklist[n.z]) {
|
||||
continue;
|
||||
} else if (subflow_map[node.z]) {
|
||||
node.z = subflow_map[node.z].id;
|
||||
@@ -1484,8 +1229,8 @@ RED.nodes = (function() {
|
||||
node._config.y = node.y;
|
||||
} else if (n.type.substring(0,7) === "subflow") {
|
||||
var parentId = n.type.split(":")[1];
|
||||
var subflow = subflow_denylist[parentId]||subflow_map[parentId]||getSubflow(parentId);
|
||||
if (createNewIds || options.importMap[n.id] === "copy") {
|
||||
var subflow = subflow_blacklist[parentId]||subflow_map[parentId]||getSubflow(parentId);
|
||||
if (createNewIds) {
|
||||
parentId = subflow.id;
|
||||
node.type = "subflow:"+parentId;
|
||||
node._def = registry.getNodeType(node.type);
|
||||
@@ -1519,9 +1264,6 @@ RED.nodes = (function() {
|
||||
delete node.wires;
|
||||
delete node.inputLabels;
|
||||
delete node.outputLabels;
|
||||
if (!n.z) {
|
||||
delete node.z;
|
||||
}
|
||||
}
|
||||
var orig = {};
|
||||
for (var p in n) {
|
||||
@@ -1582,7 +1324,6 @@ RED.nodes = (function() {
|
||||
new_nodes.push(node);
|
||||
} else if (node.type === "group") {
|
||||
new_groups.push(node);
|
||||
new_group_set.add(node.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1686,53 +1427,18 @@ RED.nodes = (function() {
|
||||
delete n.status.wires;
|
||||
}
|
||||
}
|
||||
// Order the groups to ensure they are outer-most to inner-most
|
||||
var groupDepthMap = {};
|
||||
for (i=0;i<new_groups.length;i++) {
|
||||
n = new_groups[i];
|
||||
|
||||
if (n.g && !new_group_set.has(n.g)) {
|
||||
if (n.g && node_map[n.g]) {
|
||||
n.g = node_map[n.g].id;
|
||||
} else {
|
||||
delete n.g;
|
||||
}
|
||||
n.nodes = n.nodes.map(function(id) {
|
||||
return node_map[id];
|
||||
})
|
||||
// Just in case the group references a node that doesn't exist for some reason
|
||||
n.nodes = n.nodes.filter(function(v) {
|
||||
if (v) {
|
||||
// Repair any nodes that have forgotten they are in this group
|
||||
if (v.g !== n.id) {
|
||||
v.g = n.id;
|
||||
}
|
||||
}
|
||||
return !!v
|
||||
});
|
||||
if (!n.g) {
|
||||
groupDepthMap[n.id] = 0;
|
||||
}
|
||||
}
|
||||
var changedDepth;
|
||||
do {
|
||||
changedDepth = false;
|
||||
for (i=0;i<new_groups.length;i++) {
|
||||
n = new_groups[i];
|
||||
if (n.g) {
|
||||
if (groupDepthMap[n.id] !== groupDepthMap[n.g] + 1) {
|
||||
groupDepthMap[n.id] = groupDepthMap[n.g] + 1;
|
||||
changedDepth = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(changedDepth);
|
||||
|
||||
new_groups.sort(function(A,B) {
|
||||
return groupDepthMap[A.id] - groupDepthMap[B.id];
|
||||
});
|
||||
for (i=0;i<new_groups.length;i++) {
|
||||
n = new_groups[i];
|
||||
addGroup(n);
|
||||
}
|
||||
|
||||
// Now the nodes have been fully updated, add them.
|
||||
for (i=0;i<new_nodes.length;i++) {
|
||||
var node = new_nodes[i];
|
||||
@@ -1747,47 +1453,24 @@ RED.nodes = (function() {
|
||||
}
|
||||
|
||||
RED.workspaces.refresh();
|
||||
|
||||
|
||||
if (recoveryWorkspace) {
|
||||
var notification = RED.notify(RED._("clipboard.recoveredNodesNotification",{flowName:RED._("clipboard.recoveredNodes")}),{
|
||||
type:"warning",
|
||||
fixed:true,
|
||||
buttons: [
|
||||
{text: RED._("common.label.close"), click: function() { notification.close() }}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
nodes:new_nodes,
|
||||
links:new_links,
|
||||
groups:new_groups,
|
||||
workspaces:new_workspaces,
|
||||
subflows:new_subflows,
|
||||
missingWorkspace: missingWorkspace,
|
||||
removedNodes: removedNodes
|
||||
}
|
||||
return [new_nodes,new_links,new_groups,new_workspaces,new_subflows,missingWorkspace];
|
||||
}
|
||||
|
||||
// TODO: supports filter.z|type
|
||||
function filterNodes(filter) {
|
||||
var result = [];
|
||||
var searchSet = null;
|
||||
var searchSet = nodes;
|
||||
var doZFilter = false;
|
||||
if (filter.hasOwnProperty("z")) {
|
||||
if (nodeTabMap.hasOwnProperty(filter.z)) {
|
||||
searchSet = Object.keys(nodeTabMap[filter.z]);
|
||||
if (Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
|
||||
searchSet = Object.values(nodeTabMap[filter.z]);
|
||||
} else {
|
||||
doZFilter = true;
|
||||
}
|
||||
}
|
||||
if (searchSet === null) {
|
||||
searchSet = Object.keys(nodes);
|
||||
}
|
||||
|
||||
for (var n=0;n<searchSet.length;n++) {
|
||||
var node = nodes[searchSet[n]];
|
||||
var node = searchSet[n];
|
||||
if (filter.hasOwnProperty("type") && node.type !== filter.type) {
|
||||
continue;
|
||||
}
|
||||
@@ -1856,7 +1539,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
|
||||
function clear() {
|
||||
nodes = {};
|
||||
nodes = [];
|
||||
links = [];
|
||||
nodeTabMap = {};
|
||||
configNodes = {};
|
||||
@@ -1874,8 +1557,6 @@ RED.nodes = (function() {
|
||||
});
|
||||
defaultWorkspace = null;
|
||||
initialLoad = null;
|
||||
workspaces = {};
|
||||
|
||||
RED.nodes.dirty(false);
|
||||
RED.view.redraw(true, true);
|
||||
RED.palette.refresh();
|
||||
@@ -1886,7 +1567,7 @@ RED.nodes = (function() {
|
||||
RED.events.emit("workspace:clear");
|
||||
|
||||
// var node_defs = {};
|
||||
// var nodes = {};
|
||||
// var nodes = [];
|
||||
// var configNodes = {};
|
||||
// var links = [];
|
||||
// var defaultWorkspace;
|
||||
@@ -1946,13 +1627,12 @@ RED.nodes = (function() {
|
||||
if (configNodes.hasOwnProperty(n.id)) {
|
||||
delete configNodes[n.id];
|
||||
} else {
|
||||
delete nodes[n.id];
|
||||
nodes.splice(nodes.indexOf(n),1);
|
||||
if (nodeTabMap[n.z]) {
|
||||
delete nodeTabMap[n.z][n.id];
|
||||
}
|
||||
}
|
||||
reimportList.push(convertNode(n));
|
||||
RED.events.emit('nodes:remove',n);
|
||||
});
|
||||
|
||||
// Remove any links between nodes that are going to be reimported.
|
||||
@@ -1968,9 +1648,9 @@ RED.nodes = (function() {
|
||||
// Force the redraw to be synchronous so the view updates
|
||||
// *now* and removes the unknown node
|
||||
RED.view.redraw(true, true);
|
||||
var result = importNodes(reimportList,{generateIds:false});
|
||||
var result = importNodes(reimportList,false);
|
||||
var newNodeMap = {};
|
||||
result.nodes.forEach(function(n) {
|
||||
result[0].forEach(function(n) {
|
||||
newNodeMap[n.id] = n;
|
||||
});
|
||||
RED.nodes.eachLink(function(l) {
|
||||
@@ -2027,11 +1707,9 @@ RED.nodes = (function() {
|
||||
groups: function(z) { return groupsByZ[z]||[] },
|
||||
|
||||
eachNode: function(cb) {
|
||||
for (var id in nodes) {
|
||||
if (nodes.hasOwnProperty(id)) {
|
||||
if (cb(nodes[id]) === false) {
|
||||
break;
|
||||
}
|
||||
for (var n=0;n<nodes.length;n++) {
|
||||
if (cb(nodes[n]) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2084,8 +1762,6 @@ RED.nodes = (function() {
|
||||
|
||||
import: importNodes,
|
||||
|
||||
identifyImportConflicts: identifyImportConflicts,
|
||||
|
||||
getAllFlowNodes: getAllFlowNodes,
|
||||
createExportableNodeSet: createExportableNodeSet,
|
||||
createCompleteNodeSet: createCompleteNodeSet,
|
||||
|
@@ -37,21 +37,5 @@
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (new Set([0]).size === 0) {
|
||||
// IE does not support passing an iterable to Set constructor
|
||||
var _Set = Set;
|
||||
/*global Set:true */
|
||||
Set = function Set(iterable) {
|
||||
var set = new _Set();
|
||||
if (iterable) {
|
||||
iterable.forEach(set.add, set);
|
||||
}
|
||||
return set;
|
||||
};
|
||||
Set.prototype = _Set.prototype;
|
||||
Set.prototype.constructor = Set;
|
||||
}
|
||||
|
||||
}
|
||||
})();
|
||||
|
@@ -178,21 +178,11 @@ var RED = (function() {
|
||||
var currentHash = window.location.hash;
|
||||
RED.nodes.version(nodes.rev);
|
||||
loader.reportProgress(RED._("event.importFlows"),90 )
|
||||
try {
|
||||
RED.nodes.import(nodes.flows);
|
||||
RED.nodes.dirty(false);
|
||||
RED.view.redraw(true);
|
||||
if (/^#flow\/.+$/.test(currentHash)) {
|
||||
RED.workspaces.show(currentHash.substring(6));
|
||||
}
|
||||
} catch(err) {
|
||||
RED.notify(
|
||||
RED._("event.importError", {message: err.message}),
|
||||
{
|
||||
fixed: true,
|
||||
type: 'error'
|
||||
}
|
||||
);
|
||||
RED.nodes.import(nodes.flows);
|
||||
RED.nodes.dirty(false);
|
||||
RED.view.redraw(true);
|
||||
if (/^#flow\/.+$/.test(currentHash)) {
|
||||
RED.workspaces.show(currentHash.substring(6));
|
||||
}
|
||||
}
|
||||
done();
|
||||
@@ -382,7 +372,7 @@ var RED = (function() {
|
||||
node.status = msg;
|
||||
node.dirtyStatus = true;
|
||||
node.dirty = true;
|
||||
RED.view.redrawStatus(node);
|
||||
RED.view.redraw();
|
||||
}
|
||||
});
|
||||
RED.comms.subscribe("notification/node/#",function(topic,msg) {
|
||||
|
@@ -21,18 +21,7 @@ RED.actions = (function() {
|
||||
var result = [];
|
||||
Object.keys(actions).forEach(function(action) {
|
||||
var shortcut = RED.keyboard.getShortcut(action);
|
||||
var isUser = false;
|
||||
if (shortcut) {
|
||||
isUser = shortcut.user;
|
||||
} else {
|
||||
isUser = !!RED.keyboard.getUserShortcut(action);
|
||||
}
|
||||
result.push({
|
||||
id:action,
|
||||
scope:shortcut?shortcut.scope:undefined,
|
||||
key:shortcut?shortcut.key:undefined,
|
||||
user:isUser
|
||||
})
|
||||
result.push({id:action,scope:shortcut?shortcut.scope:undefined,key:shortcut?shortcut.key:undefined,user:shortcut?shortcut.user:undefined})
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
@@ -28,8 +28,6 @@ RED.clipboard = (function() {
|
||||
var libraryBrowser;
|
||||
var examplesBrowser;
|
||||
|
||||
var pendingImportConfig;
|
||||
|
||||
function setupDialogs() {
|
||||
dialog = $('<div id="red-ui-clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
|
||||
.appendTo("#red-ui-editor")
|
||||
@@ -44,14 +42,14 @@ RED.clipboard = (function() {
|
||||
"ui-widget-overlay": "red-ui-editor-dialog"
|
||||
},
|
||||
buttons: [
|
||||
{ // red-ui-clipboard-dialog-cancel
|
||||
{
|
||||
id: "red-ui-clipboard-dialog-cancel",
|
||||
text: RED._("common.label.cancel"),
|
||||
click: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
{ // red-ui-clipboard-dialog-download
|
||||
{
|
||||
id: "red-ui-clipboard-dialog-download",
|
||||
class: "primary",
|
||||
text: RED._("clipboard.download"),
|
||||
@@ -66,7 +64,7 @@ RED.clipboard = (function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
{ // red-ui-clipboard-dialog-export
|
||||
{
|
||||
id: "red-ui-clipboard-dialog-export",
|
||||
class: "primary",
|
||||
text: RED._("clipboard.export.copy"),
|
||||
@@ -136,14 +134,14 @@ RED.clipboard = (function() {
|
||||
}
|
||||
}
|
||||
},
|
||||
{ // red-ui-clipboard-dialog-ok
|
||||
{
|
||||
id: "red-ui-clipboard-dialog-ok",
|
||||
class: "primary",
|
||||
text: RED._("common.label.import"),
|
||||
click: function() {
|
||||
var addNewFlow = ($("#red-ui-clipboard-dialog-import-opt > a.selected").attr('id') === 'red-ui-clipboard-dialog-import-opt-new');
|
||||
if (activeTab === "red-ui-clipboard-dialog-import-tab-clipboard") {
|
||||
importNodes($("#red-ui-clipboard-dialog-import-text").val(),addNewFlow);
|
||||
RED.view.importNodes($("#red-ui-clipboard-dialog-import-text").val(),addNewFlow);
|
||||
} else {
|
||||
var selectedPath;
|
||||
if (activeTab === "red-ui-clipboard-dialog-import-tab-library") {
|
||||
@@ -153,51 +151,15 @@ RED.clipboard = (function() {
|
||||
}
|
||||
if (selectedPath.path) {
|
||||
$.get('library/'+selectedPath.library+'/'+selectedPath.type+'/'+selectedPath.path, function(data) {
|
||||
importNodes(data,addNewFlow);
|
||||
RED.view.importNodes(data,addNewFlow);
|
||||
});
|
||||
}
|
||||
}
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
{ // red-ui-clipboard-dialog-import-conflict
|
||||
id: "red-ui-clipboard-dialog-import-conflict",
|
||||
class: "primary",
|
||||
text: RED._("clipboard.import.importSelected"),
|
||||
click: function() {
|
||||
var importMap = {};
|
||||
$('#red-ui-clipboard-dialog-import-conflicts-list input[type="checkbox"]').each(function() {
|
||||
importMap[$(this).attr("data-node-id")] = this.checked?"import":"skip";
|
||||
})
|
||||
|
||||
$('.red-ui-clipboard-dialog-import-conflicts-controls input[type="checkbox"]').each(function() {
|
||||
if (!$(this).attr("disabled")) {
|
||||
importMap[$(this).attr("data-node-id")] = this.checked?"replace":"copy"
|
||||
}
|
||||
})
|
||||
// skip - don't import
|
||||
// import - import as-is
|
||||
// copy - import with new id
|
||||
// replace - import over the top of existing
|
||||
pendingImportConfig.importOptions.importMap = importMap;
|
||||
|
||||
var newNodes = pendingImportConfig.importNodes.filter(function(n) {
|
||||
if (!importMap[n.id] || importMap[n.z]) {
|
||||
importMap[n.id] = importMap[n.z];
|
||||
}
|
||||
return importMap[n.id] !== "skip"
|
||||
})
|
||||
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
|
||||
RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
],
|
||||
open: function( event, ui ) {
|
||||
RED.keyboard.disable();
|
||||
},
|
||||
close: function(e) {
|
||||
RED.keyboard.enable();
|
||||
if (popover) {
|
||||
popover.close(true);
|
||||
currentPopoverError = null;
|
||||
@@ -270,14 +232,6 @@ RED.clipboard = (function() {
|
||||
'</span>'+
|
||||
'</div>';
|
||||
|
||||
importConflictsDialog =
|
||||
'<div class="form-row">'+
|
||||
'<div class="form-row"><p data-i18n="clipboard.import.conflictNotification1"></p><p data-i18n="clipboard.import.conflictNotification2"></p></div>'+
|
||||
'<div class="red-ui-clipboard-dialog-import-conflicts-list-container">'+
|
||||
'<div id="red-ui-clipboard-dialog-import-conflicts-list"></div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
|
||||
var validateExportFilenameTimeout
|
||||
@@ -401,7 +355,7 @@ RED.clipboard = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function showImportNodes(mode) {
|
||||
function importNodes(mode) {
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
@@ -487,8 +441,6 @@ RED.clipboard = (function() {
|
||||
$("#red-ui-clipboard-dialog-cancel").show();
|
||||
$("#red-ui-clipboard-dialog-export").hide();
|
||||
$("#red-ui-clipboard-dialog-download").hide();
|
||||
$("#red-ui-clipboard-dialog-import-conflict").hide();
|
||||
|
||||
$("#red-ui-clipboard-dialog-ok").button("disable");
|
||||
$("#red-ui-clipboard-dialog-import-text").on("keyup", validateImport);
|
||||
$("#red-ui-clipboard-dialog-import-text").on('paste',function() { setTimeout(validateImport,10)});
|
||||
@@ -529,9 +481,7 @@ RED.clipboard = (function() {
|
||||
}
|
||||
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
|
||||
|
||||
dialog.dialog("option","title",RED._("clipboard.importNodes"))
|
||||
.dialog("option","width",700)
|
||||
.dialog("open");
|
||||
dialog.dialog("option","title",RED._("clipboard.importNodes")).dialog("open");
|
||||
popover = RED.popover.create({
|
||||
target: $("#red-ui-clipboard-dialog-import-text"),
|
||||
trigger: "manual",
|
||||
@@ -540,7 +490,7 @@ RED.clipboard = (function() {
|
||||
});
|
||||
}
|
||||
|
||||
function showExportNodes(mode) {
|
||||
function exportNodes(mode) {
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
@@ -677,8 +627,6 @@ RED.clipboard = (function() {
|
||||
$("#red-ui-clipboard-dialog-ok").hide();
|
||||
$("#red-ui-clipboard-dialog-cancel").hide();
|
||||
$("#red-ui-clipboard-dialog-export").hide();
|
||||
$("#red-ui-clipboard-dialog-import-conflict").hide();
|
||||
|
||||
var selection = RED.workspaces.selection();
|
||||
if (selection.length > 0) {
|
||||
$("#red-ui-clipboard-dialog-export-rng-selected").trigger("click");
|
||||
@@ -705,15 +653,12 @@ RED.clipboard = (function() {
|
||||
}
|
||||
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
|
||||
|
||||
dialog.dialog("option","title",RED._("clipboard.exportNodes"))
|
||||
.dialog("option","width",700)
|
||||
.dialog("open");
|
||||
dialog.dialog("option","title",RED._("clipboard.exportNodes")).dialog( "open" );
|
||||
|
||||
$("#red-ui-clipboard-dialog-export-text").trigger("focus");
|
||||
$("#red-ui-clipboard-dialog-cancel").show();
|
||||
$("#red-ui-clipboard-dialog-export").show();
|
||||
$("#red-ui-clipboard-dialog-download").show();
|
||||
$("#red-ui-clipboard-dialog-import-conflict").hide();
|
||||
|
||||
}
|
||||
|
||||
@@ -773,12 +718,6 @@ RED.clipboard = (function() {
|
||||
// representation or null
|
||||
return null;
|
||||
}
|
||||
if (value.type === 'bigint') {
|
||||
return value.data.toString();
|
||||
}
|
||||
if (value.type === 'undefined') {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
@@ -803,315 +742,19 @@ RED.clipboard = (function() {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
function importNodes(nodesStr,addFlow) {
|
||||
var newNodes = nodesStr;
|
||||
if (typeof nodesStr === 'string') {
|
||||
try {
|
||||
nodesStr = nodesStr.trim();
|
||||
if (nodesStr.length === 0) {
|
||||
return;
|
||||
}
|
||||
newNodes = JSON.parse(nodesStr);
|
||||
} catch(err) {
|
||||
var e = new Error(RED._("clipboard.invalidFlow",{message:err.message}));
|
||||
e.code = "NODE_RED";
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
var importOptions = {generateIds: false, addFlow: addFlow};
|
||||
try {
|
||||
RED.view.importNodes(newNodes, importOptions);
|
||||
} catch(error) {
|
||||
// Thrown for import_conflict
|
||||
confirmImport(error.importConfig, newNodes, importOptions);
|
||||
}
|
||||
}
|
||||
|
||||
function confirmImport(importConfig,importNodes,importOptions) {
|
||||
var notification = RED.notify("<p>"+RED._("clipboard.import.conflictNotification1")+"</p>",{
|
||||
type: "info",
|
||||
fixed: true,
|
||||
buttons: [
|
||||
{text: RED._("common.label.cancel"), click: function() { notification.close(); }},
|
||||
{text: RED._("clipboard.import.viewNodes"), click: function() {
|
||||
notification.close();
|
||||
showImportConflicts(importConfig,importNodes,importOptions);
|
||||
}},
|
||||
{text: RED._("clipboard.import.importCopy"), click: function() {
|
||||
notification.close();
|
||||
// generateIds=true to avoid conflicts
|
||||
// and default to the 'old' behaviour around matching
|
||||
// config nodes and subflows
|
||||
importOptions.generateIds = true;
|
||||
RED.view.importNodes(importNodes, importOptions);
|
||||
}}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
function showImportConflicts(importConfig,importNodes,importOptions) {
|
||||
|
||||
pendingImportConfig = {
|
||||
importConfig: importConfig,
|
||||
importNodes: importNodes,
|
||||
importOptions: importOptions
|
||||
}
|
||||
|
||||
var id,node;
|
||||
var treeData = [];
|
||||
var container;
|
||||
var addedHeader = false;
|
||||
for (id in importConfig.subflows) {
|
||||
if (importConfig.subflows.hasOwnProperty(id)) {
|
||||
if (!addedHeader) {
|
||||
treeData.push({gutter:$('<span data-i18n="menu.label.subflows"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
|
||||
addedHeader = true;
|
||||
}
|
||||
node = importConfig.subflows[id];
|
||||
var isConflicted = importConfig.conflicted[node.id];
|
||||
var isSelected = !isConflicted;
|
||||
var elements = getNodeElement(node, isConflicted, isSelected );
|
||||
container = {
|
||||
id: node.id,
|
||||
gutter: elements.gutter.element,
|
||||
element: elements.element,
|
||||
class: isSelected?"":"disabled",
|
||||
deferBuild: true,
|
||||
children: []
|
||||
}
|
||||
treeData.push(container);
|
||||
if (importConfig.zMap[id]) {
|
||||
importConfig.zMap[id].forEach(function(node) {
|
||||
var childElements = getNodeElement(node, importConfig.conflicted[node.id], isSelected, elements.gutter.cb);
|
||||
container.children.push({
|
||||
id: node.id,
|
||||
gutter: childElements.gutter.element,
|
||||
element: childElements.element,
|
||||
class: isSelected?"":"disabled"
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
addedHeader = false;
|
||||
for (id in importConfig.tabs) {
|
||||
if (importConfig.tabs.hasOwnProperty(id)) {
|
||||
if (!addedHeader) {
|
||||
treeData.push({gutter:$('<span data-i18n="menu.label.flows"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
|
||||
addedHeader = true;
|
||||
}
|
||||
node = importConfig.tabs[id];
|
||||
var isConflicted = importConfig.conflicted[node.id];
|
||||
var isSelected = true;
|
||||
var elements = getNodeElement(node, isConflicted, isSelected);
|
||||
container = {
|
||||
id: node.id,
|
||||
gutter: elements.gutter.element,
|
||||
element: elements.element,
|
||||
icon: "red-ui-icons red-ui-icons-flow",
|
||||
deferBuild: true,
|
||||
class: isSelected?"":"disabled",
|
||||
children: []
|
||||
}
|
||||
treeData.push(container);
|
||||
if (importConfig.zMap[id]) {
|
||||
importConfig.zMap[id].forEach(function(node) {
|
||||
var childElements = getNodeElement(node, importConfig.conflicted[node.id], isSelected, elements.gutter.cb);
|
||||
container.children.push({
|
||||
id: node.id,
|
||||
gutter: childElements.gutter.element,
|
||||
element: childElements.element,
|
||||
class: isSelected?"":"disabled"
|
||||
})
|
||||
// console.log(" ["+(importConfig.conflicted[node.id]?"*":" ")+"] "+node.type+" "+node.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
addedHeader = false;
|
||||
var extraNodes = [];
|
||||
importConfig.all.forEach(function(node) {
|
||||
if (node.type !== "tab" && node.type !== "subflow" && !importConfig.tabs[node.z] && !importConfig.subflows[node.z]) {
|
||||
var isConflicted = importConfig.conflicted[node.id];
|
||||
var isSelected = !isConflicted || !importConfig.configs[node.id];
|
||||
var elements = getNodeElement(node, isConflicted, isSelected);
|
||||
var item = {
|
||||
id: node.id,
|
||||
gutter: elements.gutter.element,
|
||||
element: elements.element,
|
||||
class: isSelected?"":"disabled"
|
||||
}
|
||||
if (importConfig.configs[node.id]) {
|
||||
extraNodes.push(item);
|
||||
} else {
|
||||
if (!addedHeader) {
|
||||
treeData.push({gutter:$('<span data-i18n="menu.label.nodes"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
|
||||
addedHeader = true;
|
||||
}
|
||||
treeData.push(item);
|
||||
}
|
||||
// console.log("["+(importConfig.conflicted[node.id]?"*":" ")+"] "+node.type+" "+node.id);
|
||||
}
|
||||
})
|
||||
if (extraNodes.length > 0) {
|
||||
treeData.push({gutter:$('<span data-i18n="menu.label.displayConfig"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
|
||||
addedHeader = true;
|
||||
treeData = treeData.concat(extraNodes);
|
||||
|
||||
}
|
||||
dialogContainer.empty();
|
||||
dialogContainer.append($(importConflictsDialog));
|
||||
|
||||
|
||||
var nodeList = $("#red-ui-clipboard-dialog-import-conflicts-list").css({position:"absolute",top:0,right:0,bottom:0,left:0}).treeList({
|
||||
data: treeData
|
||||
})
|
||||
|
||||
dialogContainer.i18n();
|
||||
var dialogHeight = 400;
|
||||
var winHeight = $(window).height();
|
||||
if (winHeight < 600) {
|
||||
dialogHeight = 400 - (600 - winHeight);
|
||||
}
|
||||
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
|
||||
|
||||
$("#red-ui-clipboard-dialog-ok").hide();
|
||||
$("#red-ui-clipboard-dialog-cancel").show();
|
||||
$("#red-ui-clipboard-dialog-export").hide();
|
||||
$("#red-ui-clipboard-dialog-download").hide();
|
||||
$("#red-ui-clipboard-dialog-import-conflict").show();
|
||||
|
||||
|
||||
dialog.dialog("option","title",RED._("clipboard.importNodes"))
|
||||
.dialog("option","width",500)
|
||||
.dialog( "open" );
|
||||
|
||||
}
|
||||
|
||||
function getNodeElement(n, isConflicted, isSelected, parent) {
|
||||
var element;
|
||||
if (n.type === "tab") {
|
||||
element = getFlowLabel(n, isSelected);
|
||||
} else {
|
||||
element = getNodeLabel(n, isConflicted, isSelected);
|
||||
}
|
||||
var controls = $('<div>',{class:"red-ui-clipboard-dialog-import-conflicts-controls"}).appendTo(element);
|
||||
controls.on("click", function(evt) { evt.stopPropagation(); });
|
||||
if (isConflicted && !parent) {
|
||||
var cb = $('<label><input '+(isSelected?'':'disabled ')+'type="checkbox" data-node-id="'+n.id+'"> <span data-i18n="clipboard.import.replace"></span></label>').appendTo(controls);
|
||||
if (n.type === "tab" || (n.type !== "subflow" && n.hasOwnProperty("x") && n.hasOwnProperty("y"))) {
|
||||
cb.hide();
|
||||
}
|
||||
}
|
||||
return {
|
||||
element: element,
|
||||
gutter: getGutter(n, isSelected, parent)
|
||||
}
|
||||
}
|
||||
|
||||
function getGutter(n, isSelected, parent) {
|
||||
var span = $("<label>",{class:"red-ui-clipboard-dialog-import-conflicts-gutter"});
|
||||
var cb = $('<input data-node-id="'+n.id+'" type="checkbox" '+(isSelected?"checked":"")+'>').appendTo(span);
|
||||
|
||||
if (parent) {
|
||||
cb.attr("disabled",true);
|
||||
parent.addChild(cb);
|
||||
}
|
||||
span.on("click", function(evt) {
|
||||
evt.stopPropagation();
|
||||
})
|
||||
cb.on("change", function(evt) {
|
||||
var state = this.checked;
|
||||
span.parent().toggleClass("disabled",!!!state);
|
||||
span.parent().find('.red-ui-clipboard-dialog-import-conflicts-controls input[type="checkbox"]').attr("disabled",!!!state);
|
||||
childItems.forEach(function(c) {
|
||||
c.attr("checked",state);
|
||||
c.trigger("change");
|
||||
});
|
||||
})
|
||||
var childItems = [];
|
||||
|
||||
var checkbox = {
|
||||
addChild: function(c) {
|
||||
childItems.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
cb: checkbox,
|
||||
element: span
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeLabelText(n) {
|
||||
var label = n.name || n.type+": "+n.id;
|
||||
if (n._def.label) {
|
||||
try {
|
||||
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
|
||||
} catch(err) {
|
||||
console.log("Definition error: "+n.type+".label",err);
|
||||
}
|
||||
}
|
||||
var newlineIndex = label.indexOf("\\n");
|
||||
if (newlineIndex > -1) {
|
||||
label = label.substring(0,newlineIndex)+"...";
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
function getFlowLabel(n) {
|
||||
n = JSON.parse(JSON.stringify(n));
|
||||
n._def = RED.nodes.getType(n.type) || {};
|
||||
if (n._def) {
|
||||
n._ = n._def._;
|
||||
}
|
||||
|
||||
var div = $('<div>',{class:"red-ui-info-outline-item red-ui-info-outline-item-flow"});
|
||||
var contentDiv = $('<div>',{class:"red-ui-search-result-description red-ui-info-outline-item-label"}).appendTo(div);
|
||||
var label = (typeof n === "string")? n : n.label;
|
||||
var newlineIndex = label.indexOf("\\n");
|
||||
if (newlineIndex > -1) {
|
||||
label = label.substring(0,newlineIndex)+"...";
|
||||
}
|
||||
contentDiv.text(label);
|
||||
// A conflicted flow should not be imported by default.
|
||||
return div;
|
||||
}
|
||||
|
||||
function getNodeLabel(n, isConflicted) {
|
||||
n = JSON.parse(JSON.stringify(n));
|
||||
n._def = RED.nodes.getType(n.type) || {};
|
||||
if (n._def) {
|
||||
n._ = n._def._;
|
||||
}
|
||||
var div = $('<div>',{class:"red-ui-info-outline-item"});
|
||||
RED.utils.createNodeIcon(n).appendTo(div);
|
||||
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
|
||||
var labelText = getNodeLabelText(n);
|
||||
var label = $('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).appendTo(contentDiv);
|
||||
if (labelText) {
|
||||
label.text(labelText)
|
||||
} else {
|
||||
label.html(n.type)
|
||||
}
|
||||
return div;
|
||||
}
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
setupDialogs();
|
||||
|
||||
$('<input type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo("#red-ui-editor");
|
||||
|
||||
RED.actions.add("core:show-export-dialog",showExportNodes);
|
||||
RED.actions.add("core:show-import-dialog",showImportNodes);
|
||||
RED.actions.add("core:show-export-dialog",exportNodes);
|
||||
RED.actions.add("core:show-import-dialog",importNodes);
|
||||
|
||||
RED.actions.add("core:show-library-export-dialog",function() { showExportNodes('library') });
|
||||
RED.actions.add("core:show-library-import-dialog",function() { showImportNodes('library') });
|
||||
RED.actions.add("core:show-library-export-dialog",function() { exportNodes('library') });
|
||||
RED.actions.add("core:show-library-import-dialog",function() { importNodes('library') });
|
||||
|
||||
RED.actions.add("core:show-examples-import-dialog",function() { showImportNodes('examples') });
|
||||
RED.actions.add("core:show-examples-import-dialog",function() { importNodes('examples') });
|
||||
|
||||
RED.events.on("editor:open",function() { disabled = true; });
|
||||
RED.events.on("editor:close",function() { disabled = false; });
|
||||
@@ -1145,7 +788,7 @@ RED.clipboard = (function() {
|
||||
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) {
|
||||
var data = event.originalEvent.dataTransfer.getData("text/plain");
|
||||
data = data.substring(data.indexOf('['),data.lastIndexOf(']')+1);
|
||||
importNodes(data);
|
||||
RED.view.importNodes(data);
|
||||
} else if ($.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
|
||||
var files = event.originalEvent.dataTransfer.files;
|
||||
if (files.length === 1) {
|
||||
@@ -1153,7 +796,7 @@ RED.clipboard = (function() {
|
||||
var reader = new FileReader();
|
||||
reader.onload = (function(theFile) {
|
||||
return function(e) {
|
||||
importNodes(e.target.result);
|
||||
RED.view.importNodes(e.target.result);
|
||||
};
|
||||
})(file);
|
||||
reader.readAsText(file);
|
||||
@@ -1164,8 +807,8 @@ RED.clipboard = (function() {
|
||||
});
|
||||
|
||||
},
|
||||
import: showImportNodes,
|
||||
export: showExportNodes,
|
||||
import: importNodes,
|
||||
export: exportNodes,
|
||||
copyText: copyText
|
||||
}
|
||||
})();
|
||||
|
@@ -27,26 +27,26 @@
|
||||
this.partialFlag = false;
|
||||
this.stateValue = 0;
|
||||
var initialState = this.element.prop('checked');
|
||||
this.states = [
|
||||
this.options = [
|
||||
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-square-o"></i></span>').appendTo(this.uiElement),
|
||||
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-check-square-o"></i></span>').appendTo(this.uiElement),
|
||||
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-minus-square-o"></i></span>').appendTo(this.uiElement)
|
||||
];
|
||||
if (initialState) {
|
||||
this.states[1].show();
|
||||
this.options[1].show();
|
||||
} else {
|
||||
this.states[0].show();
|
||||
this.options[0].show();
|
||||
}
|
||||
|
||||
this.element.on("change", function() {
|
||||
if (this.checked) {
|
||||
that.states[0].hide();
|
||||
that.states[1].show();
|
||||
that.states[2].hide();
|
||||
that.options[0].hide();
|
||||
that.options[1].show();
|
||||
that.options[2].hide();
|
||||
} else {
|
||||
that.states[1].hide();
|
||||
that.states[0].show();
|
||||
that.states[2].hide();
|
||||
that.options[1].hide();
|
||||
that.options[0].show();
|
||||
that.options[2].hide();
|
||||
}
|
||||
var isChecked = this.checked;
|
||||
that.children.forEach(function(child) {
|
||||
@@ -106,17 +106,17 @@
|
||||
var trueState = this.partialFlag||state;
|
||||
this.element.prop('checked',trueState);
|
||||
if (state === true) {
|
||||
this.states[0].hide();
|
||||
this.states[1].show();
|
||||
this.states[2].hide();
|
||||
this.options[0].hide();
|
||||
this.options[1].show();
|
||||
this.options[2].hide();
|
||||
} else if (state === false) {
|
||||
this.states[2].hide();
|
||||
this.states[1].hide();
|
||||
this.states[0].show();
|
||||
this.options[2].hide();
|
||||
this.options[1].hide();
|
||||
this.options[0].show();
|
||||
} else if (state === null) {
|
||||
this.states[0].hide();
|
||||
this.states[1].hide();
|
||||
this.states[2].show();
|
||||
this.options[0].hide();
|
||||
this.options[1].hide();
|
||||
this.options[2].show();
|
||||
}
|
||||
if (!suppressEvent) {
|
||||
this.element.trigger('change',null);
|
||||
|
@@ -73,7 +73,7 @@ RED.colorPicker = (function() {
|
||||
type:"text",
|
||||
value:colorHiddenInput.val()
|
||||
}).appendTo(row);
|
||||
var focusTarget = colorInput;
|
||||
|
||||
colorInput.on("change", function (e) {
|
||||
var color = colorInput.val();
|
||||
colorHiddenInput.val(color).trigger('change');
|
||||
@@ -188,14 +188,8 @@ RED.colorPicker = (function() {
|
||||
refreshDisplay(colorHiddenInput.val())
|
||||
},50);
|
||||
colorPanel.show({
|
||||
target: colorButton,
|
||||
onclose: function() {
|
||||
colorButton.focus();
|
||||
}
|
||||
target: colorButton
|
||||
})
|
||||
if (focusTarget) {
|
||||
focusTarget.focus();
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
refreshDisplay(colorHiddenInput.val())
|
||||
|
@@ -91,9 +91,6 @@
|
||||
if (v!=="auto" && v!=="") {
|
||||
that.topContainer.css(s,v);
|
||||
that.uiContainer.css(s,"0");
|
||||
if (s === "top" && that.options.header) {
|
||||
that.uiContainer.css(s,"20px")
|
||||
}
|
||||
that.element.css(s,'auto');
|
||||
}
|
||||
})
|
||||
|
@@ -84,7 +84,6 @@ RED.popover = (function() {
|
||||
var targetHeight = target.outerHeight();
|
||||
var divHeight = div.height();
|
||||
var divWidth = div.width();
|
||||
var paddingRight = 10;
|
||||
|
||||
var viewportTop = $(window).scrollTop();
|
||||
var viewportLeft = $(window).scrollLeft();
|
||||
@@ -106,7 +105,7 @@ RED.popover = (function() {
|
||||
d = "right";
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left+targetWidth+deltaSizes[size].leftRight;
|
||||
} else if (left+divWidth+paddingRight > viewportRight) {
|
||||
} else if (left+divWidth > viewportRight) {
|
||||
d = "left";
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left-deltaSizes[size].leftLeft-divWidth;
|
||||
@@ -367,7 +366,6 @@ RED.popover = (function() {
|
||||
|
||||
function hide(dispose) {
|
||||
$(document).off("mousedown.red-ui-popover-panel-close");
|
||||
$(document).off("keydown.red-ui-popover-panel-close");
|
||||
panel.hide();
|
||||
panel.css({
|
||||
height: "auto"
|
||||
@@ -409,16 +407,6 @@ RED.popover = (function() {
|
||||
}
|
||||
panel.slideDown(100);
|
||||
|
||||
$(document).on("keydown.red-ui-popover-panel-close", function(event) {
|
||||
if (event.keyCode === 27) {
|
||||
// ESCAPE
|
||||
if (closeCallback) {
|
||||
closeCallback();
|
||||
}
|
||||
hide(options.dispose);
|
||||
}
|
||||
});
|
||||
|
||||
$(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) {
|
||||
|
@@ -119,9 +119,6 @@
|
||||
if (evt.keyCode === 27) {
|
||||
that.element.val("");
|
||||
}
|
||||
if (evt.keyCode === 13) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
})
|
||||
this.element.on("keyup",function(evt) {
|
||||
that._change($(this).val());
|
||||
|
@@ -29,7 +29,7 @@ RED.tabs = (function() {
|
||||
var currentTabWidth;
|
||||
var currentActiveTabWidth = 0;
|
||||
var collapsibleMenu;
|
||||
var preferredOrder = options.order;
|
||||
|
||||
var ul = options.element || $("#"+options.id);
|
||||
var wrapper = ul.wrap( "<div>" ).parent();
|
||||
var scrollContainer = ul.wrap( "<div>" ).parent();
|
||||
@@ -132,11 +132,11 @@ RED.tabs = (function() {
|
||||
activateTab(id);
|
||||
}
|
||||
};
|
||||
// if (tabs[id].pinned) {
|
||||
// pinnedOptions.push(opt);
|
||||
// } else {
|
||||
if (tabs[id].pinned) {
|
||||
pinnedOptions.push(opt);
|
||||
} else {
|
||||
options.push(opt);
|
||||
// }
|
||||
}
|
||||
});
|
||||
options = pinnedOptions.concat(options);
|
||||
collapsibleMenu = RED.menu.init({options: options});
|
||||
@@ -363,39 +363,23 @@ RED.tabs = (function() {
|
||||
var tabWidth;
|
||||
|
||||
if (options.collapsible) {
|
||||
var availableCount = collapsedButtonsRow.children().length;
|
||||
var visibleCount = collapsedButtonsRow.children(":visible").length;
|
||||
tabWidth = width - collapsedButtonsRow.width()-10;
|
||||
var maxTabWidth = 198;
|
||||
var minTabWidth = 80;
|
||||
if (tabWidth <= minTabWidth || (tabWidth < maxTabWidth && visibleCount > 5)) {
|
||||
// The tab is too small. Hide the next button to make room
|
||||
// Start at the end of the button row, -1 for the menu button
|
||||
if (tabWidth < 198) {
|
||||
var delta = 198 - tabWidth;
|
||||
var b = collapsedButtonsRow.find("a:last").prev();
|
||||
var index = collapsedButtonsRow.children().length - 2;
|
||||
// Work backwards to find the first visible button
|
||||
while (b.is(":not(:visible)")) {
|
||||
b = b.prev();
|
||||
index--;
|
||||
}
|
||||
// If it isn't a pinned button, hide it to get the room
|
||||
if (tabWidth <= minTabWidth || visibleCount>6) {//}!b.hasClass("red-ui-tab-link-button-pinned")) {
|
||||
if (!b.hasClass("red-ui-tab-link-button-pinned")) {
|
||||
b.hide();
|
||||
}
|
||||
tabWidth = Math.max(minTabWidth,width - collapsedButtonsRow.width()-10);
|
||||
tabWidth = width - collapsedButtonsRow.width()-10;
|
||||
} else {
|
||||
if (visibleCount !== availableCount) {
|
||||
if (visibleCount < 6) {
|
||||
tabWidth = minTabWidth;
|
||||
} else {
|
||||
tabWidth = maxTabWidth;
|
||||
}
|
||||
}
|
||||
var space = width - tabWidth - collapsedButtonsRow.width();
|
||||
var space = width - 198 - collapsedButtonsRow.width();
|
||||
if (space > 40) {
|
||||
collapsedButtonsRow.find("a:not(:visible):first").show();
|
||||
tabWidth = width - collapsedButtonsRow.width()-10;
|
||||
}
|
||||
tabWidth = width - collapsedButtonsRow.width()-10;
|
||||
}
|
||||
tabs.css({width:tabWidth});
|
||||
|
||||
@@ -485,7 +469,7 @@ RED.tabs = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
var tabAPI = {
|
||||
return {
|
||||
addTab: function(tab,targetIndex) {
|
||||
if (options.onselect) {
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
@@ -547,93 +531,11 @@ RED.tabs = (function() {
|
||||
evt.preventDefault();
|
||||
activateTab(tab.id);
|
||||
});
|
||||
pinnedLink.data("tabId",tab.id)
|
||||
if (tab.pinned) {
|
||||
pinnedLink.addClass("red-ui-tab-link-button-pinned");
|
||||
pinnedTabsCount++;
|
||||
}
|
||||
RED.popover.tooltip($(pinnedLink), tab.name, tab.action);
|
||||
if (options.onreorder) {
|
||||
var pinnedLinkIndex;
|
||||
var pinnedLinks = [];
|
||||
var startPinnedIndex;
|
||||
pinnedLink.draggable({
|
||||
distance: 10,
|
||||
axis:"x",
|
||||
containment: ".red-ui-tab-link-buttons",
|
||||
start: function(event,ui) {
|
||||
dragActive = true;
|
||||
$(".red-ui-tab-link-buttons").width($(".red-ui-tab-link-buttons").width());
|
||||
if (dblClickArmed) { dblClickArmed = false; return false }
|
||||
collapsedButtonsRow.children().each(function(i) {
|
||||
pinnedLinks[i] = {
|
||||
el:$(this),
|
||||
text: $(this).text(),
|
||||
left: $(this).position().left,
|
||||
width: $(this).width(),
|
||||
menu: $(this).hasClass("red-ui-tab-link-button-menu")
|
||||
};
|
||||
if ($(this).is(pinnedLink)) {
|
||||
pinnedLinkIndex = i;
|
||||
startPinnedIndex = i;
|
||||
}
|
||||
});
|
||||
collapsedButtonsRow.children().each(function(i) {
|
||||
if (i!==pinnedLinkIndex) {
|
||||
$(this).css({
|
||||
position: 'absolute',
|
||||
left: pinnedLinks[i].left+"px",
|
||||
width: pinnedLinks[i].width+2,
|
||||
transition: "left 0.3s"
|
||||
});
|
||||
}
|
||||
})
|
||||
if (!pinnedLink.hasClass('active')) {
|
||||
pinnedLink.css({'zIndex':1});
|
||||
}
|
||||
},
|
||||
drag: function(event,ui) {
|
||||
ui.position.left += pinnedLinks[pinnedLinkIndex].left;
|
||||
var tabCenter = ui.position.left + pinnedLinks[pinnedLinkIndex].width/2;
|
||||
for (var i=0;i<pinnedLinks.length;i++) {
|
||||
if (i === pinnedLinkIndex || pinnedLinks[i].menu || pinnedLinks[i].el.is(":not(:visible)")) {
|
||||
continue;
|
||||
}
|
||||
if (tabCenter > pinnedLinks[i].left && tabCenter < pinnedLinks[i].left+pinnedLinks[i].width) {
|
||||
if (i < pinnedLinkIndex) {
|
||||
pinnedLinks[i].left += pinnedLinks[pinnedLinkIndex].width+8;
|
||||
pinnedLinks[pinnedLinkIndex].el.detach().insertBefore(pinnedLinks[i].el);
|
||||
} else {
|
||||
pinnedLinks[i].left -= pinnedLinks[pinnedLinkIndex].width+8;
|
||||
pinnedLinks[pinnedLinkIndex].el.detach().insertAfter(pinnedLinks[i].el);
|
||||
}
|
||||
pinnedLinks[i].el.css({left:pinnedLinks[i].left+"px"});
|
||||
|
||||
pinnedLinks.splice(i, 0, pinnedLinks.splice(pinnedLinkIndex, 1)[0]);
|
||||
|
||||
pinnedLinkIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
stop: function(event,ui) {
|
||||
dragActive = false;
|
||||
collapsedButtonsRow.children().css({position:"relative",left:"",transition:""});
|
||||
$(".red-ui-tab-link-buttons").width('auto');
|
||||
pinnedLink.css({zIndex:""});
|
||||
updateTabWidths();
|
||||
if (startPinnedIndex !== pinnedLinkIndex) {
|
||||
if (collapsibleMenu) {
|
||||
collapsibleMenu.remove();
|
||||
collapsibleMenu = null;
|
||||
}
|
||||
var newOrder = $.makeArray(collapsedButtonsRow.children().map(function() { return $(this).data('tabId');}));
|
||||
tabAPI.order(newOrder);
|
||||
options.onreorder(newOrder);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
link.on("mouseup",onTabClick);
|
||||
@@ -663,7 +565,7 @@ RED.tabs = (function() {
|
||||
if (ul.find("li.red-ui-tab").length == 1) {
|
||||
activateTab(link);
|
||||
}
|
||||
if (options.onreorder && !options.collapsible) {
|
||||
if (options.onreorder) {
|
||||
var originalTabOrder;
|
||||
var tabDragIndex;
|
||||
var tabElements = [];
|
||||
@@ -750,9 +652,6 @@ RED.tabs = (function() {
|
||||
collapsibleMenu.remove();
|
||||
collapsibleMenu = null;
|
||||
}
|
||||
if (preferredOrder) {
|
||||
tabAPI.order(preferredOrder);
|
||||
}
|
||||
},
|
||||
removeTab: removeTab,
|
||||
activateTab: activateTab,
|
||||
@@ -774,8 +673,10 @@ RED.tabs = (function() {
|
||||
},
|
||||
selection: getSelection,
|
||||
order: function(order) {
|
||||
preferredOrder = order;
|
||||
var existingTabOrder = $.makeArray(ul.children().map(function() { return $(this).data('tabId');}));
|
||||
if (existingTabOrder.length !== order.length) {
|
||||
return
|
||||
}
|
||||
var i;
|
||||
var match = true;
|
||||
for (i=0;i<order.length;i++) {
|
||||
@@ -791,41 +692,12 @@ RED.tabs = (function() {
|
||||
var existingTabs = ul.children().detach().each(function() {
|
||||
existingTabMap[$(this).data("tabId")] = $(this);
|
||||
});
|
||||
var pinnedButtons = {};
|
||||
if (options.collapsible) {
|
||||
collapsedButtonsRow.children().detach().each(function() {
|
||||
var id = $(this).data("tabId");
|
||||
if (!id) {
|
||||
id = "__menu__"
|
||||
}
|
||||
pinnedButtons[id] = $(this);
|
||||
});
|
||||
}
|
||||
for (i=0;i<order.length;i++) {
|
||||
if (existingTabMap[order[i]]) {
|
||||
existingTabMap[order[i]].appendTo(ul);
|
||||
if (options.collapsible) {
|
||||
pinnedButtons[order[i]].appendTo(collapsedButtonsRow);
|
||||
}
|
||||
delete existingTabMap[order[i]];
|
||||
}
|
||||
}
|
||||
// Add any tabs that aren't known in the order
|
||||
for (i in existingTabMap) {
|
||||
if (existingTabMap.hasOwnProperty(i)) {
|
||||
existingTabMap[i].appendTo(ul);
|
||||
if (options.collapsible) {
|
||||
pinnedButtons[i].appendTo(collapsedButtonsRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (options.collapsible) {
|
||||
pinnedButtons["__menu__"].appendTo(collapsedButtonsRow);
|
||||
updateTabWidths();
|
||||
existingTabMap[order[i]].appendTo(ul);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return tabAPI;
|
||||
}
|
||||
|
||||
return {
|
||||
|
@@ -37,8 +37,8 @@
|
||||
invertState = this.options.invertState;
|
||||
}
|
||||
var baseClass = this.options.baseClass || "red-ui-button";
|
||||
var enabledIcon = this.options.hasOwnProperty('enabledIcon')?this.options.enabledIcon : "fa-check-square-o";
|
||||
var disabledIcon = this.options.hasOwnProperty('disabledIcon')?this.options.disabledIcon : "fa-square-o";
|
||||
var enabledIcon = this.options.enabledIcon || "fa-check-square-o";
|
||||
var disabledIcon = this.options.disabledIcon || "fa-square-o";
|
||||
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");
|
||||
|
||||
@@ -46,41 +46,25 @@
|
||||
this.element.on("focus", function() {
|
||||
that.button.focus();
|
||||
});
|
||||
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"></button>');
|
||||
if (enabledLabel || disabledLabel) {
|
||||
this.buttonLabel = $("<span>").appendTo(this.button);
|
||||
}
|
||||
|
||||
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"><i class="fa"></i> <span></span></button>');
|
||||
if (this.options.class) {
|
||||
this.button.addClass(this.options.class)
|
||||
}
|
||||
this.element.after(this.button);
|
||||
|
||||
if (enabledIcon && disabledIcon) {
|
||||
this.buttonIcon = $('<i class="fa"></i>').prependTo(this.button);
|
||||
}
|
||||
this.buttonIcon = this.button.find("i");
|
||||
this.buttonLabel = this.button.find("span");
|
||||
|
||||
// Quick hack to find the maximum width of the button
|
||||
this.button.addClass("selected");
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.addClass(enabledIcon);
|
||||
}
|
||||
if (this.buttonLabel) {
|
||||
this.buttonLabel.text(enabledLabel);
|
||||
}
|
||||
this.buttonIcon.addClass(enabledIcon);
|
||||
this.buttonLabel.text(enabledLabel);
|
||||
var width = this.button.width();
|
||||
this.button.removeClass("selected");
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.removeClass(enabledIcon);
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
}
|
||||
if (this.buttonLabel) {
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
}
|
||||
this.buttonIcon.removeClass(enabledIcon);
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
width = Math.max(width,this.button.width());
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.removeClass(disabledIcon);
|
||||
}
|
||||
this.buttonIcon.removeClass(disabledIcon);
|
||||
|
||||
// Fix the width of the button so it doesn't jump around when toggled
|
||||
if (width > 0) {
|
||||
@@ -89,7 +73,7 @@
|
||||
|
||||
this.button.on("click",function(e) {
|
||||
e.stopPropagation();
|
||||
if (!that.state) {
|
||||
if (that.buttonIcon.hasClass(disabledIcon)) {
|
||||
that.element.prop("checked",!invertState);
|
||||
} else {
|
||||
that.element.prop("checked",invertState);
|
||||
@@ -100,24 +84,14 @@
|
||||
this.element.on("change", function(e) {
|
||||
if ($(this).prop("checked") !== invertState) {
|
||||
that.button.addClass("selected");
|
||||
that.state = true;
|
||||
if (that.buttonIcon) {
|
||||
that.buttonIcon.addClass(enabledIcon);
|
||||
that.buttonIcon.removeClass(disabledIcon);
|
||||
}
|
||||
if (that.buttonLabel) {
|
||||
that.buttonLabel.text(enabledLabel);
|
||||
}
|
||||
that.buttonIcon.addClass(enabledIcon);
|
||||
that.buttonIcon.removeClass(disabledIcon);
|
||||
that.buttonLabel.text(enabledLabel);
|
||||
} else {
|
||||
that.button.removeClass("selected");
|
||||
that.state = false;
|
||||
if (that.buttonIcon) {
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
that.buttonIcon.removeClass(enabledIcon);
|
||||
}
|
||||
if (that.buttonLabel) {
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
}
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
that.buttonIcon.removeClass(enabledIcon);
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
}
|
||||
})
|
||||
this.element.trigger("change");
|
||||
|
@@ -167,7 +167,7 @@
|
||||
this._selected = new Set();
|
||||
this._topList = $('<ol class="red-ui-treeList-list">').css({
|
||||
position:'absolute',
|
||||
top:0,
|
||||
top: 0,
|
||||
left:0,
|
||||
right:0,
|
||||
bottom:0
|
||||
@@ -181,9 +181,6 @@
|
||||
that._addSubtree(that._topList,container,item,0);
|
||||
}
|
||||
};
|
||||
if (this.options.header) {
|
||||
topListOptions.header = this.options.header;
|
||||
}
|
||||
if (this.options.rootSortable !== false && !!this.options.sortable) {
|
||||
topListOptions.sortable = this.options.sortable;
|
||||
topListOptions.connectWith = '.red-ui-treeList-sortable';
|
||||
|
@@ -173,7 +173,6 @@
|
||||
valueLabel: function(container,value) {
|
||||
var that = this;
|
||||
container.css("pointer-events","none");
|
||||
container.css("flex-grow",0);
|
||||
this.elementDiv.hide();
|
||||
var buttons = $('<div>').css({
|
||||
position: "absolute",
|
||||
@@ -185,25 +184,22 @@
|
||||
width:"20px"
|
||||
}).appendTo(buttons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
var cursorPosition = that.input[0].selectionStart;
|
||||
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();
|
||||
that.input[0].setSelectionRange(cursorPosition, cursorPosition);
|
||||
},50);
|
||||
} else {
|
||||
that.input.attr("type","text");
|
||||
eyeCon.removeClass("fa-eye").addClass("fa-eye-slash");
|
||||
setTimeout(function() {
|
||||
that.input.focus();
|
||||
that.input[0].setSelectionRange(cursorPosition, cursorPosition);
|
||||
},50);
|
||||
}
|
||||
}).hide();
|
||||
var eyeCon = $('<i class="fa fa-eye"></i>').css("margin-left","-2px").appendTo(eyeButton);
|
||||
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({
|
||||
@@ -288,7 +284,7 @@
|
||||
this.input.css('width','100%');
|
||||
this.uiSelect.width(m[1]);
|
||||
this.uiWidth = null;
|
||||
} else if (this.uiWidth !== 0){
|
||||
} else {
|
||||
this.uiSelect.width(this.uiWidth);
|
||||
}
|
||||
["Right","Left"].forEach(function(d) {
|
||||
@@ -308,11 +304,7 @@
|
||||
|
||||
this.element.attr('type','hidden');
|
||||
|
||||
if (!this.options.types && this.options.type) {
|
||||
this.options.types = [this.options.type]
|
||||
} else {
|
||||
this.options.types = this.options.types||Object.keys(allOptions);
|
||||
}
|
||||
this.options.types = this.options.types||Object.keys(allOptions);
|
||||
|
||||
this.selectTrigger = $('<button class="red-ui-typedInput-type-select" tabindex="0"></button>').prependTo(this.uiSelect);
|
||||
$('<i class="red-ui-typedInput-icon fa fa-caret-down"></i>').toggle(this.options.types.length > 1).appendTo(this.selectTrigger);
|
||||
@@ -880,9 +872,6 @@
|
||||
this.elementDiv.hide();
|
||||
this.valueLabelContainer.hide();
|
||||
} else if (opt.valueLabel) {
|
||||
// Reset any CSS the custom label may have set
|
||||
this.valueLabelContainer.css("pointer-events","");
|
||||
this.valueLabelContainer.css("flex-grow",1);
|
||||
this.valueLabelContainer.show();
|
||||
this.valueLabelContainer.empty();
|
||||
this.elementDiv.hide();
|
||||
@@ -965,18 +954,6 @@
|
||||
},
|
||||
hide: function() {
|
||||
this.uiSelect.hide();
|
||||
},
|
||||
disable: function(val) {
|
||||
if(val === true) {
|
||||
this.uiSelect.attr("disabled", "disabled");
|
||||
} else if (val === false) {
|
||||
this.uiSelect.attr("disabled", null); //remove attr
|
||||
} else {
|
||||
this.uiSelect.attr("disabled", val); //user value
|
||||
}
|
||||
},
|
||||
disabled: function() {
|
||||
return this.uiSelect.attr("disabled");
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
@@ -1411,7 +1411,7 @@ RED.diff = (function() {
|
||||
// Restore the original flow so subsequent merge resolutions can properly
|
||||
// identify new-vs-old
|
||||
RED.nodes.originalFlow(originalFlow);
|
||||
imported.nodes.forEach(function(n) {
|
||||
imported[0].forEach(function(n) {
|
||||
if (nodeChangedStates[n.id] || localChangedStates[n.id]) {
|
||||
n.changed = true;
|
||||
}
|
||||
|
@@ -1630,7 +1630,6 @@ RED.editor = (function() {
|
||||
show: function() {
|
||||
if (editing_node) {
|
||||
RED.sidebar.info.refresh(editing_node);
|
||||
RED.sidebar.help.show(editing_node.type, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1837,7 +1836,6 @@ RED.editor = (function() {
|
||||
show: function() {
|
||||
if (editing_config_node) {
|
||||
RED.sidebar.info.refresh(editing_config_node);
|
||||
RED.sidebar.help.show(type, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2724,7 +2722,7 @@ RED.editor = (function() {
|
||||
if (options.globals) {
|
||||
setTimeout(function() {
|
||||
if (!!session.$worker) {
|
||||
session.$worker.send("setOptions", [{globals: options.globals, maxerr:1000}]);
|
||||
session.$worker.send("setOptions", [{globals: options.globals, esversion:6, sub:true, asi:true, maxerr:1000}]);
|
||||
}
|
||||
},100);
|
||||
}
|
||||
@@ -2788,13 +2786,7 @@ RED.editor = (function() {
|
||||
editExpression: function(options) { showTypeEditor("_expression", options) },
|
||||
editJSON: function(options) { showTypeEditor("_json", options) },
|
||||
editMarkdown: function(options) { showTypeEditor("_markdown", options) },
|
||||
editText: function(options) {
|
||||
if (options.mode == "markdown") {
|
||||
showTypeEditor("_markdown", options)
|
||||
} else {
|
||||
showTypeEditor("_text", options)
|
||||
}
|
||||
},
|
||||
editText: function(options) { showTypeEditor("_text", options) },
|
||||
editBuffer: function(options) { showTypeEditor("_buffer", options) },
|
||||
buildEditForm: buildEditForm,
|
||||
validateNode: validateNode,
|
||||
|
@@ -82,15 +82,12 @@ RED.group = (function() {
|
||||
colorPalette.push('#'+'000000'.slice(0, 6-s.length)+s);
|
||||
}
|
||||
|
||||
var defaultGroupStyle = {
|
||||
label: true,
|
||||
"label-position": "nw"
|
||||
};
|
||||
var defaultGroupStyle = {};
|
||||
|
||||
var groupDef = {
|
||||
defaults:{
|
||||
name:{value:""},
|
||||
style:{value:{label:true}},
|
||||
style:{value:{}},
|
||||
nodes:{value:[]}
|
||||
},
|
||||
category: "config",
|
||||
@@ -98,25 +95,25 @@ RED.group = (function() {
|
||||
var style = this.style || {};
|
||||
RED.colorPicker.create({
|
||||
id:"node-input-style-stroke",
|
||||
value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4",
|
||||
value: style.stroke || "#a4a4a4",
|
||||
palette: colorPalette,
|
||||
cellPerRow: colorCount,
|
||||
cellWidth: 16,
|
||||
cellHeight: 16,
|
||||
cellMargin: 3,
|
||||
none: true,
|
||||
opacity: style.hasOwnProperty('stroke-opacity')?style['stroke-opacity']:(defaultGroupStyle.hasOwnProperty('stroke-opacity')?defaultGroupStyle['stroke-opacity']:1.0)
|
||||
opacity: style['stroke-opacity'] || 1.0
|
||||
}).appendTo("#node-input-row-style-stroke");
|
||||
RED.colorPicker.create({
|
||||
id:"node-input-style-fill",
|
||||
value: style.fill || defaultGroupStyle.fill ||"none",
|
||||
value: style.fill || "none",
|
||||
palette: colorPalette,
|
||||
cellPerRow: colorCount,
|
||||
cellWidth: 16,
|
||||
cellHeight: 16,
|
||||
cellMargin: 3,
|
||||
none: true,
|
||||
opacity: style.hasOwnProperty('fill-opacity')?style['fill-opacity']:(defaultGroupStyle.hasOwnProperty('fill-opacity')?defaultGroupStyle['fill-opacity']:1.0)
|
||||
opacity: style['fill-opacity'] || 1.0
|
||||
}).appendTo("#node-input-row-style-fill");
|
||||
|
||||
createLayoutPicker({
|
||||
@@ -126,7 +123,7 @@ RED.group = (function() {
|
||||
|
||||
RED.colorPicker.create({
|
||||
id:"node-input-style-color",
|
||||
value: style.color || defaultGroupStyle.color ||"#a4a4a4",
|
||||
value: style.color || "#a4a4a4",
|
||||
palette: colorPalette,
|
||||
cellPerRow: colorCount,
|
||||
cellWidth: 16,
|
||||
@@ -136,9 +133,10 @@ RED.group = (function() {
|
||||
|
||||
$("#node-input-style-label").toggleButton({
|
||||
enabledLabel: RED._("editor.show"),
|
||||
disabledLabel: RED._("editor.show"),
|
||||
disabledLabel: RED._("editor.hide")
|
||||
})
|
||||
|
||||
|
||||
$("#node-input-style-label").on("change", function(evt) {
|
||||
$("#node-input-row-style-label-options").toggle($(this).prop("checked"));
|
||||
})
|
||||
@@ -162,13 +160,12 @@ RED.group = (function() {
|
||||
delete this.style.color;
|
||||
}
|
||||
|
||||
var node = this;
|
||||
['stroke','fill','stroke-opacity','fill-opacity','color','label-position'].forEach(function(prop) {
|
||||
if (node.style[prop] === defaultGroupStyle[prop]) {
|
||||
delete node.style[prop]
|
||||
}
|
||||
})
|
||||
|
||||
if (this.style["stroke-opacity"] === "1") {
|
||||
delete this.style["stroke-opacity"]
|
||||
}
|
||||
if (this.style["fill-opacity"] === "1") {
|
||||
delete this.style["fill-opacity"]
|
||||
}
|
||||
this.resize = true;
|
||||
},
|
||||
set:{
|
||||
@@ -220,18 +217,9 @@ RED.group = (function() {
|
||||
stroke: convertColorToHex(groupStyle.stroke),
|
||||
"stroke-opacity": groupStyle.strokeOpacity,
|
||||
fill: convertColorToHex(groupStyle.fill),
|
||||
"fill-opacity": groupStyle.fillOpacity,
|
||||
label: true,
|
||||
"label-position": "nw"
|
||||
"fill-opacity": groupStyle.fillOpacity
|
||||
}
|
||||
groupStyleDiv.remove();
|
||||
groupStyleDiv = $("<div>",{
|
||||
class:"red-ui-flow-group-label",
|
||||
style: "position: absolute; top: -1000px;"
|
||||
}).appendTo(document.body);
|
||||
groupStyle = getComputedStyle(groupStyleDiv[0]);
|
||||
defaultGroupStyle.color = convertColorToHex(groupStyle.fill);
|
||||
groupStyleDiv.remove();
|
||||
}
|
||||
|
||||
function convertColorToHex(c) {
|
||||
@@ -247,7 +235,6 @@ RED.group = (function() {
|
||||
var groupStyleClipboard;
|
||||
|
||||
function copyGroupStyle() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes && selection.nodes.length === 1 && selection.nodes[0].type === 'group') {
|
||||
groupStyleClipboard = JSON.parse(JSON.stringify(selection.nodes[0].style));
|
||||
@@ -255,7 +242,6 @@ RED.group = (function() {
|
||||
}
|
||||
}
|
||||
function pasteGroupStyle() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
if (groupStyleClipboard) {
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
@@ -289,7 +275,6 @@ RED.group = (function() {
|
||||
}
|
||||
|
||||
function groupSelection() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
var group = createGroup(selection.nodes);
|
||||
@@ -306,7 +291,6 @@ RED.group = (function() {
|
||||
}
|
||||
}
|
||||
function ungroupSelection() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
var newSelection = [];
|
||||
@@ -355,7 +339,8 @@ RED.group = (function() {
|
||||
}
|
||||
|
||||
function mergeSelection() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
// TODO: this currently creates an entirely new group. Need to merge properties
|
||||
// of any existing group
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
var nodes = [];
|
||||
@@ -383,16 +368,11 @@ RED.group = (function() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var existingGroup;
|
||||
|
||||
// Second pass, ungroup any groups in the selection and add their contents
|
||||
// to the selection
|
||||
for (var i=0; i<selection.nodes.length; i++) {
|
||||
n = selection.nodes[i];
|
||||
if (n.type === "group") {
|
||||
if (!existingGroup) {
|
||||
existingGroup = n;
|
||||
}
|
||||
ungroupHistoryEvent.groups.push(n);
|
||||
nodes = nodes.concat(ungroup(n));
|
||||
} else {
|
||||
@@ -406,10 +386,6 @@ RED.group = (function() {
|
||||
// Finally, create the new group
|
||||
var group = createGroup(nodes);
|
||||
if (group) {
|
||||
if (existingGroup) {
|
||||
group.style = existingGroup.style;
|
||||
group.name = existingGroup.name;
|
||||
}
|
||||
RED.view.select({nodes:[group]})
|
||||
}
|
||||
historyEvent.events.push({
|
||||
@@ -423,7 +399,6 @@ RED.group = (function() {
|
||||
}
|
||||
|
||||
function removeSelection() {
|
||||
if (RED.view.state() !== RED.state.DEFAULT) { return }
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
var nodes = [];
|
||||
@@ -640,14 +615,14 @@ RED.group = (function() {
|
||||
var row = null;
|
||||
|
||||
row = $("<div/>").appendTo(picker);
|
||||
var currentButton;
|
||||
|
||||
for (var y=0;y<2;y++) { //red-ui-group-layout-text-pos
|
||||
var yComponent= "ns"[y];
|
||||
row = $("<div/>").appendTo(picker);
|
||||
for (var x=0;x<3;x++) {
|
||||
var xComponent = ["w","","e"][x];
|
||||
var val = yComponent+xComponent;
|
||||
var button = $("<button/>", { class:"red-ui-search-result-node red-ui-button","data-pos":val }).appendTo(row);
|
||||
var button = $("<button/>", { class:"red-ui-search-result-node","data-pos":val }).appendTo(row);
|
||||
button.on("click", function (e) {
|
||||
e.preventDefault();
|
||||
layoutHiddenInput.val($(this).data("pos"));
|
||||
@@ -655,22 +630,15 @@ RED.group = (function() {
|
||||
refreshDisplay();
|
||||
});
|
||||
$('<div>',{class:"red-ui-group-layout-picker-cell-text red-ui-group-layout-text-pos-"+val}).appendTo(button);
|
||||
if (val === layoutHiddenInput.val()) {
|
||||
currentButton = button;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
refreshDisplay();
|
||||
var layoutPanel = RED.popover.panel(picker);
|
||||
layoutPanel.show({
|
||||
target: layoutButton,
|
||||
onclose: function() {
|
||||
layoutButton.focus();
|
||||
}
|
||||
});
|
||||
if (currentButton) {
|
||||
currentButton.focus();
|
||||
}
|
||||
target: layoutButton
|
||||
})
|
||||
})
|
||||
|
||||
refreshDisplay();
|
||||
|
@@ -17,8 +17,6 @@ RED.keyboard = (function() {
|
||||
|
||||
var isMac = /Mac/i.test(window.navigator.platform);
|
||||
|
||||
var handlersActive = true;
|
||||
|
||||
var handlers = {};
|
||||
var partialState;
|
||||
|
||||
@@ -70,11 +68,6 @@ RED.keyboard = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
function getUserKey(action) {
|
||||
var currentEditorSettings = RED.settings.get('editor') || {};
|
||||
var userKeymap = currentEditorSettings.keymap || {};
|
||||
return userKeymap[action];
|
||||
}
|
||||
function init() {
|
||||
// Migrate from pre-0.18
|
||||
migrateOldKeymap();
|
||||
@@ -232,9 +225,6 @@ RED.keyboard = (function() {
|
||||
}
|
||||
}
|
||||
d3.select(window).on("keydown",function() {
|
||||
if (!handlersActive) {
|
||||
return;
|
||||
}
|
||||
if (metaKeyCodes[d3.event.keyCode]) {
|
||||
return;
|
||||
}
|
||||
@@ -260,19 +250,6 @@ RED.keyboard = (function() {
|
||||
var i=0;
|
||||
if (typeof key === 'string') {
|
||||
if (typeof cbdown === 'string') {
|
||||
if (!ondown && !defaultKeyMap.hasOwnProperty(cbdown)) {
|
||||
defaultKeyMap[cbdown] = {
|
||||
scope:scope,
|
||||
key:key,
|
||||
user:false
|
||||
}
|
||||
}
|
||||
if (!ondown) {
|
||||
var userAction = getUserKey(cbdown);
|
||||
if (userAction) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
actionToKeyMap[cbdown] = {scope:scope,key:key};
|
||||
if (typeof ondown === 'boolean') {
|
||||
actionToKeyMap[cbdown].user = ondown;
|
||||
@@ -435,9 +412,11 @@ RED.keyboard = (function() {
|
||||
});
|
||||
revertButton.on("click", function(e) {
|
||||
e.stopPropagation();
|
||||
RED.keyboard.revertToDefault(object.id);
|
||||
container.empty();
|
||||
container.removeClass('keyboard-shortcut-entry-expanded');
|
||||
// var userKeymap = RED.settings.get('keymap') || {};
|
||||
var shortcut = RED.keyboard.getShortcut(object.id);
|
||||
var userKeymap = RED.settings.get('keymap') || {};
|
||||
|
||||
var currentEditorSettings = RED.settings.get('editor') || {};
|
||||
var userKeymap = currentEditorSettings.keymap || {};
|
||||
@@ -445,9 +424,6 @@ RED.keyboard = (function() {
|
||||
currentEditorSettings.keymap = userKeymap;
|
||||
RED.settings.set('editor',currentEditorSettings);
|
||||
|
||||
RED.keyboard.revertToDefault(object.id);
|
||||
|
||||
var shortcut = RED.keyboard.getShortcut(object.id);
|
||||
var obj = {
|
||||
id:object.id,
|
||||
scope:shortcut?shortcut.scope:undefined,
|
||||
@@ -594,13 +570,6 @@ RED.keyboard = (function() {
|
||||
return pane;
|
||||
}
|
||||
|
||||
function enable() {
|
||||
handlersActive = true;
|
||||
}
|
||||
function disable() {
|
||||
handlersActive = false;
|
||||
}
|
||||
|
||||
return {
|
||||
init: init,
|
||||
add: addHandler,
|
||||
@@ -608,12 +577,9 @@ RED.keyboard = (function() {
|
||||
getShortcut: function(actionName) {
|
||||
return actionToKeyMap[actionName];
|
||||
},
|
||||
getUserShortcut: getUserKey,
|
||||
revertToDefault: revertToDefault,
|
||||
formatKey: formatKey,
|
||||
validateKey: validateKey,
|
||||
disable: disable,
|
||||
enable: enable
|
||||
validateKey: validateKey
|
||||
}
|
||||
|
||||
})();
|
||||
|
@@ -472,8 +472,6 @@ RED.library = (function() {
|
||||
autoOpen: false,
|
||||
width: 800,
|
||||
resizable: false,
|
||||
open: function( event, ui ) { RED.keyboard.disable() },
|
||||
close: function( event, ui ) { RED.keyboard.enable() },
|
||||
classes: {
|
||||
"ui-dialog": "red-ui-editor-dialog",
|
||||
"ui-dialog-titlebar-close": "hide",
|
||||
@@ -558,11 +556,9 @@ RED.library = (function() {
|
||||
}
|
||||
],
|
||||
open: function(e) {
|
||||
RED.keyboard.disable();
|
||||
$(this).parent().find(".ui-dialog-titlebar-close").hide();
|
||||
},
|
||||
close: function(e) {
|
||||
RED.keyboard.enable();
|
||||
if (libraryEditor) {
|
||||
libraryEditor.destroy();
|
||||
libraryEditor = null;
|
||||
|
@@ -542,6 +542,8 @@ RED.palette.editor = (function() {
|
||||
return settingsPane;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createSettingsPane() {
|
||||
settingsPane = $('<div id="red-ui-settings-tab-palette"></div>');
|
||||
var content = $('<div id="red-ui-palette-editor">'+
|
||||
@@ -572,11 +574,7 @@ RED.palette.editor = (function() {
|
||||
minimumActiveTabWidth: 110
|
||||
});
|
||||
|
||||
createNodeTab(content);
|
||||
createInstallTab(content);
|
||||
}
|
||||
|
||||
function createNodeTab(content) {
|
||||
var modulesTab = $('<div>',{class:"red-ui-palette-editor-tab"}).appendTo(content);
|
||||
|
||||
editorTabs.addTab({
|
||||
@@ -728,9 +726,9 @@ RED.palette.editor = (function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createInstallTab(content) {
|
||||
|
||||
|
||||
var installTab = $('<div>',{class:"red-ui-palette-editor-tab hide"}).appendTo(content);
|
||||
|
||||
editorTabs.addTab({
|
||||
@@ -763,6 +761,7 @@ RED.palette.editor = (function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('<span>').text(RED._("palette.editor.sort")+' ').appendTo(toolBar);
|
||||
var sortGroup = $('<span class="button-group"></span>').appendTo(toolBar);
|
||||
var sortRelevance = $('<a href="#" class="red-ui-palette-editor-install-sort-option red-ui-sidebar-header-button-toggle selected"><i class="fa fa-sort-amount-desc"></i></a>').appendTo(sortGroup);
|
||||
@@ -796,7 +795,6 @@ RED.palette.editor = (function() {
|
||||
loadedIndex = {};
|
||||
initInstallTab();
|
||||
})
|
||||
RED.popover.tooltip(refreshButton,RED._("palette.editor.refresh"));
|
||||
|
||||
packageList = $('<ol>',{style:"position: absolute;top: 79px;bottom: 0;left: 0;right: 0px;"}).appendTo(installTab).editableList({
|
||||
addButton: false,
|
||||
@@ -880,87 +878,8 @@ RED.palette.editor = (function() {
|
||||
}
|
||||
});
|
||||
|
||||
if (RED.settings.theme('palette.upload') !== false) {
|
||||
var uploadSpan = $('<span class="button-group">').prependTo(toolBar);
|
||||
var uploadButton = $('<button type="button" class="red-ui-sidebar-header-button red-ui-palette-editor-upload-button"><label><i class="fa fa-upload"></i><form id="red-ui-palette-editor-upload-form" enctype="multipart/form-data"><input name="tarball" type="file" accept=".tgz"></label></button>').appendTo(uploadSpan);
|
||||
|
||||
var uploadInput = uploadButton.find('input[type="file"]');
|
||||
uploadInput.on("change", function(evt) {
|
||||
if (this.files.length > 0) {
|
||||
uploadFilenameLabel.text(this.files[0].name)
|
||||
uploadToolbar.slideDown(200);
|
||||
}
|
||||
})
|
||||
|
||||
var uploadToolbar = $('<div class="red-ui-palette-editor-upload"></div>').appendTo(installTab);
|
||||
var uploadForm = $('<div>').appendTo(uploadToolbar);
|
||||
var uploadFilename = $('<div class="placeholder-input"><i class="fa fa-upload"></i> </div>').appendTo(uploadForm);
|
||||
var uploadFilenameLabel = $('<span></span>').appendTo(uploadFilename);
|
||||
var uploadButtons = $('<div class="red-ui-palette-editor-upload-buttons"></div>').appendTo(uploadForm);
|
||||
$('<button class="editor-button"></button>').text(RED._("common.label.cancel")).appendTo(uploadButtons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
uploadToolbar.slideUp(200);
|
||||
uploadInput.val("");
|
||||
});
|
||||
$('<button class="editor-button primary"></button>').text(RED._("common.label.upload")).appendTo(uploadButtons).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
var spinner = RED.utils.addSpinnerOverlay(uploadToolbar, true);
|
||||
var buttonRow = $('<div style="position: relative;bottom: calc(50% + 17px); padding-right: 10px;text-align: right;"></div>').appendTo(spinner);
|
||||
$('<button class="red-ui-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+uploadInput[0].files[0].name);
|
||||
|
||||
var data = new FormData();
|
||||
data.append("tarball",uploadInput[0].files[0]);
|
||||
var filename = uploadInput[0].files[0].name;
|
||||
$.ajax({
|
||||
url: 'nodes',
|
||||
data: data,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
method: 'POST',
|
||||
}).always(function(data,textStatus,xhr) {
|
||||
spinner.remove();
|
||||
uploadInput.val("");
|
||||
uploadToolbar.slideUp(200);
|
||||
}).fail(function(xhr,textStatus,err) {
|
||||
var message = textStatus;
|
||||
if (xhr.responseJSON) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
var notification = RED.notify(RED._('palette.editor.errors.installFailed',{module: filename,message:message}),{
|
||||
type: 'error',
|
||||
modal: true,
|
||||
fixed: true,
|
||||
buttons: [
|
||||
{
|
||||
text: RED._("common.label.close"),
|
||||
click: function() {
|
||||
notification.close();
|
||||
}
|
||||
},{
|
||||
text: RED._("eventLog.view"),
|
||||
click: function() {
|
||||
notification.close();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
uploadInput.val("");
|
||||
uploadToolbar.slideUp(200);
|
||||
})
|
||||
})
|
||||
RED.popover.tooltip(uploadButton,RED._("palette.editor.upload"));
|
||||
}
|
||||
|
||||
$('<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,url,container,done) {
|
||||
if (RED.settings.theme('palette.editable') === false) {
|
||||
done(new Error('Palette not editable'));
|
||||
|
@@ -417,8 +417,7 @@ RED.palette = (function() {
|
||||
RED.workspaces.show(nt.substring(8));
|
||||
e.preventDefault();
|
||||
});
|
||||
var subflow = RED.nodes.subflow(nt.substring(8));
|
||||
nodeInfo = RED.utils.renderMarkdown(subflow.info||"");
|
||||
nodeInfo = RED.utils.renderMarkdown(def.info||"");
|
||||
}
|
||||
setLabel(nt,d,label,nodeInfo);
|
||||
|
||||
|
@@ -166,42 +166,34 @@ RED.projects.settings = (function() {
|
||||
description.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
||||
}
|
||||
|
||||
function editSummary(activeProject, summary, container, version, versionContainer) {
|
||||
function editSummary(activeProject, summary, container) {
|
||||
var editButton = container.prev();
|
||||
editButton.hide();
|
||||
container.empty();
|
||||
versionContainer.empty();
|
||||
var bg = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').appendTo(container);
|
||||
var input = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(summary||"").appendTo(container);
|
||||
var versionInput = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(version||"").appendTo(versionContainer);
|
||||
|
||||
$('<button class="red-ui-button">' + RED._("common.label.cancel") + '</button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
updateProjectSummary(activeProject.summary, container);
|
||||
updateProjectVersion(activeProject.version, versionContainer);
|
||||
editButton.show();
|
||||
});
|
||||
$('<button class="red-ui-button">' + RED._("common.label.save") + '</button>')
|
||||
.appendTo(bg)
|
||||
.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
var newSummary = input.val();
|
||||
var newVersion = versionInput.val();
|
||||
updateProjectSummary(newSummary, container);
|
||||
updateProjectVersion(newVersion, versionContainer);
|
||||
var spinner = utils.addSpinnerOverlay(container).addClass('red-ui-component-spinner-contain');
|
||||
var v = input.val();
|
||||
updateProjectSummary(v, container);
|
||||
var spinner = utils.addSpinnerOverlay(container);
|
||||
var done = function(err,res) {
|
||||
if (err) {
|
||||
spinner.remove();
|
||||
return editSummary(activeProject, summary, container, version, versionContainer);
|
||||
return editSummary(activeProject, summary, container);
|
||||
}
|
||||
activeProject.summary = newSummary;
|
||||
activeProject.version = newVersion;
|
||||
activeProject.summary = v;
|
||||
spinner.remove();
|
||||
updateProjectSummary(activeProject.summary, container);
|
||||
updateProjectVersion(activeProject.version, versionContainer);
|
||||
editButton.show();
|
||||
}
|
||||
utils.sendRequest({
|
||||
@@ -222,39 +214,31 @@ RED.projects.settings = (function() {
|
||||
}
|
||||
},
|
||||
}
|
||||
},{summary:newSummary, version: newVersion});
|
||||
},{summary:v});
|
||||
});
|
||||
}
|
||||
function updateProjectSummary(summary, container) {
|
||||
container.empty();
|
||||
if (summary) {
|
||||
container.text(summary).removeClass('red-ui-help-info-none');
|
||||
container.text(summary).removeClass('node-info-node');
|
||||
} else {
|
||||
container.text(RED._("sidebar.project.noSummaryAvailable")).addClass('red-ui-help-info-none');
|
||||
}
|
||||
}
|
||||
function updateProjectVersion(version, container) {
|
||||
container.empty();
|
||||
if (version) {
|
||||
container.text(version);
|
||||
}
|
||||
}
|
||||
|
||||
function createMainPane(activeProject) {
|
||||
|
||||
var pane = $('<div id="red-ui-project-settings-tab-main" class="red-ui-project-settings-tab-pane red-ui-help"></div>');
|
||||
$('<h1>').text(activeProject.name).appendTo(pane);
|
||||
var summary = $('<div style="position: relative">').appendTo(pane);
|
||||
var summaryContent = $('<div></div>').appendTo(summary);
|
||||
var versionContent = $('<div></div>').addClass('red-ui-help-info-none').appendTo(summary);
|
||||
updateProjectSummary(activeProject.summary, summaryContent);
|
||||
updateProjectVersion(activeProject.version, versionContent);
|
||||
|
||||
if (RED.user.hasPermission("projects.write")) {
|
||||
$('<button class="red-ui-button red-ui-button-small" style="float: right;">' + RED._('sidebar.project.editDescription') + '</button>')
|
||||
.prependTo(summary)
|
||||
.on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
editSummary(activeProject, activeProject.summary, summaryContent, activeProject.version, versionContent);
|
||||
editSummary(activeProject, activeProject.summary, summaryContent);
|
||||
});
|
||||
}
|
||||
$('<hr>').appendTo(pane);
|
||||
@@ -1033,7 +1017,7 @@ RED.projects.settings = (function() {
|
||||
|
||||
var credentialSecretExistingRow = $('<div class="red-ui-settings-row red-ui-settings-row-credentials"></div>').appendTo(credentialFormRows);
|
||||
$('<label for=""></label>').text(RED._("sidebar.project.projectSettings.currentKey")).appendTo(credentialSecretExistingRow);
|
||||
var credentialSecretExistingInput = $('<input type="text">').appendTo(credentialSecretExistingRow).typedInput({type:"cred"})
|
||||
var credentialSecretExistingInput = $('<input type="password">').appendTo(credentialSecretExistingRow)
|
||||
.on("change keyup paste",function() {
|
||||
if (popover) {
|
||||
popover.close();
|
||||
@@ -1046,7 +1030,7 @@ RED.projects.settings = (function() {
|
||||
|
||||
|
||||
$('<label for=""></label>').text(RED._("sidebar.project.projectSettings.newKey")).appendTo(credentialSecretNewRow);
|
||||
var credentialSecretNewInput = $('<input type="text">').appendTo(credentialSecretNewRow).typedInput({type:"cred"}).on("change keyup paste",checkFiles);
|
||||
var credentialSecretNewInput = $('<input type="password">').appendTo(credentialSecretNewRow).on("change keyup paste",checkFiles);
|
||||
|
||||
var credentialResetWarning = $('<div class="form-tips form-warning" style="margin: 10px;"><i class="fa fa-warning"></i>' + RED._("sidebar.project.projectSettings.credentialsAlert") + '</div>').hide().appendTo(credentialFormRows);
|
||||
|
||||
@@ -1589,6 +1573,8 @@ RED.projects.settings = (function() {
|
||||
updateForm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createSettingsPane(activeProject) {
|
||||
var pane = $('<div id="red-ui-project-settings-tab-settings" class="red-ui-project-settings-tab-pane red-ui-help"></div>');
|
||||
createFilesSection(activeProject,pane);
|
||||
|
@@ -38,34 +38,13 @@ RED.projects.userSettings = (function() {
|
||||
$('<label for="user-settings-gitconfig-email"></label>').text(RED._("editor:sidebar.project.userSettings.email")).appendTo(row);
|
||||
gitEmailInput = $('<input type="text" id="user-settings-gitconfig-email">').appendTo(row);
|
||||
gitEmailInput.val(currentGitSettings.user.email||"");
|
||||
|
||||
}
|
||||
|
||||
function createWorkflowSection(pane) {
|
||||
|
||||
var currentGitSettings = RED.settings.get('git') || {};
|
||||
currentGitSettings.workflow = currentGitSettings.workflow || {};
|
||||
currentGitSettings.workflow.mode = currentGitSettings.workflow.mode || "manual";
|
||||
|
||||
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.workflow")).appendTo(pane);
|
||||
|
||||
var workflowContainer = $('<div class="red-ui-settings-section"></div>').appendTo(pane);
|
||||
$('<div class="red-ui-settings-section-description"></div>').appendTo(workflowContainer).text(RED._("editor:sidebar.project.userSettings.workfowTip"));
|
||||
|
||||
var row = $('<div class="red-ui-settings-row"></div>').appendTo(workflowContainer);
|
||||
$('<label><input type="radio" name="user-setting-gitworkflow" value="manual"> <div style="margin-left: 3px; display: inline-block"><div data-i18n="editor:sidebar.project.userSettings.workflowManual"></div><div style="color:#aaa;" data-i18n="editor:sidebar.project.userSettings.workflowManualTip"></div></div></label>').appendTo(row);
|
||||
row = $('<div class="red-ui-settings-row"></div>').appendTo(workflowContainer);
|
||||
$('<label><input type="radio" name="user-setting-gitworkflow" value="auto"> <div style="margin-left: 3px; display: inline-block"><div data-i18n="editor:sidebar.project.userSettings.workflowAuto"></div><div style="color:#aaa;" data-i18n="editor:sidebar.project.userSettings.workflowAutoTip"></div></div></label>').appendTo(row);
|
||||
|
||||
workflowContainer.find('[name="user-setting-gitworkflow"][type="radio"][value="'+currentGitSettings.workflow.mode+'"]').prop('checked',true)
|
||||
|
||||
}
|
||||
|
||||
|
||||
function createSSHKeySection(pane) {
|
||||
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.sshKeys")).appendTo(pane);
|
||||
var container = $('<div class="red-ui-settings-section"></div>').appendTo(pane);
|
||||
var popover;
|
||||
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.sshKeys")).appendTo(container);
|
||||
var subtitle = $('<div class="red-ui-settings-section-description"></div>').appendTo(container).text(RED._("editor:sidebar.project.userSettings.sshKeysTip"));
|
||||
|
||||
var addKeyButton = $('<button id="user-settings-gitconfig-add-key" class="red-ui-button red-ui-button-small" style="float: right; margin-right: 10px;">'+RED._("editor:sidebar.project.userSettings.add")+'</button>')
|
||||
@@ -412,7 +391,6 @@ RED.projects.userSettings = (function() {
|
||||
function createSettingsPane(activeProject) {
|
||||
var pane = $('<div id="red-ui-settings-tab-gitconfig" class="project-settings-tab-pane red-ui-help"></div>');
|
||||
createGitUserSection(pane);
|
||||
createWorkflowSection(pane);
|
||||
createSSHKeySection(pane);
|
||||
return pane;
|
||||
}
|
||||
@@ -429,9 +407,6 @@ RED.projects.userSettings = (function() {
|
||||
currentGitSettings.user = currentGitSettings.user || {};
|
||||
currentGitSettings.user.name = gitUsernameInput.val();
|
||||
currentGitSettings.user.email = gitEmailInput.val();
|
||||
currentGitSettings.workflow = currentGitSettings.workflow || {};
|
||||
currentGitSettings.workflow.mode = $('[name="user-setting-gitworkflow"][type="radio"]:checked').val()
|
||||
|
||||
RED.settings.set('git', currentGitSettings);
|
||||
}
|
||||
});
|
||||
|
@@ -81,8 +81,8 @@ RED.projects = (function() {
|
||||
$('<p>').text(RED._("projects.welcome.desc2")).appendTo(body);
|
||||
|
||||
var row = $('<div style="text-align: center"></div>').appendTo(body);
|
||||
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.welcome.create")+'</button>').appendTo(row);
|
||||
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.welcome.clone")+'</button>').appendTo(row);
|
||||
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-screen-create-type"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.welcome.create")+'</button>').appendTo(row);
|
||||
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-screen-create-type"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.welcome.clone")+'</button>').appendTo(row);
|
||||
|
||||
createAsEmpty.on("click", function(e) {
|
||||
e.preventDefault();
|
||||
@@ -511,8 +511,7 @@ RED.projects = (function() {
|
||||
|
||||
subrow = $('<div style="width: calc(50% - 10px); margin-left: 20px; display:inline-block;"></div>').appendTo(row);
|
||||
$('<label for="red-ui-projects-dialog-screen-create-project-repo-pass">'+RED._("projects.clone-project.passwd")+'</label>').appendTo(subrow);
|
||||
projectRepoPasswordInput = $('<input style="width:100%" id="red-ui-projects-dialog-screen-create-project-repo-pass" type="password"></input>').appendTo(subrow);
|
||||
projectRepoPasswordInput.typedInput({type:"cred"});
|
||||
projectRepoPasswordInput = $('<input id="red-ui-projects-dialog-screen-create-project-repo-pass" type="password"></input>').appendTo(subrow);
|
||||
// -----------------------------------------------------
|
||||
|
||||
// Repo credentials - key/passphrase -------------------
|
||||
@@ -540,12 +539,12 @@ RED.projects = (function() {
|
||||
subrow = $('<div style="width: calc(50% - 10px); margin-left: 20px; display:inline-block;"></div>').appendTo(row);
|
||||
$('<label for="red-ui-projects-dialog-screen-create-project-repo-passphrase">'+RED._("projects.clone-project.passphrase")+'</label>').appendTo(subrow);
|
||||
projectRepoPassphrase = $('<input id="red-ui-projects-dialog-screen-create-project-repo-passphrase" type="password"></input>').appendTo(subrow);
|
||||
projectRepoPassphrase.typedInput({type:"cred"});
|
||||
|
||||
subrow = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-sshkey"></div>').appendTo(cloneAuthRows);
|
||||
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
||||
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.clone-project.ssh-key-desc")+'</div>').appendTo(sshwarningRow);
|
||||
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||
$('<button class="red-ui-button">'+RED._("projects.clone-project.ssh-key-add")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
dialog.dialog( "close" );
|
||||
RED.userSettings.show('gitconfig');
|
||||
@@ -559,8 +558,8 @@ RED.projects = (function() {
|
||||
// Secret - clone
|
||||
row = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-clone"></div>').appendTo(body);
|
||||
$('<label>'+RED._("projects.clone-project.credential-key")+'</label>').appendTo(row);
|
||||
projectSecretInput = $('<input style="width: 100%" type="password"></input>').appendTo(row);
|
||||
projectSecretInput.typedInput({type:"cred"});
|
||||
projectSecretInput = $('<input type="password"></input>').appendTo(row);
|
||||
|
||||
|
||||
|
||||
return container;
|
||||
@@ -895,7 +894,6 @@ RED.projects = (function() {
|
||||
$('<label class="red-ui-projects-edit-form-inline-label" style="margin-left: 5px"><input type="radio" style="vertical-align: middle; margin-top:0; margin-right: 10px;" value="custom" name="projects-encryption-key"> <span style="vertical-align: middle;">'+RED._("projects.encryption-config.use-custom")+'</span></label>').appendTo(row);
|
||||
row = $('<div class="projects-encryption-enabled-row"></div>').appendTo(credentialsRightBox);
|
||||
emptyProjectCredentialInput = $('<input disabled type="password" style="margin-left: 25px; width: calc(100% - 30px);"></input>').appendTo(row);
|
||||
emptyProjectCredentialInput.typedInput({type:"cred"});
|
||||
emptyProjectCredentialInput.on("change keyup paste", validateForm);
|
||||
|
||||
row = $('<div class="form-row projects-encryption-disabled-row"></div>').hide().appendTo(credentialsRightBox);
|
||||
@@ -1171,11 +1169,11 @@ RED.projects = (function() {
|
||||
|
||||
row = $('<div class="form-row button-group"></div>').appendTo(container);
|
||||
|
||||
var openProject = $('<button data-type="open" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
|
||||
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
|
||||
// var createAsCopy = $('<button data-type="copy" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
|
||||
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
|
||||
// var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
|
||||
var openProject = $('<button data-type="open" class="red-ui-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-folder-open"></i><br/>'+RED._("projects.create.open")+'</button>').appendTo(row);
|
||||
var createAsEmpty = $('<button data-type="empty" class="red-ui-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-asterisk"></i><br/>'+RED._("projects.create.create")+'</button>').appendTo(row);
|
||||
// var createAsCopy = $('<button data-type="copy" class="red-ui-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i class="fa fa-long-arrow-right fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Copy existing</button>').appendTo(row);
|
||||
var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-archive fa-2x"></i><i style="position: absolute;" class="fa fa-git"></i><br/>'+RED._("projects.create.clone")+'</button>').appendTo(row);
|
||||
// var createAsClone = $('<button data-type="clone" class="red-ui-button red-ui-projects-dialog-screen-create-type toggle"><i class="fa fa-git fa-2x"></i><i class="fa fa-arrows-h fa-2x"></i><i class="fa fa-archive fa-2x"></i><br/>Clone Repository</button>').appendTo(row);
|
||||
row.find(".red-ui-projects-dialog-screen-create-type").on("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
container.find(".red-ui-projects-dialog-screen-create-type").removeClass('selected');
|
||||
@@ -1300,7 +1298,6 @@ RED.projects = (function() {
|
||||
$('<label class="red-ui-projects-edit-form-inline-label">'+RED._("projects.create.encryption-key")+'</label>').appendTo(row);
|
||||
// row = $('<div class="projects-encryption-enabled-row"></div>').appendTo(credentialsRightBox);
|
||||
emptyProjectCredentialInput = $('<input type="password"></input>').appendTo(row);
|
||||
emptyProjectCredentialInput.typedInput({type:"cred"});
|
||||
emptyProjectCredentialInput.on("change keyup paste", validateForm);
|
||||
$('<label class="red-ui-projects-edit-form-sublabel"><small>'+RED._("projects.create.desc0")+'</small></label>').appendTo(row);
|
||||
|
||||
@@ -1359,8 +1356,7 @@ RED.projects = (function() {
|
||||
|
||||
subrow = $('<div style="width: calc(50% - 10px); margin-left: 20px; display:inline-block;"></div>').appendTo(row);
|
||||
$('<label for="red-ui-projects-dialog-screen-create-project-repo-pass">'+RED._("projects.create.password")+'</label>').appendTo(subrow);
|
||||
projectRepoPasswordInput = $('<input style="width:100%" id="red-ui-projects-dialog-screen-create-project-repo-pass" type="password"></input>').appendTo(subrow);
|
||||
projectRepoPasswordInput.typedInput({type:"cred"});
|
||||
projectRepoPasswordInput = $('<input id="red-ui-projects-dialog-screen-create-project-repo-pass" type="password"></input>').appendTo(subrow);
|
||||
// -----------------------------------------------------
|
||||
|
||||
// Repo credentials - key/passphrase -------------------
|
||||
@@ -1388,13 +1384,12 @@ RED.projects = (function() {
|
||||
subrow = $('<div style="width: calc(50% - 10px); margin-left: 20px; display:inline-block;"></div>').appendTo(row);
|
||||
$('<label for="red-ui-projects-dialog-screen-create-project-repo-passphrase">'+RED._("projects.create.passphrase")+'</label>').appendTo(subrow);
|
||||
projectRepoPassphrase = $('<input id="red-ui-projects-dialog-screen-create-project-repo-passphrase" type="password"></input>').appendTo(subrow);
|
||||
projectRepoPassphrase.typedInput({type:"cred"});
|
||||
|
||||
subrow = $('<div class="form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-sshkey"></div>').appendTo(cloneAuthRows);
|
||||
var sshwarningRow = $('<div class="red-ui-projects-dialog-screen-create-row-auth-error-no-keys"></div>').hide().appendTo(subrow);
|
||||
$('<div class="form-row"><i class="fa fa-warning"></i> '+RED._("projects.create.desc2")+'</div>').appendTo(sshwarningRow);
|
||||
subrow = $('<div style="text-align: center">').appendTo(sshwarningRow);
|
||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||
$('<button class="red-ui-button">'+RED._("projects.create.add-ssh-key")+'</button>').appendTo(subrow).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
$('#red-ui-projects-dialog-cancel').trigger("click");
|
||||
RED.userSettings.show('gitconfig');
|
||||
@@ -1408,8 +1403,8 @@ RED.projects = (function() {
|
||||
// Secret - clone
|
||||
row = $('<div class="hide form-row red-ui-projects-dialog-screen-create-row red-ui-projects-dialog-screen-create-row-clone"></div>').appendTo(container);
|
||||
$('<label>'+RED._("projects.create.credentials-encryption-key")+'</label>').appendTo(row);
|
||||
projectSecretInput = $('<input style="width:100%" type="password"></input>').appendTo(row);
|
||||
projectSecretInput.typedInput({type:"cred"});
|
||||
projectSecretInput = $('<input type="password"></input>').appendTo(row);
|
||||
|
||||
|
||||
switch(options.screen||"empty") {
|
||||
case "empty": createAsEmpty.trigger("click"); break;
|
||||
@@ -1620,16 +1615,25 @@ RED.projects = (function() {
|
||||
}
|
||||
|
||||
function deleteProject(row,name,done) {
|
||||
var cover = $('<div class="red-ui-projects-dialog-project-list-entry-delete-confirm"></div>').on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
|
||||
$('<span>').text(RED._("projects.delete.confirm")).appendTo(cover);
|
||||
$('<button class="red-ui-button red-ui-projects-dialog-button">'+RED._("common.label.cancel")+'</button>')
|
||||
var cover = $('<div>').css({
|
||||
background:"white",
|
||||
position:"absolute",
|
||||
top:0,right:0,bottom:0,left:"100%",
|
||||
overflow:"hidden",
|
||||
padding: "5px 20px",
|
||||
transition: "left 0.4s",
|
||||
whitespace: "nowrap",
|
||||
width:"1000px"
|
||||
}).on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
|
||||
$('<span>').css({"lineHeight":"40px"}).text(RED._("projects.delete.confirm")).appendTo(cover);
|
||||
$('<button style="margin-left:20px" class="red-ui-button">'+RED._("common.label.cancel")+'</button>')
|
||||
.appendTo(cover)
|
||||
.on("click", function(e) {
|
||||
e.stopPropagation();
|
||||
cover.remove();
|
||||
done(true);
|
||||
});
|
||||
$('<button class="red-ui-button red-ui-projects-dialog-button primary">'+RED._("common.label.delete")+'</button>')
|
||||
$('<button style="margin-left:20px" class="red-ui-button primary">'+RED._("common.label.delete")+'</button>')
|
||||
.appendTo(cover)
|
||||
.on("click", function(e) {
|
||||
e.stopPropagation();
|
||||
@@ -1813,7 +1817,7 @@ RED.projects = (function() {
|
||||
header.addClass("selectable");
|
||||
|
||||
var tools = $('<div class="red-ui-projects-dialog-project-list-entry-tools"></div>').appendTo(header);
|
||||
$('<button class="red-ui-button red-ui-projects-dialog-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
|
||||
$('<button class="red-ui-button red-ui-button-small" style="float: right;"><i class="fa fa-trash"></i></button>')
|
||||
.appendTo(tools)
|
||||
.on("click", function(e) {
|
||||
e.stopPropagation();
|
||||
@@ -1967,8 +1971,7 @@ RED.projects = (function() {
|
||||
var isSSH = false;
|
||||
if (/^https?:\/\//.test(url)) {
|
||||
$('<div class="form-row"><label for="projects-user-auth-username">'+RED._("projects.send-req.username")+'</label><input id="projects-user-auth-username" type="text"></input></div>'+
|
||||
'<div class="form-row"><label for="projects-user-auth-password">'+RED._("projects.send-req.password")+'</label><input id="projects-user-auth-password" type="password"></input></div>').appendTo(message);
|
||||
message.find("#projects-user-auth-password").typedInput({type:"cred"})
|
||||
'<div class="form-row"><label for=projects-user-auth-password">'+RED._("projects.send-req.password")+'</label><input id="projects-user-auth-password" type="password"></input></div>').appendTo(message);
|
||||
} else if (/^(?:ssh|[\d\w\.\-_]+@[\w\.]+):(?:\/\/)?/.test(url)) {
|
||||
isSSH = true;
|
||||
var row = $('<div class="form-row"></div>').appendTo(message);
|
||||
@@ -1986,7 +1989,7 @@ RED.projects = (function() {
|
||||
});
|
||||
row = $('<div class="form-row"></div>').appendTo(message);
|
||||
$('<label for="projects-user-auth-passphrase">'+RED._("projects.send-req.passphrase")+'</label>').appendTo(row);
|
||||
$('<input id="projects-user-auth-passphrase" type="password"></input>').appendTo(row).typedInput({type:"cred"});
|
||||
$('<input id="projects-user-auth-passphrase" type="password"></input>').appendTo(row);
|
||||
}
|
||||
|
||||
var notification = RED.notify(message,{
|
||||
@@ -2269,12 +2272,6 @@ RED.projects = (function() {
|
||||
autoOpen: false,
|
||||
width: 600,
|
||||
resizable: false,
|
||||
open: function(e) {
|
||||
RED.keyboard.disable();
|
||||
},
|
||||
close: function(e) {
|
||||
RED.keyboard.enable();
|
||||
},
|
||||
classes: {
|
||||
"ui-dialog": "red-ui-editor-dialog",
|
||||
"ui-dialog-titlebar-close": "hide",
|
||||
|
@@ -293,20 +293,14 @@ RED.sidebar.versionControl = (function() {
|
||||
if (activeProject) {
|
||||
// TODO: this is a full refresh of the files - should be able to
|
||||
// just do an incremental refresh
|
||||
allChanges = {};
|
||||
unstagedChangesList.editableList('empty');
|
||||
stagedChangesList.editableList('empty');
|
||||
unmergedChangesList.editableList('empty');
|
||||
|
||||
var workflowMode = ((RED.settings.get('git') || {}).workflow || {}).mode || "manual";
|
||||
if (workflowMode === 'auto') {
|
||||
refresh(true);
|
||||
} else {
|
||||
allChanges = {};
|
||||
unstagedChangesList.editableList('empty');
|
||||
stagedChangesList.editableList('empty');
|
||||
unmergedChangesList.editableList('empty');
|
||||
|
||||
$.getJSON("projects/"+activeProject.name+"/status",function(result) {
|
||||
refreshFiles(result);
|
||||
});
|
||||
}
|
||||
$.getJSON("projects/"+activeProject.name+"/status",function(result) {
|
||||
refreshFiles(result);
|
||||
});
|
||||
}
|
||||
});
|
||||
RED.events.on("login",function() {
|
||||
|
@@ -83,7 +83,7 @@ RED.search = (function() {
|
||||
// flagName:XYZ
|
||||
var regEx = new RegExp("(?:^| )"+flagName+":([^ ]+)(?: |$)");
|
||||
var m
|
||||
while(!!(m = regEx.exec(val))) {
|
||||
while(m = regEx.exec(val)) {
|
||||
val = val.replace(regEx," ").trim();
|
||||
flags[flagName] = flags[flagName] || [];
|
||||
flags[flagName].push(m[1]);
|
||||
@@ -93,7 +93,7 @@ RED.search = (function() {
|
||||
|
||||
function search(val) {
|
||||
var results = [];
|
||||
var keys = [];
|
||||
var keys = Object.keys(index);
|
||||
var typeFilter;
|
||||
var m = /(?:^| )type:([^ ]+)/.exec(val);
|
||||
if (m) {
|
||||
@@ -118,11 +118,6 @@ RED.search = (function() {
|
||||
var j;
|
||||
var list = [];
|
||||
var nodes = {};
|
||||
if (flags.uses) {
|
||||
keys = flags.uses;
|
||||
} else {
|
||||
keys = Object.keys(index);
|
||||
}
|
||||
for (i=0;i<keys.length;i++) {
|
||||
var key = keys[i];
|
||||
var kpos = keys[i].indexOf(val);
|
||||
@@ -131,9 +126,6 @@ RED.search = (function() {
|
||||
for (j=0;j<ids.length;j++) {
|
||||
var node = index[key][ids[j]];
|
||||
var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
|
||||
if (flags.uses && key === node.node.id) {
|
||||
continue;
|
||||
}
|
||||
if (flags.hasOwnProperty("invalid")) {
|
||||
var nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
|
||||
if (flags.invalid === nodeIsValid) {
|
||||
|
@@ -232,11 +232,7 @@ RED.sidebar = (function() {
|
||||
}
|
||||
},
|
||||
// minimumActiveTabWidth: 70,
|
||||
collapsible: true,
|
||||
onreorder: function(order) {
|
||||
RED.settings.set("editor.sidebar.order",order);
|
||||
},
|
||||
order: RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])
|
||||
collapsible: true
|
||||
// scrollable: true
|
||||
});
|
||||
|
||||
|
@@ -453,16 +453,14 @@ RED.subflow = (function() {
|
||||
$("#red-ui-workspace-chart").css({"margin-top": "0"});
|
||||
}
|
||||
|
||||
function removeSubflow(id, keepInstanceNodes) {
|
||||
// TODO: A lot of this logic is common with RED.nodes.removeWorkspace
|
||||
function removeSubflow(id) {
|
||||
var removedNodes = [];
|
||||
var removedLinks = [];
|
||||
var removedGroups = [];
|
||||
|
||||
var activeSubflow = RED.nodes.subflow(id);
|
||||
|
||||
RED.nodes.eachNode(function(n) {
|
||||
if (!keepInstanceNodes && n.type == "subflow:"+id) {
|
||||
if (n.type == "subflow:"+id) {
|
||||
removedNodes.push(n);
|
||||
}
|
||||
if (n.z == id) {
|
||||
@@ -474,9 +472,7 @@ RED.subflow = (function() {
|
||||
removedNodes.push(n);
|
||||
}
|
||||
});
|
||||
RED.nodes.groups(id).forEach(function(n) {
|
||||
removedGroups.push(n);
|
||||
})
|
||||
|
||||
var removedConfigNodes = [];
|
||||
for (var i=0;i<removedNodes.length;i++) {
|
||||
var removedEntities = RED.nodes.remove(removedNodes[i].id);
|
||||
@@ -486,18 +482,6 @@ RED.subflow = (function() {
|
||||
// TODO: this whole delete logic should be in RED.nodes.removeSubflow..
|
||||
removedNodes = removedNodes.concat(removedConfigNodes);
|
||||
|
||||
removedGroups = RED.nodes.groups(id).filter(function(g) { return !g.g; });
|
||||
for (i=0;i<removedGroups.length;i++) {
|
||||
removedGroups[i].nodes.forEach(function(n) {
|
||||
if (n.type === "group") {
|
||||
removedGroups.push(n);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Now remove them in the reverse order
|
||||
for (i=removedGroups.length-1; i>=0; i--) {
|
||||
RED.nodes.removeGroup(removedGroups[i]);
|
||||
}
|
||||
RED.nodes.removeSubflow(activeSubflow);
|
||||
RED.workspaces.remove(activeSubflow);
|
||||
RED.nodes.dirty(true);
|
||||
@@ -506,7 +490,6 @@ RED.subflow = (function() {
|
||||
return {
|
||||
nodes:removedNodes,
|
||||
links:removedLinks,
|
||||
groups: removedGroups,
|
||||
subflows: [activeSubflow]
|
||||
}
|
||||
}
|
||||
@@ -1182,7 +1165,11 @@ RED.subflow = (function() {
|
||||
default: DEFAULT_ENV_TYPE_LIST,
|
||||
valueLabel: function(container,value) {
|
||||
container.css("padding",0);
|
||||
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type"></div>').appendTo(container);
|
||||
var innerContainer = $('<div>').css({
|
||||
"background":"white",
|
||||
"height":"100%",
|
||||
"box-sizing": "border-box"
|
||||
}).appendTo(container);
|
||||
|
||||
var input = $('<div class="placeholder-input">').appendTo(innerContainer);
|
||||
$('<span><i class="fa fa-i-cursor"></i></span>').appendTo(input);
|
||||
@@ -1196,7 +1183,10 @@ RED.subflow = (function() {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$('<span class="red-ui-editor-subflow-env-input-type-placeholder"></span>').text(RED._("editor.selectType")).appendTo(input);
|
||||
$("<span>").css({
|
||||
"color":"#aaa",
|
||||
"padding-left": "4px"
|
||||
}).text("select types...").appendTo(input);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1205,7 +1195,10 @@ RED.subflow = (function() {
|
||||
label: RED._("typedInput.type.cred"), icon:"fa fa-lock", showLabel: false,
|
||||
valueLabel: function(container,value) {
|
||||
container.css("padding",0);
|
||||
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type">').css({
|
||||
var innerContainer = $('<div>').css({
|
||||
"background":"white",
|
||||
"height":"100%",
|
||||
"box-sizing": "border-box",
|
||||
"border-top-right-radius": "4px",
|
||||
"border-bottom-right-radius": "4px"
|
||||
}).appendTo(container);
|
||||
@@ -1350,7 +1343,11 @@ RED.subflow = (function() {
|
||||
label:RED._("editor.inputs.spinner"), icon:"fa fa-sort-numeric-asc", showLabel:false,
|
||||
valueLabel: function(container,value) {
|
||||
container.css("padding",0);
|
||||
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type"></div>').appendTo(container);
|
||||
var innerContainer = $('<div>').css({
|
||||
"background":"white",
|
||||
"height":"100%",
|
||||
"box-sizing": "border-box"
|
||||
}).appendTo(container);
|
||||
|
||||
var input = $('<div class="placeholder-input">').appendTo(innerContainer);
|
||||
$('<span><i class="fa fa-sort-numeric-asc"></i></span>').appendTo(input);
|
||||
@@ -1455,8 +1452,7 @@ RED.subflow = (function() {
|
||||
|
||||
}).on("change", function(evt,type) {
|
||||
if (ui.type === 'input') {
|
||||
var types = inputCellInput.typedInput('value');
|
||||
ui.opts.types = (types === "") ? ["str"] : types.split(",");
|
||||
ui.opts.types = inputCellInput.typedInput('value').split(",");
|
||||
valueField.typedInput('types',ui.opts.types);
|
||||
}
|
||||
});
|
||||
|
@@ -261,12 +261,10 @@ RED.sidebar.help = (function() {
|
||||
|
||||
}
|
||||
|
||||
function show(type, bringToFront) {
|
||||
if (bringToFront !== false) {
|
||||
RED.sidebar.show("help");
|
||||
}
|
||||
function show(type) {
|
||||
RED.sidebar.show("help");
|
||||
if (type) {
|
||||
// hideTOC();
|
||||
hideTOC();
|
||||
showHelp(type);
|
||||
}
|
||||
resizeStack();
|
||||
|
@@ -30,7 +30,6 @@ RED.sidebar.info.outliner = (function() {
|
||||
},
|
||||
{
|
||||
id: "__global__",
|
||||
flow: "__global__",
|
||||
label: RED._("sidebar.info.globalConfig"),
|
||||
types: {},
|
||||
children: [
|
||||
@@ -79,7 +78,7 @@ RED.sidebar.info.outliner = (function() {
|
||||
try {
|
||||
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
|
||||
} catch(err) {
|
||||
console.log("Definition error: "+n.type+".label",err);
|
||||
console.log("Definition error: "+type+".label",err);
|
||||
}
|
||||
}
|
||||
var newlineIndex = label.indexOf("\\n");
|
||||
@@ -203,7 +202,7 @@ RED.sidebar.info.outliner = (function() {
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip(toggleButton,function() {
|
||||
return RED._("common.label."+(((n.type==='tab' && n.disabled) || (n.type!=='tab' && n.d))?"enable":"disable"));
|
||||
return RED._("common.label."+((n.type==='tab' && n.disabled) || (n.type!=='tab' && n.d))?"enable":"disable")
|
||||
});
|
||||
} else {
|
||||
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
|
||||
@@ -409,11 +408,7 @@ RED.sidebar.info.outliner = (function() {
|
||||
} else {
|
||||
existingObject.element.find(".red-ui-info-outline-item-label").html(" ");
|
||||
}
|
||||
var existingParent = existingObject.parent.id;
|
||||
if (!existingParent) {
|
||||
existingParent = existingObject.parent.parent.flow
|
||||
}
|
||||
if (parent !== existingParent) {
|
||||
if (parent !== existingObject.parent.id) {
|
||||
var parentItem = existingObject.parent;
|
||||
existingObject.treeList.remove(true);
|
||||
if (parentItem.children.length === 0) {
|
||||
@@ -431,28 +426,15 @@ RED.sidebar.info.outliner = (function() {
|
||||
} else {
|
||||
delete configNodeTypes[parentItem.parent.parent.id];
|
||||
parentItem.parent.treeList.remove();
|
||||
if (parentItem.parent.parent.children.length === 0) {
|
||||
parentItem.parent.parent.treeList.addChild(getEmptyItem(parentItem.parent.parent.id));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
parentItem.treeList.addChild(getEmptyItem(parentItem.id));
|
||||
}
|
||||
}
|
||||
if (n._def.category === 'config' && n.type !== 'group') {
|
||||
// This must be a config node that has been rescoped
|
||||
createFlowConfigNode(parent,n.type);
|
||||
configNodeTypes[parent].types[n.type].treeList.addChild(objects[n.id]);
|
||||
} else {
|
||||
// This is a node that has moved groups
|
||||
if (empties[parent]) {
|
||||
empties[parent].treeList.remove();
|
||||
delete empties[parent];
|
||||
}
|
||||
objects[parent].treeList.addChild(existingObject)
|
||||
}
|
||||
// This must be a config node that has been rescoped
|
||||
createFlowConfigNode(parent,n.type);
|
||||
configNodeTypes[parent].types[n.type].treeList.addChild(objects[n.id]);
|
||||
|
||||
// if (parent === "__global__") {
|
||||
// // Global always exists here
|
||||
@@ -502,9 +484,6 @@ RED.sidebar.info.outliner = (function() {
|
||||
} else {
|
||||
delete configNodeTypes[n.z];
|
||||
parent.parent.treeList.remove();
|
||||
if (parent.parent.parent.children.length === 0) {
|
||||
parent.parent.parent.treeList.addChild(getEmptyItem(parent.parent.parent.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -533,7 +512,6 @@ RED.sidebar.info.outliner = (function() {
|
||||
// There is no 'config nodes' item in the parent flow
|
||||
configNodeTypes[parent] = {
|
||||
config: true,
|
||||
flow: parent,
|
||||
types: {},
|
||||
label: RED._("menu.label.displayConfig"),
|
||||
children: []
|
||||
|
@@ -112,14 +112,14 @@ RED.touch.radialMenu = (function() {
|
||||
if (!opt.disabled) {
|
||||
if (p[0]>opt.x-30 && p[0]<opt.x+30 && p[1]>opt.y-30 && p[1]<opt.y+30) {
|
||||
if (opt !== activeOption) {
|
||||
opt.el.classed("selected",true);
|
||||
opt.el.style("background","#999");
|
||||
activeOption = opt;
|
||||
}
|
||||
} else if (opt === activeOption) {
|
||||
opt.el.style("background","#fff");
|
||||
activeOption = null;
|
||||
} else {
|
||||
if (opt === activeOption) {
|
||||
activeOption = null;
|
||||
}
|
||||
opt.el.classed("selected",false);
|
||||
opt.el.style("background","#fff");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -52,15 +52,13 @@ RED.utils = (function() {
|
||||
} else if (value === null) {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-null">null</span>');
|
||||
} else if (typeof value === 'object') {
|
||||
if (value.hasOwnProperty('type') && value.type === 'undefined') {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-null">undefined</span>');
|
||||
} else if (value.hasOwnProperty('type') && value.type === 'Buffer' && value.hasOwnProperty('data')) {
|
||||
if (value.hasOwnProperty('type') && value.type === 'Buffer' && value.hasOwnProperty('data')) {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('buffer['+value.length+']');
|
||||
} else if (value.hasOwnProperty('type') && value.type === 'array' && value.hasOwnProperty('data')) {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('array['+value.length+']');
|
||||
} else if (value.hasOwnProperty('type') && value.type === 'function') {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('function');
|
||||
} else if (value.hasOwnProperty('type') && (value.type === 'number' || value.type === 'bigint')) {
|
||||
} else if (value.hasOwnProperty('type') && value.type === 'number') {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-number"></span>').text(value.data);
|
||||
} else {
|
||||
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta">object</span>');
|
||||
@@ -350,9 +348,7 @@ RED.utils = (function() {
|
||||
}
|
||||
if (obj === null || obj === undefined) {
|
||||
$('<span class="red-ui-debug-msg-type-null">'+obj+'</span>').appendTo(entryObj);
|
||||
} else if (obj.__enc__ && obj.type === 'undefined') {
|
||||
$('<span class="red-ui-debug-msg-type-null">undefined</span>').appendTo(entryObj);
|
||||
} else if (obj.__enc__ && (obj.type === 'number' || obj.type === 'bigint')) {
|
||||
} else if (obj.__enc__ && obj.type === 'number') {
|
||||
e = $('<span class="red-ui-debug-msg-type-number red-ui-debug-msg-object-header"></span>').text(obj.data).appendTo(entryObj);
|
||||
} else if (typeHint === "function" || (obj.__enc__ && obj.type === 'function')) {
|
||||
e = $('<span class="red-ui-debug-msg-type-meta red-ui-debug-msg-object-header"></span>').text("function").appendTo(entryObj);
|
||||
|
@@ -102,13 +102,11 @@ RED.view.tools = (function() {
|
||||
node.n.dirty = true;
|
||||
if (node.n.type === "group") {
|
||||
RED.group.markDirty(node.n);
|
||||
minX = Math.min(node.n.x - 5,minX);
|
||||
minY = Math.min(node.n.y - 5,minY);
|
||||
} else {
|
||||
minX = Math.min(node.n.x-node.n.w/2-5,minX);
|
||||
minY = Math.min(node.n.y-node.n.h/2-5,minY);
|
||||
}
|
||||
minX = Math.min(node.n.x-node.n.w/2-5,minX);
|
||||
minY = Math.min(node.n.y-node.n.h/2-5,minY);
|
||||
}
|
||||
|
||||
if (minX !== 0 || minY !== 0) {
|
||||
for (var n = 0; n<moving_set.length; n++) {
|
||||
node = moving_set[n];
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -39,11 +39,7 @@ RED.user = (function() {
|
||||
closeOnEscape: !!opts.cancelable,
|
||||
width: 600,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
close: function( event, ui ) {
|
||||
$("#node-dialog-login").dialog('destroy').remove();
|
||||
RED.keyboard.enable()
|
||||
}
|
||||
draggable: false
|
||||
});
|
||||
|
||||
$("#node-dialog-login-fields").empty();
|
||||
@@ -102,10 +98,10 @@ RED.user = (function() {
|
||||
data: body
|
||||
}).done(function(data,textStatus,xhr) {
|
||||
RED.settings.set("auth-tokens",data);
|
||||
$("#node-dialog-login").dialog('destroy').remove();
|
||||
if (opts.updateMenu) {
|
||||
updateUserMenu();
|
||||
}
|
||||
$("#node-dialog-login").dialog("close");
|
||||
done();
|
||||
}).fail(function(jqXHR,textStatus,errorThrown) {
|
||||
RED.settings.remove("auth-tokens");
|
||||
@@ -147,8 +143,7 @@ RED.user = (function() {
|
||||
}
|
||||
if (opts.cancelable) {
|
||||
$("#node-dialog-login-cancel").button().on("click", function( event ) {
|
||||
$("#node-dialog-login").dialog('close');
|
||||
|
||||
$("#node-dialog-login").dialog('destroy').remove();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -157,7 +152,8 @@ RED.user = (function() {
|
||||
$("#node-dialog-login-image").load(function() {
|
||||
dialog.dialog("open");
|
||||
}).attr("src",loginImageSrc);
|
||||
RED.keyboard.disable();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -219,7 +215,7 @@ RED.user = (function() {
|
||||
|
||||
function init() {
|
||||
if (RED.settings.user) {
|
||||
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu") || RED.settings.editorTheme.userMenu) {
|
||||
if (!RED.settings.editorTheme || !RED.settings.editorTheme.hasOwnProperty("userMenu")) {
|
||||
|
||||
var userMenu = $('<li><a id="red-ui-header-button-user" class="button hide" href="#"></a></li>')
|
||||
.prependTo(".red-ui-header-toolbar");
|
||||
|
@@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.red-ui-editor {
|
||||
font-size: $primary-font-size;
|
||||
@@ -70,9 +67,6 @@ body {
|
||||
text-decoration: none;
|
||||
color: $primary-text-color;
|
||||
}
|
||||
a:focus {
|
||||
outline: 1px solid $form-input-focus-color;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 0 10px;
|
||||
|
@@ -129,7 +129,7 @@ $workspace-button-color-primary: #eee;
|
||||
$workspace-button-background-primary: #AD1625;
|
||||
$workspace-button-background-primary-hover: #6E0A1E;
|
||||
|
||||
$workspace-button-color-focus-outline: $form-input-focus-color;
|
||||
$workspace-button-color-focus-outline: $form-input-border-color;
|
||||
|
||||
$shade-color: rgba(160,160,160,0.5);
|
||||
|
||||
@@ -289,4 +289,3 @@ $group-default-fill: none;
|
||||
$group-default-fill-opacity: 1;
|
||||
$group-default-stroke: #999;
|
||||
$group-default-stroke-opacity: 1;
|
||||
$group-default-label-color: #a4a4a4;
|
@@ -410,7 +410,7 @@ button.red-ui-button.red-ui-editor-node-appearance-button {
|
||||
|
||||
.red-ui-group-layout-picker {
|
||||
padding: 5px;
|
||||
background: $secondary-background;
|
||||
background: $primary-background;
|
||||
}
|
||||
.red-ui-group-layout-picker-cell-text {
|
||||
position: absolute;
|
||||
@@ -597,7 +597,6 @@ div.red-ui-button-small.red-ui-color-picker-opacity-slider-handle {
|
||||
padding: 4px;
|
||||
color: $secondary-text-color;
|
||||
font-size: 0.9em;
|
||||
line-height: 24px;
|
||||
}
|
||||
button {
|
||||
float: right;
|
||||
@@ -716,9 +715,6 @@ div.red-ui-button-small.red-ui-color-picker-opacity-slider-handle {
|
||||
|
||||
button.red-ui-toggleButton.toggle {
|
||||
text-align: left;
|
||||
i {
|
||||
min-width: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -832,18 +828,8 @@ span.red-ui-editor-subflow-env-lang-icon {
|
||||
right: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.red-ui-editor-subflow-env-input-type {
|
||||
background: $secondary-background;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.red-ui-editor-subflow-env-input-type-placeholder {
|
||||
color: $tertiary-text-color;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
// .red-ui-editor-subflow-ui-grid {
|
||||
// width: 100%;
|
||||
// .red-ui-editableList-container {
|
||||
|
@@ -37,7 +37,7 @@
|
||||
@include disable-selection;
|
||||
|
||||
.red-ui-flow-node-label-text {
|
||||
dominant-baseline: middle;
|
||||
alignment-baseline: middle;
|
||||
}
|
||||
|
||||
&.red-ui-flow-node-label-right .red-ui-flow-node-label-text {
|
||||
@@ -49,7 +49,7 @@
|
||||
stroke-width: 0;
|
||||
fill: $secondary-text-color;
|
||||
font-size: 16px;
|
||||
dominant-baseline: middle;
|
||||
alignment-baseline: middle;
|
||||
text-anchor: middle;
|
||||
pointer-events: none;
|
||||
-webkit-touch-callout: none;
|
||||
@@ -106,11 +106,6 @@
|
||||
pointer-events: stroke;
|
||||
stroke-opacity: 0;
|
||||
stroke-width: 3;
|
||||
|
||||
&.red-ui-flow-group-outline-select-background {
|
||||
stroke: $view-background;
|
||||
stroke-width: 6;
|
||||
}
|
||||
}
|
||||
.red-ui-flow-group-body {
|
||||
pointer-events: none;
|
||||
@@ -122,7 +117,6 @@
|
||||
}
|
||||
.red-ui-flow-group-label {
|
||||
@include disable-selection;
|
||||
fill: $group-default-label-color;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +134,6 @@
|
||||
}
|
||||
.red-ui-flow-node-icon-group {
|
||||
.fa-lg {
|
||||
@include disable-selection;
|
||||
stroke: none;
|
||||
fill: $node-icon-color;
|
||||
text-anchor: middle;
|
||||
@@ -160,15 +153,6 @@
|
||||
|
||||
.red-ui-flow-node-button {
|
||||
fill: inherit;
|
||||
&.red-ui-flow-node-button-disabled {
|
||||
opacity: 0.4;
|
||||
.red-ui-flow-node-button-button {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
.red-ui-flow-node-button-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
.red-ui-flow-node-button-background {
|
||||
fill: $node-background-placeholder;
|
||||
@@ -251,7 +235,7 @@ g.red-ui-flow-node-selected {
|
||||
stroke-dasharray: none;
|
||||
}
|
||||
}
|
||||
@each $current-color in red green yellow blue grey gray {
|
||||
@each $current-color in red green yellow blue grey {
|
||||
.red-ui-flow-node-status-dot-#{$current-color} {
|
||||
fill: map-get($node-status-colors,$current-color);
|
||||
stroke: map-get($node-status-colors,$current-color);
|
||||
@@ -343,10 +327,7 @@ g.red-ui-flow-link-unknown path.red-ui-flow-link-line {
|
||||
stroke-dasharray: 10, 4;
|
||||
}
|
||||
|
||||
// @keyframes *must* be on multiple lines so build-custom-theme can filter them out
|
||||
@keyframes red-ui-flow-port-tooltip-fadeIn {
|
||||
from { opacity:0; } to { opacity:1; }
|
||||
}
|
||||
@keyframes red-ui-flow-port-tooltip-fadeIn { from { opacity:0; } to { opacity:1; } }
|
||||
|
||||
.red-ui-flow-port-tooltip {
|
||||
opacity:0;
|
||||
|
@@ -153,61 +153,3 @@
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.red-ui-clipboard-dialog-import-conflicts-list-container {
|
||||
min-height: 300px;
|
||||
position: relative;
|
||||
|
||||
li:not(:first-child) .red-ui-clipboard-dialog-import-conflicts-item-header {
|
||||
// border-top: 1px solid $secondary-border-color;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-clipboard-dialog-import-conflicts-item-header {
|
||||
background: $tertiary-background;
|
||||
& > span:first-child {
|
||||
color: $header-text-color;
|
||||
padding-left: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.red-ui-clipboard-dialog-import-conflicts-controls {
|
||||
position: absolute;
|
||||
top:0;
|
||||
bottom: 0;
|
||||
right: 0px;
|
||||
text-align: center;
|
||||
color: $form-text-color;
|
||||
.form-row & label {
|
||||
padding: 2px 0;
|
||||
line-height: 23px;
|
||||
margin-bottom: 0;
|
||||
width: 80px;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
border-left: 1px solid $secondary-border-color;
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
#red-ui-clipboard-dialog-import-conflicts-list .disabled .red-ui-info-outline-item {
|
||||
opacity: 0.4;
|
||||
}
|
||||
.form-row label.red-ui-clipboard-dialog-import-conflicts-gutter {
|
||||
box-sizing: border-box;
|
||||
width: 22px;
|
||||
text-align: center;
|
||||
.red-ui-editor-dialog & input[type="checkbox"] {
|
||||
width: auto;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
@@ -71,9 +71,38 @@
|
||||
}
|
||||
|
||||
.red-ui-notification-shake-horizontal {
|
||||
animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
|
||||
-webkit-animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
|
||||
animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
|
||||
}
|
||||
|
||||
@-webkit-keyframes red-ui-notification-shake-horizontal {
|
||||
0%,
|
||||
100% {
|
||||
-webkit-transform: translateX(0);
|
||||
transform: translateX(0);
|
||||
}
|
||||
10%,
|
||||
30%,
|
||||
50%,
|
||||
70% {
|
||||
-webkit-transform: translateX(-1px);
|
||||
transform: translateX(-1px);
|
||||
}
|
||||
20%,
|
||||
40%,
|
||||
60% {
|
||||
-webkit-transform: translateX(1px);
|
||||
transform: translateX(1px);
|
||||
}
|
||||
// 80% {
|
||||
// -webkit-transform: translateX(1px);
|
||||
// transform: translateX(1px);
|
||||
// }
|
||||
// 90% {
|
||||
// -webkit-transform: translateX(-1px);
|
||||
// transform: translateX(-1px);
|
||||
// }
|
||||
}
|
||||
// @keyframes *must* be on multiple lines so build-custom-theme can filter them out
|
||||
@keyframes red-ui-notification-shake-horizontal {
|
||||
0%,
|
||||
100% {
|
||||
@@ -93,4 +122,12 @@
|
||||
-webkit-transform: translateX(1px);
|
||||
transform: translateX(1px);
|
||||
}
|
||||
// 80% {
|
||||
// -webkit-transform: translateX(1px);
|
||||
// transform: translateX(1px);
|
||||
// }
|
||||
// 90% {
|
||||
// -webkit-transform: translateX(-1px);
|
||||
// transform: translateX(-1px);
|
||||
// }
|
||||
}
|
||||
|
@@ -237,45 +237,3 @@ ul.red-ui-palette-module-error-list {
|
||||
#red-ui-palette-module-install-shade {
|
||||
padding-top: 80px;
|
||||
}
|
||||
button.red-ui-palette-editor-upload-button {
|
||||
padding: 0;
|
||||
height: 25px;
|
||||
margin-top: -1px;
|
||||
|
||||
input[type="file"] {
|
||||
opacity: 0;
|
||||
margin: 0;
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
.red-ui-settings-tabs-content & label {
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
form {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
.red-ui-palette-editor-upload {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 44px;
|
||||
padding: 20px;
|
||||
background: $secondary-background;
|
||||
border-bottom: 1px $secondary-border-color solid;
|
||||
box-shadow: 1px 1px 4px $shadow;
|
||||
|
||||
.placeholder-input {
|
||||
width: calc(100% - 180px);
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
.red-ui-palette-editor-upload-buttons {
|
||||
float: right;
|
||||
button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
@@ -204,7 +204,7 @@
|
||||
.red-ui-palette-icon-fa {
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: calc(50% - 7px);
|
||||
top: 7px;
|
||||
left: 3px;
|
||||
}
|
||||
.red-ui-palette-node-small {
|
||||
|
@@ -90,7 +90,7 @@
|
||||
font-size: 1.2em;
|
||||
}
|
||||
}
|
||||
button.red-ui-button.red-ui-projects-dialog-button {
|
||||
button.red-ui-button {
|
||||
width: calc(50% - 80px);
|
||||
margin: 20px;
|
||||
height: auto;
|
||||
@@ -265,26 +265,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.red-ui-projects-dialog-project-list-entry-delete-confirm {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 100%;
|
||||
width: 1000px;
|
||||
overflow: hidden;
|
||||
padding: 5px 20px;
|
||||
background: $secondary-background;
|
||||
transition: left 0.4s;
|
||||
white-space: nowrap;
|
||||
> span {
|
||||
line-height: 40px;
|
||||
}
|
||||
button {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-projects-dialog-screen-create-type {
|
||||
position: relative;
|
||||
}
|
||||
|
@@ -42,11 +42,7 @@
|
||||
background: $secondary-background;
|
||||
border: 2px solid $primary-border-color;
|
||||
text-align: center;
|
||||
line-height:50px;
|
||||
|
||||
&.selected {
|
||||
background: $workspace-button-background-hover;
|
||||
}
|
||||
line-height:50px
|
||||
}
|
||||
|
||||
.red-ui-editor-radial-menu-opt-disabled {
|
||||
|
@@ -29,10 +29,6 @@
|
||||
.red-ui-searchBox-container {
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&:not(.red-ui-type-search) .red-ui-searchBox-container {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
}
|
||||
|
@@ -20,10 +20,6 @@
|
||||
height: 100%;
|
||||
overflow-y:auto;
|
||||
@include disable-selection;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
ul.red-ui-sidebar-node-config-list {
|
||||
|
@@ -39,13 +39,6 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
button.red-ui-toggleButton.toggle {
|
||||
text-align: center;
|
||||
i {
|
||||
min-width: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-sidebar-context-property {
|
||||
|
@@ -321,12 +321,15 @@ div.red-ui-info-table {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.red-ui-treeList-label {
|
||||
font-size: 13px;
|
||||
padding: 2px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.red-ui-info-outline-project {
|
||||
border-bottom: 1px solid $secondary-border-color;
|
||||
}
|
||||
}
|
||||
.red-ui-info-outline,.red-ui-sidebar-help-toc, #red-ui-clipboard-dialog-import-conflicts-list {
|
||||
|
||||
.red-ui-info-outline-item {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
@@ -363,12 +366,6 @@ div.red-ui-info-table {
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-treeList-label {
|
||||
font-size: 13px;
|
||||
padding: 2px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.red-ui-search-result-node {
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
@@ -390,7 +387,6 @@ div.red-ui-info-table {
|
||||
color: $secondary-text-color;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-info-outline-item-control-spacer {
|
||||
display: inline-block;
|
||||
width: 23px;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
color: $secondary-text-color;
|
||||
cursor: pointer;
|
||||
input {
|
||||
display:none !important;
|
||||
display:none;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
|
@@ -95,12 +95,6 @@
|
||||
}
|
||||
}
|
||||
.red-ui-searchBox-compact {
|
||||
|
||||
input:focus.red-ui-searchBox-input {
|
||||
outline: 1px solid $form-input-focus-color;
|
||||
}
|
||||
|
||||
|
||||
input.red-ui-searchBox-input,input:focus.red-ui-searchBox-input {
|
||||
border: 1px solid $secondary-border-color;
|
||||
border-radius: 3px;
|
||||
|
@@ -18,7 +18,6 @@
|
||||
border: 1px solid $form-input-border-color;
|
||||
border-radius: 4px;
|
||||
height: 34px;
|
||||
line-height: 14px;
|
||||
display: inline-flex;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
@@ -26,14 +25,6 @@
|
||||
box-sizing: border-box;
|
||||
overflow:visible;
|
||||
position: relative;
|
||||
&[disabled] {
|
||||
input, button {
|
||||
background: $secondary-background-inactive;
|
||||
pointer-events: none;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-typedInput-input-wrap {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
.uneditable-input, input[type="text"],input[type="password"], textarea {
|
||||
.uneditable-input, input, textarea {
|
||||
width: calc(100% - 150px);
|
||||
}
|
||||
textarea {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user