From c88e03548c08e4fc9d4f49d92f56306519094682 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 08:52:15 +0200 Subject: [PATCH] luci-app-mwan3: add new config options initial_state and keep_failure_interval Signed-off-by: Florian Eckert --- .../luci-app-mwan3/luasrc/controller/mwan3.lua | 2 ++ .../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" -- 2.30.2