mirror of https://github.com/aredn/aredn.git
Setting POE or USB to off caused 'Bad Gateway' (#264)
This commit is contained in:
parent
125f49d640
commit
c1ab4f9a51
|
@ -163,7 +163,7 @@ local settings = {
|
||||||
{
|
{
|
||||||
key = "aredn.@poe[0].passthrough",
|
key = "aredn.@poe[0].passthrough",
|
||||||
type = "boolean",
|
type = "boolean",
|
||||||
desc = "Specifies whether a PoE passthrough port should be on or off. (Not all devices have PoE passthrough ports.",
|
desc = "Specifies whether a PoE passthrough port should be on or off. (Not all devices have PoE passthrough ports).",
|
||||||
default = "0",
|
default = "0",
|
||||||
condition = "hasPOE()",
|
condition = "hasPOE()",
|
||||||
postcallback = "setPOEOutput()"
|
postcallback = "setPOEOutput()"
|
||||||
|
@ -171,7 +171,7 @@ local settings = {
|
||||||
{
|
{
|
||||||
key = "aredn.@usb[0].passthrough",
|
key = "aredn.@usb[0].passthrough",
|
||||||
type = "boolean",
|
type = "boolean",
|
||||||
desc = "Specifies whether the USB port should be on or off. (Not all devices have USB powered ports.",
|
desc = "Specifies whether the USB port should be on or off. (Not all devices have USB powered ports).",
|
||||||
default = "1",
|
default = "1",
|
||||||
postcallback = "setUSBOutput()",
|
postcallback = "setUSBOutput()",
|
||||||
condition = "hasUSB()"
|
condition = "hasUSB()"
|
||||||
|
@ -472,7 +472,11 @@ for i, setting in ipairs(settings)
|
||||||
do
|
do
|
||||||
if parms["button_save_" .. i] then
|
if parms["button_save_" .. i] then
|
||||||
newval = parms["newval_" .. i]
|
newval = parms["newval_" .. i]
|
||||||
|
if not newval then
|
||||||
|
newval = ""
|
||||||
|
else
|
||||||
newval = newval:gsub("^%s+", ""):gsub("%s+$", "")
|
newval = newval:gsub("^%s+", ""):gsub("%s+$", "")
|
||||||
|
end
|
||||||
if setting.type == "boolean" then
|
if setting.type == "boolean" then
|
||||||
if newval == "1" or newval == "true" then
|
if newval == "1" or newval == "true" then
|
||||||
newval = "1"
|
newval = "1"
|
||||||
|
|
Loading…
Reference in New Issue