@node-red/nodes 3.0.2 → 3.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/core/common/20-inject.js +48 -29
  2. package/core/common/24-complete.html +1 -1
  3. package/core/common/25-catch.html +2 -2
  4. package/core/common/25-status.html +2 -2
  5. package/core/common/91-global-config.html +27 -0
  6. package/core/common/91-global-config.js +7 -0
  7. package/core/function/10-function.html +12 -8
  8. package/core/function/15-change.js +1 -1
  9. package/core/function/16-range.html +1 -0
  10. package/core/function/16-range.js +6 -2
  11. package/core/function/80-template.html +2 -1
  12. package/core/function/89-delay.js +34 -30
  13. package/core/function/89-trigger.html +8 -1
  14. package/core/network/05-tls.html +3 -3
  15. package/core/network/06-httpproxy.html +1 -0
  16. package/core/network/10-mqtt.html +13 -5
  17. package/core/network/10-mqtt.js +51 -28
  18. package/core/network/21-httpin.html +1 -0
  19. package/core/network/21-httpin.js +12 -3
  20. package/core/network/21-httprequest.html +1 -0
  21. package/core/network/21-httprequest.js +5 -0
  22. package/core/network/31-tcpin.js +1 -1
  23. package/core/parsers/70-CSV.js +16 -5
  24. package/core/sequence/17-split.html +6 -1
  25. package/core/sequence/17-split.js +3 -1
  26. package/core/sequence/19-batch.html +8 -1
  27. package/core/storage/10-file.html +0 -0
  28. package/locales/de/common/20-inject.html +0 -0
  29. package/locales/de/common/21-debug.html +0 -0
  30. package/locales/de/common/25-catch.html +0 -0
  31. package/locales/de/common/25-status.html +0 -0
  32. package/locales/de/common/60-link.html +0 -0
  33. package/locales/de/common/90-comment.html +0 -0
  34. package/locales/de/common/98-unknown.html +0 -0
  35. package/locales/de/function/10-function.html +0 -0
  36. package/locales/de/function/10-switch.html +0 -0
  37. package/locales/de/function/15-change.html +0 -0
  38. package/locales/de/function/16-range.html +0 -0
  39. package/locales/de/function/80-template.html +0 -0
  40. package/locales/de/function/89-delay.html +0 -0
  41. package/locales/de/function/89-trigger.html +0 -0
  42. package/locales/de/function/90-exec.html +0 -0
  43. package/locales/de/messages.json +0 -0
  44. package/locales/de/network/05-tls.html +0 -0
  45. package/locales/de/network/06-httpproxy.html +0 -0
  46. package/locales/de/network/10-mqtt.html +0 -0
  47. package/locales/de/network/21-httpin.html +0 -0
  48. package/locales/de/network/21-httprequest.html +0 -0
  49. package/locales/de/network/22-websocket.html +0 -0
  50. package/locales/de/network/31-tcpin.html +0 -0
  51. package/locales/de/network/32-udp.html +0 -0
  52. package/locales/de/parsers/70-CSV.html +0 -0
  53. package/locales/de/parsers/70-HTML.html +0 -0
  54. package/locales/de/parsers/70-JSON.html +0 -0
  55. package/locales/de/parsers/70-XML.html +0 -0
  56. package/locales/de/parsers/70-YAML.html +0 -0
  57. package/locales/de/sequence/17-split.html +0 -0
  58. package/locales/de/sequence/18-sort.html +0 -0
  59. package/locales/de/sequence/19-batch.html +0 -0
  60. package/locales/de/storage/10-file.html +0 -0
  61. package/locales/de/storage/23-watch.html +0 -0
  62. package/locales/en-US/common/90-comment.html +1 -1
  63. package/locales/en-US/common/91-global-config.html +3 -0
  64. package/locales/en-US/function/16-range.html +3 -0
  65. package/locales/en-US/function/80-template.html +3 -0
  66. package/locales/en-US/messages.json +10 -2
  67. package/locales/en-US/parsers/70-CSV.html +1 -0
  68. package/locales/ja/common/91-global-config.html +3 -0
  69. package/locales/ja/function/80-template.html +3 -0
  70. package/locales/ja/messages.json +14 -5
  71. package/locales/ja/parsers/70-CSV.html +1 -0
  72. package/locales/ko/messages.json +0 -0
  73. package/locales/ru/messages.json +0 -0
  74. package/package.json +6 -6
@@ -95,45 +95,64 @@ module.exports = function(RED) {
95
95
  }
96
96
 
97
97
  this.on("input", function(msg, send, done) {
98
- var errors = [];
99
- var props = this.props;
98
+ const errors = [];
99
+ let props = this.props;
100
100
  if (msg.__user_inject_props__ && Array.isArray(msg.__user_inject_props__)) {
101
101
  props = msg.__user_inject_props__;
102
102
  }
103
103
  delete msg.__user_inject_props__;
104
- props.forEach(p => {
105
- var property = p.p;
106
- var value = p.v ? p.v : '';
107
- var valueType = p.vt ? p.vt : 'str';
108
-
109
- if (!property) return;
104
+ props = [...props]
105
+ function evaluateProperty(doneEvaluating) {
106
+ if (props.length === 0) {
107
+ doneEvaluating()
108
+ return
109
+ }
110
+ const p = props.shift()
111
+ const property = p.p;
112
+ const value = p.v ? p.v : '';
113
+ const valueType = p.vt ? p.vt : 'str';
110
114
 
111
- if (valueType === "jsonata") {
112
- if (p.v) {
113
- try {
114
- var exp = RED.util.prepareJSONataExpression(p.v, node);
115
- var val = RED.util.evaluateJSONataExpression(exp, msg);
116
- RED.util.setMessageProperty(msg, property, val, true);
115
+ if (property) {
116
+ if (valueType === "jsonata") {
117
+ if (p.v) {
118
+ try {
119
+ var exp = RED.util.prepareJSONataExpression(p.v, node);
120
+ var val = RED.util.evaluateJSONataExpression(exp, msg);
121
+ RED.util.setMessageProperty(msg, property, val, true);
122
+ }
123
+ catch (err) {
124
+ errors.push(err.message);
125
+ }
117
126
  }
118
- catch (err) {
119
- errors.push(err.message);
127
+ evaluateProperty(doneEvaluating)
128
+ } else {
129
+ try {
130
+ RED.util.evaluateNodeProperty(value, valueType, node, msg, (err, newValue) => {
131
+ if (err) {
132
+ errors.push(err.toString())
133
+ } else {
134
+ RED.util.setMessageProperty(msg,property,newValue,true);
135
+ }
136
+ evaluateProperty(doneEvaluating)
137
+ })
138
+ } catch (err) {
139
+ errors.push(err.toString());
140
+ evaluateProperty(doneEvaluating)
120
141
  }
121
142
  }
122
- return;
123
- }
124
- try {
125
- RED.util.setMessageProperty(msg,property,RED.util.evaluateNodeProperty(value, valueType, this, msg),true);
126
- } catch (err) {
127
- errors.push(err.toString());
143
+ } else {
144
+ evaluateProperty(doneEvaluating)
128
145
  }
129
- });
130
-
131
- if (errors.length) {
132
- done(errors.join('; '));
133
- } else {
134
- send(msg);
135
- done();
136
146
  }
147
+
148
+ evaluateProperty(() => {
149
+ if (errors.length) {
150
+ done(errors.join('; '));
151
+ } else {
152
+ send(msg);
153
+ done();
154
+ }
155
+ })
137
156
  });
138
157
  }
139
158
 
@@ -1,6 +1,6 @@
1
1
  <script type="text/html" data-template-name="complete">
2
2
  <div class="form-row node-input-target-row">
3
- <button id="node-input-complete-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
3
+ <button type="button" id="node-input-complete-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
4
4
  </div>
5
5
  <div class="form-row node-input-target-row node-input-target-list-row" style="position: relative; min-height: 100px">
6
6
  <div style="position: absolute; top: -30px; right: 0;"><input type="text" id="node-input-complete-target-filter"></div>
@@ -4,7 +4,7 @@
4
4
  <label style="width: auto" for="node-input-scope" data-i18n="catch.label.source"></label>
5
5
  <select id="node-input-scope-select">
6
6
  <option value="all" data-i18n="catch.scope.all"></option>
7
- <option value="target" data-i18n="catch.scope.selected"></options>
7
+ <option value="target" data-i18n="catch.scope.selected"></option>
8
8
  </select>
9
9
  </div>
10
10
  <div class="form-row node-input-uncaught-row">
@@ -12,7 +12,7 @@
12
12
  <label for="node-input-uncaught" style="width: auto" data-i18n="catch.label.uncaught"></label>
13
13
  </div>
14
14
  <div class="form-row node-input-target-row">
15
- <button id="node-input-catch-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
15
+ <button type="button" id="node-input-catch-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
16
16
  </div>
17
17
  <div class="form-row node-input-target-row node-input-target-list-row" style="position: relative; min-height: 100px">
18
18
  <div style="position: absolute; top: -30px; right: 0;"><input type="text" id="node-input-catch-target-filter"></div>
@@ -4,11 +4,11 @@
4
4
  <label style="width: auto" for="node-input-scope" data-i18n="status.label.source"></label>
5
5
  <select id="node-input-scope-select">
6
6
  <option value="all" data-i18n="status.scope.all"></option>
7
- <option value="target" data-i18n="status.scope.selected"></options>
7
+ <option value="target" data-i18n="status.scope.selected"></option>
8
8
  </select>
9
9
  </div>
10
10
  <div class="form-row node-input-target-row">
11
- <button id="node-input-status-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
11
+ <button type="button" id="node-input-status-target-select" class="red-ui-button" data-i18n="common.label.selectNodes"></button>
12
12
  </div>
13
13
  <div class="form-row node-input-target-row node-input-target-list-row" style="position: relative; min-height: 100px">
14
14
  <div style="position: absolute; top: -30px; right: 0;"><input type="text" id="node-input-status-target-filter"></div>
@@ -0,0 +1,27 @@
1
+ <script type="text/html" data-template-name="global-config">
2
+   <div class="form-row">
3
+ <label style="width: 100%"><span data-i18n="global-config.label.open-conf"></span>:</label>
4
+ </div>
5
+ <div class="form-row">
6
+ <button class="red-ui-button" type="button" id="node-input-edit-env-var" data-i18n="editor:env-var.header" style="margin-left: 20px"></button>
7
+ </div>
8
+ </script>
9
+
10
+ <script type="text/javascript">
11
+ RED.nodes.registerType('global-config',{
12
+ category: 'config',
13
+ defaults: {
14
+ name: { value: "" },
15
+ env: { value: [] },
16
+ },
17
+ credentials: {
18
+ map: { type: "map" }
19
+ },
20
+ oneditprepare: function() {
21
+ $('#node-input-edit-env-var').on('click', function(evt) {
22
+ RED.actions.invoke('core:show-user-settings', 'envvar')
23
+ });
24
+ },
25
+ hasUsers: false
26
+ });
27
+ </script>
@@ -0,0 +1,7 @@
1
+ module.exports = function(RED) {
2
+ "use strict";
3
+ function GlobalConfigNode(n) {
4
+ RED.nodes.createNode(this,n);
5
+ }
6
+ RED.nodes.registerType("global-config", GlobalConfigNode);
7
+ }
@@ -17,6 +17,8 @@
17
17
  display: flex;
18
18
  background: var(--red-ui-tertiary-background);
19
19
  padding-right: 75px;
20
+ border-top-left-radius: 3px;
21
+ border-top-right-radius: 3px;
20
22
  }
21
23
  #node-input-libs-container-row .red-ui-editableList-header > div {
22
24
  flex-grow: 1;
@@ -91,21 +93,21 @@
91
93
  <div id="func-tab-init" style="display:none">
92
94
  <div class="form-row node-text-editor-row" style="position:relative">
93
95
  <div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-init-editor" ></div>
94
- <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button id="node-init-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
96
+ <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button type="button" id="node-init-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
95
97
  </div>
96
98
  </div>
97
99
 
98
100
  <div id="func-tab-body" style="display:none">
99
101
  <div class="form-row node-text-editor-row" style="position:relative">
100
102
  <div style="height: 220px; min-height:150px;" class="node-text-editor" id="node-input-func-editor" ></div>
101
- <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button id="node-function-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
103
+ <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button type="button" id="node-function-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
102
104
  </div>
103
105
  </div>
104
106
 
105
107
  <div id="func-tab-finalize" style="display:none">
106
108
  <div class="form-row node-text-editor-row" style="position:relative">
107
109
  <div style="height: 250px; min-height:150px;" class="node-text-editor" id="node-input-finalize-editor" ></div>
108
- <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button id="node-finalize-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
110
+ <div style="position: absolute; right:0; bottom: calc(100% - 20px); z-Index: 10;"><button type="button" id="node-finalize-expand-js" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button></div>
109
111
  </div>
110
112
  </div>
111
113
 
@@ -294,7 +296,7 @@
294
296
  if (val === "_custom_") {
295
297
  val = $(this).val();
296
298
  }
297
- var varName = val.trim().replace(/^@/,"").replace(/@.*$/,"").replace(/[-_/].?/g, function(v) { return v[1]?v[1].toUpperCase():"" });
299
+ var varName = val.trim().replace(/^@/,"").replace(/@.*$/,"").replace(/[-_/\.].?/g, function(v) { return v[1]?v[1].toUpperCase():"" });
298
300
  fvar.val(varName);
299
301
  fvar.trigger("change");
300
302
 
@@ -451,11 +453,13 @@
451
453
  tabs.activateTab("func-tab-body");
452
454
 
453
455
  $( "#node-input-outputs" ).spinner({
454
- min:0,
456
+ min: 0,
457
+ max: 500,
455
458
  change: function(event, ui) {
456
- var value = this.value;
457
- if (!value.match(/^\d+$/)) { value = 1; }
458
- else if (value < this.min) { value = this.min; }
459
+ var value = parseInt(this.value);
460
+ value = isNaN(value) ? 1 : value;
461
+ value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
462
+ value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
459
463
  if (value !== this.value) { $(this).spinner("value", value); }
460
464
  }
461
465
  });
@@ -318,7 +318,7 @@ module.exports = function(RED) {
318
318
  }
319
319
  var r = node.rules[currentRule];
320
320
  if (r.t === "move") {
321
- if ((r.tot !== r.pt) || (r.p.indexOf(r.to) !== -1)) {
321
+ if ((r.tot !== r.pt) || (r.p.indexOf(r.to) !== -1) && (r.p !== r.to)) {
322
322
  applyRule(msg,{t:"set", p:r.to, pt:r.tot, to:r.p, tot:r.pt},(err,msg) => {
323
323
  applyRule(msg,{t:"delete", p:r.p, pt:r.pt}, (err,msg) => {
324
324
  completeApplyingRules(msg,currentRule,done);
@@ -10,6 +10,7 @@
10
10
  <option value="scale" data-i18n="range.scale.payload"></option>
11
11
  <option value="clamp" data-i18n="range.scale.limit"></option>
12
12
  <option value="roll" data-i18n="range.scale.wrap"></option>
13
+ <option value="drop" data-i18n="range.scale.drop"></option>
13
14
  </select>
14
15
  </div>
15
16
  <br/>
@@ -32,11 +32,15 @@ module.exports = function(RED) {
32
32
  if (value !== undefined) {
33
33
  var n = Number(value);
34
34
  if (!isNaN(n)) {
35
- if (node.action == "clamp") {
35
+ if (node.action === "drop") {
36
+ if (n < node.minin) { done(); return; }
37
+ if (n > node.maxin) { done(); return; }
38
+ }
39
+ if (node.action === "clamp") {
36
40
  if (n < node.minin) { n = node.minin; }
37
41
  if (n > node.maxin) { n = node.maxin; }
38
42
  }
39
- if (node.action == "roll") {
43
+ if (node.action === "roll") {
40
44
  var divisor = node.maxin - node.minin;
41
45
  n = ((n - node.minin) % divisor + divisor) % divisor + node.minin;
42
46
  }
@@ -21,12 +21,13 @@
21
21
  <option value="javascript">JavaScript</option>
22
22
  <option value="css">CSS</option>
23
23
  <option value="markdown">Markdown</option>
24
+ <option value="php">PHP</option>
24
25
  <option value="python">Python</option>
25
26
  <option value="sql">SQL</option>
26
27
  <option value="yaml">YAML</option>
27
28
  <option value="text" data-i18n="template.label.none"></option>
28
29
  </select>
29
- <button id="node-template-expand-editor" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button>
30
+ <button type="button" id="node-template-expand-editor" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button>
30
31
  </div>
31
32
  </div>
32
33
  <div class="form-row node-text-editor-row">
@@ -201,6 +201,7 @@ module.exports = function(RED) {
201
201
  });
202
202
  node.on("close", function() { clearDelayList(); });
203
203
  }
204
+
204
205
  else if (node.pauseType === "random") {
205
206
  node.on("input", function(msg, send, done) {
206
207
  var wait = node.randomFirst + (node.diff * Math.random());
@@ -226,34 +227,19 @@ module.exports = function(RED) {
226
227
  // The rate limit/queue type modes
227
228
  else if (node.pauseType === "rate") {
228
229
  node.on("input", function(msg, send, done) {
229
- if (msg.hasOwnProperty("reset")) {
230
- if (node.intervalID !== -1 ) {
231
- clearInterval(node.intervalID);
232
- node.intervalID = -1;
233
- }
234
- delete node.lastSent;
235
- node.buffer = [];
236
- node.rate = node.fixedrate;
237
- node.status({fill:"blue",shape:"ring",text:0});
238
- done();
239
- return;
240
- }
241
-
242
230
  if (!node.drop) {
243
231
  var m = RED.util.cloneMessage(msg);
244
- delete m.flush;
245
- delete m.lifo;
246
232
  if (Object.keys(m).length > 1) {
247
233
  if (node.intervalID !== -1) {
248
- if (node.allowrate && msg.hasOwnProperty("rate") && !isNaN(parseFloat(msg.rate)) && node.rate !== msg.rate) {
249
- node.rate = msg.rate;
234
+ if (node.allowrate && m.hasOwnProperty("rate") && !isNaN(parseFloat(m.rate)) && node.rate !== m.rate) {
235
+ node.rate = m.rate;
250
236
  clearInterval(node.intervalID);
251
237
  node.intervalID = setInterval(sendMsgFromBuffer, node.rate);
252
238
  }
253
239
  var max_msgs = maxKeptMsgsCount(node);
254
240
  if ((max_msgs > 0) && (node.buffer.length >= max_msgs)) {
255
241
  node.buffer = [];
256
- node.error(RED._("delay.errors.too-many"), msg);
242
+ node.error(RED._("delay.errors.too-many"), m);
257
243
  } else if (msg.toFront === true) {
258
244
  node.buffer.unshift({msg: m, send: send, done: done});
259
245
  node.reportDepth();
@@ -263,8 +249,8 @@ module.exports = function(RED) {
263
249
  }
264
250
  }
265
251
  else {
266
- if (node.allowrate && msg.hasOwnProperty("rate") && !isNaN(parseFloat(msg.rate))) {
267
- node.rate = msg.rate;
252
+ if (node.allowrate && m.hasOwnProperty("rate") && !isNaN(parseFloat(m.rate))) {
253
+ node.rate = m.rate;
268
254
  }
269
255
  send(m);
270
256
  node.reportDepth();
@@ -282,6 +268,8 @@ module.exports = function(RED) {
282
268
  else {
283
269
  while (len > 0) {
284
270
  const msgInfo = node.buffer.shift();
271
+ delete msgInfo.msg.flush;
272
+ delete msgInfo.msg.reset;
285
273
  if (Object.keys(msgInfo.msg).length > 1) {
286
274
  node.send(msgInfo.msg);
287
275
  msgInfo.done();
@@ -335,6 +323,21 @@ module.exports = function(RED) {
335
323
  }
336
324
  done();
337
325
  }
326
+
327
+ if (msg.hasOwnProperty("reset")) {
328
+ if (msg.flush === undefined) {
329
+ if (node.intervalID !== -1 ) {
330
+ clearInterval(node.intervalID);
331
+ node.intervalID = -1;
332
+ }
333
+ delete node.lastSent;
334
+ }
335
+ node.buffer = [];
336
+ node.rate = node.fixedrate;
337
+ node.status({fill:"blue",shape:"ring",text:0});
338
+ done();
339
+ return;
340
+ }
338
341
  });
339
342
  node.on("close", function() {
340
343
  clearInterval(node.intervalID);
@@ -387,22 +390,13 @@ module.exports = function(RED) {
387
390
  node.buffer.push({msg, send, done}); // if not add to end of queue
388
391
  node.reportDepth();
389
392
  }
390
- if (msg.hasOwnProperty("reset")) {
391
- while (node.buffer.length > 0) {
392
- const msgInfo = node.buffer.shift();
393
- msgInfo.done();
394
- }
395
- node.buffer = [];
396
- node.rate = node.fixedrate;
397
- node.status({text:"reset"});
398
- done();
399
- }
400
393
  if (msg.hasOwnProperty("flush")) {
401
394
  var len = node.buffer.length;
402
395
  if (typeof(msg.flush) == 'number') { len = Math.min(Math.floor(msg.flush,len)); }
403
396
  while (len > 0) {
404
397
  const msgInfo = node.buffer.shift();
405
398
  delete msgInfo.msg.flush;
399
+ delete msgInfo.msg.reset;
406
400
  if (Object.keys(msgInfo.msg).length > 2) {
407
401
  node.send(msgInfo.msg);
408
402
  msgInfo.done();
@@ -412,6 +406,16 @@ module.exports = function(RED) {
412
406
  node.status({});
413
407
  done();
414
408
  }
409
+ if (msg.hasOwnProperty("reset")) {
410
+ while (node.buffer.length > 0) {
411
+ const msgInfo = node.buffer.shift();
412
+ msgInfo.done();
413
+ }
414
+ node.buffer = [];
415
+ node.rate = node.fixedrate;
416
+ node.status({text:"reset"});
417
+ done();
418
+ }
415
419
  });
416
420
  node.on("close", function() {
417
421
  clearInterval(node.intervalID);
@@ -25,7 +25,7 @@
25
25
  <select id="node-then-type" style="width:70%;">
26
26
  <option value="block" data-i18n="trigger.wait-reset"></option>
27
27
  <option value="wait" data-i18n="trigger.wait-for"></option>
28
- <option value="loop" data-i18n="trigger.wait-loop"></option>
28
+ <option id="node-trigger-wait-loop" value="loop" data-i18n="trigger.wait-loop"></option>
29
29
  </select>
30
30
  </div>
31
31
  <div class="form-row node-type-duration">
@@ -181,6 +181,13 @@
181
181
  $("#node-input-op2type").val('str');
182
182
  }
183
183
 
184
+ $("#node-input-op1").on("change", function() {
185
+ if ($("#node-input-op1type").val() === "nul") {
186
+ $("#node-trigger-wait-loop").hide();
187
+ }
188
+ else { $("#node-trigger-wait-loop").show(); }
189
+ });
190
+
184
191
  var optionNothing = {value:"nul",label:this._("trigger.output.nothing"),hasValue:false};
185
192
  var optionPayload = {value:"pay",label:this._("trigger.output.existing"),hasValue:false};
186
193
  var optionOriginalPayload = {value:"pay",label:this._("trigger.output.original"),hasValue:false};
@@ -25,7 +25,7 @@
25
25
  <label class="red-ui-button" for="node-config-input-certfile"><i class="fa fa-upload"></i> <span data-i18n="tls.label.upload"></span></label>
26
26
  <input class="hide" type="file" id="node-config-input-certfile">
27
27
  <span id="tls-config-certname" style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;"> </span>
28
- <button class="red-ui-button red-ui-button-small" id="tls-config-button-cert-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
28
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-config-button-cert-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
29
29
  </span>
30
30
  <input type="hidden" id="node-config-input-certname">
31
31
  <input type="hidden" id="node-config-input-certdata">
@@ -37,7 +37,7 @@
37
37
  <label class="red-ui-button" for="node-config-input-keyfile"><i class="fa fa-upload"></i> <span data-i18n="tls.label.upload"></span></label>
38
38
  <input class="hide" type="file" id="node-config-input-keyfile">
39
39
  <span id="tls-config-keyname" style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;"> </span>
40
- <button class="red-ui-button red-ui-button-small" id="tls-config-button-key-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
40
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-config-button-key-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
41
41
  </span>
42
42
  <input type="hidden" id="node-config-input-keyname">
43
43
  <input type="hidden" id="node-config-input-keydata">
@@ -53,7 +53,7 @@
53
53
  <label class="red-ui-button" for="node-config-input-cafile"><i class="fa fa-upload"></i> <span data-i18n="tls.label.upload"></span></label>
54
54
  <input class="hide" type="file" title=" " id="node-config-input-cafile">
55
55
  <span id="tls-config-caname" style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;"> </span>
56
- <button class="red-ui-button red-ui-button-small" id="tls-config-button-ca-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
56
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-config-button-ca-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
57
57
  </span>
58
58
  <input type="hidden" id="node-config-input-caname">
59
59
  <input type="hidden" id="node-config-input-cadata">
@@ -101,6 +101,7 @@
101
101
  hostField.val(data.host);
102
102
  }
103
103
  },
104
+ sortable: true,
104
105
  removable: true
105
106
  });
106
107
  if (this.noproxy) {
@@ -421,7 +421,11 @@
421
421
  <script type="text/javascript">
422
422
  (function() {
423
423
 
424
- var typedInputNoneOpt = { value: 'none', label: '', hasValue: false };
424
+ var typedInputNoneOpt = {
425
+ value: 'none',
426
+ label: RED._("node-red:mqtt.label.none"),
427
+ hasValue: false
428
+ };
425
429
  var makeTypedInputOpt = function(value){
426
430
  return {
427
431
  value: value,
@@ -436,7 +440,11 @@
436
440
  makeTypedInputOpt("text/csv"),
437
441
  makeTypedInputOpt("text/html"),
438
442
  makeTypedInputOpt("text/plain"),
439
- {value:"other", label:""}
443
+ {
444
+ value: "other",
445
+ label: RED._("node-red:mqtt.label.other"),
446
+ icon: "red/images/typedInput/az.svg"
447
+ }
440
448
  ];
441
449
 
442
450
  function getDefaultContentType(value) {
@@ -499,17 +507,17 @@
499
507
  cleansession: {value: true},
500
508
  birthTopic: {value:"", validate:validateMQTTPublishTopic},
501
509
  birthQos: {value:"0"},
502
- birthRetain: {value:false},
510
+ birthRetain: {value:"false"},
503
511
  birthPayload: {value:""},
504
512
  birthMsg: { value: {}},
505
513
  closeTopic: {value:"", validate:validateMQTTPublishTopic},
506
514
  closeQos: {value:"0"},
507
- closeRetain: {value:false},
515
+ closeRetain: {value:"false"},
508
516
  closePayload: {value:""},
509
517
  closeMsg: { value: {}},
510
518
  willTopic: {value:"", validate:validateMQTTPublishTopic},
511
519
  willQos: {value:"0"},
512
- willRetain: {value:false},
520
+ willRetain: {value:"false"},
513
521
  willPayload: {value:""},
514
522
  willMsg: { value: {}},
515
523
  userProps: { value: ""},