mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
d3efb9d7cc
commit
679e07189d
@ -353,14 +353,16 @@
|
|||||||
},
|
},
|
||||||
oneditprepare: function() {
|
oneditprepare: function() {
|
||||||
var node = this;
|
var node = this;
|
||||||
|
var payloadType = node.payloadType;
|
||||||
|
|
||||||
if (node.payloadType == null) {
|
if (node.payloadType == null) {
|
||||||
if (node.payload == "") {
|
if (node.payload == "") {
|
||||||
node.payloadType = "date";
|
payloadType = "date";
|
||||||
} else {
|
} else {
|
||||||
node.payloadType = "str";
|
payloadType = "str";
|
||||||
}
|
}
|
||||||
} else if (node.payloadType === 'string' || node.payloadType === 'none') {
|
} else if (node.payloadType === 'string' || node.payloadType === 'none') {
|
||||||
node.payloadType = "str";
|
payloadType = "str";
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#inject-time-type-select").on("change", function() {
|
$("#inject-time-type-select").on("change", function() {
|
||||||
@ -557,7 +559,7 @@
|
|||||||
var payload = {
|
var payload = {
|
||||||
p:'payload',
|
p:'payload',
|
||||||
v: node.payload ? node.payload : '',
|
v: node.payload ? node.payload : '',
|
||||||
vt:node.payloadType ? node.payloadType : 'date'
|
vt:payloadType ? payloadType : 'date'
|
||||||
};
|
};
|
||||||
var topic = {
|
var topic = {
|
||||||
p:'topic',
|
p:'topic',
|
||||||
@ -573,7 +575,7 @@
|
|||||||
if (newProp.v === undefined) {
|
if (newProp.v === undefined) {
|
||||||
if (prop.p === 'payload') {
|
if (prop.p === 'payload') {
|
||||||
newProp.v = node.payload ? node.payload : '';
|
newProp.v = node.payload ? node.payload : '';
|
||||||
newProp.vt = node.payloadType ? node.payloadType : 'date';
|
newProp.vt = payloadType ? payloadType : 'date';
|
||||||
} else if (prop.p === 'topic' && prop.vt === "str") {
|
} else if (prop.p === 'topic' && prop.vt === "str") {
|
||||||
newProp.v = node.topic ? node.topic : '';
|
newProp.v = node.topic ? node.topic : '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user