mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Adding a validator to the timeout field and included the timeout in the lable by default
This commit is contained in:
parent
d13a569c49
commit
e255cf7659
@ -40,13 +40,13 @@
|
|||||||
color:"#E6E0F8",
|
color:"#E6E0F8",
|
||||||
defaults: { // defines the editable properties of the node
|
defaults: { // defines the editable properties of the node
|
||||||
name: {value:""}, // along with default values.
|
name: {value:""}, // along with default values.
|
||||||
timeout: {value:"5", required:true}
|
timeout: {value:"5", required:true, validate:RED.validators.number()}
|
||||||
},
|
},
|
||||||
inputs:1, // set the number of inputs - only 0 or 1
|
inputs:1, // set the number of inputs - only 0 or 1
|
||||||
outputs:1, // set the number of outputs - 0 to n
|
outputs:1, // set the number of outputs - 0 to n
|
||||||
icon: "arrow-in.png", // set the icon (held in public/icons)
|
icon: "arrow-in.png", // set the icon (held in public/icons)
|
||||||
label: function() { // sets the default label contents
|
label: function() { // sets the default label contents
|
||||||
return this.name||this.topic||"pause";
|
return this.name||this.topic||"pause "+this.timeout+" s";
|
||||||
},
|
},
|
||||||
labelStyle: function() { // sets the class to apply to the label
|
labelStyle: function() { // sets the class to apply to the label
|
||||||
return this.name?"node_label_italic":"";
|
return this.name?"node_label_italic":"";
|
||||||
|
Loading…
Reference in New Issue
Block a user