1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Merge pull request #1 from htmltiger/htmltiger-patch-1

display reconnect time as sec
This commit is contained in:
htmltiger 2023-08-06 23:26:22 +01:00 committed by GitHub
commit d73bb47ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -220,8 +220,8 @@
<label for="node-config-input-autoConnect"><span data-i18n="serial.label.autoconnect"></span></label>
<input type="checkbox" id="node-config-input-autoConnect" style="width:auto; margin-bottom: 4px;"/>
<span data-i18n="serial.label.serialReconnectTime"></span>
<input type="number" id="node-config-input-serialReconnectTime" style="width:90px; height:28px;">
<span data-i18n="serial.label.ms"></span>
<input type="number" id="node-config-input-serialReconnectTime" style="width:60px; height:28px;">
<span data-i18n="serial.label.sec"></span>
</div>
</div>
<div class="form-tips" id="tip-waitfor" hidden><span data-i18n="serial.tip.waitfor"></span></div>
@ -265,7 +265,12 @@
},
oneditprepare: function() {
if(typeof this.autoConnect === "undefined"){ this.autoConnect = true; }
var defReconnectTime = RED.settings.serialReconnectTime || 15000;
$('#node-config-input-serialReconnectTime').attr('placeholder',Math.round(defReconnectTime/1000));
var reconnectms = $('#node-config-input-serialReconnectTime').val();
if(reconnectms){
$('#node-config-input-serialReconnectTime').val(Math.round(reconnectms/1000));
}
var previous = null;
var blist = [
{value:"230400",label:"230400",hasValue:false},
@ -362,9 +367,13 @@
}).autocomplete("search","");
});
});
},
oneditsave: function() {
var reconnectms = $('#node-config-input-serialReconnectTime').val();
if(reconnectms){
$('#node-config-input-serialReconnectTime').val(reconnectms*1000);
}
var mytype = $("#node-config-input-serialbaud").typedInput('type');
if (mytype !== "other") {
$("#node-config-input-serialbaud").typedInput('value',mytype);

View File

@ -17,8 +17,9 @@
"output": "Output",
"request": "Request",
"responsetimeout": "Default response timeout",
"serialReconnectTime": "Default Reconnect time",
"serialReconnectTime": "Reconnect After",
"ms": "ms",
"sec": "Seconds",
"serial": "serial",
"none": "none",
"start": "Optionally wait for a start character of",