Apply suggestions from code review

This commit is contained in:
Nick O'Leary 2023-06-21 14:27:32 +01:00 committed by GitHub
parent 20d2c11154
commit aa0225f59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View File

@ -84,7 +84,7 @@
<div class="form-row">
<label for="node-input-timeout"><i class="fa fa-clock"></i> <span data-i18n="function.label.timeout"></span></label>
<input id="node-input-timeout" style="width: 60px;" value="1000">
<input id="node-input-timeout" style="width: 60px;" data-i18n="[placeholder]join.seconds">
</div>
<div class="form-row node-input-libs-row hide" style="margin-bottom: 0px;">
@ -470,10 +470,10 @@
}
});
// 4294967295 is max in node.js timeout.
// 4294967 is max in node.js timeout.
$( "#node-input-timeout" ).spinner({
min: 0,
max: 4294967294,
max: 4294967,
change: function(event, ui) {
var value = this.value;
if(value == ""){

View File

@ -96,7 +96,7 @@ module.exports = function(RED) {
node.name = n.name;
node.func = n.func;
node.outputs = n.outputs;
node.timeout = n.timeout*1;
node.timeout = n.timeout*1000;
if(node.timeout>0){
node.timeoutOptions = {
timeout:node.timeout,

View File

@ -217,7 +217,7 @@
"finalize": "Stopp",
"outputs": "Ausgänge",
"modules": "Module",
"timeout": "Timeout (ms)"
"timeout": "Timeout"
},
"text": {
"initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\n",

View File

@ -253,7 +253,7 @@
"finalize": "On Stop",
"outputs": "Outputs",
"modules": "Modules",
"timeout": "Timeout (ms)"
"timeout": "Timeout"
},
"text": {
"initialize": "// Code added here will be run once\n// whenever the node is started.\n",

View File

@ -213,7 +213,7 @@
"initialize": "Настройка",
"finalize": "Закрытие",
"outputs": "Выходы",
"timeout":"Время ожидания (мс)"
"timeout":"Время ожидания"
},
"text": {
"initialize": "// Добавленный здесь код будет исполняться\n// однократно при развертывании узла.\n",

View File

@ -1425,7 +1425,7 @@ describe('function node', function() {
});
it('should timeout if timeout is set', function(done) {
var flow = [{id:"n1",type:"function",wires:[["n2"]],timeout:"10",func:"while(1==1){};\nreturn msg;"}];
var flow = [{id:"n1",type:"function",wires:[["n2"]],timeout:"0.010",func:"while(1==1){};\nreturn msg;"}];
helper.load(functionNode, flow, function() {
var n1 = helper.getNode("n1");
n1.receive({payload:"foo",topic: "bar"});