From 9cef7848c5c51585b9a72aae0e3b678a61e82f59 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Mon, 22 Apr 2024 07:37:31 +1000 Subject: [PATCH] =?UTF-8?q?encode=20special=20characters=20when=20saving?= =?UTF-8?q?=20device=20details=20#644=F0=9F=9A=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/deviceDetails.php | 12 ++++++------ front/plugins/_publisher_mqtt/README.md | 2 +- front/plugins/_publisher_mqtt/config.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/front/deviceDetails.php b/front/deviceDetails.php index fcf6d2e9..c1c9cb59 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -1443,15 +1443,15 @@ function setDeviceData (direction='', refreshCallback='') { // update data to server $.get('php/server/devices.php?action=setDeviceData&mac='+ mac - + '&name=' + $('#txtName').val() - + '&owner=' + $('#txtOwner').val() + + '&name=' + encodeURIComponent($('#txtName').val()) + + '&owner=' + encodeURIComponent($('#txtOwner').val()) + '&type=' + $('#txtDeviceType').val() - + '&vendor=' + $('#txtVendor').val() + + '&vendor=' + encodeURIComponent($('#txtVendor').val()) + '&icon=' + encodeURIComponent($('#txtIcon').val()) + '&favorite=' + ($('#chkFavorite')[0].checked * 1) - + '&group=' + $('#txtGroup').val() - + '&location=' + $('#txtLocation').val() - + '&comments=' + $('#txtComments').val() + + '&group=' + encodeURIComponent($('#txtGroup').val()) + + '&location=' + encodeURIComponent($('#txtLocation').val()) + + '&comments=' + encodeURIComponent($('#txtComments').val()) + '&networknode=' + $('#txtNetworkNodeMac').attr('data-mynodemac') + '&networknodeport=' + $('#txtNetworkPort').val() + '&staticIP=' + ($('#chkStaticIP')[0].checked * 1) diff --git a/front/plugins/_publisher_mqtt/README.md b/front/plugins/_publisher_mqtt/README.md index dc1f7c9f..f24cf631 100755 --- a/front/plugins/_publisher_mqtt/README.md +++ b/front/plugins/_publisher_mqtt/README.md @@ -9,7 +9,7 @@ ### Notes -The first run will take a while, subsequent should be much faster because new sensors don't have to be created anymore. A bit of background: +The first run will take a while, subsequent should be much faster because new sensors don't have to be created anymore. If the first sync times out, try to increase the timeout setting (default: 10s per device). A bit of background: 1. The app keeps a hash of the sensors. The hash includes: - deviceId: Unique identifier for the device associated with the sensor. diff --git a/front/plugins/_publisher_mqtt/config.json b/front/plugins/_publisher_mqtt/config.json index 0313e06d..18a8a826 100755 --- a/front/plugins/_publisher_mqtt/config.json +++ b/front/plugins/_publisher_mqtt/config.json @@ -332,7 +332,7 @@ { "function": "RUN_TIMEOUT", "type": "integer", - "default_value": 10, + "default_value": 20, "options": [], "localized": ["name", "description"], "name" : [{