Skip to content
Snippets Groups Projects
Unverified Commit a6a25c94 authored by Matthias Schiffer's avatar Matthias Schiffer Committed by GitHub
Browse files

Merge pull request #1724 from freifunk-gluon/pr/tc-mbits

gluon-config-mode-mesh-vpn: display tc limits in Mbit/s
parents a2ba3efe ada723a0
No related branches found
No related tags found
No related merge requests found
......@@ -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)"
......
......@@ -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)"
......
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)"
......
......@@ -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)"))
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.default = uci:get("gluon", "mesh_vpn", "limit_ingress")
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_ingress", data)
uci:set("gluon", "mesh_vpn", "limit_ingress", data * 1000)
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.default = uci:get("gluon", "mesh_vpn", "limit_egress")
o.datatype = "uinteger"
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)
uci:set("gluon", "mesh_vpn", "limit_egress", data * 1000)
end
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