summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-mwan3
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-mwan3')
-rw-r--r--applications/luci-app-mwan3/luasrc/controller/mwan3.lua23
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua6
-rw-r--r--applications/luci-app-mwan3/po/ja/mwan3.po21
-rw-r--r--applications/luci-app-mwan3/po/ru/mwan3.po21
-rw-r--r--applications/luci-app-mwan3/po/templates/mwan3.pot21
-rw-r--r--applications/luci-app-mwan3/po/zh-cn/mwan3.po21
-rw-r--r--applications/luci-app-mwan3/po/zh-tw/mwan3.po21
7 files changed, 121 insertions, 13 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
index 2d46953e55..d2d7422a6b 100644
--- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
+++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
@@ -101,6 +101,10 @@ function diagnosticsData(interface, task)
if addr and addr:match("^[a-zA-Z0-9%-%.:_]+$") then
local util = io.popen(cmd %{ut.shellquote(device), ut.shellquote(addr)})
if util then
+ luci.http.write("Command:\n")
+ luci.http.write(cmd %{ut.shellquote(device),
+ ut.shellquote(addr)} .. "\n\n")
+ luci.http.write("Result:\n")
while true do
local ln = util:read("*l")
if not ln then break end
@@ -140,7 +144,8 @@ function diagnosticsData(interface, task)
local uci = require "luci.model.uci".cursor(nil, "/var/state")
local nw = require "luci.model.network".init()
local network = nw:get_network(interface)
- local device = network and network:ifname()
+ local device = network and network:get_interface()
+ device = device:name()
luci.http.prepare_content("text/plain")
if device then
@@ -150,7 +155,7 @@ function diagnosticsData(interface, task)
diag_command("ping -I %s -c 5 -W 1 %s 2>&1", device, gateway)
else
luci.http.prepare_content("text/plain")
- luci.http.write(string.format("No gateway for interface %s found.", interface))
+ luci.http.write(translatef("No gateway for interface %s found.", interface))
end
elseif task == "ping_trackips" then
local trackips = uci:get("mwan3", interface, "track_ip")
@@ -159,7 +164,7 @@ function diagnosticsData(interface, task)
diag_command("ping -I %s -c 5 -W 1 %s 2>&1", device, trackips[i])
end
else
- luci.http.write(string.format("No tracking Hosts for interface %s defined.", interface))
+ luci.http.write(translatef("No tracking Hosts for interface %s defined.", interface))
end
elseif task == "check_rules" then
local number = getInterfaceNumber(interface)
@@ -168,30 +173,30 @@ function diagnosticsData(interface, task)
local iif_rule = sys.exec(string.format("ip rule | grep %d", iif))
local fwmark_rule = sys.exec(string.format("ip rule | grep %d", fwmark))
if iif_rule ~= "" and fwmark_rule ~= "" then
- luci.http.write(string.format("All required IP rules for interface %s found", interface))
+ luci.http.write(translatef("All required IP rules for interface %s found", interface))
luci.http.write("\n")
luci.http.write(fwmark_rule)
luci.http.write(iif_rule)
elseif iif_rule == "" and fwmark_rule ~= "" then
- luci.http.write(string.format("Only one IP rules for interface %s found", interface))
+ luci.http.write(translatef("Only one IP rules for interface %s found", interface))
luci.http.write("\n")
luci.http.write(fwmark_rule)
elseif iif_rule ~= "" and fwmark_rule == "" then
- luci.http.write(string.format("Only one IP rules for interface %s found", interface))
+ luci.http.write(translatef("Only one IP rules for interface %s found", interface))
luci.http.write("\n")
luci.http.write(iif_rule)
else
- luci.http.write(string.format("Missing both IP rules for interface %s", interface))
+ luci.http.write(translatef("Missing both IP rules for interface %s", interface))
end
elseif task == "check_routes" then
local number = getInterfaceNumber(interface)
local routeTable = sys.exec(string.format("ip route list table %s", number))
if routeTable ~= "" then
- luci.http.write(string.format("Routing table %s for interface %s found", number, interface))
+ luci.http.write(translatef("Routing table %s for interface %s found", number, interface))
luci.http.write("\n")
luci.http.write(routeTable)
else
- luci.http.write(string.format("Routing table %s for interface %s not found", number, interface))
+ luci.http.write(translatef("Routing table %s for interface %s not found", number, interface))
end
elseif task == "hotplug_ifup" then
os.execute(string.format("/usr/sbin/mwan3 ifup %s", ut.shellquote(interface)))
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua
index a6570e341c..d01945bf4a 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua
@@ -13,10 +13,8 @@ mwan_interface = m5:section(NamedSection, arg[1], "interface", "")
mwan_interface.addremove = false
mwan_interface.dynamic = false
-enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled"))
-enabled.default = "1"
-enabled:value("1", translate("Yes"))
-enabled:value("0", translate("No"))
+enabled = mwan_interface:option(Flag, "enabled", translate("Enabled"))
+enabled.default = false
initial_state = mwan_interface:option(ListValue, "initial_state", translate("Initial state"),
translate("Expect interface state on up event"))
diff --git a/applications/luci-app-mwan3/po/ja/mwan3.po b/applications/luci-app-mwan3/po/ja/mwan3.po
index a5826926dd..8a1cad2f6b 100644
--- a/applications/luci-app-mwan3/po/ja/mwan3.po
+++ b/applications/luci-app-mwan3/po/ja/mwan3.po
@@ -40,6 +40,9 @@ msgstr "利用可能な値: 1-1000。空欄の場合のデフォルトは1です
msgid "Acceptable values: 1-256. Defaults to 1 if not set"
msgstr "利用可能な値: 1-256。空欄の場合のデフォルトは1です。"
+msgid "All required IP rules for interface %s found"
+msgstr ""
+
msgid "Check IP rules"
msgstr "IP ルールのチェック"
@@ -263,6 +266,9 @@ msgstr "最小パケットレイテンシ [ms]"
msgid "Min packet loss [%]"
msgstr "最小パケットロス [%]"
+msgid "Missing both IP rules for interface %s"
+msgstr ""
+
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
@@ -276,6 +282,12 @@ msgstr "いいえ"
msgid "No MWAN interfaces found"
msgstr "MWAN インターフェースが見つかりません"
+msgid "No gateway for interface %s found."
+msgstr ""
+
+msgid "No tracking Hosts for interface %s defined."
+msgstr ""
+
msgid "Notification"
msgstr "通知"
@@ -285,6 +297,9 @@ msgstr "オフライン"
msgid "Online"
msgstr "オンライン"
+msgid "Only one IP rules for interface %s found"
+msgstr ""
+
msgid "Ping count"
msgstr "Ping 回数"
@@ -342,6 +357,12 @@ msgstr "プロトコル"
msgid "Recovery interval"
msgstr "障害復旧 インターバル"
+msgid "Routing table %s for interface %s found"
+msgstr ""
+
+msgid "Routing table %s for interface %s not found"
+msgstr ""
+
msgid "Rule"
msgstr "ルール"
diff --git a/applications/luci-app-mwan3/po/ru/mwan3.po b/applications/luci-app-mwan3/po/ru/mwan3.po
index 140c537e73..4d52d7108c 100644
--- a/applications/luci-app-mwan3/po/ru/mwan3.po
+++ b/applications/luci-app-mwan3/po/ru/mwan3.po
@@ -43,6 +43,9 @@ msgstr "Допустимые значения: 1-1000. По умолчанию 1
msgid "Acceptable values: 1-256. Defaults to 1 if not set"
msgstr "Допустимые значения: 1-256 По умолчанию 1, если значение не задано."
+msgid "All required IP rules for interface %s found"
+msgstr ""
+
msgid "Check IP rules"
msgstr "Проверить правила IP"
@@ -262,6 +265,9 @@ msgstr ""
msgid "Min packet loss [%]"
msgstr ""
+msgid "Missing both IP rules for interface %s"
+msgstr ""
+
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
@@ -275,6 +281,12 @@ msgstr "Нет"
msgid "No MWAN interfaces found"
msgstr "Интерфейсы MWAN не найдены"
+msgid "No gateway for interface %s found."
+msgstr ""
+
+msgid "No tracking Hosts for interface %s defined."
+msgstr ""
+
msgid "Notification"
msgstr "Уведомления"
@@ -284,6 +296,9 @@ msgstr "Отключен"
msgid "Online"
msgstr "Онлайн"
+msgid "Only one IP rules for interface %s found"
+msgstr ""
+
msgid "Ping count"
msgstr "Кол-во пинг-запросов"
@@ -341,6 +356,12 @@ msgstr "Протокол"
msgid "Recovery interval"
msgstr "Интервал восстановления"
+msgid "Routing table %s for interface %s found"
+msgstr ""
+
+msgid "Routing table %s for interface %s not found"
+msgstr ""
+
msgid "Rule"
msgstr "Правило"
diff --git a/applications/luci-app-mwan3/po/templates/mwan3.pot b/applications/luci-app-mwan3/po/templates/mwan3.pot
index bcc5e977a5..e815afd1f0 100644
--- a/applications/luci-app-mwan3/po/templates/mwan3.pot
+++ b/applications/luci-app-mwan3/po/templates/mwan3.pot
@@ -27,6 +27,9 @@ msgstr ""
msgid "Acceptable values: 1-256. Defaults to 1 if not set"
msgstr ""
+msgid "All required IP rules for interface %s found"
+msgstr ""
+
msgid "Check IP rules"
msgstr ""
@@ -231,6 +234,9 @@ msgstr ""
msgid "Min packet loss [%]"
msgstr ""
+msgid "Missing both IP rules for interface %s"
+msgstr ""
+
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
@@ -242,6 +248,12 @@ msgstr ""
msgid "No MWAN interfaces found"
msgstr ""
+msgid "No gateway for interface %s found."
+msgstr ""
+
+msgid "No tracking Hosts for interface %s defined."
+msgstr ""
+
msgid "Notification"
msgstr ""
@@ -251,6 +263,9 @@ msgstr ""
msgid "Online"
msgstr ""
+msgid "Only one IP rules for interface %s found"
+msgstr ""
+
msgid "Ping count"
msgstr ""
@@ -300,6 +315,12 @@ msgstr ""
msgid "Recovery interval"
msgstr ""
+msgid "Routing table %s for interface %s found"
+msgstr ""
+
+msgid "Routing table %s for interface %s not found"
+msgstr ""
+
msgid "Rule"
msgstr ""
diff --git a/applications/luci-app-mwan3/po/zh-cn/mwan3.po b/applications/luci-app-mwan3/po/zh-cn/mwan3.po
index a6d73159f5..4fd6817407 100644
--- a/applications/luci-app-mwan3/po/zh-cn/mwan3.po
+++ b/applications/luci-app-mwan3/po/zh-cn/mwan3.po
@@ -38,6 +38,9 @@ msgstr "取值范围:1-1000。如果不填写,默认值为 1"
msgid "Acceptable values: 1-256. Defaults to 1 if not set"
msgstr "取值范围:1-256。如果不填写,默认值为 1"
+msgid "All required IP rules for interface %s found"
+msgstr ""
+
msgid "Check IP rules"
msgstr "检查 IP 规则"
@@ -251,6 +254,9 @@ msgstr "最小数据包延迟 [ms]"
msgid "Min packet loss [%]"
msgstr "最小数据包丢失率 [%]"
+msgid "Missing both IP rules for interface %s"
+msgstr ""
+
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
@@ -264,6 +270,12 @@ msgstr "否"
msgid "No MWAN interfaces found"
msgstr "没有找到 MWAN 接口"
+msgid "No gateway for interface %s found."
+msgstr ""
+
+msgid "No tracking Hosts for interface %s defined."
+msgstr ""
+
msgid "Notification"
msgstr "通知"
@@ -273,6 +285,9 @@ msgstr "离线"
msgid "Online"
msgstr "在线"
+msgid "Only one IP rules for interface %s found"
+msgstr ""
+
msgid "Ping count"
msgstr "Ping 计数"
@@ -327,6 +342,12 @@ msgstr "通信协议"
msgid "Recovery interval"
msgstr "故障恢复间隔"
+msgid "Routing table %s for interface %s found"
+msgstr ""
+
+msgid "Routing table %s for interface %s not found"
+msgstr ""
+
msgid "Rule"
msgstr "规则"
diff --git a/applications/luci-app-mwan3/po/zh-tw/mwan3.po b/applications/luci-app-mwan3/po/zh-tw/mwan3.po
index 00baedf216..bb17b559d2 100644
--- a/applications/luci-app-mwan3/po/zh-tw/mwan3.po
+++ b/applications/luci-app-mwan3/po/zh-tw/mwan3.po
@@ -38,6 +38,9 @@ msgstr "取值範圍:1-1000。如果不填寫,預設值為 1"
msgid "Acceptable values: 1-256. Defaults to 1 if not set"
msgstr "取值範圍:1-256。如果不填寫,預設值為 1"
+msgid "All required IP rules for interface %s found"
+msgstr ""
+
msgid "Check IP rules"
msgstr "檢查 IP 規則"
@@ -251,6 +254,9 @@ msgstr "最小資料包延遲 [ms]"
msgid "Min packet loss [%]"
msgstr "最小資料包丟失率 [%]"
+msgid "Missing both IP rules for interface %s"
+msgstr ""
+
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
@@ -264,6 +270,12 @@ msgstr "否"
msgid "No MWAN interfaces found"
msgstr "沒有找到 MWAN 介面"
+msgid "No gateway for interface %s found."
+msgstr ""
+
+msgid "No tracking Hosts for interface %s defined."
+msgstr ""
+
msgid "Notification"
msgstr "通知"
@@ -273,6 +285,9 @@ msgstr "離線"
msgid "Online"
msgstr "在線"
+msgid "Only one IP rules for interface %s found"
+msgstr ""
+
msgid "Ping count"
msgstr "Ping 計數"
@@ -327,6 +342,12 @@ msgstr "通訊協議"
msgid "Recovery interval"
msgstr "故障恢復間隔"
+msgid "Routing table %s for interface %s found"
+msgstr ""
+
+msgid "Routing table %s for interface %s not found"
+msgstr ""
+
msgid "Rule"
msgstr "規則"