From 933e0f335c70c2b96ab05adb6f4d0d48d8034cfc Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 11 Aug 2017 08:53:00 +0200 Subject: [PATCH] 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 000000000..54d20bdcb --- /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 -- 2.11.0