gluon-config-mode-mesh-vpn: display tc limits in Mbit/s
This commit is contained in:
		
							parent
							
								
									fc7c8cb086
								
							
						
					
					
						commit
						ada723a0df
					
				| @ -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 "" | |||||||
| "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)" | ||||||
|  | |||||||
| @ -1,13 +1,13 @@ | |||||||
| 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) | |||||||
| 		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) | ||||||
| 	o:depends(limit, true) | 		if n then | ||||||
| 	o.default = uci:get("gluon", "mesh_vpn", "limit_ingress") | 			return n / d | ||||||
| 	o.datatype = "uinteger" | 		end | ||||||
| 	function o:write(data) |  | ||||||
| 		uci:set("gluon", "mesh_vpn", "limit_ingress", data) |  | ||||||
| 	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:depends(limit, true) | ||||||
| 	o.default = uci:get("gluon", "mesh_vpn", "limit_egress") | 	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_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 | 	end | ||||||
| 
 | 
 | ||||||
| 	function s:handle() | 	function s:handle() | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user