mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 15:34:26 +01:00
Merge branch 'master' into dev
This commit is contained in:
@@ -44,6 +44,51 @@ RED.nodes = (function() {
|
||||
|
||||
var dirty = false;
|
||||
|
||||
const internalProperties = [
|
||||
"changed",
|
||||
"dirty",
|
||||
"id",
|
||||
"inputLabels",
|
||||
"moved",
|
||||
"outputLabels",
|
||||
"selected",
|
||||
"type",
|
||||
"users",
|
||||
"valid",
|
||||
"validationErrors",
|
||||
"wires",
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"e",
|
||||
"f",
|
||||
"g",
|
||||
"h",
|
||||
"i",
|
||||
"j",
|
||||
"k",
|
||||
"l",
|
||||
"m",
|
||||
"n",
|
||||
"o",
|
||||
"p",
|
||||
"q",
|
||||
"r",
|
||||
"s",
|
||||
"t",
|
||||
"u",
|
||||
"v",
|
||||
"w",
|
||||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"_",
|
||||
"_config",
|
||||
"_def",
|
||||
"_orig"
|
||||
];
|
||||
|
||||
function setDirty(d) {
|
||||
dirty = d;
|
||||
if (!d) {
|
||||
@@ -231,7 +276,6 @@ RED.nodes = (function() {
|
||||
def.type = nt;
|
||||
nodeDefinitions[nt] = def;
|
||||
|
||||
|
||||
if (def.defaults) {
|
||||
for (var d in def.defaults) {
|
||||
if (def.defaults.hasOwnProperty(d)) {
|
||||
@@ -242,6 +286,11 @@ RED.nodes = (function() {
|
||||
console.warn(err);
|
||||
}
|
||||
}
|
||||
|
||||
if (internalProperties.includes(d)) {
|
||||
console.warn(`registerType: ${nt}: the property "${d}" is internal and cannot be used.`);
|
||||
delete def.defaults[d];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,16 @@ module.exports = function(RED) {
|
||||
function CompleteNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var node = this;
|
||||
this.scope = n.scope;
|
||||
this.scope = n.scope || [];
|
||||
|
||||
// auto-filter out any directly connected nodes to avoid simple loopback
|
||||
const w = this.wires.flat();
|
||||
for (let i=0; i < this.scope.length; i++) {
|
||||
if (w.includes(this.scope[i])) {
|
||||
this.scope.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
this.on("input",function(msg, send, done) {
|
||||
send(msg);
|
||||
done();
|
||||
|
||||
@@ -20,7 +20,16 @@ module.exports = function(RED) {
|
||||
function StatusNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var node = this;
|
||||
this.scope = n.scope;
|
||||
this.scope = n.scope || [];
|
||||
|
||||
// auto-filter out any directly connected nodes to avoid simple loopback
|
||||
const w = this.wires.flat();
|
||||
for (let i=0; i < this.scope.length; i++) {
|
||||
if (w.includes(this.scope[i])) {
|
||||
this.scope.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
this.on("input", function(msg, send, done) {
|
||||
send(msg);
|
||||
done();
|
||||
|
||||
@@ -675,7 +675,7 @@ module.exports = function(RED) {
|
||||
node.options.password = node.password;
|
||||
node.options.keepalive = node.keepalive;
|
||||
node.options.clean = node.cleansession;
|
||||
node.options.clientId = node.clientid || 'nodered_' + RED.util.generateId();
|
||||
node.options.clientId = node.clientid || 'nodered' + RED.util.generateId();
|
||||
node.options.reconnectPeriod = RED.settings.mqttReconnectTime||5000;
|
||||
delete node.options.protocolId; //V4+ default
|
||||
delete node.options.protocolVersion; //V4 default
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<p>Wenn <code>msg.payload</code> ein Objekt ist, setzt der Node automatisch den Inhaltstyp der Anforderung
|
||||
auf <code>application/json</code> und kodiert den Hauptteil als solchen.</p>
|
||||
<p>Um die Anforderung als Formulardaten zu kodieren, sollte <code>msg.headers["content-type"]</code> auf
|
||||
<code>application/x-wwww-form-urlencoded</code> gesetzt werden.</p>
|
||||
<code>application/x-www-form-urlencoded</code> gesetzt werden.</p>
|
||||
<h4><b>Datei-Upload</b></h4>
|
||||
<p>Um einen Datei-Upload umzusetzen, sollte <code>msg.headers["content-type"]</code> auf <code>multipart/form-data</code>
|
||||
gesetzt werden und das an den Node zu sendende <code>msg.payload</code> muss ein Objekt mit folgender Struktur sein:</p>
|
||||
|
||||
Reference in New Issue
Block a user