gluon-config-mode-mesh-vpn: add extra message if mesh-VPN was not selected

This was introduced in ffhh-packages at https://github.com/freifunkhamburg/ffhh-packages/tree/master/gluon-config-mode-reboot-ffhh
This commit is contained in:
rubo77 2016-11-10 07:40:21 +01:00
parent fcf3abd9c4
commit 434da00e49
6 changed files with 53 additions and 27 deletions

View File

@ -31,6 +31,13 @@ msgstr ""
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"
msgid "gluon-config-mode:novpn"
msgstr ""
"<p><div class=\"the-key\">Du hast ausgewählt, <strong>kein Mesh-VPN</strong> "
"zu nutzen. Dein Knoten kann also nur dann eine Verbindung zum Freifunk Netz "
"aufbauen, wenn andere Freifunk-Router in WLAN-Reichweite sind."
"</div></p>"
msgid "gluon-config-mode:reboot" msgid "gluon-config-mode:reboot"
msgstr "" msgstr ""
"<p>Dein Knoten startet gerade neu und wird anschließend versuchen, " "<p>Dein Knoten startet gerade neu und wird anschließend versuchen, "

View File

@ -28,6 +28,12 @@ msgstr ""
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"
msgid "gluon-config-mode:novpn"
msgstr ""
"<p><div class=\"the-key\">You have selected <strong>not</strong> to use the mesh VPN. "
"Your node will only be able to connect to the Freifunk network if other nodes in reach "
"already have a connection.</div></p>"
msgid "gluon-config-mode:reboot" msgid "gluon-config-mode:reboot"
msgstr "" msgstr ""
"<p>The node is currently rebooting and will try to connect to other " "<p>The node is currently rebooting and will try to connect to other "

View File

@ -31,6 +31,12 @@ msgstr ""
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"
msgid "gluon-config-mode:novpn"
msgstr ""
"<p><div class=\"the-key\">Vous avez choisi de <strong>ne pas utiliser</strong> "
"le réseau VPN. Votre nœud ne pourra se connecter au réseau Freifunk que si "
"d'autres nœuds à portée ont déjà une connexion.</div></p>"
msgid "gluon-config-mode:reboot" msgid "gluon-config-mode:reboot"
msgstr "" msgstr ""
"<p>Votre nœud es en train de redémarrer et va ensuite éssayer de se connecter " "<p>Votre nœud es en train de redémarrer et va ensuite éssayer de se connecter "

View File

@ -7,6 +7,9 @@ msgstr ""
msgid "gluon-config-mode:pubkey" msgid "gluon-config-mode:pubkey"
msgstr "" msgstr ""
msgid "gluon-config-mode:novpn"
msgstr ""
msgid "gluon-config-mode:reboot" msgid "gluon-config-mode:reboot"
msgstr "" msgstr ""

View File

@ -364,6 +364,9 @@ gluon-config-mode:welcome
gluon-config-mode:pubkey gluon-config-mode:pubkey
Information about the public VPN key on the reboot page. Information about the public VPN key on the reboot page.
gluon-config-mode:novpn
Information shown on the reboot page, if the mesh VPN was not selected.
gluon-config-mode:altitude-label gluon-config-mode:altitude-label
Label for the ``altitude`` field Label for the ``altitude`` field

View File

@ -1,33 +1,34 @@
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0") local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0")
local i18n = require "luci.i18n"
local util = require "luci.util"
local gluon_luci = require 'gluon.luci'
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local pretty_hostname = require 'pretty_hostname'
local pubkey = ""
local hostname = pretty_hostname.get(uci)
local contact = uci:get_first("gluon-node-info", "owner", "contact")
if meshvpn_enabled ~= "1" then if meshvpn_enabled ~= "1" then
return nil local msg = i18n.translate('gluon-config-mode:novpn')
else else
local i18n = require "luci.i18n" pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn"))
local util = require "luci.util"
local gluon_luci = require 'gluon.luci'
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local pretty_hostname = require 'pretty_hostname'
local pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn"))
local hostname = pretty_hostname.get(uci)
local contact = uci:get_first("gluon-node-info", "owner", "contact")
local msg = i18n.translate('gluon-config-mode:pubkey') local msg = i18n.translate('gluon-config-mode:pubkey')
end
return function ()
luci.template.render_string(msg, { return function ()
pubkey = pubkey, luci.template.render_string(msg, {
hostname = hostname, pubkey = pubkey,
site = site, hostname = hostname,
sysconfig = sysconfig, site = site,
contact = contact, sysconfig = sysconfig,
escape = gluon_luci.escape, contact = contact,
urlescape = gluon_luci.urlescape, escape = gluon_luci.escape,
}) urlescape = gluon_luci.urlescape,
end })
end end