summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-10-23 18:44:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-10-23 18:44:58 +0000
commitaa5c150f37acd749b2bd506257d0062e83811d22 (patch)
tree2c93980ad4c0cdc960b40aad18d7c9f5e8570395
parent08a89f42b51bf708f41a8b3f60e3712063a36783 (diff)
* luci/modules/admin-mini: port selective protocol handling from admin-full
* luci/i18n: add required strings for admin-mini
-rw-r--r--i18n/english/luasrc/i18n/admin-core.en.lua1
-rw-r--r--i18n/english/luasrc/i18n/admin-core.en.xml1
-rw-r--r--i18n/german/luasrc/i18n/admin-core.de.lua1
-rw-r--r--i18n/german/luasrc/i18n/admin-core.de.xml1
-rw-r--r--i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua1
-rw-r--r--i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml1
-rw-r--r--modules/admin-mini/luasrc/model/cbi/mini/network.lua30
7 files changed, 27 insertions, 9 deletions
diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua
index b43863812..a9dab7e4b 100644
--- a/i18n/english/luasrc/i18n/admin-core.en.lua
+++ b/i18n/english/luasrc/i18n/admin-core.en.lua
@@ -196,6 +196,7 @@ dhcp_leases_active = 'Active Leases'
a_n_ptp = 'Point-to-Point Connections'
a_n_ptp1 = 'Point-to-Point connections with <abbr title="Point-to-Point Protocol over Ethernet">PPPoE</abbr> or <abbr title="Point-to-Point Tunneling Protocol">PPTP</abbr> are often used to connect a device over <abbr title="Digital Subscriber Line">DSL</abbr> or similar technologies to an internet access point.'
network_interface_prereq = 'You need to install &quot;comgt&quot; for UMTS/GPRS, &quot;ppp-mod-pppoe&quot; for PPPoE, &quot;ppp-mod-pppoa&quot; for PPPoA or &quot;pptp&quot; for PPtP support'
+network_interface_prereq_mini = 'You need to install &quot;ppp-mod-pppoe&quot; for PPPoE or &quot;pptp&quot; for PPtP support'
network_interface_server = '<abbr title="Point-to-Point Tunneling Protocol">PPTP</abbr>-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 05fd023a6..9e07e80f0 100644
--- a/i18n/english/luasrc/i18n/admin-core.en.xml
+++ b/i18n/english/luasrc/i18n/admin-core.en.xml
@@ -200,6 +200,7 @@
<i18n:msg xml:id="a_n_ptp">Point-to-Point Connections</i18n:msg>
<i18n:msg xml:id="a_n_ptp1">Point-to-Point connections with <abbr title="Point-to-Point Protocol over Ethernet">PPPoE</abbr> or <abbr title="Point-to-Point Tunneling Protocol">PPTP</abbr> are often used to connect a device over <abbr title="Digital Subscriber Line">DSL</abbr> or similar technologies to an internet access point.</i18n:msg>
<i18n:msg xml:id="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</i18n:msg>
+<i18n:msg xml:id="network_interface_prereq_mini">You need to install "ppp-mod-pppoe" for PPPoE or "pptp" for PPtP support</i18n:msg>
<i18n:msg xml:id="network_interface_server"><abbr title="Point-to-Point Tunneling Protocol">PPTP</abbr>-Server</i18n:msg>
<i18n:msg xml:id="network_interface_demand">Automatic Disconnect</i18n:msg>
<i18n:msg xml:id="network_interface_demand_desc">Time (in seconds) after which an unused connection will be closed</i18n:msg>
diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua
index cdee5f449..1ea56e346 100644
--- a/i18n/german/luasrc/i18n/admin-core.de.lua
+++ b/i18n/german/luasrc/i18n/admin-core.de.lua
@@ -199,6 +199,7 @@ 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 &quot;comgt&quot;, für PPPoE &quot;ppp-mod-pppoe&quot;, für PPPoA &quot;ppp-mod-pppoa&quot; und für PPtP &quot;pptp&quot; installiert sein'
+network_interface_prereq_mini = 'Für die Unterstützung von PPPoE muss &quot;ppp-mod-pppoe&quot; und für PPtP &quot;pptp&quot; 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 c2d71380b..9078f7721 100644
--- a/i18n/german/luasrc/i18n/admin-core.de.xml
+++ b/i18n/german/luasrc/i18n/admin-core.de.xml
@@ -206,6 +206,7 @@
<i18n:msg xml:id="dhcp_leases_active">Aktive Zuweisungen</i18n:msg>
<i18n:msg xml:id="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</i18n:msg>
+<i18n:msg xml:id="network_interface_prereq_mini">Für die Unterstützung von PPPoE muss "ppp-mod-pppoe" und für PPtP "pptp" installiert sein</i18n:msg>
<i18n:msg xml:id="network_interface_demand">Automatische Trennung</i18n:msg>
<i18n:msg xml:id="network_interface_demand_desc">Zeit (in s) nach der die Verbindung bei Inaktivität getrennt wird</i18n:msg>
<i18n:msg xml:id="network_interface_keepalive">Keep-Alive</i18n:msg>
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 75e4717da..a941c433e 100644
--- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
+++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
@@ -196,6 +196,7 @@ dhcp_leases_active = 'Leases Ativos'
a_n_ptp = 'Conexões Ponto-a-Ponto'
a_n_ptp1 = 'Conexões Ponto-a-Ponto com <abbr title="Protocolo Ponto-a-Ponto sobre Ethernet">PPPoE</abbr> ou <abbr title="Protocolo de Tunelamento Ponto-a-Ponto">PPTP</abbr> muitas vezes são usados para conectar um dispositivo sobre <abbr title="Linha Digital de Assinante">DSL</abbr> ou tecnologia similar para um ponto de acesso à internet.'
network_interface_prereq = 'Você precisa instalar os pacotes &quot;comgt&quot; para UMTS/GPRS, &quot;ppp-mod-pppoe&quot; para PPPoE, &quot;ppp-mod-pppoa&quot; para PPPoA ou &quot;pptp&quot; para o suporte PPtP'
+network_interface_prereq_mini = 'Você precisa instalar os pacotes &quot;ppp-mod-pppoe&quot; para PPPoE ou &quot;pptp&quot; para o suporte PPtP'
network_interface_server = 'Servidor-<abbr title="Protocolo de Tunelamento Ponto-a-Ponto">PPTP</abbr>'
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 b323e3aea..923b45b53 100644
--- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
+++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
@@ -200,6 +200,7 @@
<i18n:msg xml:id="a_n_ptp">Conexões Ponto-a-Ponto</i18n:msg>
<i18n:msg xml:id="a_n_ptp1">Conexões Ponto-a-Ponto com <abbr title="Protocolo Ponto-a-Ponto sobre Ethernet">PPPoE</abbr> ou <abbr title="Protocolo de Tunelamento Ponto-a-Ponto">PPTP</abbr> muitas vezes são usados para conectar um dispositivo sobre <abbr title="Linha Digital de Assinante">DSL</abbr> ou tecnologia similar para um ponto de acesso à internet.</i18n:msg>
<i18n:msg xml:id="network_interface_prereq">Você precisa instalar os pacotes "comgt" para UMTS/GPRS, "ppp-mod-pppoe" para PPPoE, "ppp-mod-pppoa" para PPPoA ou "pptp" para o suporte PPtP</i18n:msg>
+<i18n:msg xml:id="network_interface_prereq_mini">Você precisa instalar os pacotes "ppp-mod-pppoe" para PPPoE ou "pptp" para o suporte PPtP</i18n:msg>
<i18n:msg xml:id="network_interface_server">Servidor-<abbr title="Protocolo de Tunelamento Ponto-a-Ponto">PPTP</abbr></i18n:msg>
<i18n:msg xml:id="network_interface_demand">Desconexão Automática</i18n:msg>
<i18n:msg xml:id="network_interface_demand_desc">Tempo (em segundos) para desconexão de uma conexão não mais utilizada</i18n:msg>
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/network.lua b/modules/admin-mini/luasrc/model/cbi/mini/network.lua
index ccb5dac89..d03e6a777 100644
--- a/modules/admin-mini/luasrc/model/cbi/mini/network.lua
+++ b/modules/admin-mini/luasrc/model/cbi/mini/network.lua
@@ -12,8 +12,13 @@ You may obtain a copy of the License at
$Id$
]]--
+
require("luci.tools.webadmin")
require("luci.sys")
+require("luci.fs")
+
+local has_pptp = luci.fs.mtime("/usr/sbin/pptp")
+local has_pppoe = luci.fs.glob("/usr/lib/pppd/*/rp-pppoe.so")
local network = luci.model.uci.cursor_state():get_all("network")
@@ -52,13 +57,13 @@ txrx = s:option(DummyValue, "_txrx",
function txrx.cfgvalue(self, section)
local ix = self.map:get(section, "ifname")
-
+
local rx = netstat and netstat[ix] and netstat[ix][1]
rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-"
-
+
local tx = netstat and netstat[ix] and netstat[ix][9]
tx = tx and luci.tools.webadmin.byte_format(tonumber(tx)) or "-"
-
+
return string.format("%s / %s", tx, rx)
end
@@ -67,13 +72,13 @@ errors = s:option(DummyValue, "_err",
function errors.cfgvalue(self, section)
local ix = self.map:get(section, "ifname")
-
+
local rx = netstat and netstat[ix] and netstat[ix][3]
local tx = netstat and netstat[ix] and netstat[ix][11]
-
+
rx = rx and tostring(rx) or "-"
tx = tx and tostring(tx) or "-"
-
+
return string.format("%s / %s", tx, rx)
end
@@ -97,11 +102,17 @@ dns.rmempty = true
s = m:section(NamedSection, "wan", "interface", translate("m_n_inet"))
s.addremove = false
p = s:option(ListValue, "proto", translate("protocol"))
+p.override_values = true
p:value("none", "disabled")
p:value("static", translate("manual", "manual"))
p:value("dhcp", translate("automatic", "automatic"))
-p:value("pppoe", "PPPoE")
-p:value("pptp", "PPTP")
+if has_pppoe then p:value("pppoe", "PPPoE") end
+if has_pptp then p:value("pptp", "PPTP") end
+
+if not ( has_pppoe and has_pptp ) then
+ p.description = translate("network_interface_prereq_mini")
+end
+
ip = s:option(Value, "ipaddr", translate("ipaddress"))
ip:depends("proto", "static")
@@ -122,6 +133,7 @@ usr:depends("proto", "pppoe")
usr:depends("proto", "pptp")
pwd = s:option(Value, "password", translate("password"))
+pwd.password = true
pwd:depends("proto", "pppoe")
pwd:depends("proto", "pptp")
@@ -143,4 +155,4 @@ srv.rmempty = true
-return m \ No newline at end of file
+return m