diff --git a/front/deviceDetailsEdit.php b/front/deviceDetailsEdit.php index d2771de3..ee512e10 100755 --- a/front/deviceDetailsEdit.php +++ b/front/deviceDetailsEdit.php @@ -388,7 +388,7 @@ }, error: function (xhr) { if (xhr.status === 403) { - showMessage("Unauthorized – invalid API token"); + showMessage("Unauthorized - invalid API token"); } else { showMessage("Failed to save device (" + xhr.status + ")"); } diff --git a/front/js/common.js b/front/js/common.js index 8e7b0365..25d6f330 100755 --- a/front/js/common.js +++ b/front/js/common.js @@ -1000,7 +1000,8 @@ function isRandomMAC(mac) return input; } // Empty array - if (input === '[]' || input === '') { + // if (input === '[]' || input === '') { + if (input === '[]') { return []; } // handle integer diff --git a/front/js/settings_utils.js b/front/js/settings_utils.js index aa509180..2f713b73 100755 --- a/front/js/settings_utils.js +++ b/front/js/settings_utils.js @@ -1135,16 +1135,19 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) { function generateFormHtml(settingsData, set, overrideValue, overrideOptions, originalSetKey) { let inputHtml = ''; - isEmpty(overrideValue) ? inVal = set['setValue'] : inVal = overrideValue; + + // if override value is considered empty initialize from setting defaults + overrideValue == null || overrideValue == undefined ? inVal = set['setValue'] : inVal = overrideValue const setKey = set['setKey']; const setType = set['setType']; - // if (setKey == '') { + // if (setKey == 'NEWDEV_devParentMAC') { - // console.log(setType); - // console.log(setKey); - // console.log(overrideValue); - // console.log(inVal); + // console.log("==== DEBUG OUTPUT BELOW 1 ===="); + // console.log(setType); + // console.log(setKey); + // console.log(overrideValue); + // console.log(inVal); // } @@ -1186,15 +1189,16 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori // Override value let val = valRes; - // if (setKey == '') { + // if (setKey == 'NEWDEV_devParentMAC') { + // console.log("==== DEBUG OUTPUT BELOW 2 ===="); // console.log(setType); // console.log(setKey); // console.log(overrideValue); // console.log(inVal); // console.log(val); - // } + // } // Generate HTML based on elementType switch (elementType) { @@ -1340,7 +1344,7 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori let j = 0; columnSettings.forEach(set => { - // Extract the value for the current column based on the new structure + // Extract the value for the current column let columnOverrideValue = rowData[j] && Object.values(rowData[j])[0]; if(columnOverrideValue == undefined) diff --git a/server/models/device_instance.py b/server/models/device_instance.py index 103b0cfd..91812075 100755 --- a/server/models/device_instance.py +++ b/server/models/device_instance.py @@ -590,6 +590,10 @@ class DeviceInstance: cur.execute(sql, values) conn.commit() conn.close() + + mylog("debug", f"[DeviceInstance] setDeviceData SQL: {sql.strip()}") + mylog("debug", f"[DeviceInstance] setDeviceData VALUES:{values}") + return {"success": True} except Exception as e: if conn: