From 02ef5ea6fbf3adf896e782863ed79778fb80be63 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 23 Oct 2008 18:19:27 +0000 Subject: [PATCH] * luci/modules/admin-full: only display interface protocols that are actually supported * luci/18n: add prereq description for interface proto to translations --- i18n/english/luasrc/i18n/admin-core.en.lua | 1 + i18n/english/luasrc/i18n/admin-core.en.xml | 1 + i18n/german/luasrc/i18n/admin-core.de.lua | 1 + i18n/german/luasrc/i18n/admin-core.de.xml | 1 + .../luasrc/i18n/admin-core.pt-br.lua | 1 + .../luasrc/i18n/admin-core.pt-br.xml | 7 +++--- .../luasrc/model/cbi/admin_network/ifaces.lua | 24 +++++++++++++++---- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua index ffd15a4fc..b43863812 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/i18n/english/luasrc/i18n/admin-core.en.lua @@ -195,6 +195,7 @@ dhcp_timeremain = 'Leasetime remaining' dhcp_leases_active = 'Active Leases' a_n_ptp = 'Point-to-Point Connections' a_n_ptp1 = 'Point-to-Point connections with PPPoE or PPTP are often used to connect a device over DSL or similar technologies to an internet access point.' +network_interface_prereq = 'You need to install "comgt" for UMTS/GPRS, "ppp-mod-pppoe" for PPPoE, "ppp-mod-pppoa" for PPPoA or "pptp" for PPtP support' network_interface_server = 'PPTP-Server' network_interface_demand = 'Automatic Disconnect' network_interface_demand_desc = 'Time (in seconds) after which an unused connection will be closed' diff --git a/i18n/english/luasrc/i18n/admin-core.en.xml b/i18n/english/luasrc/i18n/admin-core.en.xml index 266f36258..05fd023a6 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.xml +++ b/i18n/english/luasrc/i18n/admin-core.en.xml @@ -199,6 +199,7 @@ Active Leases Point-to-Point Connections Point-to-Point connections with PPPoE or PPTP are often used to connect a device over DSL or similar technologies to an internet access point. +You need to install "comgt" for UMTS/GPRS, "ppp-mod-pppoe" for PPPoE, "ppp-mod-pppoa" for PPPoA or "pptp" for PPtP support PPTP-Server Automatic Disconnect Time (in seconds) after which an unused connection will be closed diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua index 650cc06c0..cdee5f449 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.lua +++ b/i18n/german/luasrc/i18n/admin-core.de.lua @@ -198,6 +198,7 @@ dhcp_leases = 'Zuweisungen' luci_ethers = 'Statische Einträge' dhcp_timeremain = 'Verbleibende Gültigkeit' dhcp_leases_active = 'Aktive Zuweisungen' +network_interface_prereq = 'Für die Unterstützung von UMTS/GPRS muss "comgt", für PPPoE "ppp-mod-pppoe", für PPPoA "ppp-mod-pppoa" und für PPtP "pptp" installiert sein' network_interface_demand = 'Automatische Trennung' network_interface_demand_desc = 'Zeit (in s) nach der die Verbindung bei Inaktivität getrennt wird' network_interface_keepalive = 'Keep-Alive' diff --git a/i18n/german/luasrc/i18n/admin-core.de.xml b/i18n/german/luasrc/i18n/admin-core.de.xml index cab785265..c2d71380b 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.xml +++ b/i18n/german/luasrc/i18n/admin-core.de.xml @@ -205,6 +205,7 @@ Verbleibende Gültigkeit Aktive Zuweisungen +Für die Unterstützung von UMTS/GPRS muss "comgt", für PPPoE "ppp-mod-pppoe", für PPPoA "ppp-mod-pppoa" und für PPtP "pptp" installiert sein Automatische Trennung Zeit (in s) nach der die Verbindung bei Inaktivität getrennt wird Keep-Alive diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua index fe5e059c9..600741b7e 100644 --- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua +++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua @@ -195,6 +195,7 @@ dhcp_timeremain = 'Tempo de lease restante' dhcp_leases_active = 'Leases Ativos' a_n_ptp = 'Conexões Ponto-a-Ponto' a_n_ptp1 = 'Conexões Ponto-a-Ponto com PPPoE ou PPTP muitas vezes são usados para conectar um dispositivo sobre DSL ou tecnologia similar para um ponto de acesso à internet.' +network_interface_prereq = 'You need to install "comgt" for UMTS/GPRS, "ppp-mod-pppoe" for PPPoE, "ppp-mod-pppoa" for PPPoA or "pptp" for PPtP support' network_interface_server = 'Servidor-PPTP' network_interface_demand = 'Desconexão Automática' network_interface_demand_desc = 'Tempo (em segundos) para desconexão de uma conexão não mais utilizada' diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml index 8c726aab5..e9c74c787 100644 --- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml +++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml @@ -166,9 +166,9 @@ max. de DHCP-Leases arquivo host adicional porta para consulta -Ativar servidor TFTP -Diretório raiz do servidor TFTP -Imagem para o boot remoto +Ativar servidor TFTP +Diretório raiz do servidor TFTP +Imagem para o boot remoto Switch Conexões Ativas Esta página fornece informações sobre as conexões de rede ativas. @@ -199,6 +199,7 @@ Leases Ativos Conexões Ponto-a-Ponto Conexões Ponto-a-Ponto com PPPoE ou PPTP muitas vezes são usados para conectar um dispositivo sobre DSL ou tecnologia similar para um ponto de acesso à internet. +You need to install "comgt" for UMTS/GPRS, "ppp-mod-pppoe" for PPPoE, "ppp-mod-pppoa" for PPPoA or "pptp" for PPtP support Servidor-PPTP Desconexão Automática Tempo (em segundos) para desconexão de uma conexão não mais utilizada diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index 780e6075b..98623e730 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -12,8 +12,16 @@ You may obtain a copy of the License at $Id$ ]]-- + require("luci.tools.webadmin") arg[1] = arg[1] or "" + +local has_3g = luci.fs.mtime("/usr/bin/gcom") +local has_pptp = luci.fs.mtime("/usr/sbin/pptp") +local has_pppd = luci.fs.mtime("/usr/sbin/pppd") +local has_pppoe = luci.fs.glob("/usr/lib/pppd/*/rp-pppoe.so") +local has_pppoa = luci.fs.glob("/usr/lib/pppd/*/pppoatm.so") + m = Map("network", translate("interfaces"), translate("a_n_ifaces1")) s = m:section(NamedSection, arg[1], "interface") @@ -24,13 +32,19 @@ back.value = "" back.titleref = luci.dispatcher.build_url("admin", "network", "network") p = s:option(ListValue, "proto", translate("protocol")) +p.override_scheme = true +p.default = "static" p:value("static", translate("static")) p:value("dhcp", "DHCP") -p:value("pppoe", "PPPoE") -p:value("ppp", "PPP") -p:value("3g", "UMTS/3G") -p:value("pptp", "PPTP") -p.default = "static" +if has_pppd then p:value("ppp", "PPP") end +if has_pppoe then p:value("pppoe", "PPPoE") end +if has_pppoa then p:value("pppoa", "PPPoA") end +if has_3g then p:value("3g", "UMTS/3G") end +if has_pptp then p:value("pptp", "PPTP") end + +if not ( has_pppd and has_pppoe and has_pppoa and has_3g and has_pptp ) then + p.description = translate("network_interface_prereq") +end br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1")) br.enabled = "bridge" -- 2.25.1