diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index d9210479f767dfaa3bd3d229eb346f72fc8a5bc3..861c13a43f9fa09545bb4fa5a8a74172c587cbf5 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -64,6 +64,16 @@ return v and translate('enabled') or translate('disabled') end + local function formatBits(bits) + local units = {[0]='', 'k', 'M', 'G'} + + local pow = math.floor(math.log(math.max(math.abs(bits), 1)) / math.log(1000)) + local known_pow = math.min(pow, #units) + + local significand = bits/(1000^known_pow) + return string.format('%g %sbit', significand, units[known_pow]) + end + local function statistics(key, format) return string.format('<span data-statistics="%s" data-format="%s"></span>', pcdata(key), pcdata(format or 'id')) end @@ -122,6 +132,17 @@ <br /><%| nodeinfo.network.mesh_vpn.provider %> <%- end %> </dd> + <% if nodeinfo.network.mesh_vpn.bandwidth_limit.enabled then -%> + <dt><%:Bandwidth limit%></dt> + <dd> + <% if nodeinfo.network.mesh_vpn.bandwidth_limit.egress then -%> + â–² <%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.egress*1000) %>/s <%:upstream%><br /> + <%- end %> + <% if nodeinfo.network.mesh_vpn.bandwidth_limit.ingress then -%> + â–¼ <%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.ingress*1000) %>/s <%:downstream%> + <%- end %> + </dd> + <%- end %> <%- end %> <dt><%:Site%></dt><dd><%| site.site_name() %></dd> <% if nodeinfo.system.domain_code then -%> diff --git a/package/gluon-status-page/i18n/de.po b/package/gluon-status-page/i18n/de.po index 31ee99d5f7c1a906c2462b70f7f49b0f67ecbb01..e86b174bee7cb616c8be99ba0b063217f0e4a739 100644 --- a/package/gluon-status-page/i18n/de.po +++ b/package/gluon-status-page/i18n/de.po @@ -28,6 +28,9 @@ msgstr "1 Tag" msgid "Automatic updates" msgstr "Automatische Updates" +msgid "Bandwidth limit" +msgstr "Bandbreitenlimit" + msgid "Channel" msgstr "Kanal" @@ -43,6 +46,9 @@ msgstr "Entfernung" msgid "Domain" msgstr "Domäne" +msgid "downstream" +msgstr "Downstream" + msgid "Error" msgstr "Fehler" @@ -124,6 +130,9 @@ msgstr "" msgid "Transmitted" msgstr "Gesendet" +msgid "upstream" +msgstr "Upstream" + msgid "Uptime" msgstr "Laufzeit" diff --git a/package/gluon-status-page/i18n/fr.README b/package/gluon-status-page/i18n/fr.README new file mode 100644 index 0000000000000000000000000000000000000000..642f9aaf3f30779e91a699e2b17ada2ad09f4af9 --- /dev/null +++ b/package/gluon-status-page/i18n/fr.README @@ -0,0 +1,10 @@ +Draft for french translation, taken from gluon-config-mode-mesh-vpn + +msgid "" +msgstr "" + +msgid "downstream" +msgstr "débit déscendant" + +msgid "upstream" +msgstr "débit ascendant" diff --git a/package/gluon-status-page/i18n/gluon-status-page.pot b/package/gluon-status-page/i18n/gluon-status-page.pot index cac28222f38273a69c3de25afd0042f153cad709..5a8008fdfa7d59965f085ad1a678b4538b5bb75a 100644 --- a/package/gluon-status-page/i18n/gluon-status-page.pot +++ b/package/gluon-status-page/i18n/gluon-status-page.pot @@ -19,6 +19,9 @@ msgstr "" msgid "Automatic updates" msgstr "" +msgid "Bandwidth limit" +msgstr "" + msgid "Channel" msgstr "" @@ -34,6 +37,9 @@ msgstr "" msgid "Domain" msgstr "" +msgid "downstream" +msgstr "" + msgid "Error" msgstr "" @@ -115,6 +121,9 @@ msgstr "" msgid "Transmitted" msgstr "" +msgid "upstream" +msgstr "" + msgid "Uptime" msgstr "" diff --git a/package/gluon-status-page/i18n/ru.README b/package/gluon-status-page/i18n/ru.README index 06f8e4e7d56b20204b9f27836e9a9e443eb10bae..b5a1b85e5d6ee9d4d54b891c27159dddae03afb6 100644 --- a/package/gluon-status-page/i18n/ru.README +++ b/package/gluon-status-page/i18n/ru.README @@ -10,6 +10,7 @@ if we ever add Russion to gluon-web, the following strings can be reused: "Primary MAC": "ОÑновной MAC", "IP Address": "IP ÐдреÑ", "Automatic updates": "ÐвтоматичеÑкие обновлениÑ", +"Bandwidth limit": "Ограничение пропуÑкной ÑпоÑобноÑти", "Overview": "Обзор", "used": "иÑпользуетÑÑ", "Uptime": "Ð’Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹",