addec checkbox for autoconnect, fixed default reconnection

This commit is contained in:
htmltiger 2023-06-23 02:30:13 +01:00 committed by GitHub
parent 0c0f45b8f5
commit 64f12e8316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,12 +213,14 @@
</div>
<div class="form-row" style="padding-left:18px; margin-bottom:18px;">
<span data-i18n="serial.label.responsetimeout"></span>
<input type="text" id="node-config-input-responsetimeout" style="width:120px; height:28px;">
<input type="text" id="node-config-input-responsetimeout" style="width:90px; height:28px;">
<span data-i18n="serial.label.ms"></span>
</div>
<div class="form-row" style="padding-left:18px; margin-bottom:18px;">
<div class="form-row" style="margin-bottom:18px;">
<input type="checkbox" id="node-config-input-autoConnect" style="width:auto; margin-bottom: 4px;"/>
<label for="node-config-input-autoConnect"><span data-i18n="serial.label.autoconnect"></span></label>
<span data-i18n="serial.label.serialReconnectTime"></span>
<input type="number" id="node-config-input-serialReconnectTime" style="width:120px; height:28px;">
<input type="number" id="node-config-input-serialReconnectTime" style="width:90px; height:28px;">
<span data-i18n="serial.label.ms"></span>
</div>
</div>
@ -251,7 +253,8 @@
out: {value:"char"},
addchar: {value:""},
responsetimeout: {value: 10000},
serialReconnectTime: {value: 15000}
serialReconnectTime: {value: ""},
autoConnect: {value: true}
},
label: function() {
this.serialbaud = this.serialbaud || 57600;
@ -261,6 +264,8 @@
return this.serialport+":"+this.serialbaud+"-"+this.databits+this.parity.charAt(0).toUpperCase()+this.stopbits;
},
oneditprepare: function() {
if(typeof this.autoConnect === "undefined"){ this.autoConnect = true; }
var previous = null;
var blist = [
{value:"230400",label:"230400",hasValue:false},
@ -357,6 +362,7 @@
}).autocomplete("search","");
});
});
},
oneditsave: function() {
var mytype = $("#node-config-input-serialbaud").typedInput('type');