From c88e03548c08e4fc9d4f49d92f56306519094682 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 08:52:15 +0200 Subject: luci-app-mwan3: add new config options initial_state and keep_failure_interval Signed-off-by: Florian Eckert --- applications/luci-app-mwan3/luasrc/controller/mwan3.lua | 2 ++ .../luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index ca39c9bf30..c24beda281 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -29,6 +29,8 @@ function index() entry({"admin", "network", "mwan", "configuration"}, alias("admin", "network", "mwan", "configuration", "interface"), _("Configuration"), 20) + entry({"admin", "network", "mwan", "configuration", "globals"}, + cbi("mwan/globalsconfig"),_("Globals"), 5).leaf = true entry({"admin", "network", "mwan", "configuration", "interface"}, arcombine(cbi("mwan/interface"), cbi("mwan/interfaceconfig")), _("Interfaces"), 10).leaf = true 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 2b46376399..ab44ba6970 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua @@ -102,6 +102,12 @@ enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled")) enabled:value("1", translate("Yes")) enabled:value("0", translate("No")) +initial_state = mwan_interface:option(ListValue, "initial_state", translate("Initial state"), + translate("Expect interface state on up event")) + initial_state.default = "online" + initial_state:value("online", translate("Online")) + initial_state:value("offline", translate("Offline")) + family = mwan_interface:option(ListValue, "family", translate("Internet Protocol")) family.default = "ipv4" family:value("ipv4", translate("IPv4")) @@ -183,6 +189,10 @@ failure = mwan_interface:option(Value, "failure_interval", translate("Failure in failure:value("1800", translatef("%d minutes", 30)) failure:value("3600", translatef("%d hour", 1)) +keep_failure = mwan_interface:option(Flag, "keep_failure_interval", translate("Keep failure interval"), + translate("Keep ping failure interval during failure state")) + keep_failure.default = keep_failure.disabled + recovery = mwan_interface:option(Value, "recovery_interval", translate("Recovery interval"), translate("Ping interval during failure recovering")) recovery.default = "5" -- cgit v1.2.3 From 933e0f335c70c2b96ab05adb6f4d0d48d8034cfc Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 08:53:00 +0200 Subject: luci-app-mwan3: add globals config section Signed-off-by: Florian Eckert --- .../luasrc/model/cbi/mwan/globalsconfig.lua | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua new file mode 100644 index 0000000000..54d20bdcb5 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua @@ -0,0 +1,32 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2017 Florian Eckert + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +local net = require "luci.model.network".init() + +m = Map("mwan3") + +s = m:section(NamedSection, "globals", "globals", translate("Globals mwan3 options")) +n = s:option(ListValue, "local_source", + translate("Local source interface"), + translate("Use the IP address of this interface as source IP address for traffic initiated by the router itself")) +n:value("none") +n.default = "none" +for _, net in ipairs(net:get_networks()) do + if net:name() ~= "loopback" then + n:value(net:name()) + end +end +n.rmempty = false + +return m -- cgit v1.2.3 From 5371f159da1806dc58671c6e1f519a3c9b9d120f Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 08:54:07 +0200 Subject: luci-app-mwan3: extend uci-default to set globals section if not present Signed-off-by: Florian Eckert --- applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 b/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 index ff9a229edd..509a694364 100755 --- a/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 +++ b/applications/luci-app-mwan3/root/etc/uci-defaults/60_luci-mwan3 @@ -8,6 +8,13 @@ uci -q batch <<-EOF >/dev/null commit ucitrack EOF +uci -q get mwan3.globals >/dev/null || { + uci -q add mwan3 globals >/dev/null + uci -q rename mwan3.@globals[-1]="globals" >/dev/null + uci -q set mwan3.globals.initial_source="none" >/dev/null + uci commit mwan3 +} + # remove LuCI cache rm -rf /tmp/luci-indexcache /tmp/luci-modulecache -- cgit v1.2.3 From bcc9382e160407760a2b327b15494c3673819314 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 13:42:38 +0200 Subject: luci-app-mwan3: update i18n Signed-off-by: Florian Eckert --- applications/luci-app-mwan3/po/ja/mwan3.po | 29 ++++++++++++++++++++++ applications/luci-app-mwan3/po/templates/mwan3.pot | 29 ++++++++++++++++++++++ applications/luci-app-mwan3/po/zh-cn/mwan3.po | 29 ++++++++++++++++++++++ 3 files changed, 87 insertions(+) diff --git a/applications/luci-app-mwan3/po/ja/mwan3.po b/applications/luci-app-mwan3/po/ja/mwan3.po index f6a70c3561..89fa5ea02d 100644 --- a/applications/luci-app-mwan3/po/ja/mwan3.po +++ b/applications/luci-app-mwan3/po/ja/mwan3.po @@ -94,6 +94,9 @@ msgstr "トラブルシューティング情報の収集エラー" msgid "Errors" msgstr "エラー" +msgid "Expect interface state on up event" +msgstr "" + msgid "Failure interval" msgstr "障害検出 インターバル" @@ -103,6 +106,12 @@ msgstr "" msgid "Flush global firewall conntrack table on interface events" msgstr "" +msgid "Globals" +msgstr "" + +msgid "Globals mwan3 options" +msgstr "" + msgid "Hotplug Script" msgstr "ホットプラグ スクリプト" @@ -121,6 +130,9 @@ msgstr "IPv4" msgid "IPv6" msgstr "IPv6" +msgid "Initial state" +msgstr "" + msgid "Interface" msgstr "インターフェース" @@ -144,6 +156,12 @@ msgstr "インターフェース" msgid "Internet Protocol" msgstr "インターネット プロトコル" +msgid "Keep failure interval" +msgstr "" + +msgid "Keep ping failure interval during failure state" +msgstr "" + msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" msgstr "直近の MWAN システムログ(50行)です。一番上が最新の行です:" @@ -156,6 +174,9 @@ msgstr "負荷分散" msgid "Loading" msgstr "読込中" +msgid "Local source interface" +msgstr "" + msgid "MWAN Config" msgstr "MWAN 設定" @@ -277,6 +298,9 @@ msgstr "プロトコルが設定されていません" msgid "Offline" msgstr "オフライン" +msgid "Online" +msgstr "" + msgid "Online (tracking active)" msgstr "オンライン(追跡実行中)" @@ -477,6 +501,11 @@ msgstr "トラブルシューティング" msgid "Troubleshooting Data" msgstr "トラブルシューティング データ" +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "" + msgid "View the contents of /etc/protocols for protocol descriptions" msgstr "プロトコルの説明については、 /etc/protocols の内容を確認してください。" diff --git a/applications/luci-app-mwan3/po/templates/mwan3.pot b/applications/luci-app-mwan3/po/templates/mwan3.pot index 3d25e844ac..8694298728 100644 --- a/applications/luci-app-mwan3/po/templates/mwan3.pot +++ b/applications/luci-app-mwan3/po/templates/mwan3.pot @@ -79,6 +79,9 @@ msgstr "" msgid "Errors" msgstr "" +msgid "Expect interface state on up event" +msgstr "" + msgid "Failure interval" msgstr "" @@ -88,6 +91,12 @@ msgstr "" msgid "Flush global firewall conntrack table on interface events" msgstr "" +msgid "Globals" +msgstr "" + +msgid "Globals mwan3 options" +msgstr "" + msgid "Hotplug Script" msgstr "" @@ -106,6 +115,9 @@ msgstr "" msgid "IPv6" msgstr "" +msgid "Initial state" +msgstr "" + msgid "Interface" msgstr "" @@ -127,6 +139,12 @@ msgstr "" msgid "Internet Protocol" msgstr "" +msgid "Keep failure interval" +msgstr "" + +msgid "Keep ping failure interval during failure state" +msgstr "" + msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" msgstr "" @@ -139,6 +157,9 @@ msgstr "" msgid "Loading" msgstr "" +msgid "Local source interface" +msgstr "" + msgid "MWAN Config" msgstr "" @@ -245,6 +266,9 @@ msgstr "" msgid "Offline" msgstr "" +msgid "Online" +msgstr "" + msgid "Online (tracking active)" msgstr "" @@ -408,6 +432,11 @@ msgstr "" msgid "Troubleshooting Data" msgstr "" +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "" + msgid "View the contents of /etc/protocols for protocol descriptions" msgstr "" diff --git a/applications/luci-app-mwan3/po/zh-cn/mwan3.po b/applications/luci-app-mwan3/po/zh-cn/mwan3.po index 1e0f34f088..3c505d8477 100644 --- a/applications/luci-app-mwan3/po/zh-cn/mwan3.po +++ b/applications/luci-app-mwan3/po/zh-cn/mwan3.po @@ -82,6 +82,9 @@ msgstr "收集故障排除信息时出错" msgid "Errors" msgstr "错误" +msgid "Expect interface state on up event" +msgstr "" + msgid "Failure interval" msgstr "故障检测间隔" @@ -91,6 +94,12 @@ msgstr "刷新连接跟踪表" msgid "Flush global firewall conntrack table on interface events" msgstr "在接口事件触发时刷新全局防火墙连接跟踪表" +msgid "Globals" +msgstr "" + +msgid "Globals mwan3 options" +msgstr "" + msgid "Hotplug Script" msgstr "Hotplug 脚本" @@ -109,6 +118,9 @@ msgstr "IPv4" msgid "IPv6" msgstr "IPv6" +msgid "Initial state" +msgstr "" + msgid "Interface" msgstr "接口" @@ -130,6 +142,12 @@ msgstr "接口" msgid "Internet Protocol" msgstr "互联网协议" +msgid "Keep failure interval" +msgstr "" + +msgid "Keep ping failure interval during failure state" +msgstr "" + msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" msgstr "最近 50 条 MWAN 系统日志,最新条目排在顶部:" @@ -142,6 +160,9 @@ msgstr "负载均衡" msgid "Loading" msgstr "载入中" +msgid "Local source interface" +msgstr "" + msgid "MWAN Config" msgstr "MWAN 配置文件" @@ -260,6 +281,9 @@ msgstr "未指定协议" msgid "Offline" msgstr "离线" +msgid "Online" +msgstr "" + msgid "Online (tracking active)" msgstr "在线(追踪启用中)" @@ -443,6 +467,11 @@ msgstr "故障排除" msgid "Troubleshooting Data" msgstr "故障排除数据" +msgid "" +"Use the IP address of this interface as source IP address for traffic " +"initiated by the router itself" +msgstr "" + msgid "View the contents of /etc/protocols for protocol descriptions" msgstr "请查看 /etc/protocols 获取可选协议详情" -- cgit v1.2.3