diff --git a/package/gluon-config-mode-mesh-vpn/i18n/de.po b/package/gluon-config-mode-mesh-vpn/i18n/de.po index c2e6b35c..314866e5 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/de.po +++ b/package/gluon-config-mode-mesh-vpn/i18n/de.po @@ -10,14 +10,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "Downstream (kbit/s)" -msgstr "Downstream (kbit/s)" +msgid "Downstream (Mbit/s)" +msgstr "Downstream (Mbit/s)" msgid "Limit bandwidth" msgstr "Bandbreite begrenzen" -msgid "Upstream (kbit/s)" -msgstr "Upstream (kbit/s)" +msgid "Upstream (Mbit/s)" +msgstr "Upstream (Mbit/s)" msgid "Use internet connection (mesh VPN)" msgstr "Internetverbindung nutzen (Mesh-VPN)" diff --git a/package/gluon-config-mode-mesh-vpn/i18n/fr.po b/package/gluon-config-mode-mesh-vpn/i18n/fr.po index 0c324f32..884c8339 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/fr.po +++ b/package/gluon-config-mode-mesh-vpn/i18n/fr.po @@ -10,14 +10,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "Downstream (kbit/s)" -msgstr "Débit déscendant (kbit/s)" +msgid "Downstream (Mbit/s)" +msgstr "Débit déscendant (Mbit/s)" msgid "Limit bandwidth" msgstr "Limiter la bande passante" -msgid "Upstream (kbit/s)" -msgstr "Débit ascendant (kbit/s)" +msgid "Upstream (Mbit/s)" +msgstr "Débit ascendant (Mbit/s)" msgid "Use internet connection (mesh VPN)" msgstr "Utiliser la connection internet (Mesh-VPN)" diff --git a/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot b/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot index b6722919..435b2e35 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot +++ b/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot @@ -1,13 +1,13 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" -msgid "Downstream (kbit/s)" +msgid "Downstream (Mbit/s)" msgstr "" msgid "Limit bandwidth" msgstr "" -msgid "Upstream (kbit/s)" +msgid "Upstream (Mbit/s)" msgstr "" msgid "Use internet connection (mesh VPN)" diff --git a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index d10f2ea4..84482bb8 100644 --- a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -36,20 +36,26 @@ return function(form, uci) uci:set("gluon", "mesh_vpn", "limit_enabled", data) end - o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (kbit/s)")) - o:depends(limit, true) - o.default = uci:get("gluon", "mesh_vpn", "limit_ingress") - o.datatype = "uinteger" - function o:write(data) - uci:set("gluon", "mesh_vpn", "limit_ingress", data) + local function div(n, d) + if n then + return n / d + end end - o = s:option(Value, "limit_egress", pkg_i18n.translate("Upstream (kbit/s)")) + o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (Mbit/s)")) o:depends(limit, true) - o.default = uci:get("gluon", "mesh_vpn", "limit_egress") - o.datatype = "uinteger" + o.default = div(uci:get("gluon", "mesh_vpn", "limit_ingress"), 1000) + o.datatype = "ufloat" function o:write(data) - uci:set("gluon", "mesh_vpn", "limit_egress", data) + uci:set("gluon", "mesh_vpn", "limit_ingress", data * 1000) + end + + o = s:option(Value, "limit_egress", pkg_i18n.translate("Upstream (Mbit/s)")) + o:depends(limit, true) + o.default = div(uci:get("gluon", "mesh_vpn", "limit_egress"), 1000) + o.datatype = "ufloat" + function o:write(data) + uci:set("gluon", "mesh_vpn", "limit_egress", data * 1000) end function s:handle()