summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--applications/luci-app-adblock/po/sv/adblock.po69
-rw-r--r--applications/luci-app-simple-adblock/po/pt-br/simple-adblock.po80
-rw-r--r--applications/luci-app-simple-adblock/po/pt/simple-adblock.po80
-rw-r--r--applications/luci-app-travelmate/luasrc/controller/travelmate.lua13
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua2
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua48
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/setup_tab.lua55
-rw-r--r--modules/luci-base/luasrc/dispatcher.lua6
8 files changed, 247 insertions, 106 deletions
diff --git a/applications/luci-app-adblock/po/sv/adblock.po b/applications/luci-app-adblock/po/sv/adblock.po
index 04332a59bd..7a19f872f7 100644
--- a/applications/luci-app-adblock/po/sv/adblock.po
+++ b/applications/luci-app-adblock/po/sv/adblock.po
@@ -2,67 +2,66 @@ msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "."
-msgstr ""
+msgstr "."
msgid "Adblock"
-msgstr "Blockering av annonser"
+msgstr "Adblock"
msgid "Adblock Domain Query"
msgstr ""
msgid "Adblock Logfile"
-msgstr ""
+msgstr "Adblock's loggfil"
msgid "Adblock version"
-msgstr ""
+msgstr "Version för Adblock"
msgid "Additional trigger delay in seconds before adblock processing begins."
msgstr ""
msgid "Advanced"
-msgstr ""
+msgstr "Avancerat"
msgid "Available blocklist sources."
-msgstr ""
+msgstr "Tillgängliga källor för blockeringslistor"
msgid "Backup directory"
msgstr "Säkerhetskopiera mapp"
msgid "Blocked domains (overall)"
-msgstr ""
+msgstr "Blockerade domäner (övergripande)"
msgid "Blocklist sources"
msgstr "Källor för blockeringslistor"
msgid "Collecting data..."
-msgstr ""
+msgstr "Samlar in data..."
msgid ""
"Configuration of the adblock package to block ad/abuse domains by using DNS."
msgstr ""
-"Konfiguration av paket adblock för att blockera annons/otillåtna domäner "
-"genom att användning DNS."
+"Konfiguration av paketet adblock för att blockera annons/otillåtna domäner genom att använda DNS."
msgid "DNS backend"
-msgstr ""
+msgstr "Bakände för DNS"
msgid "Description"
msgstr "Beskrivning"
msgid "Download Utility (SSL Library)"
-msgstr ""
+msgstr "Nerladdningsprogram (SSL-bibliotek)"
msgid "Edit Blacklist"
-msgstr ""
+msgstr "Redigera svartlista"
msgid "Edit Configuration"
-msgstr ""
+msgstr Redigerar konfigurationen""
msgid "Edit Whitelist"
-msgstr ""
+msgstr "Redigera vitlista"
msgid "Enable adblock"
-msgstr "Aktivera abblock"
+msgstr "Aktivera adblock"
msgid "Enable blocklist backup"
msgstr "Aktivera säkerhetskopiering av blockeringslistan"
@@ -87,28 +86,28 @@ msgid ""
msgstr ""
msgid "For further information"
-msgstr ""
+msgstr "För mer information"
msgid "Force Overall Sort"
msgstr ""
msgid "Force local DNS"
-msgstr ""
+msgstr "Tvinga lokal DNS"
msgid "Input file not found, please check your configuration."
-msgstr ""
+msgstr "Inmatningsfilen hittades inte, var vänlig och kontrollera din konfiguration."
msgid "Invalid domain specified!"
-msgstr ""
+msgstr "Ogiltig domän angiven!"
msgid "Last rundate"
msgstr ""
msgid "Loading"
-msgstr ""
+msgstr "Laddar"
msgid "No"
-msgstr ""
+msgstr "Nej"
msgid ""
"Note that list URLs and Shallalist category selections are configurable in "
@@ -120,7 +119,7 @@ msgid ""
msgstr ""
msgid "Overview"
-msgstr ""
+msgstr "Översikt"
msgid ""
"Please add only one domain per line. Comments introduced with '#' are "
@@ -140,10 +139,10 @@ msgid "Restrict interface trigger to certain interface(s)"
msgstr ""
msgid "Resume adblock"
-msgstr ""
+msgstr "Återuppta adblock"
msgid "Runtime information"
-msgstr ""
+msgstr "Information om kör-tid"
msgid "SSL req."
msgstr ""
@@ -154,13 +153,13 @@ msgid ""
msgstr ""
msgid "Status"
-msgstr ""
+msgstr "Status"
msgid "Suspend / Resume adblock"
-msgstr ""
+msgstr "Upphäv / Återuppta adblock"
msgid "Suspend adblock"
-msgstr ""
+msgstr "Upphäv adblock"
msgid ""
"This form allows you to modify the content of the adblock blacklist (%s)."
@@ -191,28 +190,28 @@ msgid "Trigger delay"
msgstr ""
msgid "View Logfile"
-msgstr ""
+msgstr "Visa loggfil"
msgid "Waiting for command to complete..."
-msgstr ""
+msgstr "Väntar på att kommandot ska slutföras..."
msgid "Yes"
-msgstr ""
+msgstr "Ja"
msgid "active"
-msgstr ""
+msgstr "aktiv"
msgid "n/a"
-msgstr ""
+msgstr "n/a"
msgid "no domains blocked"
-msgstr ""
+msgstr "inga domäner blockerades"
msgid "see online documentation"
msgstr ""
msgid "suspended"
-msgstr ""
+msgstr "upphävd"
#~ msgid "Backup options"
#~ msgstr "Alternativ för säkerhetskopiering"
diff --git a/applications/luci-app-simple-adblock/po/pt-br/simple-adblock.po b/applications/luci-app-simple-adblock/po/pt-br/simple-adblock.po
new file mode 100644
index 0000000000..c7d0f0d81a
--- /dev/null
+++ b/applications/luci-app-simple-adblock/po/pt-br/simple-adblock.po
@@ -0,0 +1,80 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Blacklisted Domain URLs"
+msgstr "Endereço com lista de Domínio para a Lista Negra"
+
+msgid "Blacklisted Domains"
+msgstr "Domínios para a Lista Negra"
+
+msgid "Blacklisted Hosts URLs"
+msgstr "Endereços de Hosts para a Lista Negra"
+
+msgid "Controls system log and console output verbosity"
+msgstr "Controla o sistema de registro e o detalhamento das mensagens de saída do console"
+
+msgid "Enable/start service"
+msgstr "Habilitar/Iniciar o serviço"
+
+msgid "Force Router DNS"
+msgstr "Forçar o DNS do Roteador"
+
+msgid "Force Router DNS server to all local devices"
+msgstr "Forçar o servidor de DNS do Roteador para todos os dispositivos locais"
+
+msgid "Forces Router DNS use on local devices, also known as DNS Hijacking"
+msgstr "Forçar o uso do DNS do Roteador nos dispositivos locais, também conhecido como redirecionamento de DNS"
+
+msgid "Individual domains to be blacklisted"
+msgstr "Domínios individuais para serem incluídos na Lista Negra"
+
+msgid "Individual domains to be whitelisted"
+msgstr "Domínios individuais para serem incluídos na Lista Branca"
+
+msgid "LED to indicate status"
+msgstr "LED para indicar o estado"
+
+msgid "Let local devices use their own DNS servers if set"
+msgstr "Deixe que os dispositivos locais usem seus próprios servidores de DNS, se definidos"
+
+msgid "Output Verbosity Setting"
+msgstr "Definição do detalhamento do registro"
+
+msgid "Pick the LED not already used in"
+msgstr "Escolha um LED não usando em"
+
+msgid "Simple AdBlock"
+msgstr "Simple AdBlock"
+
+msgid "Simple AdBlock Settings"
+msgstr "Configuração do Simple AdBlock"
+
+msgid "Some output"
+msgstr "Pouco detalhado"
+
+msgid "Suppress output"
+msgstr "Suprimir"
+
+msgid "System LED Configuration"
+msgstr "Configuração do LED"
+
+msgid "URLs to lists of domains to be blacklisted"
+msgstr "Endereço da lista dos domínios para a Lista Negra"
+
+msgid "URLs to lists of domains to be whitelisted"
+msgstr "Endereço da lista dos domínios para a Lista Branca"
+
+msgid "URLs to lists of hosts to be blacklisted"
+msgstr "Endereço da lista dos hosts para a Lista Negra"
+
+msgid "Verbose output"
+msgstr "Detalhado"
+
+msgid "Whitelisted Domain URLs"
+msgstr "Endereço com lista de domínio para a Lista Branca"
+
+msgid "Whitelisted Domains"
+msgstr "Domínios para a Lista Branca"
+
+msgid "none"
+msgstr "Nenhum"
diff --git a/applications/luci-app-simple-adblock/po/pt/simple-adblock.po b/applications/luci-app-simple-adblock/po/pt/simple-adblock.po
new file mode 100644
index 0000000000..c7d0f0d81a
--- /dev/null
+++ b/applications/luci-app-simple-adblock/po/pt/simple-adblock.po
@@ -0,0 +1,80 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Blacklisted Domain URLs"
+msgstr "Endereço com lista de Domínio para a Lista Negra"
+
+msgid "Blacklisted Domains"
+msgstr "Domínios para a Lista Negra"
+
+msgid "Blacklisted Hosts URLs"
+msgstr "Endereços de Hosts para a Lista Negra"
+
+msgid "Controls system log and console output verbosity"
+msgstr "Controla o sistema de registro e o detalhamento das mensagens de saída do console"
+
+msgid "Enable/start service"
+msgstr "Habilitar/Iniciar o serviço"
+
+msgid "Force Router DNS"
+msgstr "Forçar o DNS do Roteador"
+
+msgid "Force Router DNS server to all local devices"
+msgstr "Forçar o servidor de DNS do Roteador para todos os dispositivos locais"
+
+msgid "Forces Router DNS use on local devices, also known as DNS Hijacking"
+msgstr "Forçar o uso do DNS do Roteador nos dispositivos locais, também conhecido como redirecionamento de DNS"
+
+msgid "Individual domains to be blacklisted"
+msgstr "Domínios individuais para serem incluídos na Lista Negra"
+
+msgid "Individual domains to be whitelisted"
+msgstr "Domínios individuais para serem incluídos na Lista Branca"
+
+msgid "LED to indicate status"
+msgstr "LED para indicar o estado"
+
+msgid "Let local devices use their own DNS servers if set"
+msgstr "Deixe que os dispositivos locais usem seus próprios servidores de DNS, se definidos"
+
+msgid "Output Verbosity Setting"
+msgstr "Definição do detalhamento do registro"
+
+msgid "Pick the LED not already used in"
+msgstr "Escolha um LED não usando em"
+
+msgid "Simple AdBlock"
+msgstr "Simple AdBlock"
+
+msgid "Simple AdBlock Settings"
+msgstr "Configuração do Simple AdBlock"
+
+msgid "Some output"
+msgstr "Pouco detalhado"
+
+msgid "Suppress output"
+msgstr "Suprimir"
+
+msgid "System LED Configuration"
+msgstr "Configuração do LED"
+
+msgid "URLs to lists of domains to be blacklisted"
+msgstr "Endereço da lista dos domínios para a Lista Negra"
+
+msgid "URLs to lists of domains to be whitelisted"
+msgstr "Endereço da lista dos domínios para a Lista Branca"
+
+msgid "URLs to lists of hosts to be blacklisted"
+msgstr "Endereço da lista dos hosts para a Lista Negra"
+
+msgid "Verbose output"
+msgstr "Detalhado"
+
+msgid "Whitelisted Domain URLs"
+msgstr "Endereço com lista de domínio para a Lista Branca"
+
+msgid "Whitelisted Domains"
+msgstr "Domínios para a Lista Branca"
+
+msgid "none"
+msgstr "Nenhum"
diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
index 4286b80d76..86382f6ae0 100644
--- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
+++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
@@ -12,15 +12,14 @@ function index()
if not nixio.fs.access("/etc/config/travelmate") then
return
end
- entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 30).dependent = false
- entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab"), _("Overview"), 10).leaf = true
+ entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 40).dependent = false
+ entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true
entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true
entry({"admin", "services", "travelmate", "advanced"}, firstchild(), _("Advanced"), 100)
- entry({"admin", "services", "travelmate", "advanced", "setup"}, cbi("travelmate/setup_tab"), _("Setup WWAN Interface"), 110).leaf = true
- entry({"admin", "services", "travelmate", "advanced", "configuration"}, cbi("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 120).leaf = true
- entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, cbi("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 130).leaf = true
- entry({"admin", "services", "travelmate", "advanced", "cfg_network"}, cbi("travelmate/cfg_network_tab"), _("Edit Network Configuration"), 140).leaf = true
- entry({"admin", "services", "travelmate", "advanced", "cfg_firewall"}, cbi("travelmate/cfg_firewall_tab"), _("Edit Firewall Configuration"), 150).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "configuration"}, cbi("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 110).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, cbi("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 120).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_network"}, cbi("travelmate/cfg_network_tab"), _("Edit Network Configuration"), 130).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_firewall"}, cbi("travelmate/cfg_firewall_tab"), _("Edit Firewall Configuration"), 140).leaf = true
end
function logread()
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua
index 6e9e2872fc..4233da6ac7 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/configuration_tab.lua
@@ -7,6 +7,8 @@ local trminput = "/etc/config/travelmate"
if not nixio.fs.access(trminput) then
m = SimpleForm("error", nil, translate("Input file not found, please check your configuration."))
+ m.reset = false
+ m.submit = false
return m
end
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
index 085d413d9a..6b07aabaed 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua
@@ -3,18 +3,18 @@
local fs = require("nixio.fs")
local uci = require("uci")
-local sys = require("luci.sys")
local json = require("luci.jsonc")
+local nw = require("luci.model.network").init()
+local fw = require("luci.model.firewall").init()
+local uplink = uci.get("network", "trm_wwan") or ""
local trminput = uci.get("travelmate", "global", "trm_rtfile") or "/tmp/trm_runtime.json"
local parse = json.parse(fs.readfile(trminput) or "")
m = Map("travelmate", translate("Travelmate"),
translate("Configuration of the travelmate package to to enable travel router functionality. ")
- .. translate("For further information ")
- .. [[<a href="https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md" target="_blank">]]
- .. translate("see online documentation")
- .. [[</a>]]
- .. translate("."))
+ .. translatef("For further information "
+ .. "<a href=\"%s\" target=\"_blank\">"
+ .. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md"))
-- Main travelmate options
@@ -44,6 +44,42 @@ o5 = s:option(Flag, "trm_debug", translate("Enable verbose debug logging"))
o5.default = o5.disabled
o5.rmempty = false
+-- Interface setup
+
+if uplink == "" then
+ dv = s:option(DummyValue, "_dummy", translate("Interface Setup"))
+ dv.template = "cbi/nullsection"
+ btn = s:option(Button, "", translate("Create Uplink Interface"),
+ translate("Automatically create a new wireless wan uplink interface 'trm_wwan', configure it to use dhcp and ")
+ .. translate("add it to the wan zone of the firewall. This step has only to be done once."))
+ btn.inputtitle = translate("Add Interface")
+ btn.inputstyle = "apply"
+ btn.disabled = false
+ function btn.write()
+ local name = "trm_wwan"
+ local net = nw:add_network(name, { proto = "dhcp" })
+ if net then
+ nw:save("network")
+ nw:commit("network")
+ local zone = fw:get_zone_by_network("wan")
+ if zone then
+ zone:add_network(name)
+ fw:save("firewall")
+ fw:commit("firewall")
+ end
+ luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1")
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", "travelmate"))
+ end
+ end
+else
+ dv = s:option(DummyValue, "_dummy", translate("Interface Setup"),
+ translate("<br />&nbsp;Network Interface 'trm_wwan' created successfully. ")
+ .. translatef("Scan &amp; Add new wireless stations via standard "
+ .. "<a href=\"%s\">"
+ .. "Wireless Setup</a>", luci.dispatcher.build_url("admin/network/wireless")))
+ dv.template = "cbi/nullsection"
+end
+
-- Runtime information
ds = s:option(DummyValue, "_dummy", translate("Runtime information"))
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/setup_tab.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/setup_tab.lua
deleted file mode 100644
index 6cd030ce6e..0000000000
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/setup_tab.lua
+++ /dev/null
@@ -1,55 +0,0 @@
--- Copyright 2017 Dirk Brenken (dev@brenken.org)
--- This is free software, licensed under the Apache License, Version 2.0
-
-local nw = require("luci.model.network").init()
-local fw = require("luci.model.firewall").init()
-local util = require("luci.util")
-local uci = require("luci.model.uci").cursor()
-
-m = SimpleForm("network", translate("Interface Setup"),
- translate("Automatically create a new wireless wan interface, configure it to use dhcp and " ..
- "add it to the wan zone of the firewall. This step has only to be done once."))
-m.reset = false
-
-iface = m:field(Value, "netname", translate("Name of the new wireless wan interface"),
- translate("The allowed characters are: <code>A-Z</code>, <code>a-z</code>, " ..
- "<code>0-9</code> and <code>_</code> (3-15 characters)."))
-iface.default = "wwan"
-iface.datatype = "and(uciname,minlength(3),maxlength(15))"
-
-function iface.validate(self, value, section)
- local value = iface:formvalue(section)
- local name = uci.get("network", value)
- if name then
- iface:add_error(section, translate("The given network interface name already exist"))
- else
- iface.datatype = false
- iface.default = iface.disabled
- f = m:field(DummyValue, "textfield", "&nbsp;", translatef("Direct Link: "
- .. "<a href=\"%s\">"
- .. "Wireless Setup</a>", luci.dispatcher.build_url("admin/network/wireless")))
- f.default = translatef("Network Interface '%s' created successfully." ..
- " Feel free to scan & add new stations via standard wireless setup.", value)
- f.disabled = true
- end
- return value
-end
-
-function iface.write(self, section, value)
- local name = iface:formvalue(section)
- if name then
- local net = nw:add_network(name, { proto = "dhcp" })
- if net then
- nw:save("network")
- nw:commit("network")
- local zone = fw:get_zone_by_network("wan")
- if zone then
- zone:add_network(name)
- fw:save("firewall")
- fw:commit("firewall")
- end
- end
- end
-end
-
-return m
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
index 0876ce6585..0bd19456f2 100644
--- a/modules/luci-base/luasrc/dispatcher.lua
+++ b/modules/luci-base/luasrc/dispatcher.lua
@@ -101,7 +101,7 @@ function error500(message)
return false
end
-function authenticator.htmlauth(validator, accs, default)
+function authenticator.htmlauth(validator, accs, default, template)
local user = http.formvalue("luci_username")
local pass = http.formvalue("luci_password")
@@ -113,7 +113,7 @@ function authenticator.htmlauth(validator, accs, default)
require("luci.template")
context.path = {}
http.status(403, "Forbidden")
- luci.template.render("sysauth", {duser=default, fuser=user})
+ luci.template.render(template or "sysauth", {duser=default, fuser=user})
return false
@@ -360,7 +360,7 @@ function dispatch(request)
if not util.contains(accs, user) then
if authen then
- local user, sess = authen(sys.user.checkpasswd, accs, def)
+ local user, sess = authen(sys.user.checkpasswd, accs, def, track.sysauth_template)
local token
if not user or not util.contains(accs, user) then
return