Browse Source

gluon-luci-portconfig: add setting for PoE passthrough

Fixes #328
Matthias Schiffer 7 years ago
parent
commit
f3cb6d7b36

+ 6 - 3
package/gluon-luci-portconfig/i18n/de.po

@@ -1,12 +1,12 @@
 msgid ""
 msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "PO-Revision-Date: 2015-05-04 02:08+0200\n"
 "Last-Translator:  <mschiffer@universe-factory.net>\n"
 "Language-Team: German\n"
 "Language: de\n"
 "MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
@@ -16,12 +16,15 @@ msgstr "Automatisch (DHCP)"
 msgid "Automatic (RA/DHCPv6)"
 msgstr "Automatisch (RA/DHCPv6)"
 
-msgid "Enable meshing on the WAN interface"
-msgstr "Mesh auf dem WAN-Port aktivieren"
+msgid "Enable PoE passthrough"
+msgstr "PoE-Passthrough aktivieren"
 
 msgid "Enable meshing on the LAN interface"
 msgstr "Mesh auf dem LAN-Port aktivieren"
 
+msgid "Enable meshing on the WAN interface"
+msgstr "Mesh auf dem WAN-Port aktivieren"
+
 msgid "Static"
 msgstr "Statisch"
 

+ 6 - 4
package/gluon-luci-portconfig/i18n/fr.po

@@ -1,28 +1,30 @@
 msgid ""
 msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "PO-Revision-Date: 2015-08-19 23:30+0100\n"
 "Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
 "Language-Team: French\n"
 "Language: fr\n"
 "MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-
 msgid "Automatic (DHCP)"
 msgstr "Automatique (DHCP)"
 
 msgid "Automatic (RA/DHCPv6)"
 msgstr "Automatique (RA/DHCPv6)"
 
-msgid "Enable meshing on the WAN interface"
-msgstr "Activer le réseau MESH sur les ports WAN"
+msgid "Enable PoE passthrough"
+msgstr ""
 
 msgid "Enable meshing on the LAN interface"
 msgstr "Activer le réseau MESH sur le port LAN"
 
+msgid "Enable meshing on the WAN interface"
+msgstr "Activer le réseau MESH sur les ports WAN"
+
 msgid "Static"
 msgstr "Statique"
 

+ 4 - 1
package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot

@@ -7,12 +7,15 @@ msgstr ""
 msgid "Automatic (RA/DHCPv6)"
 msgstr ""
 
-msgid "Enable meshing on the WAN interface"
+msgid "Enable PoE passthrough"
 msgstr ""
 
 msgid "Enable meshing on the LAN interface"
 msgstr ""
 
+msgid "Enable meshing on the WAN interface"
+msgstr ""
+
 msgid "Static"
 msgstr ""
 

+ 13 - 0
package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua

@@ -94,6 +94,13 @@ if sysconfig.lan_ifname then
   o.rmempty = false
 end
 
+if uci:get('system', 'gpio_switch_poe_passthrough') then
+  s = f:section(SimpleSection, nil, nil)
+  o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))
+  o.default = uci:get_bool("system", "gpio_switch_poe_passthrough", "value") and o.enabled or o.disabled
+  o.rmempty = false
+end
+
 
 function f.handle(self, state, data)
   if state == FORM_VALID then
@@ -137,6 +144,12 @@ function f.handle(self, state, data)
     uci:save("network")
     uci:commit("network")
 
+    if uci:get('system', 'gpio_switch_poe_passthrough') then
+        uci:set('system', 'gpio_switch_poe_passthrough', 'value', data.poe_passthrough)
+        uci:save('system')
+        uci:commit('system')
+    end
+
     if dns then
       if #data.dns > 0 then
         uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)