From 03aa77a1ab2e7b1e0b5bca4d76175778b60b2997 Mon Sep 17 00:00:00 2001 From: htmltiger <1429451+htmltiger@users.noreply.github.com> Date: Sun, 6 Aug 2023 23:16:36 +0100 Subject: [PATCH 1/2] display reconnect time as sec --- io/serialport/25-serial.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/io/serialport/25-serial.html b/io/serialport/25-serial.html index 90a5740b..39e40cc6 100644 --- a/io/serialport/25-serial.html +++ b/io/serialport/25-serial.html @@ -220,8 +220,8 @@ - - + + @@ -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); From 7a92fc596c1b4b05f0bff1205ca1243e839caab3 Mon Sep 17 00:00:00 2001 From: htmltiger <1429451+htmltiger@users.noreply.github.com> Date: Sun, 6 Aug 2023 23:19:56 +0100 Subject: [PATCH 2/2] add seconds in json --- io/serialport/locales/en-US/25-serial.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/serialport/locales/en-US/25-serial.json b/io/serialport/locales/en-US/25-serial.json index 38af6560..bd70a965 100644 --- a/io/serialport/locales/en-US/25-serial.json +++ b/io/serialport/locales/en-US/25-serial.json @@ -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",