luci-app-mwan3: remove/unify lua require order

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2018-01-18 07:26:27 +01:00
parent d369c80bec
commit 831bd71eb3
9 changed files with 15 additions and 18 deletions

View file

@ -14,12 +14,14 @@ $Id$
local net = require "luci.model.network".init()
m = Map("mwan3", translate("MWAN - Globals"))
s = m:section(NamedSection, "globals", "globals", nil)
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"))
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

View file

@ -1,6 +1,5 @@
dsp = require "luci.dispatcher"
sys = require "luci.sys"
ut = require "luci.util"
function interfaceWarnings(overview, count)
local warnings = ""

View file

@ -1,6 +1,4 @@
dsp = require "luci.dispatcher"
sys = require "luci.sys"
ut = require "luci.util"
arg[1] = arg[1] or ""

View file

@ -1,4 +1,4 @@
ds = require "luci.dispatcher"
dsp = require "luci.dispatcher"
m5 = Map("mwan3", translate("MWAN - Members"))
@ -12,11 +12,11 @@ mwan_member = m5:section(TypedSection, "member", nil,
mwan_member.sectionhead = translate("Member")
mwan_member.sortable = true
mwan_member.template = "cbi/tblsection"
mwan_member.extedit = ds.build_url("admin", "network", "mwan", "member", "%s")
mwan_member.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s")
function mwan_member.create(self, section)
TypedSection.create(self, section)
m5.uci:save("mwan3")
luci.http.redirect(ds.build_url("admin", "network", "mwan", "member", section))
luci.http.redirect(dsp.build_url("admin", "network", "mwan", "member", section))
end
interface = mwan_member:option(DummyValue, "interface", translate("Interface"))

View file

@ -1,9 +1,8 @@
-- ------ hotplug script configuration ------ --
local fs = require "nixio.fs"
local ut = require "luci.util"
script = "/etc/mwan3.user"
m5 = SimpleForm("luci", translate("MWAN - Notification"))
f = m5:section(SimpleSection, nil,

View file

@ -1,5 +1,5 @@
ds = require "luci.dispatcher"
sys = require "luci.sys"
dsp = require "luci.dispatcher"
function policyCheck()
local policy_error = {}
@ -44,11 +44,11 @@ mwan_policy = m5:section(TypedSection, "policy", nil,
mwan_policy.sectionhead = translate("Policy")
mwan_policy.sortable = true
mwan_policy.template = "cbi/tblsection"
mwan_policy.extedit = ds.build_url("admin", "network", "mwan", "policy", "%s")
mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s")
function mwan_policy.create(self, section)
TypedSection.create(self, section)
m5.uci:save("mwan3")
luci.http.redirect(ds.build_url("admin", "network", "mwan", "policy", section))
luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section))
end

View file

@ -1,6 +1,7 @@
dsp = require "luci.dispatcher"
arg[1] = arg[1] or ""
m5 = Map("mwan3", translatef("MWAN Policy Configuration - %s", arg[1]))
m5.redirect = dsp.build_url("admin", "network", "mwan", "policy")

View file

@ -1,6 +1,5 @@
dsp = require "luci.dispatcher"
sys = require "luci.sys"
ut = require "luci.util"
function ruleCheck()
local rule_error = {}

View file

@ -1,8 +1,7 @@
dsp = require "luci.dispatcher"
sys = require "luci.sys"
ut = require "luci.util"
arg[1] = arg[1] or ""
m5 = Map("mwan3", translatef("MWAN Rule Configuration - %s", arg[1]))
m5.redirect = dsp.build_url("admin", "network", "mwan", "rule")