Skip to content
Snippets Groups Projects
Unverified Commit ada723a0 authored by Martin Weinelt's avatar Martin Weinelt Committed by Matthias Schiffer
Browse files

gluon-config-mode-mesh-vpn: display tc limits in Mbit/s

parent fc7c8cb0
No related branches found
No related tags found
No related merge requests found
...@@ -10,14 +10,14 @@ msgstr "" ...@@ -10,14 +10,14 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Downstream (kbit/s)" msgid "Downstream (Mbit/s)"
msgstr "Downstream (kbit/s)" msgstr "Downstream (Mbit/s)"
msgid "Limit bandwidth" msgid "Limit bandwidth"
msgstr "Bandbreite begrenzen" msgstr "Bandbreite begrenzen"
msgid "Upstream (kbit/s)" msgid "Upstream (Mbit/s)"
msgstr "Upstream (kbit/s)" msgstr "Upstream (Mbit/s)"
msgid "Use internet connection (mesh VPN)" msgid "Use internet connection (mesh VPN)"
msgstr "Internetverbindung nutzen (Mesh-VPN)" msgstr "Internetverbindung nutzen (Mesh-VPN)"
......
...@@ -10,14 +10,14 @@ msgstr "" ...@@ -10,14 +10,14 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Downstream (kbit/s)" msgid "Downstream (Mbit/s)"
msgstr "Débit déscendant (kbit/s)" msgstr "Débit déscendant (Mbit/s)"
msgid "Limit bandwidth" msgid "Limit bandwidth"
msgstr "Limiter la bande passante" msgstr "Limiter la bande passante"
msgid "Upstream (kbit/s)" msgid "Upstream (Mbit/s)"
msgstr "Débit ascendant (kbit/s)" msgstr "Débit ascendant (Mbit/s)"
msgid "Use internet connection (mesh VPN)" msgid "Use internet connection (mesh VPN)"
msgstr "Utiliser la connection internet (Mesh-VPN)" msgstr "Utiliser la connection internet (Mesh-VPN)"
......
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Downstream (kbit/s)" msgid "Downstream (Mbit/s)"
msgstr "" msgstr ""
msgid "Limit bandwidth" msgid "Limit bandwidth"
msgstr "" msgstr ""
msgid "Upstream (kbit/s)" msgid "Upstream (Mbit/s)"
msgstr "" msgstr ""
msgid "Use internet connection (mesh VPN)" msgid "Use internet connection (mesh VPN)"
......
...@@ -36,20 +36,26 @@ return function(form, uci) ...@@ -36,20 +36,26 @@ return function(form, uci)
uci:set("gluon", "mesh_vpn", "limit_enabled", data) uci:set("gluon", "mesh_vpn", "limit_enabled", data)
end end
o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (kbit/s)")) local function div(n, d)
if n then
return n / d
end
end
o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (Mbit/s)"))
o:depends(limit, true) o:depends(limit, true)
o.default = uci:get("gluon", "mesh_vpn", "limit_ingress") o.default = div(uci:get("gluon", "mesh_vpn", "limit_ingress"), 1000)
o.datatype = "uinteger" o.datatype = "ufloat"
function o:write(data) function o:write(data)
uci:set("gluon", "mesh_vpn", "limit_ingress", data) uci:set("gluon", "mesh_vpn", "limit_ingress", data * 1000)
end end
o = s:option(Value, "limit_egress", pkg_i18n.translate("Upstream (kbit/s)")) o = s:option(Value, "limit_egress", pkg_i18n.translate("Upstream (Mbit/s)"))
o:depends(limit, true) o:depends(limit, true)
o.default = uci:get("gluon", "mesh_vpn", "limit_egress") o.default = div(uci:get("gluon", "mesh_vpn", "limit_egress"), 1000)
o.datatype = "uinteger" o.datatype = "ufloat"
function o:write(data) function o:write(data)
uci:set("gluon", "mesh_vpn", "limit_egress", data) uci:set("gluon", "mesh_vpn", "limit_egress", data * 1000)
end end
function s:handle() function s:handle()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment