diff --git a/package/gluon-web-network/i18n/de.po b/package/gluon-web-network/i18n/de.po index f394b84bc5acbfe60c350dbc220e2fec9b2849dc..194a41ddcb3917d1382b172bcb8032317d4084b6 100644 --- a/package/gluon-web-network/i18n/de.po +++ b/package/gluon-web-network/i18n/de.po @@ -19,7 +19,7 @@ msgstr "Automatisch (RA/DHCPv6)" msgid "Disabled" msgstr "Deaktiviert" -msgid "Enable PoE passthrough" +msgid "Enable PoE Passthrough" msgstr "PoE-Passthrough aktivieren" msgid "Enable meshing on the LAN interface" diff --git a/package/gluon-web-network/i18n/fr.po b/package/gluon-web-network/i18n/fr.po index 9bea9996c45b12bae0e12defa171d37ec381caa4..0b880036983df16bfa4a2ba6a63c6e04a4f1a949 100644 --- a/package/gluon-web-network/i18n/fr.po +++ b/package/gluon-web-network/i18n/fr.po @@ -19,7 +19,7 @@ msgstr "Automatique (RA/DHCPv6)" msgid "Disabled" msgstr "Désactivé" -msgid "Enable PoE passthrough" +msgid "Enable PoE Passthrough" msgstr "" msgid "Enable meshing on the LAN interface" diff --git a/package/gluon-web-network/i18n/gluon-web-network.pot b/package/gluon-web-network/i18n/gluon-web-network.pot index 946ec2c28b8b006f800e741f1c07e17040656833..ebc795f419d3abeef8b74b9d5751204668f722f1 100644 --- a/package/gluon-web-network/i18n/gluon-web-network.pot +++ b/package/gluon-web-network/i18n/gluon-web-network.pot @@ -10,7 +10,7 @@ msgstr "" msgid "Disabled" msgstr "" -msgid "Enable PoE passthrough" +msgid "Enable PoE Passthrough" msgstr "" msgid "Enable meshing on the LAN interface" diff --git a/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua b/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua index e634512ecc235a6b8f11bff8185d6f2c78d10f02..ccfd6284a17bb93e98176e07f80146e8a65f0c6c 100644 --- a/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua +++ b/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua @@ -122,15 +122,20 @@ if sysconfig.lan_ifname then end end -if uci:get('system', 'gpio_switch_poe_passthrough') then - local s = f:section(Section) - local poe_passthrough = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough")) - poe_passthrough.default = uci:get_bool("system", "gpio_switch_poe_passthrough", "value") +local section +uci:foreach("system", "gpio_switch", function(s) + if s[".name"]:match("poe") then + if not section then + section = f:section(Section) + end + local poe = section:option(Flag, s[".name"], translate("Enable " .. s.name)) + poe.default = uci:get_bool("system", s[".name"], "value") - function poe_passthrough:write(data) - uci:set('system', 'gpio_switch_poe_passthrough', 'value', data) + function poe:write(data) + uci:set("system", s[".name"], "value", data) + end end -end +end) function f:write() uci:set("network", "wan", "proto", ipv4.data)